Skip to content

Commit 7cebf5e

Browse files
authored
Merge pull request #109 from JudahSan/main
Enhance Security, Testing, and Code Compatibility (#26)
2 parents c77a4f4 + 8d5d778 commit 7cebf5e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1009
-216
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ jobs:
55
name: RuboCop Linter
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v4
9-
- name: Setup Ruby 3.4.1
8+
- uses: actions/checkout@v5
9+
- name: Setup Ruby 3.4.4
1010
uses: ruby/setup-ruby@v1
1111
with:
12-
ruby-version: '3.4.1' # Not needed with a .ruby-version file
12+
ruby-version: '3.4.4' # Not needed with a .ruby-version file
1313
bundler-cache: true
1414

1515
- run: bundle exec rubocop
@@ -28,11 +28,11 @@ jobs:
2828
--health-retries 5
2929
3030
steps:
31-
- uses: actions/checkout@v4
32-
- name: Setup Ruby 3.4.1
31+
- uses: actions/checkout@v5
32+
- name: Setup Ruby 3.4.4
3333
uses: ruby/setup-ruby@v1
3434
with:
35-
ruby-version: '3.4.1' # Not needed with a .ruby-version file
35+
ruby-version: '3.4.4' # Not needed with a .ruby-version file
3636
bundler-cache: true
3737

3838
- name: Setup Node
@@ -42,7 +42,7 @@ jobs:
4242

4343
- name: Find yarn cache location
4444
id: yarn-cache
45-
run: echo "::set-output name=dir::$(yarn cache dir)"
45+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
4646

4747
- name: JS package cache
4848
uses: actions/cache@v4
@@ -60,7 +60,7 @@ jobs:
6060
DATABASE_URL: postgres://postgres:@localhost:5432/test
6161
#POSTGRES_PASSWORD: postgres
6262
RAILS_ENV: test
63-
#RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
63+
RAILS_MASTER_KEY: ${{ secrets.RAILS_TEST_MASTER_KEY }}
6464
run: |
6565
sudo apt-get -yqq install libpq-dev
6666
gem install bundler

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,7 @@ coverage/
4141

4242
# Ignore JetBrains IDE .idea directory
4343
.idea/
44+
45+
/config/credentials/development.key
46+
47+
/config/credentials/test.key

.rubocop.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ require:
33
- rubocop-rails
44

55
AllCops:
6+
UseCache: false
7+
UseServer: false
68
NewCops: enable
79
SuggestExtensions:
810
rubocop-rake: false
9-
TargetRubyVersion: 3.0.2
11+
TargetRubyVersion: 3.4
1012
Exclude:
1113
- bin/**/*
1214
- config/**/*
@@ -19,3 +21,7 @@ AllCops:
1921

2022
Style/Documentation:
2123
Enabled: false
24+
25+
Rails/LexicallyScopedActionFilter:
26+
Exclude:
27+
- 'app/controllers/users/sessions_controller.rb'

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.4.1
1+
3.4.4

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
nodejs 20.9.0
2-
ruby 3.4.1
2+
ruby 3.4.4

Gemfile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
source 'https://rubygems.org'
44
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
55

6-
ruby '3.4.1'
6+
ruby '3.4.4'
77

88
gem 'active_storage_validations', '~> 1.0' # Active Storage gems for validating attachments https://github.com/igorkasyanchuk/active_storage_validations
99
gem 'aws-sdk-s3', '~> 1.119', require: false # Official AWS Ruby gem for Amazon S3
@@ -13,24 +13,27 @@ gem 'cssbundling-rails' # Bundle and process CSS [https://github.com/rails/cssbu
1313
gem 'devise' # Devise 4.0 works with Rails 4.1 onwards.
1414
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
1515
gem 'image_processing', '~> 1.2'
16+
gem 'invisible_captcha' # Spam protection solution [https://github.com/markets/invisible_captcha]
1617
gem 'jbuilder' # Build JSON APIs with ease [https://github.com/rails/jbuilder]
1718
gem 'jsbundling-rails' # Bundle and transpile JavaScript [https://github.com/rails/jsbundling-rails]
1819
gem 'mini_magick', '~> 4.12'
1920
# Motor Admin allows you to deploy a no-code admin panel for your application in less than a minute
2021
gem 'motor-admin', '~> 0.4.7'
2122
gem 'pg', '~> 1.1' # Use postgresql as the database for Active Record
2223
gem 'premailer-rails', '~> 1.12' # This gem is a drop in solution for styling HTML emails with CSS
23-
gem 'puma', '~> 5.0' # Use the Puma web server [https://github.com/puma/puma]
24+
gem 'puma', '~> 6.0' # Use the Puma web server [https://github.com/puma/puma]
2425
gem 'rails', '~> 7.2.2.1' # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
2526
gem 'redis', '~> 4.0' # Use Redis adapter to run Action Cable in production
2627
# An ActionMailer adapter to send email using SendGrid's HTTPS Web API (instead of SMTP).
28+
gem 'rack-attack' # Rack middleware for blocking & throttling abusive requests
2729
gem 'sendgrid-actionmailer', '~> 3.2'
2830
gem 'simple_form', '~> 5.1' # Gem to pimp up forms
2931
gem 'sitemap_generator' # A dynamic sitemap generator gem for the Ruby on Rails framework
3032
gem 'sprockets-rails' # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
3133
gem 'stimulus-rails' # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
3234
gem 'turbo-rails' # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
3335
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
36+
gem 'rails_cloudflare_turnstile'
3437
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
3538

3639
# gem "kredis" # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
@@ -40,10 +43,10 @@ gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
4043

4144
group :development, :test do
4245
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
43-
gem 'debug', platforms: %i[mri mingw x64_mingw]
44-
gem 'rubocop', '~> 1.51.0', require: false
45-
gem 'rubocop-performance', '~> 1.18', require: false
46-
gem 'rubocop-rails', '~> 2.19.1', require: false
46+
gem 'debug', '~> 1.10.0', platforms: %i[mri mingw x64_mingw]
47+
gem 'rubocop', '~> 1.79.2', require: false
48+
gem 'rubocop-performance', '~> 1.25.0', require: false
49+
gem 'rubocop-rails', '~> 2.30.3', require: false
4750
end
4851

4952
group :development do
@@ -72,7 +75,8 @@ group :test do
7275
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
7376
gem 'capybara'
7477
gem 'faker', '~> 3.1'
78+
gem 'mocha'
7579
gem 'selenium-webdriver'
76-
gem 'simplecov', require: false # Code coverage analysis tool for ruby
80+
gem 'simplecov', require: false # Code coverage analysis tool for ruby
7781
gem 'webdrivers'
7882
end

0 commit comments

Comments
 (0)