From dd673df42934075d0879fa9aad16c35719309a15 Mon Sep 17 00:00:00 2001 From: lorenzo farnararo Date: Tue, 14 Jan 2025 10:34:29 +0100 Subject: [PATCH] mega update --- .env.example | 6 - .github/workflows/ci.yml | 98 ++-- .github/workflows/kamal.yml | 30 -- .kamal/secrets | 1 - .rubocop.yml | 44 +- .rubocop_todo.yml | 39 -- .ruby-version | 2 +- .tool-versions | 1 - Dockerfile | 49 +- Gemfile | 148 +++--- Gemfile.lock | 470 ++++++++++-------- Procfile | 5 +- app/assets/config/manifest.js | 2 +- app/controllers/clubs_controller.rb | 4 +- app/controllers/events_controller.rb | 6 +- app/controllers/expense_reasons_controller.rb | 6 +- app/controllers/expenses_controller.rb | 8 +- app/controllers/groups_controller.rb | 6 +- app/controllers/members_controller.rb | 6 +- app/controllers/payment_reasons_controller.rb | 6 +- app/controllers/payments_controller.rb | 8 +- app/controllers/tags_controller.rb | 6 +- .../users/registrations_controller.rb | 6 +- app/controllers/users_controller.rb | 8 +- app/mailers/application_mailer.rb | 4 +- app/mailers/blsd_mailer.rb | 2 +- app/mailers/medical_certificate_mailer.rb | 2 +- app/mailers/receipt_mailer.rb | 8 +- app/models/club.rb | 6 +- app/models/member.rb | 30 +- app/models/user.rb | 4 +- .../pdf/collaborators_receipt_generator.rb | 12 +- app/services/pdf/members_receipt_generator.rb | 10 +- app/views/layouts/application.html.erb | 7 +- bin/dev | 2 + bin/setup | 24 +- config/application.rb | 9 +- config/boot.rb | 7 +- config/cable.yml | 13 +- config/cache.yml | 16 + config/credentials.yml.enc | 2 +- config/database.yml | 46 +- config/deploy.yml | 29 +- config/environment.rb | 4 +- config/environments/development.rb | 52 +- config/environments/production.rb | 107 ++-- config/environments/test.rb | 30 +- config/importmap.rb | 14 +- config/initializers/assets.rb | 8 +- .../initializers/content_security_policy.rb | 2 - config/initializers/devise.rb | 10 +- config/initializers/enable_yjit.rb | 13 - config/initializers/extensions.rb | 3 - .../initializers/filter_parameter_logging.rb | 6 +- config/initializers/inflections.rb | 2 - .../new_framework_defaults_8_0.rb | 30 ++ config/initializers/pdfkit.rb | 4 +- config/initializers/rack_attack.rb | 3 - config/initializers/simple_form.rb | 6 +- config/initializers/simple_form_bootstrap.rb | 272 +++++----- config/puma.rb | 10 +- config/queue.yml | 18 + config/recurring.yml | 10 + config/routes.rb | 20 +- config/solid_queue.yml | 28 -- db/cable_schema.rb | 23 + db/cache_schema.rb | 24 + ...te_active_storage_tables.active_storage.rb | 4 +- db/queue_schema.rb | 141 ++++++ db/schema.rb | 5 +- db/seeds.rb | 8 +- docker-compose.yaml | 43 -- public/400.html | 114 +++++ public/404.html | 179 ++++--- public/406-unsupported-browser.html | 178 ++++--- public/422.html | 179 ++++--- public/500.html | 178 ++++--- public/icon.png | Bin 0 -> 4166 bytes public/icon.svg | 3 + test/application_system_test_case.rb | 4 +- .../medical_certificate_mailer_test.rb | 8 +- test/models/club_test.rb | 6 +- test/models/event_group_test.rb | 8 +- test/models/event_test.rb | 10 +- test/models/group_test.rb | 8 +- test/models/member_group_test.rb | 8 +- test/models/member_test.rb | 22 +- test/models/payment_test.rb | 8 +- test/models/presence_test.rb | 8 +- test/models/user_test.rb | 2 +- test/system/registration_test.rb | 32 +- test/test_helper.rb | 8 +- test/test_helpers/system_test_helper.rb | 10 +- 93 files changed, 1742 insertions(+), 1329 deletions(-) delete mode 100644 .github/workflows/kamal.yml delete mode 100644 .rubocop_todo.yml delete mode 100644 .tool-versions create mode 100755 bin/dev create mode 100644 config/cache.yml delete mode 100644 config/initializers/enable_yjit.rb delete mode 100644 config/initializers/extensions.rb create mode 100644 config/initializers/new_framework_defaults_8_0.rb delete mode 100644 config/initializers/rack_attack.rb create mode 100644 config/queue.yml create mode 100644 config/recurring.yml delete mode 100644 config/solid_queue.yml create mode 100644 db/cable_schema.rb create mode 100644 db/cache_schema.rb create mode 100644 db/queue_schema.rb delete mode 100644 docker-compose.yaml create mode 100644 public/400.html create mode 100644 public/icon.png create mode 100644 public/icon.svg diff --git a/.env.example b/.env.example index 5d1f926..cb79c16 100644 --- a/.env.example +++ b/.env.example @@ -1,9 +1,3 @@ -# conf for docker compose - -PG_PORT=8001 -REDIS_URL=redis://localhost -REDIS_PORT=8002 - # kamal version hack for github deployment APP_VERSION=dev diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5dbb70..ea97421 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,59 +7,83 @@ on: pull_request: branches: ["main"] jobs: - tests: + scan_ruby: runs-on: ubuntu-latest - services: - postgres: - image: postgres:16.4-alpine - ports: - - "5432:5432" - env: - POSTGRES_DB: opengas_test - POSTGRES_USER: opengas - POSTGRES_PASSWORD: opengas - env: - RAILS_ENV: test - DATABASE_URL: "postgres://opengas:opengas@localhost:5432/opengas_test" + steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install Ruby and gems + + - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: .ruby-version bundler-cache: true - - name: Set up database schema - run: bin/rails db:schema:load - - name: Run tests - run: bin/rails test:all - lint: + - name: Scan for common Rails security vulnerabilities using static analysis + run: bin/brakeman --no-pager + + scan_js: runs-on: ubuntu-latest + steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install Ruby and gems + + - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: .ruby-version bundler-cache: true - - name: Security audit dependencies - run: bundle exec bundler-audit --update - - name: Security audit - run: bundle exec bundle audit - - name: Security audit application code - run: bin/brakeman -q -w2 + - name: Scan for security vulnerabilities in JavaScript dependencies run: bin/importmap audit - - name: Lint Ruby files - run: bin/rubocop --parallel -f github - - name: Install Hadolint - run: | - wget -O ./hadolint https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64 - chmod +x ./hadolint - - name: Lint Dockerfile with Hadolint - run: ./hadolint Dockerfile + + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Lint code for consistent style + run: bin/rubocop -f github + + tests: + runs-on: ubuntu-latest + env: + RAILS_ENV: test + steps: + - name: Install packages + run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libjemalloc2 libvips sqlite3 + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Ruby and gems + uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Run tests + env: + RAILS_ENV: test + # REDIS_URL: redis://localhost:6379/0 + run: bin/rails db:test:prepare test test:system + + - name: Keep screenshots from failed system tests + uses: actions/upload-artifact@v4 + if: failure() + with: + name: screenshots + path: ${{ github.workspace }}/tmp/screenshots + if-no-files-found: ignore build: needs: [tests, lint] @@ -83,6 +107,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: + registry: ghcr.io username: baldarn password: ${{ secrets.KAMAL_REGISTRY_PASSWORD }} - name: Build image @@ -94,8 +119,8 @@ jobs: labels: | "service=open-gas" tags: | - baldarn/open-gas:latest - baldarn/open-gas:${{ github.ref_name }} + ghcr.io/baldarn/open-gas:latest + ghcr.io/baldarn/open-gas:${{ github.ref_name }} cache-from: type=gha cache-to: type=gha,mode=max @@ -109,7 +134,6 @@ jobs: env: RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} KAMAL_REGISTRY_PASSWORD: ${{ secrets.KAMAL_REGISTRY_PASSWORD }} - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} APP_VERSION: ${{ github.ref_name }} steps: diff --git a/.github/workflows/kamal.yml b/.github/workflows/kamal.yml deleted file mode 100644 index 0fb3822..0000000 --- a/.github/workflows/kamal.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Kamal Command - -on: - workflow_dispatch: - inputs: - command: - description: "Kamal command to run" - default: "kamal app details" - -jobs: - Command: - runs-on: ubuntu-latest - - env: - RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} - KAMAL_REGISTRY_PASSWORD: ${{ secrets.KAMAL_REGISTRY_PASSWORD }} - POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - uses: webfactory/ssh-agent@v0.9.0 - with: - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - - name: Run KAMAL command - run: ${{ github.event.inputs.command }} diff --git a/.kamal/secrets b/.kamal/secrets index 73f9f9d..ab18806 100644 --- a/.kamal/secrets +++ b/.kamal/secrets @@ -12,7 +12,6 @@ # Grab the registry password from ENV KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD -POSTGRES_PASSWORD=$POSTGRES_PASSWORD APP_VERSION=$APP_VERSION # Improve security by using a password manager. Never check config/master.key into git! diff --git a/.rubocop.yml b/.rubocop.yml index 14b1387..f9d86d4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,36 +1,8 @@ -inherit_from: .rubocop_todo.yml - -require: - - rubocop-capybara - - rubocop-rails - -AllCops: - TargetRubyVersion: 3.3 - NewCops: enable - Exclude: - - bin/* - - db/schema.rb - - vendor/**/* - -Style/Documentation: - Enabled: false - -Metrics/BlockLength: - Exclude: - - config/environments/* - - config/initializers/simple_form_bootstrap.rb - - config/routes.rb - -Layout/LineLength: - Exclude: - - config/initializers/devise.rb - -Metrics/MethodLength: - Max: 50 - Exclude: - - db/migrate/* - -Metrics/AbcSize: - Max: 50 - Exclude: - - db/migrate/* +# Omakase Ruby styling for Rails +inherit_gem: { rubocop-rails-omakase: rubocop.yml } + +# Overwrite or add rules to create your own house style +# +# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]` +# Layout/SpaceInsideArrayLiteralBrackets: +# Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index dc3183e..0000000 --- a/.rubocop_todo.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This configuration was generated by -# `rubocop --auto-gen-config` -# on 2024-09-04 12:44:30 UTC using RuboCop version 1.65.1. -# The point is for the user to remove these configuration records -# one by one as the offenses are removed from the code base. -# Note that changes in the inspected code, or installation of new -# versions of RuboCop, may require this file to be generated again. - -# Offense count: 1 -# Configuration parameters: AllowedMethods, AllowedPatterns. -Metrics/CyclomaticComplexity: - Max: 13 - -# Offense count: 1 -# Configuration parameters: AllowedMethods, AllowedPatterns. -Metrics/PerceivedComplexity: - Max: 13 - -# Offense count: 2 -# Configuration parameters: Include. -# Include: app/controllers/**/*.rb, app/mailers/**/*.rb -Rails/LexicallyScopedActionFilter: - Exclude: - - 'app/controllers/users/registrations_controller.rb' - -# Offense count: 2 -# Configuration parameters: ForbiddenMethods, AllowedMethods. -# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all -Rails/SkipsModelValidations: - Exclude: - - 'app/models/payment.rb' - - 'db/migrate/20240812090546_add_service_name_to_active_storage_blobs.active_storage.rb' - -# Offense count: 1 -# Configuration parameters: Include. -# Include: db/**/*.rb -Rails/ThreeStateBooleanColumn: - Exclude: - - 'db/migrate/20240818144629_create_recurring_tasks.solid_queue.rb' diff --git a/.ruby-version b/.ruby-version index fa7adc7..47b322c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.5 +3.4.1 diff --git a/.tool-versions b/.tool-versions deleted file mode 100644 index 1dd1998..0000000 --- a/.tool-versions +++ /dev/null @@ -1 +0,0 @@ -ruby 3.3.5 diff --git a/Dockerfile b/Dockerfile index 9d8c5ef..cdb9936 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,25 @@ -# syntax = docker/dockerfile:1 +# syntax=docker/dockerfile:1 +# check=error=true -# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile -ARG RUBY_VERSION=3.3.5 +# This Dockerfile is designed for production, not development. Use with Kamal or build'n'run by hand: +# docker build -t fixora . +# docker run -d -p 80:80 -e RAILS_MASTER_KEY= --name fixora fixora + +# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html + +# Make sure RUBY_VERSION matches the Ruby version in .ruby-version +ARG RUBY_VERSION=3.4.1 ARG APP_VERSION=undefined -FROM ruby:$RUBY_VERSION-slim AS base +FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base # Rails app lives here WORKDIR /rails +# Install base packages +RUN apt-get update -qq && \ + apt-get install --no-install-recommends -y curl clang libjemalloc2 libvips sqlite3 && \ + rm -rf /var/lib/apt/lists /var/cache/apt/archives + # Set production environment ENV RAILS_ENV="production" \ BUNDLE_DEPLOYMENT="1" \ @@ -15,31 +27,34 @@ ENV RAILS_ENV="production" \ BUNDLE_WITHOUT="development" # Throw-away build stage to reduce size of final image -FROM --platform=$TARGETPLATFORM base as build +FROM base AS build # Install packages needed to build gems RUN apt-get update -qq && \ - apt-get install --no-install-recommends -y build-essential=12* git=1* libpq-dev=15* libvips42=8* pkg-config=1* nodejs=18* + apt-get install --no-install-recommends -y build-essential=12* git=1* libvips42=8* pkg-config=1* nodejs=18* && \ + rm -rf /var/lib/apt/lists /var/cache/apt/archives # Install application gems -COPY Gemfile Gemfile.lock .ruby-version ./ +COPY Gemfile Gemfile.lock ./ RUN bundle install && \ - rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git + rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \ + bundle exec bootsnap precompile --gemfile # Copy application code COPY . . +# Precompile bootsnap code for faster boot times +RUN bundle exec bootsnap precompile app/ lib/ + # Precompiling assets for production without requiring secret RAILS_MASTER_KEY RUN SECRET_KEY_BASE_DUMMY=1 LOGTAIL_SKIP_LOGS=true ./bin/rails assets:precompile + + + # Final stage for app image FROM base -# Install packages needed for deployment -RUN apt-get update -qq && \ - apt-get install --no-install-recommends -y curl=7* libjemalloc2=5* libpq-dev=15* libvips42=8* wkhtmltopdf=0* nodejs=18* && \ - rm -rf /var/lib/apt/lists /var/cache/apt/archives - # Copy built artifacts: gems, application COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}" COPY --from=build /rails /rails @@ -50,9 +65,9 @@ RUN groupadd --system --gid 1000 rails && \ chown -R rails:rails db log storage tmp USER 1000:1000 -# Entrypoint prepares the application. +# Entrypoint prepares the database. ENTRYPOINT ["/rails/bin/docker-entrypoint"] -# Start the server by default, this can be overwritten at runtime -EXPOSE 3000 -CMD ["bin/rails", "s", "-b", "0.0.0.0"] +# Start server via Thruster by default, this can be overwritten at runtime +EXPOSE 80 +CMD ["./bin/thrust", "./bin/rails", "server"] diff --git a/Gemfile b/Gemfile index 797e0f7..4169e47 100644 --- a/Gemfile +++ b/Gemfile @@ -1,87 +1,111 @@ -# frozen_string_literal: true - -source 'https://rubygems.org' - -ruby file: '.ruby-version' - -gem 'rails', '~> 7.2.1' - -# Drivers -gem 'pg', '~> 1.5.7' -gem 'redis', '~> 5.3' -gem 'sqlite3', '~> 1.4' - -# Deployment -gem 'puma', '>= 5.0' +source "https://rubygems.org" + +# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" +gem "rails", "~> 8.0.0" +# The modern asset pipeline for Rails [https://github.com/rails/propshaft] +gem "propshaft" +# Use sqlite3 as the database for Active Record +gem "sqlite3", ">= 2.1" +# Use the Puma web server [https://github.com/puma/puma] +gem "puma", ">= 5.0" +# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] +gem "importmap-rails" +# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev] +gem "turbo-rails" +# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev] +gem "stimulus-rails" +# Build JSON APIs with ease [https://github.com/rails/jbuilder] +gem "jbuilder" + +# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword] +gem "bcrypt", "~> 3.1.7" + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem "tzinfo-data", platforms: %i[ windows jruby ] + +# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable +gem "solid_cache" +gem "solid_queue" +gem "solid_cable" + +# Reduces boot times through caching; required in config/boot.rb +gem "bootsnap", require: false + +# Deploy this application anywhere as a Docker container [https://kamal-deploy.org] +gem "kamal", require: false + +# Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/] +gem "thruster", require: false # Metrics -gem 'logtail-rails', '~> 0.2.7' +gem "logtail-rails", "~> 0.2.7" -gem 'yabeda' -gem 'yabeda-prometheus' -gem 'yabeda-puma-plugin' -gem 'yabeda-rails' +gem "yabeda" +gem "yabeda-prometheus" +gem "yabeda-puma-plugin" +gem "yabeda-rails" # Jobs -gem 'mission_control-jobs', '~> 0.3.1' -gem 'solid_queue', '~> 0.5.0' +gem "mission_control-jobs" # Front-end -gem 'bootstrap', '~> 5.1' -gem 'importmap-rails' -gem 'simple_calendar' -gem 'simple_form', '~> 5.3' -gem 'stimulus-rails' -gem 'turbo-rails' +gem "bootstrap", "~> 5.1" +gem "simple_calendar" +gem "simple_form", "~> 5.3" # Security -gem 'rack-attack' -gem 'rucaptcha' +gem "rucaptcha" # Pagination -gem 'kaminari' -gem 'kaminari-i18n' +gem "kaminari" +gem "kaminari-i18n" -gem 'devise', '~> 4.9' -gem 'devise-i18n' +gem "devise", "~> 4.9" +gem "devise-i18n" # Pdf -gem 'pdfkit' +gem "pdfkit" # Other -gem 'active_storage_validations' -gem 'aws-sdk-s3' -gem 'bcrypt', '~> 3.1.7' -gem 'front_matter_parser' -gem 'image_processing', '~> 1.13' -gem 'jbuilder' -gem 'rails-i18n', '~> 7.0.0' -gem 'redcarpet', '~> 3.6' -gem 'rouge', '~> 4.4' -gem 'rqrcode' -gem 'sassc-rails' -gem 'sprockets-rails' -gem 'useragent', github: 'basecamp/useragent' +gem "active_storage_validations" +gem "aws-sdk-s3" +gem "front_matter_parser" +gem "image_processing", "~> 1.13" +gem "rails-i18n", "~> 8.0.0" +gem "redcarpet", "~> 3.6" +gem "rouge", "~> 4.4" +gem "rqrcode" +gem "dartsass-rails", "~> 0.5.1" +gem "sprockets-rails" +gem "useragent", github: "basecamp/useragent" group :development, :test do - gem 'debug' - gem 'dotenv-rails' - gem 'faker', require: false - gem 'rubocop', '~> 1.65', require: false - gem 'rubocop-capybara', require: false - gem 'rubocop-rails', require: false + # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem + gem "debug", platforms: %i[ mri windows ], require: "debug/prelude" + + # Static analysis for security vulnerabilities [https://brakemanscanner.org/] + gem "brakeman", require: false + + gem "bundle-audit", require: false + + # Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/] + gem "rubocop-rails-omakase", require: false + + gem "faker", require: false + + gem "hotwire-spark" end group :development do - gem 'brakeman', require: false - gem 'bundle-audit', require: false - gem 'htmlbeautifier' - gem 'kamal', '~> 2.2' - gem 'web-console' + gem "htmlbeautifier" + + # Use console on exceptions pages [https://github.com/rails/web-console] + gem "web-console" end group :test do - gem 'capybara' - gem 'selenium-webdriver' - gem 'simplecov', require: false + # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing] + gem "capybara" + gem "selenium-webdriver" + gem "simplecov", require: false end diff --git a/Gemfile.lock b/Gemfile.lock index c57993f..0191b8c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,71 +7,71 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.2.2) - actionpack (= 7.2.2) - activesupport (= 7.2.2) + actioncable (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.2.2) - actionpack (= 7.2.2) - activejob (= 7.2.2) - activerecord (= 7.2.2) - activestorage (= 7.2.2) - activesupport (= 7.2.2) + actionmailbox (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) mail (>= 2.8.0) - actionmailer (7.2.2) - actionpack (= 7.2.2) - actionview (= 7.2.2) - activejob (= 7.2.2) - activesupport (= 7.2.2) + actionmailer (8.0.1) + actionpack (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activesupport (= 8.0.1) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.2.2) - actionview (= 7.2.2) - activesupport (= 7.2.2) + actionpack (8.0.1) + actionview (= 8.0.1) + activesupport (= 8.0.1) nokogiri (>= 1.8.5) - racc - rack (>= 2.2.4, < 3.2) + rack (>= 2.2.4) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actiontext (7.2.2) - actionpack (= 7.2.2) - activerecord (= 7.2.2) - activestorage (= 7.2.2) - activesupport (= 7.2.2) + actiontext (8.0.1) + actionpack (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.2.2) - activesupport (= 7.2.2) + actionview (8.0.1) + activesupport (= 8.0.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - active_storage_validations (1.1.4) - activejob (>= 5.2.0) - activemodel (>= 5.2.0) - activestorage (>= 5.2.0) - activesupport (>= 5.2.0) - activejob (7.2.2) - activesupport (= 7.2.2) + active_storage_validations (1.4.0) + activejob (>= 6.1.4) + activemodel (>= 6.1.4) + activestorage (>= 6.1.4) + activesupport (>= 6.1.4) + marcel (>= 1.0.3) + activejob (8.0.1) + activesupport (= 8.0.1) globalid (>= 0.3.6) - activemodel (7.2.2) - activesupport (= 7.2.2) - activerecord (7.2.2) - activemodel (= 7.2.2) - activesupport (= 7.2.2) + activemodel (8.0.1) + activesupport (= 8.0.1) + activerecord (8.0.1) + activemodel (= 8.0.1) + activesupport (= 8.0.1) timeout (>= 0.4.0) - activestorage (7.2.2) - actionpack (= 7.2.2) - activejob (= 7.2.2) - activerecord (= 7.2.2) - activesupport (= 7.2.2) + activestorage (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activesupport (= 8.0.1) marcel (~> 1.0) - activesupport (7.2.2) + activesupport (8.0.1) base64 benchmark (>= 0.3) bigdecimal @@ -83,46 +83,47 @@ GEM minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + uri (>= 0.13.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) anyway_config (2.6.4) ruby-next-core (~> 1.0) ast (2.4.2) - autoprefixer-rails (10.4.16.0) + autoprefixer-rails (10.4.19.0) execjs (~> 2) aws-eventstream (1.3.0) - aws-partitions (1.965.0) - aws-sdk-core (3.201.5) + aws-partitions (1.1036.0) + aws-sdk-core (3.215.0) aws-eventstream (~> 1, >= 1.3.0) - aws-partitions (~> 1, >= 1.651.0) + aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.88.0) - aws-sdk-core (~> 3, >= 3.201.0) + aws-sdk-kms (1.96.0) + aws-sdk-core (~> 3, >= 3.210.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.158.0) - aws-sdk-core (~> 3, >= 3.201.0) + aws-sdk-s3 (1.177.0) + aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) - aws-sigv4 (1.9.1) + aws-sigv4 (1.11.0) aws-eventstream (~> 1, >= 1.0.2) base64 (0.2.0) bcrypt (3.1.20) bcrypt_pbkdf (1.1.1) - bcrypt_pbkdf (1.1.1-arm64-darwin) - bcrypt_pbkdf (1.1.1-x86_64-darwin) benchmark (0.4.0) - bigdecimal (3.1.8) + bigdecimal (3.1.9) bindex (0.8.1) + bootsnap (1.18.4) + msgpack (~> 1.2) bootstrap (5.3.3) autoprefixer-rails (>= 9.1.0) popper_js (>= 2.11.8, < 3) - brakeman (6.2.2) + brakeman (7.0.0) racc builder (3.3.0) bundle-audit (0.1.0) bundler-audit - bundler-audit (0.9.1) + bundler-audit (0.9.2) bundler (>= 1.2.0, < 3) thor (~> 1.0) capybara (3.40.0) @@ -136,10 +137,13 @@ GEM xpath (~> 3.2) chunky_png (1.4.0) concurrent-ruby (1.3.4) - connection_pool (2.4.1) + connection_pool (2.5.0) crass (1.0.6) + dartsass-rails (0.5.1) + railties (>= 6.0.0) + sass-embedded (~> 1.63) date (3.4.1) - debug (1.9.2) + debug (1.10.0) irb (~> 1.10) reline (>= 0.3.8) devise (4.9.4) @@ -151,61 +155,80 @@ GEM devise-i18n (1.12.1) devise (>= 4.9.0) docile (1.4.1) - dotenv (3.1.4) - dotenv-rails (3.1.4) - dotenv (= 3.1.4) - railties (>= 6.1) + dotenv (3.1.7) drb (2.2.1) - dry-initializer (3.1.1) + dry-initializer (3.2.0) ed25519 (1.3.0) - erubi (1.13.0) + erubi (1.13.1) et-orbi (1.2.11) tzinfo - execjs (2.9.1) - faker (3.4.2) + execjs (2.10.0) + faker (3.5.1) i18n (>= 1.8.11, < 2) - ffi (1.17.0-aarch64-linux-gnu) - ffi (1.17.0-arm-linux-gnu) - ffi (1.17.0-arm64-darwin) - ffi (1.17.0-x86-linux-gnu) - ffi (1.17.0-x86_64-darwin) - ffi (1.17.0-x86_64-linux-gnu) + ffi (1.17.1-aarch64-linux-gnu) + ffi (1.17.1-arm-linux-gnu) + ffi (1.17.1-arm64-darwin) + ffi (1.17.1-x86-linux-gnu) + ffi (1.17.1-x86_64-darwin) + ffi (1.17.1-x86_64-linux-gnu) front_matter_parser (1.0.1) fugit (1.11.1) et-orbi (~> 1, >= 1.2.11) raabro (~> 1.4) globalid (1.2.1) activesupport (>= 6.1) + google-protobuf (4.29.3) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-aarch64-linux) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-arm64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-x86-linux) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-x86_64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.29.3-x86_64-linux) + bigdecimal + rake (>= 13) + hotwire-spark (0.1.12) + listen + rails (>= 7.0.0) + zeitwerk htmlbeautifier (1.4.3) i18n (1.14.6) concurrent-ruby (~> 1.0) image_processing (1.13.0) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) - importmap-rails (2.0.3) + importmap-rails (2.1.0) actionpack (>= 6.0.0) activesupport (>= 6.0.0) railties (>= 6.0.0) io-console (0.8.0) - irb (1.14.1) + irb (1.14.3) rdoc (>= 4.0.0) reline (>= 0.4.2) jbuilder (2.13.0) actionview (>= 5.0.0) activesupport (>= 5.0.0) jmespath (1.6.2) - json (2.7.2) - kamal (2.2.1) + json (2.9.1) + kamal (2.4.0) activesupport (>= 7.0) base64 (~> 0.2) bcrypt_pbkdf (~> 1.0) concurrent-ruby (~> 1.2) dotenv (~> 3.1) ed25519 (~> 1.2) - net-ssh (~> 7.0) + net-ssh (~> 7.3) sshkit (>= 1.23.0, < 2.0) thor (~> 1.3) - zeitwerk (~> 2.5) + zeitwerk (>= 2.6.18, < 3.0) kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -222,19 +245,22 @@ GEM kaminari rails language_server-protocol (3.17.0.3) - logger (1.6.2) + listen (3.9.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + logger (1.6.5) logtail (0.1.13) msgpack (~> 1.0) logtail-rack (0.2.5) logtail (~> 0.1) rack (>= 1.2, < 4.0) - logtail-rails (0.2.7) + logtail-rails (0.2.8) actionpack (>= 5.0.0) activerecord (>= 5.0.0) logtail (~> 0.1) logtail-rack (~> 0.1) railties (>= 5.0.0) - loofah (2.23.1) + loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -246,15 +272,20 @@ GEM matrix (0.4.2) mini_magick (4.13.2) mini_mime (1.1.5) + mini_portile2 (2.8.8) minitest (5.25.4) - mission_control-jobs (0.3.1) - importmap-rails + mission_control-jobs (1.0.1) + actioncable (>= 7.1) + actionpack (>= 7.1) + activejob (>= 7.1) + activerecord (>= 7.1) + importmap-rails (>= 1.2.1) irb (~> 1.13) - rails (>= 7.1) + railties (>= 7.1) stimulus-rails turbo-rails - msgpack (1.7.2) - net-imap (0.5.1) + msgpack (1.7.5) + net-imap (0.5.5) date net-protocol net-pop (0.1.2) @@ -266,76 +297,79 @@ GEM net-sftp (4.0.0) net-ssh (>= 5.0.0, < 8.0.0) net-smtp (0.5.0) - net-protocol net-ssh (7.3.0) nio4r (2.7.4) - nokogiri (1.16.8-aarch64-linux) + nokogiri (1.18.1) + mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.16.8-arm-linux) + nokogiri (1.18.1-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.16.8-arm64-darwin) + nokogiri (1.18.1-arm-linux-gnu) racc (~> 1.4) - nokogiri (1.16.8-x86-linux) + nokogiri (1.18.1-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.8-x86_64-darwin) + nokogiri (1.18.1-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.8-x86_64-linux) + nokogiri (1.18.1-x86_64-linux-gnu) racc (~> 1.4) orm_adapter (0.5.0) - ostruct (0.6.0) + ostruct (0.6.1) parallel (1.26.3) - parser (3.3.3.0) + parser (3.3.6.0) ast (~> 2.4.1) racc pdfkit (0.8.7.3) - pg (1.5.7) popper_js (2.11.8) prometheus-client (4.2.3) base64 - psych (5.2.1) + propshaft (1.1.0) + actionpack (>= 7.0.0) + activesupport (>= 7.0.0) + rack + railties (>= 7.0.0) + psych (5.2.2) date stringio - public_suffix (5.0.5) - puma (6.4.3) + public_suffix (6.0.1) + puma (6.5.0) nio4r (~> 2.0) raabro (1.4.0) racc (1.8.1) rack (3.1.8) - rack-attack (6.7.0) - rack (>= 1.0, < 4) - rack-session (2.0.0) + rack-session (2.1.0) + base64 (>= 0.1.0) rack (>= 3.0.0) - rack-test (2.1.0) + rack-test (2.2.0) rack (>= 1.3) rackup (2.2.1) rack (>= 3) - rails (7.2.2) - actioncable (= 7.2.2) - actionmailbox (= 7.2.2) - actionmailer (= 7.2.2) - actionpack (= 7.2.2) - actiontext (= 7.2.2) - actionview (= 7.2.2) - activejob (= 7.2.2) - activemodel (= 7.2.2) - activerecord (= 7.2.2) - activestorage (= 7.2.2) - activesupport (= 7.2.2) + rails (8.0.1) + actioncable (= 8.0.1) + actionmailbox (= 8.0.1) + actionmailer (= 8.0.1) + actionpack (= 8.0.1) + actiontext (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activemodel (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) bundler (>= 1.15.0) - railties (= 7.2.2) + railties (= 8.0.1) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.1) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) - rails-i18n (7.0.9) + rails-i18n (8.0.1) i18n (>= 0.7, < 2) - railties (>= 6.0.0, < 8) - railties (7.2.2) - actionpack (= 7.2.2) - activesupport (= 7.2.2) + railties (>= 8.0.0, < 9) + railties (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) @@ -343,82 +377,95 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) - rb_sys (0.9.102) - rdoc (6.8.1) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + rb_sys (0.9.108) + rdoc (6.10.0) psych (>= 4.0.0) redcarpet (3.6.0) - redis (5.3.0) - redis-client (>= 0.22.0) - redis-client (0.22.2) - connection_pool - regexp_parser (2.9.2) - reline (0.5.12) + regexp_parser (2.10.0) + reline (0.6.0) io-console (~> 0.5) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.3.9) - rouge (4.4.0) + rexml (3.4.0) + rouge (4.5.1) rqrcode (2.2.0) chunky_png (~> 1.0) rqrcode_core (~> 1.0) rqrcode_core (1.2.0) - rubocop (1.65.1) + rubocop (1.70.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.4, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.36.2, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.37.0) parser (>= 3.3.1.0) - rubocop-capybara (2.21.0) - rubocop (~> 1.41) - rubocop-rails (2.25.0) + rubocop-minitest (0.36.0) + rubocop (>= 1.61, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-performance (1.23.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.28.0) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 1.33.0, < 2.0) + rubocop (>= 1.52.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails-omakase (1.0.0) + rubocop + rubocop-minitest + rubocop-performance + rubocop-rails ruby-next-core (1.0.3) ruby-progressbar (1.13.0) ruby-vips (2.2.2) ffi (~> 1.12) logger - rubyzip (2.3.2) - rucaptcha (3.2.3) + rubyzip (2.4.1) + rucaptcha (3.2.5) railties (>= 3.2) - rb_sys (>= 0.9.86) - rucaptcha (3.2.3-aarch64-linux) + rb_sys (>= 0.9.105) + rucaptcha (3.2.5-aarch64-linux) railties (>= 3.2) - rb_sys (>= 0.9.86) - rucaptcha (3.2.3-arm64-darwin) + rb_sys (>= 0.9.105) + rucaptcha (3.2.5-arm64-darwin) railties (>= 3.2) - rb_sys (>= 0.9.86) - rucaptcha (3.2.3-x86_64-darwin) + rb_sys (>= 0.9.105) + rucaptcha (3.2.5-x86_64-darwin) railties (>= 3.2) - rb_sys (>= 0.9.86) - rucaptcha (3.2.3-x86_64-linux) + rb_sys (>= 0.9.105) + rucaptcha (3.2.5-x86_64-linux) railties (>= 3.2) - rb_sys (>= 0.9.86) - sassc (2.4.0) - ffi (~> 1.9) - sassc-rails (2.1.2) - railties (>= 4.0.0) - sassc (>= 2.0) - sprockets (> 3.0) - sprockets-rails - tilt - securerandom (0.4.0) - selenium-webdriver (4.21.1) + rb_sys (>= 0.9.105) + sass-embedded (1.83.4) + google-protobuf (~> 4.29) + rake (>= 13) + sass-embedded (1.83.4-aarch64-linux-gnu) + google-protobuf (~> 4.29) + sass-embedded (1.83.4-arm-linux-gnueabihf) + google-protobuf (~> 4.29) + sass-embedded (1.83.4-arm64-darwin) + google-protobuf (~> 4.29) + sass-embedded (1.83.4-x86_64-darwin) + google-protobuf (~> 4.29) + sass-embedded (1.83.4-x86_64-linux-gnu) + google-protobuf (~> 4.29) + securerandom (0.4.1) + selenium-webdriver (4.27.0) base64 (~> 0.2) + logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - simple_calendar (3.0.4) + simple_calendar (3.1.0) rails (>= 6.1) simple_form (5.3.1) actionpack (>= 5.2) @@ -429,44 +476,60 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.13.1) simplecov_json_formatter (0.1.4) - solid_queue (0.5.0) + solid_cable (3.0.5) + actioncable (>= 7.2) + activejob (>= 7.2) + activerecord (>= 7.2) + railties (>= 7.2) + solid_cache (1.0.6) + activejob (>= 7.2) + activerecord (>= 7.2) + railties (>= 7.2) + solid_queue (1.1.2) activejob (>= 7.1) activerecord (>= 7.1) concurrent-ruby (>= 1.3.1) fugit (~> 1.11.0) railties (>= 7.1) + thor (~> 1.3.1) sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) - sprockets-rails (3.5.1) + sprockets-rails (3.5.2) actionpack (>= 6.1) activesupport (>= 6.1) sprockets (>= 3.0.0) - sqlite3 (1.7.3-aarch64-linux) - sqlite3 (1.7.3-arm-linux) - sqlite3 (1.7.3-arm64-darwin) - sqlite3 (1.7.3-x86-linux) - sqlite3 (1.7.3-x86_64-darwin) - sqlite3 (1.7.3-x86_64-linux) - sshkit (1.23.1) + sqlite3 (2.5.0-aarch64-linux-gnu) + sqlite3 (2.5.0-arm-linux-gnu) + sqlite3 (2.5.0-arm64-darwin) + sqlite3 (2.5.0-x86-linux-gnu) + sqlite3 (2.5.0-x86_64-darwin) + sqlite3 (2.5.0-x86_64-linux-gnu) + sshkit (1.23.2) base64 net-scp (>= 1.1.2) net-sftp (>= 2.1.2) net-ssh (>= 2.8.0) ostruct - stimulus-rails (1.3.3) + stimulus-rails (1.3.4) railties (>= 6.0.0) stringio (3.1.2) thor (1.3.2) - tilt (2.3.0) - timeout (0.4.2) - turbo-rails (2.0.5) + thruster (0.1.10) + thruster (0.1.10-aarch64-linux) + thruster (0.1.10-arm64-darwin) + thruster (0.1.10-x86_64-darwin) + thruster (0.1.10-x86_64-linux) + timeout (0.4.3) + turbo-rails (2.0.11) actionpack (>= 6.0.0) - activejob (>= 6.0.0) railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + uri (1.0.2) warden (1.2.9) rack (>= 2.0.9) web-console (4.2.1) @@ -474,13 +537,14 @@ GEM activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - websocket (1.2.10) - websocket-driver (0.7.6) + websocket (1.2.11) + websocket-driver (0.7.7) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - yabeda (0.13.0) + yabeda (0.13.1) anyway_config (>= 1.0, < 3) concurrent-ruby dry-initializer @@ -511,49 +575,50 @@ DEPENDENCIES active_storage_validations aws-sdk-s3 bcrypt (~> 3.1.7) + bootsnap bootstrap (~> 5.1) brakeman bundle-audit capybara + dartsass-rails (~> 0.5.1) debug devise (~> 4.9) devise-i18n - dotenv-rails faker front_matter_parser + hotwire-spark htmlbeautifier image_processing (~> 1.13) importmap-rails jbuilder - kamal (~> 2.2) + kamal kaminari kaminari-i18n logtail-rails (~> 0.2.7) - mission_control-jobs (~> 0.3.1) + mission_control-jobs pdfkit - pg (~> 1.5.7) + propshaft puma (>= 5.0) - rack-attack - rails (~> 7.2.1) - rails-i18n (~> 7.0.0) + rails (~> 8.0.0) + rails-i18n (~> 8.0.0) redcarpet (~> 3.6) - redis (~> 5.3) rouge (~> 4.4) rqrcode - rubocop (~> 1.65) - rubocop-capybara - rubocop-rails + rubocop-rails-omakase rucaptcha - sassc-rails selenium-webdriver simple_calendar simple_form (~> 5.3) simplecov - solid_queue (~> 0.5.0) + solid_cable + solid_cache + solid_queue sprockets-rails - sqlite3 (~> 1.4) + sqlite3 (>= 2.1) stimulus-rails + thruster turbo-rails + tzinfo-data useragent! web-console yabeda @@ -561,8 +626,5 @@ DEPENDENCIES yabeda-puma-plugin yabeda-rails -RUBY VERSION - ruby 3.3.5p100 - BUNDLED WITH - 2.5.18 + 2.6.2 diff --git a/Procfile b/Procfile index 20e1430..852e6c7 100644 --- a/Procfile +++ b/Procfile @@ -1,3 +1,2 @@ -web: bundle exec thrust bin/start-app -redis: redis-server config/redis.conf -workers: FORK_PER_JOB=false INTERVAL=0.1 bundle exec resque-pool +web: bin/rails server -p 3000 +css: bin/rails dartsass:watch diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index ddd546a..4028c22 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -1,4 +1,4 @@ //= link_tree ../images -//= link_directory ../stylesheets .css //= link_tree ../../javascript .js //= link_tree ../../../vendor/javascript .js +//= link_tree ../builds diff --git a/app/controllers/clubs_controller.rb b/app/controllers/clubs_controller.rb index 9ab6cde..b70ad05 100644 --- a/app/controllers/clubs_controller.rb +++ b/app/controllers/clubs_controller.rb @@ -2,7 +2,7 @@ class ClubsController < BaseController before_action :current_user_is_admin? - before_action -> { resize_image(club_params[:picture], 300, 300) }, only: [:update] + before_action -> { resize_image(club_params[:picture], 300, 300) }, only: [ :update ] def edit @club = current_user.club @@ -12,7 +12,7 @@ def update @club = current_user.club if @club.update(club_params) - redirect_to edit_club_url(@club), flash: { notice: I18n.t('clubs.updated') } + redirect_to edit_club_url(@club), flash: { notice: I18n.t("clubs.updated") } else render :edit, status: :unprocessable_entity end diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index d683684..b8ee7d1 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -21,7 +21,7 @@ def create @event = @club.events.build(event_params) if @event.save - redirect_to club_events_url(@club), flash: { notice: I18n.t('events.created') } + redirect_to club_events_url(@club), flash: { notice: I18n.t("events.created") } else render :new, status: :unprocessable_entity end @@ -31,7 +31,7 @@ def update @event = @club.events.find(params[:id]) if @event.update(event_params) - redirect_to club_events_url(@club), flash: { notice: I18n.t('events.updated') } + redirect_to club_events_url(@club), flash: { notice: I18n.t("events.updated") } else render :new, status: :unprocessable_entity end @@ -41,7 +41,7 @@ def destroy @event = @club.events.find(params[:id]) @event.destroy - redirect_to club_events_url(@club), flash: { success: I18n.t('events.destroyed') } + redirect_to club_events_url(@club), flash: { success: I18n.t("events.destroyed") } end private diff --git a/app/controllers/expense_reasons_controller.rb b/app/controllers/expense_reasons_controller.rb index 88e9b89..3e8bc5a 100644 --- a/app/controllers/expense_reasons_controller.rb +++ b/app/controllers/expense_reasons_controller.rb @@ -19,7 +19,7 @@ def create @expense_reason = @club.expense_reasons.build(expense_params) if @expense_reason.save - redirect_to club_expense_reasons_url(@club), flash: { notice: I18n.t('expense_reasons.created') } + redirect_to club_expense_reasons_url(@club), flash: { notice: I18n.t("expense_reasons.created") } else render :new, status: :unprocessable_entity end @@ -29,7 +29,7 @@ def update @expense_reason = @club.expense_reasons.find(params[:id]) if @expense_reason.update(expense_params) - redirect_to club_expense_reasons_url(@club), flash: { notice: I18n.t('expense_reasons.updated') } + redirect_to club_expense_reasons_url(@club), flash: { notice: I18n.t("expense_reasons.updated") } else render :edit, status: :unprocessable_entity end @@ -39,7 +39,7 @@ def destroy @expense_reason = @club.expense_reasons.find(params[:id]) @expense_reason.destroy - redirect_to club_expense_reasons_url(@club), flash: { success: I18n.t('expense_reasons.destroyed') } + redirect_to club_expense_reasons_url(@club), flash: { success: I18n.t("expense_reasons.destroyed") } end private diff --git a/app/controllers/expenses_controller.rb b/app/controllers/expenses_controller.rb index a6030cf..5995cdc 100644 --- a/app/controllers/expenses_controller.rb +++ b/app/controllers/expenses_controller.rb @@ -23,7 +23,7 @@ def create @expense = @club.expenses.build(expense_params) if @expense.save - redirect_to club_expenses_url(@club), flash: { notice: I18n.t('expenses.created') } + redirect_to club_expenses_url(@club), flash: { notice: I18n.t("expenses.created") } else render :new, status: :unprocessable_entity end @@ -33,7 +33,7 @@ def update @expense = @club.expenses.find(params[:id]) if @expense.update(expense_params) - redirect_to club_expenses_url(@club), flash: { notice: I18n.t('expenses.updated') } + redirect_to club_expenses_url(@club), flash: { notice: I18n.t("expenses.updated") } else render :edit, status: :unprocessable_entity end @@ -43,7 +43,7 @@ def destroy @expense = @club.expenses.find(params[:id]) @expense.destroy - redirect_to club_expenses_url(@club), flash: { success: I18n.t('expenses.destroyed') } + redirect_to club_expenses_url(@club), flash: { success: I18n.t("expenses.destroyed") } end def send_receipt @@ -51,7 +51,7 @@ def send_receipt ReceiptMailer.with(expense: @expense).collaborator_receipt_email.deliver_later - redirect_to club_expenses_url(@club), flash: { notice: I18n.t('expenses.receipt_sent') } + redirect_to club_expenses_url(@club), flash: { notice: I18n.t("expenses.receipt_sent") } end private diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 2eefac3..06aa3b6 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -19,7 +19,7 @@ def create @group = @club.groups.build(group_params) if @group.save - redirect_to club_groups_url(@club), flash: { notice: I18n.t('groups.created') } + redirect_to club_groups_url(@club), flash: { notice: I18n.t("groups.created") } else render :new, status: :unprocessable_entity end @@ -29,7 +29,7 @@ def update @group = @club.groups.find(params[:id]) if @group.update(group_params) - redirect_to club_groups_url(@club), flash: { notice: I18n.t('groups.updated') } + redirect_to club_groups_url(@club), flash: { notice: I18n.t("groups.updated") } else render :edit, status: :unprocessable_entity end @@ -39,7 +39,7 @@ def destroy @group = @club.groups.find(params[:id]) @group.destroy - redirect_to club_groups_url(@club), flash: { success: I18n.t('groups.destroyed') } + redirect_to club_groups_url(@club), flash: { success: I18n.t("groups.destroyed") } end private diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index cf0da90..01170fe 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -26,7 +26,7 @@ def create @member = @club.members.build(member_params) if @member.save - redirect_to club_members_url(@club), flash: { notice: I18n.t('members.created') } + redirect_to club_members_url(@club), flash: { notice: I18n.t("members.created") } else render :new, status: :unprocessable_entity end @@ -36,7 +36,7 @@ def update @member = @club.members.find(params[:id]) if @member.update(member_params) - redirect_to club_members_url(@club), flash: { notice: I18n.t('members.updated') } + redirect_to club_members_url(@club), flash: { notice: I18n.t("members.updated") } else render :edit, status: :unprocessable_entity end @@ -46,7 +46,7 @@ def destroy @member = @club.members.find(params[:id]) @member.destroy - redirect_to club_members_url(@club), flash: { success: I18n.t('members.destroyed') } + redirect_to club_members_url(@club), flash: { success: I18n.t("members.destroyed") } end private diff --git a/app/controllers/payment_reasons_controller.rb b/app/controllers/payment_reasons_controller.rb index a5d9094..08c00d2 100644 --- a/app/controllers/payment_reasons_controller.rb +++ b/app/controllers/payment_reasons_controller.rb @@ -19,7 +19,7 @@ def create @payment_reason = @club.payment_reasons.build(expense_params) if @payment_reason.save - redirect_to club_expense_reasons_url(@club), flash: { notice: I18n.t('payment_reasons.created') } + redirect_to club_expense_reasons_url(@club), flash: { notice: I18n.t("payment_reasons.created") } else render :new, status: :unprocessable_entity end @@ -29,7 +29,7 @@ def update @payment_reason = @club.payment_reasons.find(params[:id]) if @payment_reason.update(expense_params) - redirect_to club_expense_reasons_url(@club), flash: { notice: I18n.t('payment_reasons.updated') } + redirect_to club_expense_reasons_url(@club), flash: { notice: I18n.t("payment_reasons.updated") } else render :edit, status: :unprocessable_entity end @@ -39,7 +39,7 @@ def destroy @payment_reason = @club.payment_reasons.find(params[:id]) @payment_reason.destroy - redirect_to club_payment_reasons_url(@club), flash: { success: I18n.t('payment_reasons.destroyed') } + redirect_to club_payment_reasons_url(@club), flash: { success: I18n.t("payment_reasons.destroyed") } end private diff --git a/app/controllers/payments_controller.rb b/app/controllers/payments_controller.rb index 83ab7ff..144d6d1 100644 --- a/app/controllers/payments_controller.rb +++ b/app/controllers/payments_controller.rb @@ -26,7 +26,7 @@ def create @payment = @member.payments.build(payment_params) if @payment.save - redirect_to club_member_url(@club, @member), flash: { notice: I18n.t('payments.created') } + redirect_to club_member_url(@club, @member), flash: { notice: I18n.t("payments.created") } else render :new, status: :unprocessable_entity end @@ -36,7 +36,7 @@ def update @payment = @member.payments.find(params[:id]) if @payment.update(payment_params) - redirect_to club_member_url(@club, @member), flash: { notice: I18n.t('payments.updated') } + redirect_to club_member_url(@club, @member), flash: { notice: I18n.t("payments.updated") } else render :edit, status: :unprocessable_entity end @@ -46,7 +46,7 @@ def destroy @payment = @club.payments.find(params[:id]) @payment.destroy - redirect_to club_payments_url(@club), flash: { success: I18n.t('payments.destroyed') } + redirect_to club_payments_url(@club), flash: { success: I18n.t("payments.destroyed") } end def send_receipt @@ -54,7 +54,7 @@ def send_receipt ReceiptMailer.with(payment: @payment).member_receipt_email.deliver_later - redirect_to club_payments_url(@club), flash: { notice: I18n.t('payments.receipt_sent') } + redirect_to club_payments_url(@club), flash: { notice: I18n.t("payments.receipt_sent") } end private diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 3e9a7f0..ce223c6 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -19,7 +19,7 @@ def create @tag = @club.tags.build(tag_params) if @tag.save - redirect_to club_tags_url(@club), flash: { notice: I18n.t('tags.created') } + redirect_to club_tags_url(@club), flash: { notice: I18n.t("tags.created") } else render :new, status: :unprocessable_entity end @@ -29,7 +29,7 @@ def update @tag = @club.tags.find(params[:id]) if @tag.update(tag_params) - redirect_to club_tags_url(@club), flash: { notice: I18n.t('tags.updated') } + redirect_to club_tags_url(@club), flash: { notice: I18n.t("tags.updated") } else render :edit, status: :unprocessable_entity end @@ -39,7 +39,7 @@ def destroy @tag = @club.tags.find(params[:id]) @tag.destroy - redirect_to club_tags_url(@club), flash: { success: I18n.t('tags.destroyed') } + redirect_to club_tags_url(@club), flash: { success: I18n.t("tags.destroyed") } end private diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 9968148..e2bf265 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -2,8 +2,8 @@ module Users class RegistrationsController < Devise::RegistrationsController - before_action :configure_sign_up_params, only: [:create] - before_action :configure_account_update_params, only: [:update] + before_action :configure_sign_up_params, only: [ :create ] + before_action :configure_account_update_params, only: [ :update ] before_action :set_club, only: %i[edit destroy] # GET /resource/sign_up @@ -17,7 +17,7 @@ def create # TODO: fix this in tests if !Rails.env.test? && !verify_rucaptcha?(nil, captcha: params[:user][:_rucaptcha]) clean_up_passwords resource - resource.errors.add(:_rucaptcha, '') + resource.errors.add(:_rucaptcha, "") return respond_with resource end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c948324..9214321 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -19,10 +19,10 @@ def edit def create @user = @club.users.build(user_params) @user.role = :collaborator - @user.password = 'password' + @user.password = "password" if @user.save - redirect_to new_club_user_url(@club), flash: { notice: I18n.t('users.created') } + redirect_to new_club_user_url(@club), flash: { notice: I18n.t("users.created") } else render :new, status: :unprocessable_entity end @@ -32,7 +32,7 @@ def update @user = @club.users.find(params[:id]) if @user.update(user_params) - redirect_to club_users_url(@club), flash: { notice: I18n.t('users.updated') } + redirect_to club_users_url(@club), flash: { notice: I18n.t("users.updated") } else render :edit, status: :unprocessable_entity end @@ -42,7 +42,7 @@ def destroy @user = @club.users.find(params[:id]) @user.destroy - redirect_to club_users_url(@club), flash: { success: I18n.t('users.destroyed') } + redirect_to club_users_url(@club), flash: { success: I18n.t("users.destroyed") } end private diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index ba861c0..ff66ff5 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true class ApplicationMailer < ActionMailer::Base - default from: 'info@opengas.eu' - layout 'mailer' + default from: "info@opengas.eu" + layout "mailer" end diff --git a/app/mailers/blsd_mailer.rb b/app/mailers/blsd_mailer.rb index 39d8c5c..d108e2a 100644 --- a/app/mailers/blsd_mailer.rb +++ b/app/mailers/blsd_mailer.rb @@ -4,6 +4,6 @@ class BlsdMailer < ApplicationMailer def expiring_email @user = params[:user] - mail(to: @user.email, subject: I18n.t('blsd.expiring_email.subject')) + mail(to: @user.email, subject: I18n.t("blsd.expiring_email.subject")) end end diff --git a/app/mailers/medical_certificate_mailer.rb b/app/mailers/medical_certificate_mailer.rb index 6e996cb..f010027 100644 --- a/app/mailers/medical_certificate_mailer.rb +++ b/app/mailers/medical_certificate_mailer.rb @@ -4,6 +4,6 @@ class MedicalCertificateMailer < ApplicationMailer def expiring_email @member = params[:member] - mail(to: @member.email, subject: I18n.t('medical_certificate.expiring_email.subject')) + mail(to: @member.email, subject: I18n.t("medical_certificate.expiring_email.subject")) end end diff --git a/app/mailers/receipt_mailer.rb b/app/mailers/receipt_mailer.rb index 39a9cfd..0212306 100644 --- a/app/mailers/receipt_mailer.rb +++ b/app/mailers/receipt_mailer.rb @@ -7,8 +7,8 @@ def collaborator_receipt_email generator = Pdf::CollaboratorsReceiptGenerator.new(expense: @expense) pdf_path = generator.call - attachments['receipt.pdf'] = File.read(pdf_path) - mail(to: @expense.user.email, subject: I18n.t('expenses.collaborator_email.subject')) + attachments["receipt.pdf"] = File.read(pdf_path) + mail(to: @expense.user.email, subject: I18n.t("expenses.collaborator_email.subject")) end def member_receipt_email @@ -17,7 +17,7 @@ def member_receipt_email generator = Pdf::MembersReceiptGenerator.new(payment: @payment) pdf_path = generator.call - attachments['receipt.pdf'] = File.read(pdf_path) - mail(to: @payment.member.email, subject: I18n.t('payments.member_email.subject')) + attachments["receipt.pdf"] = File.read(pdf_path) + mail(to: @payment.member.email, subject: I18n.t("payments.member_email.subject")) end end diff --git a/app/models/club.rb b/app/models/club.rb index e8c8210..79dd857 100644 --- a/app/models/club.rb +++ b/app/models/club.rb @@ -2,7 +2,7 @@ class Club < ApplicationRecord has_one_attached :picture - validates :picture, content_type: ['image/png', 'image/jpeg', 'image/webp'] + validates :picture, content_type: [ "image/png", "image/jpeg", "image/webp" ] has_many :users, dependent: :destroy @@ -24,10 +24,10 @@ class Club < ApplicationRecord normalizes :province, with: ->(v) { v.upcase } def full_name_and_address_for_receipt - [name, full_address, email].join('
') + [ name, full_address, email ].join("
") end def full_address - [address, municipality, postal_code, province].join(', ') + [ address, municipality, postal_code, province ].join(", ") end end diff --git a/app/models/member.rb b/app/models/member.rb index 681fc3d..fb37eed 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -2,7 +2,7 @@ class Member < ApplicationRecord has_one_attached :picture - validates :picture, content_type: ['image/png', 'image/jpeg'] + validates :picture, content_type: [ "image/png", "image/jpeg" ] belongs_to :club @@ -49,10 +49,10 @@ class Member < ApplicationRecord enum :medical_certificate_kind, %i[regular competitive] scope :with_warnings, - -> { includes(:payments).select { |m| m.status == 'warning' } } + -> { includes(:payments).select { |m| m.status == "warning" } } scope :with_errors, - -> { includes(:payments).select { |m| m.status == 'error' } } + -> { includes(:payments).select { |m| m.status == "error" } } def full_name "#{last_name} #{first_name}".capitalize @@ -63,37 +63,37 @@ def child? end def status - return 'error' if statuses.find { |s| s == 'error' } - return 'warning' if statuses.find { |s| s == 'warning' } + return "error" if statuses.find { |s| s == "error" } + return "warning" if statuses.find { |s| s == "warning" } - 'ok' + "ok" end def statuses - [membership_status, medical_status, payments_status] + [ membership_status, medical_status, payments_status ] end def membership_status - return 'error' if membership_expires_at.blank? || membership_expires_at <= 1.month.ago - return 'warning' if membership_expires_at <= Time.zone.now + return "error" if membership_expires_at.blank? || membership_expires_at <= 1.month.ago + return "warning" if membership_expires_at <= Time.zone.now - 'ok' + "ok" end def medical_status - return 'error' if medical_certificate_expires_at.blank? || medical_certificate_expires_at <= Time.zone.now - return 'warning' if medical_certificate_expires_at <= 2.months.from_now + return "error" if medical_certificate_expires_at.blank? || medical_certificate_expires_at <= Time.zone.now + return "warning" if medical_certificate_expires_at <= 2.months.from_now - 'ok' + "ok" end def payments_status last_payment = payments.last - return 'error' if last_payment.blank? + return "error" if last_payment.blank? # TODO: logic - 'ok' + "ok" end end diff --git a/app/models/user.rb b/app/models/user.rb index 2b69ed4..d8ace74 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -8,7 +8,7 @@ class User < ApplicationRecord :confirmable, :lockable, :timeoutable has_one_attached :picture - validates :picture, content_type: ['image/png', 'image/jpeg'] + validates :picture, content_type: [ "image/png", "image/jpeg" ] has_many :user_groups, dependent: :destroy has_many :groups, through: :user_groups, dependent: :nullify @@ -31,7 +31,7 @@ class User < ApplicationRecord validates :club_email, format: { with: URI::MailTo::EMAIL_REGEXP }, if: -> { registering == true } def admin? - role == 'admin' + role == "admin" end def full_name diff --git a/app/services/pdf/collaborators_receipt_generator.rb b/app/services/pdf/collaborators_receipt_generator.rb index 3bca64e..1b81278 100644 --- a/app/services/pdf/collaborators_receipt_generator.rb +++ b/app/services/pdf/collaborators_receipt_generator.rb @@ -8,22 +8,22 @@ def initialize(expense:) @expense = expense @user = expense.user - raise 'Expense is without collaborator!' unless @user + raise "Expense is without collaborator!" unless @user @club = @user.club end def call - path = Rails.root.join('tmp', filename) - template = Rails.root.join('app/views/pdf/expenses/compensation.html.erb') + path = Rails.root.join("tmp", filename) + template = Rails.root.join("app/views/pdf/expenses/compensation.html.erb") html = ERB.new(template.read).result(binding) kit = PDFKit.new( html, - page_size: 'A4', orientation: 'portrait', - margin_top: '5mm', margin_bottom: '5mm', - margin_left: '5mm', margin_right: '5mm' + page_size: "A4", orientation: "portrait", + margin_top: "5mm", margin_bottom: "5mm", + margin_left: "5mm", margin_right: "5mm" ) kit.to_file(path) diff --git a/app/services/pdf/members_receipt_generator.rb b/app/services/pdf/members_receipt_generator.rb index 06ba15a..a7d36a6 100644 --- a/app/services/pdf/members_receipt_generator.rb +++ b/app/services/pdf/members_receipt_generator.rb @@ -11,16 +11,16 @@ def initialize(payment:) end def call - path = Rails.root.join('tmp', filename) - template = Rails.root.join('app/views/pdf/payments/receipt.html.erb') + path = Rails.root.join("tmp", filename) + template = Rails.root.join("app/views/pdf/payments/receipt.html.erb") html = ERB.new(template.read).result(binding) kit = PDFKit.new( html, - page_size: 'A4', orientation: 'portrait', - margin_top: '5mm', margin_bottom: '5mm', - margin_left: '5mm', margin_right: '5mm' + page_size: "A4", orientation: "portrait", + margin_top: "5mm", margin_bottom: "5mm", + margin_left: "5mm", margin_right: "5mm" ) kit.to_file(path) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 9d8f8b9..0eef39c 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -2,8 +2,9 @@ <%= content_for(:title) || "Open GAS" %> - - + + + <%= csrf_meta_tags %> <%= csp_meta_tag %> @@ -11,7 +12,7 @@ <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %> <%= javascript_importmap_tags %> - <%= content_tag :body, data: { action: action_name, controller: controller_name, path: request.path, controller: "toggle" } do %> + <%= content_tag :body, data: { action: action_name, controller: controller_name, path: request.path } do %>
<%= render 'header' %>
diff --git a/bin/dev b/bin/dev new file mode 100755 index 0000000..5f91c20 --- /dev/null +++ b/bin/dev @@ -0,0 +1,2 @@ +#!/usr/bin/env ruby +exec "./bin/rails", "server", *ARGV diff --git a/bin/setup b/bin/setup index 67b9d6c..be3db3c 100755 --- a/bin/setup +++ b/bin/setup @@ -2,16 +2,23 @@ require "fileutils" APP_ROOT = File.expand_path("..", __dir__) -APP_NAME = "open-GAS" def system!(*args) system(*args, exception: true) end FileUtils.chdir APP_ROOT do + # This script is a way to set up or update your development environment automatically. + # This script is idempotent, so that you can run it at any time and get an expectable outcome. + # Add necessary setup steps to this file. + puts "== Installing dependencies ==" - system! "gem install bundler --conservative" - system!("bundle install") + system("bundle check") || system!("bundle install") + + # puts "\n== Copying sample files ==" + # unless File.exist?("config/database.yml") + # FileUtils.cp "config/database.yml.sample", "config/database.yml" + # end puts "\n== Preparing database ==" system! "bin/rails db:prepare" @@ -19,10 +26,9 @@ FileUtils.chdir APP_ROOT do puts "\n== Removing old logs and tempfiles ==" system! "bin/rails log:clear tmp:clear" - puts "\n== Restarting application server ==" - system! "bin/rails restart" - - puts "\n== Configuring puma-dev ==" - system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}" - system "curl -Is https://#{APP_NAME}.test/up | head -n 1" + unless ARGV.include?("--skip-server") + puts "\n== Starting development server ==" + STDOUT.flush # flush the output before exec(2) so that it displays + exec "bin/dev" + end end diff --git a/config/application.rb b/config/application.rb index d9d8046..7ddfced 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,8 +1,6 @@ -# frozen_string_literal: true +require_relative "boot" -require_relative 'boot' - -require 'rails/all' +require "rails/all" # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. @@ -25,9 +23,8 @@ class Application < Rails::Application # # config.time_zone = "Central Time (US & Canada)" # config.eager_load_paths << Rails.root.join("extras") - config.autoload_paths << Rails.root.join('app/services') + config.autoload_paths << Rails.root.join("app/services") config.i18n.default_locale = :it - config.hosts = [] end end diff --git a/config/boot.rb b/config/boot.rb index 30e594e..988a5dd 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,5 +1,4 @@ -# frozen_string_literal: true +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) - -require 'bundler/setup' # Set up gems listed in the Gemfile. +require "bundler/setup" # Set up gems listed in the Gemfile. +require "bootsnap/setup" # Speed up boot time by caching expensive operations. diff --git a/config/cable.yml b/config/cable.yml index 3b74af8..b9adc5a 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -1,3 +1,7 @@ +# Async adapter only works within the same process, so for manually triggering cable updates from a console, +# and seeing results in the browser, you must do so from the web console (running inside the dev process), +# not a terminal started via bin/rails console! Add "console" to any action or any ERB template view +# to make the web console appear. development: adapter: async @@ -5,6 +9,9 @@ test: adapter: test production: - adapter: redis - url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> - channel_prefix: opengas_production + adapter: solid_cable + connects_to: + database: + writing: cable + polling_interval: 0.1.seconds + message_retention: 1.day diff --git a/config/cache.yml b/config/cache.yml new file mode 100644 index 0000000..19d4908 --- /dev/null +++ b/config/cache.yml @@ -0,0 +1,16 @@ +default: &default + store_options: + # Cap age of oldest cache entry to fulfill retention policies + # max_age: <%= 60.days.to_i %> + max_size: <%= 256.megabytes %> + namespace: <%= Rails.env %> + +development: + <<: *default + +test: + <<: *default + +production: + database: cache + <<: *default diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc index 87fe214..6688cb4 100644 --- a/config/credentials.yml.enc +++ b/config/credentials.yml.enc @@ -1 +1 @@ -0jzAHU8ow9zF8PpcXF9uvHb1G4gMQnqaDND2rEdqpdKJYsWAVXDsvswNgIpHFgtk3Rrh18nLQhASM87NUXoflDuUB+Rie0v1UceAkJk+0Zus2z4r7+QYe/dnkFj6/8ytDk1aOe62P9ZuoX1arffDE5m2Okw3heGl71oD5S159gZCtsDK+uMzcKzF2Sj8cFpr7VsDyIDXYIA/EgNKEzFaryfdtFWEIcAzf3fUzJESmFdr/2wNPckWIHUMyO8FGkinh0kLcjql3YJ8nicnOP2G55545ddrJUhDo9vCFqmiuMrZjhqiDeuzyOjhZp6sK/DczmwUrvn4sF2Cmyl9olpx0sO2urlZJSyKsdNaEsRPhD+HJ2tA4XC551DKorr+uCFunHFZMeRauefKJFcnIKqMuFVPzdUW/Lar1JUncGsjWBLFmAz08BJmKnJEdatinlqdIA+uRQ75PEos3QMWbniF5HHaIyfLNPfnSc46AI2zmFsMCLKcPkBH2WJeTDpE50gqDT1G7CzwKbe3trPkhTXdQqffHLpX362YhZfW8cgfVbQS5PGFn8VKP9b4GyxIHUjKQc/ZzdlN0ZvH2Y+sz8D43QsiHwKKm3HYgOMepO7W2dQKeAc3be9hgbdYvdAJhUKpMcnnhzAif5z+i3fMEqSwOm/bdyqiWEIL60B+54x60J2QfqTdgo0x/mt27ZLx3vmGQbCEtK1/znA9SEVTUrbIpDZCBeQ9JQ5nHw==--GR9yMZHk6YurLTID--V1FXeATVLIMqP47eowGGbA== \ No newline at end of file +o9T2G0byvsVT43DQkAW7vjw29CpIrbPuIFQR4Z9NEz4sTZlHajTHdjBn/+fnYfpFML5AYesfUQHt/ql5z9a1uaShp1wqhsgCei0FoQcGy3V2XD5h+rOnDKYgmm9g7E0cPiCE5adQIJ8t9NbftiLCzZhBz091S1REaLBn6r/RKkOd+y6w+bOk8i9m8PA32iXswiOiHBft0SlbGKGxY4UvnKU5QrkqZk2dHt79aAiu19jwAh6TOc+8mIbzn9Bo3yOxlnPb4KQsopsvTtLM1DPrmnWD8dNFlrq/NW8MB7ctgfD8UQ5FBVEw5FwlWVJlsOvhmI3mT5kXpKdDnl/5u8UZS91JyoYW+HG2zP9SEQhGrCT8qpPkQQZluWDWW+vw+ws0Hs3CepVIl+0/9ZGoKW9bylTBv9La2F63PuIeTCuxPU8x2kSCy/eNRacnVf9DG9jAbRErzWGm/A9CIrY768+g+kYhMLwA4ODSiQZckyHHLZ/YdTlDwGjrbttd3VFbHguf43KdYQO7p01oIRqhm0983jLOzNLuQFIjy3iiR13O5ci9E5G7yLg7qvN78gU2rqi7x8P8ONLvM8fkzuPcNZTYHi8R1NXdx7nb3UwkIjdt/MNTQLGEAhF68Pv69510nHraTkCWYPRB36OEQ4OyV8zVHC4Pe8jGu9Naz9vQ1utTU8IVCT4=--IF9uOrmhSsv5l9tX--/V+Hr3Vs88aV3ZLQJNJOHw== \ No newline at end of file diff --git a/config/database.yml b/config/database.yml index a4bacaf..2640cb5 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,23 +1,41 @@ +# SQLite. Versions 3.8.0 and up are supported. +# gem install sqlite3 +# +# Ensure the SQLite 3 gem is defined in your Gemfile +# gem "sqlite3" +# default: &default - adapter: postgresql - pool: <%= ENV.fetch('RAILS_MAX_THREADS') { 10 } %> - host: <%= ENV.fetch('PG_HOST', 'localhost') %> - port: <%= ENV.fetch('PG_PORT', '5432') %> - username: <%= ENV.fetch('PG_USER', 'opengas') %> - password: <%= ENV.fetch('PG_PASSWORD', 'opengas') %> - database: <%= ENV.fetch('PG_DATABASE', "opengas_#{Rails.env}") %> - encoding: unicode + adapter: sqlite3 + pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + timeout: 5000 development: - primary: - <<: *default + <<: *default + database: storage/development.sqlite3 +# Warning: The database defined as "test" will be erased and +# re-generated from your development database when you run "rake". +# Do not set this db to the same as development or production. test: - primary: - <<: *default - database: <%= ENV.fetch('PG_DATABASE', 'opengas_test') %> + <<: *default + database: storage/test.sqlite3 + +# Store production database in the storage/ directory, which by default +# is mounted as a persistent Docker volume in config/deploy.yml. production: primary: <<: *default - password: <%= Rails.application.credentials.dig(:pg, :password) %> + database: storage/production.sqlite3 + cache: + <<: *default + database: storage/production_cache.sqlite3 + migrations_paths: db/cache_migrate + queue: + <<: *default + database: storage/production_queue.sqlite3 + migrations_paths: db/queue_migrate + cable: + <<: *default + database: storage/production_cable.sqlite3 + migrations_paths: db/cable_migrate diff --git a/config/deploy.yml b/config/deploy.yml index c0fe117..5e6d7cd 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -16,13 +16,12 @@ servers: # Set ssl: false if using something like Cloudflare to terminate SSL (but keep host!). proxy: ssl: true - app_port: 3000 host: opengas.eu # Credentials for your image host. registry: # Specify the registry server, if you're not using Docker Hub - # server: registry.digitalocean.com / ghcr.io / ... + server: ghcr.io username: baldarn # Always use an access token ratherg than real password when possible. @@ -33,12 +32,7 @@ registry: # Remember to run `kamal env push` after making changes! env: clear: - PG_HOST: host.docker.internal - REDIS_URL: redis://host.docker.internal:6379/0 APP_HOST: opengas.eu - SMTP_PORT: 587 - SMTP_ADDRESS: smtp.ionos.it - SMTP_USERNAME: info@opengas.eu # Run the Solid Queue Supervisor inside the web server's Puma process to do jobs. # When you start using multiple servers, you should split out job processing to a dedicated machine. SOLID_QUEUE_IN_PUMA: true @@ -95,24 +89,3 @@ ssh: # user: app # Use accessory services (secrets come from .kamal/secrets). -accessories: - db: - image: postgres:16.4 - host: opengas.eu - port: 5432 - options: - restart: always - env: - clear: - POSTGRES_DB: opengas_production - POSTGRES_USER: opengas - secret: - - POSTGRES_PASSWORD - directories: - - data:/var/lib/postgresql/data - redis: - image: redis:7.4 - host: opengas.eu - port: 6379 - directories: - - data:/data diff --git a/config/environment.rb b/config/environment.rb index d5abe55..cac5315 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,7 +1,5 @@ -# frozen_string_literal: true - # Load the Rails application. -require_relative 'application' +require_relative "application" # Initialize the Rails application. Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index c631384..4cc21c4 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,13 +1,9 @@ -# frozen_string_literal: true - -require 'active_support/core_ext/integer/time' +require "active_support/core_ext/integer/time" Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # In the development environment your application's code is reloaded any time - # it changes. This slows down response time but is perfect for development - # since you don't have to restart the web server when you make code changes. + # Make code changes take effect immediately without server restart. config.enable_reloading = true # Do not eager load code on boot. @@ -19,58 +15,46 @@ # Enable server timing. config.server_timing = true - # Enable/disable caching. By default caching is disabled. - # Run rails dev:cache to toggle caching. - if Rails.root.join('tmp/caching-dev.txt').exist? + # Enable/disable Action Controller caching. By default Action Controller caching is disabled. + # Run rails dev:cache to toggle Action Controller caching. + if Rails.root.join("tmp/caching-dev.txt").exist? config.action_controller.perform_caching = true config.action_controller.enable_fragment_cache_logging = true - - config.cache_store = :redis_cache_store, { - url: "#{ENV.fetch('REDIS_URL', 'redis://localhost')}:#{ENV.fetch('REDIS_PORT', '6379')}/0" - } - config.public_file_server.headers = { 'Cache-Control' => "public, max-age=#{2.days.to_i}" } + config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" } else config.action_controller.perform_caching = false - - config.cache_store = :null_store end + # Change to :null_store to avoid any caching. + config.cache_store = :memory_store + # Store uploaded files on the local file system (see config/storage.yml for options). config.active_storage.service = :local # Don't care if the mailer can't send. - config.action_mailer.raise_delivery_errors = true + config.action_mailer.raise_delivery_errors = false - # Disable caching for Action Mailer templates even if Action Controller - # caching is enabled. + # Make template changes take effect immediately. config.action_mailer.perform_caching = false - config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } + # Set localhost to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "localhost", port: 3000 } - config.action_mailer.delivery_method = :file # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log - # Raise exceptions for disallowed deprecations. - config.active_support.disallowed_deprecation = :raise - - # Tell Active Support which deprecation messages to disallow. - config.active_support.disallowed_deprecation_warnings = [] - # Raise an error on page load if there are pending migrations. config.active_record.migration_error = :page_load # Highlight code that triggered database queries in logs. config.active_record.verbose_query_logs = true + # Append comments with runtime information tags to SQL queries in logs. + config.active_record.query_log_tags_enabled = true + # Highlight code that enqueued background job in logs. config.active_job.verbose_enqueue_logs = true - config.active_job.queue_adapter = :solid_queue - - # Suppress logger output for asset requests. - config.assets.quiet = true - # Raises error for missing translations. # config.i18n.raise_on_missing_translations = true @@ -84,7 +68,5 @@ config.action_controller.raise_on_missing_callback_actions = true # Apply autocorrection by RuboCop to files generated by `bin/rails generate`. - config.generators.apply_rubocop_autocorrect_after_generate! + # config.generators.apply_rubocop_autocorrect_after_generate! end - -Rack::Attack.enabled = false diff --git a/config/environments/production.rb b/config/environments/production.rb index 60be458..8b4a45f 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,100 +1,71 @@ -# frozen_string_literal: true - -require 'active_support/core_ext/integer/time' +require "active_support/core_ext/integer/time" Rails.application.configure do - # Prepare the ingress controller used to receive mail - # config.action_mailbox.ingress = :relay - # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.enable_reloading = false - # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both threaded web servers - # and those relying on copy on write to perform better. - # Rake tasks automatically ignore this option for performance. + # Eager load code on boot for better performance and memory savings (ignored by Rake tasks). config.eager_load = true - # Full error reports are disabled and caching is turned on. + # Full error reports are disabled. config.consider_all_requests_local = false - config.action_controller.perform_caching = true - - # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment - # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files). - # config.require_master_key = true - - # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead. - # config.public_file_server.enabled = false - # Compress CSS using a preprocessor. - config.assets.css_compressor = :sass + # Turn on fragment caching in view templates. + config.action_controller.perform_caching = true - # Do not fall back to assets pipeline if a precompiled asset is missed. - config.assets.compile = true + # Cache assets for far-future expiry since they are all digest stamped. + config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" } # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.asset_host = "http://assets.example.com" - # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache - # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX - - config.active_storage.service = :s3 - - # Mount Action Cable outside main process or domain. - # config.action_cable.mount_path = nil - # config.action_cable.url = "wss://example.com/cable" - # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ] + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local # Assume all access to the app is happening through a SSL-terminating reverse proxy. - # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies. - # config.assume_ssl = true + config.assume_ssl = true # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - config.force_ssl = false + config.force_ssl = true # Skip http-to-https redirect for the default health check endpoint. # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } - # Log to STDOUT by default - config.logger = ActiveSupport::Logger.new($stdout) - .tap { |logger| logger.formatter = Logger::Formatter.new } - .then { |logger| ActiveSupport::TaggedLogging.new(logger) } + # Log to STDOUT with the current request id as a default log tag. + config.log_tags = [ :request_id ] + config.logger = ActiveSupport::TaggedLogging.logger(STDOUT) - # Prepend all log lines with the following tags. - config.log_tags = [:request_id] + # Change to "debug" to log everything (including potentially personally-identifiable information!) + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info") - # "info" includes generic and useful information about system operation, but avoids logging too much - # information to avoid inadvertent exposure of personally identifiable information (PII). If you - # want to log everything, set the level to "debug". - config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info') - - config.cache_store = :redis_cache_store, { - url: "#{ENV.fetch('REDIS_URL', 'redis://localhost')}:#{ENV.fetch('REDIS_PORT', '6379')}/0" - } + # Prevent health checks from clogging up the logs. + config.silence_healthcheck_path = "/up" - # Use a real queuing backend for Active Job (and separate queues per environment). - config.active_job.queue_adapter = :solid_queue - # config.active_job.queue_name_prefix = "open_gas_production" + # Don't log any deprecations. + config.active_support.report_deprecations = false - # Disable caching for Action Mailer templates even if Action Controller - # caching is enabled. - config.action_mailer.perform_caching = false + # Replace the default in-process memory cache store with a durable alternative. + config.cache_store = :solid_cache_store - config.action_mailer.default_url_options = { host: ENV.fetch('APP_HOST', 'localhost') } + # Replace the default in-process and non-durable queuing backend for Active Job. + # config.active_job.queue_adapter = :resque # Ignore bad email addresses and do not raise email delivery errors. # Set this to true and configure the email server for immediate delivery to raise delivery errors. - config.action_mailer.raise_delivery_errors = false + # config.action_mailer.raise_delivery_errors = false + + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } + # Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit. config.action_mailer.smtp_settings = { - address: ENV.fetch('SMTP_ADDRESS', 'smtp.ionos.it'), - port: ENV.fetch('SMTP_PORT', 587), - user_name: ENV.fetch('SMTP_USERNAME', 'info@opengas.eu'), + address: ENV.fetch("SMTP_ADDRESS", "smtp.ionos.it"), + port: ENV.fetch("SMTP_PORT", 587), + user_name: ENV.fetch("SMTP_USERNAME", "info@opengas.eu"), password: Rails.application.credentials.dig(:smtp, :password), - authentication: 'plain', + authentication: "plain", enable_starttls: true } @@ -108,22 +79,18 @@ # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true - # Don't log any deprecations. - config.active_support.report_deprecations = false - # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + # Only use :id for inspections in production. + config.active_record.attributes_for_inspect = [ :id ] + # Enable DNS rebinding protection and other `Host` header attacks. # config.hosts = [ # "example.com", # Allow requests from example.com # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com` # ] + # # Skip DNS rebinding protection for the default health check endpoint. # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } - - # SQLite is good, actually - config.active_record.sqlite3_production_warning = false - - config.assets.manifest = Rails.root.join('config/manifest.json') end diff --git a/config/environments/test.rb b/config/environments/test.rb index bcec91f..c2095b1 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,7 +1,3 @@ -# frozen_string_literal: true - -require 'active_support/core_ext/integer/time' - # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped @@ -17,14 +13,13 @@ # this is usually not necessary, and can slow down your test suite. However, it's # recommended that you enable it in continuous integration systems to ensure eager # loading is working properly before deploying your code. - config.eager_load = true + config.eager_load = ENV["CI"].present? - # Configure public file server for tests with Cache-Control for performance. - config.public_file_server.headers = { 'Cache-Control' => "public, max-age=#{1.hour.to_i}" } + # Configure public file server for tests with cache-control for performance. + config.public_file_server.headers = { "cache-control" => "public, max-age=3600" } - # Show full error reports and disable caching. + # Show full error reports. config.consider_all_requests_local = true - config.action_controller.perform_caching = false config.cache_store = :null_store # Render exception templates for rescuable exceptions and raise for other exceptions. @@ -36,28 +31,17 @@ # Store uploaded files on the local file system in a temporary directory. config.active_storage.service = :test - # Disable caching for Action Mailer templates even if Action Controller - # caching is enabled. - config.action_mailer.perform_caching = false - # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test - # Unlike controllers, the mailer instance doesn't have any context about the - # incoming request so you'll need to provide the :host parameter yourself. - config.action_mailer.default_url_options = { host: 'www.example.com' } + # Set host to be used by links generated in mailer templates. + config.action_mailer.default_url_options = { host: "example.com" } # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr - # Raise exceptions for disallowed deprecations. - config.active_support.disallowed_deprecation = :raise - - # Tell Active Support which deprecation messages to disallow. - config.active_support.disallowed_deprecation_warnings = [] - # Raises error for missing translations. # config.i18n.raise_on_missing_translations = true @@ -67,5 +51,3 @@ # Raise error when a before_action's only/except options reference missing actions. config.action_controller.raise_on_missing_callback_actions = true end - -Rack::Attack.enabled = false diff --git a/config/importmap.rb b/config/importmap.rb index b37a292..86bd00c 100644 --- a/config/importmap.rb +++ b/config/importmap.rb @@ -2,11 +2,11 @@ # Pin npm packages by running ./bin/importmap -pin 'application' -pin '@hotwired/turbo-rails', to: 'turbo.min.js' -pin '@hotwired/stimulus', to: 'stimulus.min.js' -pin '@hotwired/stimulus-loading', to: 'stimulus-loading.js' -pin_all_from 'app/javascript/controllers', under: 'controllers' +pin "application" +pin "@hotwired/turbo-rails", to: "turbo.min.js" +pin "@hotwired/stimulus", to: "stimulus.min.js" +pin "@hotwired/stimulus-loading", to: "stimulus-loading.js" +pin_all_from "app/javascript/controllers", under: "controllers" -pin 'bootstrap', to: 'bootstrap.min.js', preload: true -pin 'popper', to: 'popper.js', preload: true +pin "bootstrap", to: "bootstrap.min.js", preload: true +pin "popper", to: "popper.js", preload: true diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 35f5c22..97653ea 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -1,14 +1,8 @@ -# frozen_string_literal: true - # Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. -Rails.application.config.assets.version = '1.0' +Rails.application.config.assets.version = "1.0" # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in the app/assets -# folder are already added. Rails.application.config.assets.precompile += %w[bootstrap.min.js popper.js] diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index 35ab3fd..b3076b3 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - # Be sure to restart your server when you modify this file. # Define an application-wide content security policy. diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 754a025..af6b221 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -24,7 +24,7 @@ # Configure the e-mail address which will be shown in Devise::Mailer, # note that it will be overwritten if you use your own mailer class # with default "from" parameter. - config.mailer_sender = ENV.fetch('SMTP_USERNAME', 'info@opengas.eu') + config.mailer_sender = ENV.fetch("SMTP_USERNAME", "info@opengas.eu") # Configure the class responsible to send e-mails. # config.mailer = 'Devise::Mailer' @@ -36,7 +36,7 @@ # Load and configure the ORM. Supports :active_record (default) and # :mongoid (bson_ext recommended) by default. Other ORMs may be # available as additional gems. - require 'devise/orm/active_record' + require "devise/orm/active_record" # ==> Configuration for any authentication mechanism # Configure which keys are used when authenticating a user. The default is @@ -58,12 +58,12 @@ # Configure which authentication keys should be case-insensitive. # These keys will be downcased upon creating or modifying a user and when used # to authenticate or find a user. Default is :email. - config.case_insensitive_keys = [:email] + config.case_insensitive_keys = [ :email ] # Configure which authentication keys should have whitespace stripped. # These keys will have whitespace before and after removed upon creating or # modifying a user and when used to authenticate or find a user. Default is :email. - config.strip_whitespace_keys = [:email] + config.strip_whitespace_keys = [ :email ] # Tell if authentication through request.params is enabled. True by default. # It can be set to an array that will enable params authentication only for the @@ -97,7 +97,7 @@ # Notice that if you are skipping storage for all authentication paths, you # may want to disable generating routes to Devise's sessions controller by # passing skip: :sessions to `devise_for` in your config/routes.rb - config.skip_session_storage = [:http_auth] + config.skip_session_storage = [ :http_auth ] # By default, Devise cleans up the CSRF token on authentication to # avoid CSRF token fixation attacks. This means that, when using AJAX diff --git a/config/initializers/enable_yjit.rb b/config/initializers/enable_yjit.rb deleted file mode 100644 index 8d19d5a..0000000 --- a/config/initializers/enable_yjit.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -# Automatically enable YJIT as of Ruby 3.3, as it brings very -# sizeable performance improvements. - -# If you are deploying to a memory constrained environment -# you may want to delete this file, but otherwise it's free -# performance. -if defined? RubyVM::YJIT.enable - Rails.application.config.after_initialize do - RubyVM::YJIT.enable - end -end diff --git a/config/initializers/extensions.rb b/config/initializers/extensions.rb deleted file mode 100644 index caf04fa..0000000 --- a/config/initializers/extensions.rb +++ /dev/null @@ -1,3 +0,0 @@ -# frozen_string_literal: true - -Dir[Rails.root.join('lib/rails_ext/*').to_s].each { |path| require "rails_ext/#{File.basename(path)}" } diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index 5a36c53..c0b717f 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,10 +1,8 @@ -# frozen_string_literal: true - # Be sure to restart your server when you modify this file. # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. # Use this to limit dissemination of sensitive information. # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. -Rails.application.config.filter_parameters += %i[ - passw email secret token _key crypt salt certificate otp ssn +Rails.application.config.filter_parameters += [ + :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc ] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 9e049dc..3860f65 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/config/initializers/new_framework_defaults_8_0.rb b/config/initializers/new_framework_defaults_8_0.rb new file mode 100644 index 0000000..92efa95 --- /dev/null +++ b/config/initializers/new_framework_defaults_8_0.rb @@ -0,0 +1,30 @@ +# Be sure to restart your server when you modify this file. +# +# This file eases your Rails 8.0 framework defaults upgrade. +# +# Uncomment each configuration one by one to switch to the new default. +# Once your application is ready to run with all new defaults, you can remove +# this file and set the `config.load_defaults` to `8.0`. +# +# Read the Guide for Upgrading Ruby on Rails for more info on each option. +# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html + +### +# Specifies whether `to_time` methods preserve the UTC offset of their receivers or preserves the timezone. +# If set to `:zone`, `to_time` methods will use the timezone of their receivers. +# If set to `:offset`, `to_time` methods will use the UTC offset. +# If `false`, `to_time` methods will convert to the local system UTC offset instead. +#++ +# Rails.application.config.active_support.to_time_preserves_timezone = :zone + +### +# When both `If-Modified-Since` and `If-None-Match` are provided by the client +# only consider `If-None-Match` as specified by RFC 7232 Section 6. +# If set to `false` both conditions need to be satisfied. +#++ +# Rails.application.config.action_dispatch.strict_freshness = true + +### +# Set `Regexp.timeout` to `1`s by default to improve security over Regexp Denial-of-Service attacks. +#++ +# Regexp.timeout = 1 diff --git a/config/initializers/pdfkit.rb b/config/initializers/pdfkit.rb index f71a3a5..9acbb24 100644 --- a/config/initializers/pdfkit.rb +++ b/config/initializers/pdfkit.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true PDFKit.configure do |config| - config.wkhtmltopdf = ENV.fetch('WKHTMLTOPDF_PATH', '/usr/local/bin/wkhtmltopdf') + config.wkhtmltopdf = ENV.fetch("WKHTMLTOPDF_PATH", "/usr/local/bin/wkhtmltopdf") config.default_options = { - page_size: 'A4', + page_size: "A4", print_media_type: true } # Use only if your external hostname is unavailable on the server. diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb deleted file mode 100644 index 31da29e..0000000 --- a/config/initializers/rack_attack.rb +++ /dev/null @@ -1,3 +0,0 @@ -# frozen_string_literal: true - -Rack::Attack.throttle('requests by ip', limit: 5, period: 2, &:ip) diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb index 8d5f9bc..1b6cf73 100644 --- a/config/initializers/simple_form.rb +++ b/config/initializers/simple_form.rb @@ -78,7 +78,7 @@ config.boolean_style = :nested # Default class for buttons - config.button_class = 'btn' + config.button_class = "btn" # Method used to tidy up errors. Specify any Rails Array method. # :first lists the first message for each field. @@ -89,7 +89,7 @@ config.error_notification_tag = :div # CSS class to add for error notification helper. - config.error_notification_class = 'error_notification' + config.error_notification_class = "error_notification" # Series of attempts to detect a default label method for collection. # config.collection_label_methods = [ :to_label, :name, :title, :to_s ] @@ -165,7 +165,7 @@ # config.input_class = nil # Define the default class of the input wrapper of the boolean input. - config.boolean_label_class = 'checkbox' + config.boolean_label_class = "checkbox" # Defines if the default input wrapper class should be included in radio # collection wrappers. diff --git a/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb index 09ccabd..d05a94e 100644 --- a/config/initializers/simple_form_bootstrap.rb +++ b/config/initializers/simple_form_bootstrap.rb @@ -13,10 +13,10 @@ # Use this setup block to configure all options available in SimpleForm. SimpleForm.setup do |config| # Default class for buttons - config.button_class = 'btn' + config.button_class = "btn" # Define the default class of the input wrapper of the boolean input. - config.boolean_label_class = 'form-check-label' + config.boolean_label_class = "form-check-label" # How the label text should be generated altogether with the required text. config.label_text = ->(label, required, _explicit_label) { "#{label} #{required}" } @@ -32,7 +32,7 @@ config.include_default_input_wrapper_class = false # CSS class to add for error notification helper. - config.error_notification_class = 'alert alert-danger' + config.error_notification_class = "alert alert-danger" # Method used to tidy up errors. Specify any Rails Array method. # :first lists the first message for each field. @@ -40,13 +40,13 @@ config.error_method = :to_sentence # add validation classes to `input_field` - config.input_field_error_class = 'is-invalid' - config.input_field_valid_class = 'is-valid' + config.input_field_error_class = "is-invalid" + config.input_field_valid_class = "is-valid" # vertical forms # # vertical default_wrapper - config.wrappers :vertical_form, class: 'mb-3' do |b| + config.wrappers :vertical_form, class: "mb-3" do |b| b.use :html5 b.use :placeholder b.optional :maxlength @@ -54,107 +54,107 @@ b.optional :pattern b.optional :min_max b.optional :readonly - b.use :label, class: 'form-label' - b.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid' - b.use :full_error, wrap_with: { class: 'invalid-feedback' } - b.use :hint, wrap_with: { class: 'form-text' } + b.use :label, class: "form-label" + b.use :input, class: "form-control", error_class: "is-invalid", valid_class: "is-valid" + b.use :full_error, wrap_with: { class: "invalid-feedback" } + b.use :hint, wrap_with: { class: "form-text" } end # vertical input for boolean - config.wrappers :vertical_boolean, tag: 'fieldset', class: 'mb-3' do |b| + config.wrappers :vertical_boolean, tag: "fieldset", class: "mb-3" do |b| b.use :html5 b.optional :readonly - b.wrapper :form_check_wrapper, class: 'form-check' do |bb| - bb.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid' - bb.use :label, class: 'form-check-label' - bb.use :full_error, wrap_with: { class: 'invalid-feedback' } - bb.use :hint, wrap_with: { class: 'form-text' } + b.wrapper :form_check_wrapper, class: "form-check" do |bb| + bb.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid" + bb.use :label, class: "form-check-label" + bb.use :full_error, wrap_with: { class: "invalid-feedback" } + bb.use :hint, wrap_with: { class: "form-text" } end end # vertical input for radio buttons and check boxes config.wrappers :vertical_collection, - item_wrapper_class: 'form-check', - item_label_class: 'form-check-label', - tag: 'fieldset', - class: 'mb-3' do |b| + item_wrapper_class: "form-check", + item_label_class: "form-check-label", + tag: "fieldset", + class: "mb-3" do |b| b.use :html5 b.optional :readonly - b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba| + b.wrapper :legend_tag, tag: "legend", class: "col-form-label pt-0" do |ba| ba.use :label_text end - b.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid' - b.use :full_error, wrap_with: { class: 'invalid-feedback d-block' } - b.use :hint, wrap_with: { class: 'form-text' } + b.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid" + b.use :full_error, wrap_with: { class: "invalid-feedback d-block" } + b.use :hint, wrap_with: { class: "form-text" } end # vertical input for inline radio buttons and check boxes config.wrappers :vertical_collection_inline, - item_wrapper_class: 'form-check form-check-inline', - item_label_class: 'form-check-label', - tag: 'fieldset', - class: 'mb-3' do |b| + item_wrapper_class: "form-check form-check-inline", + item_label_class: "form-check-label", + tag: "fieldset", + class: "mb-3" do |b| b.use :html5 b.optional :readonly - b.wrapper :legend_tag, tag: 'legend', class: 'col-form-label pt-0' do |ba| + b.wrapper :legend_tag, tag: "legend", class: "col-form-label pt-0" do |ba| ba.use :label_text end - b.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid' - b.use :full_error, wrap_with: { class: 'invalid-feedback d-block' } - b.use :hint, wrap_with: { class: 'form-text' } + b.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid" + b.use :full_error, wrap_with: { class: "invalid-feedback d-block" } + b.use :hint, wrap_with: { class: "form-text" } end # vertical file input - config.wrappers :vertical_file, class: 'mb-3' do |b| + config.wrappers :vertical_file, class: "mb-3" do |b| b.use :html5 b.use :placeholder b.optional :maxlength b.optional :minlength b.optional :readonly - b.use :label, class: 'form-label' - b.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid' - b.use :full_error, wrap_with: { class: 'invalid-feedback' } - b.use :hint, wrap_with: { class: 'form-text' } + b.use :label, class: "form-label" + b.use :input, class: "form-control", error_class: "is-invalid", valid_class: "is-valid" + b.use :full_error, wrap_with: { class: "invalid-feedback" } + b.use :hint, wrap_with: { class: "form-text" } end # vertical select input - config.wrappers :vertical_select, class: 'mb-3' do |b| + config.wrappers :vertical_select, class: "mb-3" do |b| b.use :html5 b.optional :readonly - b.use :label, class: 'form-label' - b.use :input, class: 'form-select', error_class: 'is-invalid', valid_class: 'is-valid' - b.use :full_error, wrap_with: { class: 'invalid-feedback' } - b.use :hint, wrap_with: { class: 'form-text' } + b.use :label, class: "form-label" + b.use :input, class: "form-select", error_class: "is-invalid", valid_class: "is-valid" + b.use :full_error, wrap_with: { class: "invalid-feedback" } + b.use :hint, wrap_with: { class: "form-text" } end # vertical multi select - config.wrappers :vertical_multi_select, class: 'mb-3' do |b| + config.wrappers :vertical_multi_select, class: "mb-3" do |b| b.use :html5 b.optional :readonly - b.use :label, class: 'form-label' - b.wrapper class: 'd-flex flex-row justify-content-between align-items-center' do |ba| - ba.use :input, class: 'form-select mx-1', error_class: 'is-invalid', valid_class: 'is-valid' + b.use :label, class: "form-label" + b.wrapper class: "d-flex flex-row justify-content-between align-items-center" do |ba| + ba.use :input, class: "form-select mx-1", error_class: "is-invalid", valid_class: "is-valid" end - b.use :full_error, wrap_with: { class: 'invalid-feedback d-block' } - b.use :hint, wrap_with: { class: 'form-text' } + b.use :full_error, wrap_with: { class: "invalid-feedback d-block" } + b.use :hint, wrap_with: { class: "form-text" } end # vertical range input - config.wrappers :vertical_range, class: 'mb-3' do |b| + config.wrappers :vertical_range, class: "mb-3" do |b| b.use :html5 b.use :placeholder b.optional :readonly b.optional :step - b.use :label, class: 'form-label' - b.use :input, class: 'form-range', error_class: 'is-invalid', valid_class: 'is-valid' - b.use :full_error, wrap_with: { class: 'invalid-feedback' } - b.use :hint, wrap_with: { class: 'form-text' } + b.use :label, class: "form-label" + b.use :input, class: "form-range", error_class: "is-invalid", valid_class: "is-valid" + b.use :full_error, wrap_with: { class: "invalid-feedback" } + b.use :hint, wrap_with: { class: "form-text" } end # horizontal forms # # horizontal default_wrapper - config.wrappers :horizontal_form, class: 'row mb-3' do |b| + config.wrappers :horizontal_form, class: "row mb-3" do |b| b.use :html5 b.use :placeholder b.optional :maxlength @@ -162,113 +162,113 @@ b.optional :pattern b.optional :min_max b.optional :readonly - b.use :label, class: 'col-sm-3 col-form-label' - b.wrapper :grid_wrapper, class: 'col-sm-9' do |ba| - ba.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid' - ba.use :full_error, wrap_with: { class: 'invalid-feedback' } - ba.use :hint, wrap_with: { class: 'form-text' } + b.use :label, class: "col-sm-3 col-form-label" + b.wrapper :grid_wrapper, class: "col-sm-9" do |ba| + ba.use :input, class: "form-control", error_class: "is-invalid", valid_class: "is-valid" + ba.use :full_error, wrap_with: { class: "invalid-feedback" } + ba.use :hint, wrap_with: { class: "form-text" } end end # horizontal input for boolean - config.wrappers :horizontal_boolean, class: 'row mb-3' do |b| + config.wrappers :horizontal_boolean, class: "row mb-3" do |b| b.use :html5 b.optional :readonly - b.wrapper :grid_wrapper, class: 'col-sm-9 offset-sm-3' do |wr| - wr.wrapper :form_check_wrapper, class: 'form-check' do |bb| - bb.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid' - bb.use :label, class: 'form-check-label' - bb.use :full_error, wrap_with: { class: 'invalid-feedback' } - bb.use :hint, wrap_with: { class: 'form-text' } + b.wrapper :grid_wrapper, class: "col-sm-9 offset-sm-3" do |wr| + wr.wrapper :form_check_wrapper, class: "form-check" do |bb| + bb.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid" + bb.use :label, class: "form-check-label" + bb.use :full_error, wrap_with: { class: "invalid-feedback" } + bb.use :hint, wrap_with: { class: "form-text" } end end end # horizontal input for radio buttons and check boxes - config.wrappers :horizontal_collection, item_wrapper_class: 'form-check', item_label_class: 'form-check-label', - class: 'row mb-3' do |b| + config.wrappers :horizontal_collection, item_wrapper_class: "form-check", item_label_class: "form-check-label", + class: "row mb-3" do |b| b.use :html5 b.optional :readonly - b.use :label, class: 'col-sm-3 col-form-label pt-0' - b.wrapper :grid_wrapper, class: 'col-sm-9' do |ba| - ba.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid' - ba.use :full_error, wrap_with: { class: 'invalid-feedback d-block' } - ba.use :hint, wrap_with: { class: 'form-text' } + b.use :label, class: "col-sm-3 col-form-label pt-0" + b.wrapper :grid_wrapper, class: "col-sm-9" do |ba| + ba.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid" + ba.use :full_error, wrap_with: { class: "invalid-feedback d-block" } + ba.use :hint, wrap_with: { class: "form-text" } end end # horizontal input for inline radio buttons and check boxes - config.wrappers :horizontal_collection_inline, item_wrapper_class: 'form-check form-check-inline', - item_label_class: 'form-check-label', class: 'row mb-3' do |b| + config.wrappers :horizontal_collection_inline, item_wrapper_class: "form-check form-check-inline", + item_label_class: "form-check-label", class: "row mb-3" do |b| b.use :html5 b.optional :readonly - b.use :label, class: 'col-sm-3 col-form-label pt-0' - b.wrapper :grid_wrapper, class: 'col-sm-9' do |ba| - ba.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid' - ba.use :full_error, wrap_with: { class: 'invalid-feedback d-block' } - ba.use :hint, wrap_with: { class: 'form-text' } + b.use :label, class: "col-sm-3 col-form-label pt-0" + b.wrapper :grid_wrapper, class: "col-sm-9" do |ba| + ba.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid" + ba.use :full_error, wrap_with: { class: "invalid-feedback d-block" } + ba.use :hint, wrap_with: { class: "form-text" } end end # horizontal file input - config.wrappers :horizontal_file, class: 'row mb-3' do |b| + config.wrappers :horizontal_file, class: "row mb-3" do |b| b.use :html5 b.use :placeholder b.optional :maxlength b.optional :minlength b.optional :readonly - b.use :label, class: 'col-sm-3 col-form-label' - b.wrapper :grid_wrapper, class: 'col-sm-9' do |ba| - ba.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid' - ba.use :full_error, wrap_with: { class: 'invalid-feedback' } - ba.use :hint, wrap_with: { class: 'form-text' } + b.use :label, class: "col-sm-3 col-form-label" + b.wrapper :grid_wrapper, class: "col-sm-9" do |ba| + ba.use :input, class: "form-control", error_class: "is-invalid", valid_class: "is-valid" + ba.use :full_error, wrap_with: { class: "invalid-feedback" } + ba.use :hint, wrap_with: { class: "form-text" } end end # horizontal select input - config.wrappers :horizontal_select, class: 'row mb-3' do |b| + config.wrappers :horizontal_select, class: "row mb-3" do |b| b.use :html5 b.optional :readonly - b.use :label, class: 'col-sm-3 col-form-label' - b.wrapper :grid_wrapper, class: 'col-sm-9' do |ba| - ba.use :input, class: 'form-select', error_class: 'is-invalid', valid_class: 'is-valid' - ba.use :full_error, wrap_with: { class: 'invalid-feedback' } - ba.use :hint, wrap_with: { class: 'form-text' } + b.use :label, class: "col-sm-3 col-form-label" + b.wrapper :grid_wrapper, class: "col-sm-9" do |ba| + ba.use :input, class: "form-select", error_class: "is-invalid", valid_class: "is-valid" + ba.use :full_error, wrap_with: { class: "invalid-feedback" } + ba.use :hint, wrap_with: { class: "form-text" } end end # horizontal multi select - config.wrappers :horizontal_multi_select, class: 'row mb-3' do |b| + config.wrappers :horizontal_multi_select, class: "row mb-3" do |b| b.use :html5 b.optional :readonly - b.use :label, class: 'col-sm-3 col-form-label' - b.wrapper :grid_wrapper, class: 'col-sm-9' do |ba| - ba.wrapper class: 'd-flex flex-row justify-content-between align-items-center' do |bb| - bb.use :input, class: 'form-select mx-1', error_class: 'is-invalid', valid_class: 'is-valid' + b.use :label, class: "col-sm-3 col-form-label" + b.wrapper :grid_wrapper, class: "col-sm-9" do |ba| + ba.wrapper class: "d-flex flex-row justify-content-between align-items-center" do |bb| + bb.use :input, class: "form-select mx-1", error_class: "is-invalid", valid_class: "is-valid" end - ba.use :full_error, wrap_with: { class: 'invalid-feedback d-block' } - ba.use :hint, wrap_with: { class: 'form-text' } + ba.use :full_error, wrap_with: { class: "invalid-feedback d-block" } + ba.use :hint, wrap_with: { class: "form-text" } end end # horizontal range input - config.wrappers :horizontal_range, class: 'row mb-3' do |b| + config.wrappers :horizontal_range, class: "row mb-3" do |b| b.use :html5 b.use :placeholder b.optional :readonly b.optional :step - b.use :label, class: 'col-sm-3 col-form-label pt-0' - b.wrapper :grid_wrapper, class: 'col-sm-9' do |ba| - ba.use :input, class: 'form-range', error_class: 'is-invalid', valid_class: 'is-valid' - ba.use :full_error, wrap_with: { class: 'invalid-feedback' } - ba.use :hint, wrap_with: { class: 'form-text' } + b.use :label, class: "col-sm-3 col-form-label pt-0" + b.wrapper :grid_wrapper, class: "col-sm-9" do |ba| + ba.use :input, class: "form-range", error_class: "is-invalid", valid_class: "is-valid" + ba.use :full_error, wrap_with: { class: "invalid-feedback" } + ba.use :hint, wrap_with: { class: "form-text" } end end # inline forms # # inline default_wrapper - config.wrappers :inline_form, class: 'col-12' do |b| + config.wrappers :inline_form, class: "col-12" do |b| b.use :html5 b.use :placeholder b.optional :maxlength @@ -276,42 +276,42 @@ b.optional :pattern b.optional :min_max b.optional :readonly - b.use :label, class: 'visually-hidden' + b.use :label, class: "visually-hidden" - b.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid' - b.use :error, wrap_with: { class: 'invalid-feedback' } - b.optional :hint, wrap_with: { class: 'form-text' } + b.use :input, class: "form-control", error_class: "is-invalid", valid_class: "is-valid" + b.use :error, wrap_with: { class: "invalid-feedback" } + b.optional :hint, wrap_with: { class: "form-text" } end # inline input for boolean - config.wrappers :inline_boolean, class: 'col-12' do |b| + config.wrappers :inline_boolean, class: "col-12" do |b| b.use :html5 b.optional :readonly - b.wrapper :form_check_wrapper, class: 'form-check' do |bb| - bb.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid' - bb.use :label, class: 'form-check-label' - bb.use :error, wrap_with: { class: 'invalid-feedback' } - bb.optional :hint, wrap_with: { class: 'form-text' } + b.wrapper :form_check_wrapper, class: "form-check" do |bb| + bb.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid" + bb.use :label, class: "form-check-label" + bb.use :error, wrap_with: { class: "invalid-feedback" } + bb.optional :hint, wrap_with: { class: "form-text" } end end # bootstrap custom forms # # custom input switch for boolean - config.wrappers :custom_boolean_switch, class: 'mb-3' do |b| + config.wrappers :custom_boolean_switch, class: "mb-3" do |b| b.use :html5 b.optional :readonly - b.wrapper :form_check_wrapper, tag: 'div', class: 'form-check form-switch' do |bb| - bb.use :input, class: 'form-check-input', error_class: 'is-invalid', valid_class: 'is-valid' - bb.use :label, class: 'form-check-label' - bb.use :full_error, wrap_with: { tag: 'div', class: 'invalid-feedback' } - bb.use :hint, wrap_with: { class: 'form-text' } + b.wrapper :form_check_wrapper, tag: "div", class: "form-check form-switch" do |bb| + bb.use :input, class: "form-check-input", error_class: "is-invalid", valid_class: "is-valid" + bb.use :label, class: "form-check-label" + bb.use :full_error, wrap_with: { tag: "div", class: "invalid-feedback" } + bb.use :hint, wrap_with: { class: "form-text" } end end # Input Group - custom component # see example app and config at https://github.com/heartcombo/simple_form-bootstrap - config.wrappers :input_group, class: 'mb-3' do |b| + config.wrappers :input_group, class: "mb-3" do |b| b.use :html5 b.use :placeholder b.optional :maxlength @@ -319,20 +319,20 @@ b.optional :pattern b.optional :min_max b.optional :readonly - b.use :label, class: 'form-label' - b.wrapper :input_group_tag, class: 'input-group' do |ba| + b.use :label, class: "form-label" + b.wrapper :input_group_tag, class: "input-group" do |ba| ba.optional :prepend - ba.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid' + ba.use :input, class: "form-control", error_class: "is-invalid", valid_class: "is-valid" ba.optional :append - ba.use :full_error, wrap_with: { class: 'invalid-feedback' } + ba.use :full_error, wrap_with: { class: "invalid-feedback" } end - b.use :hint, wrap_with: { class: 'form-text' } + b.use :hint, wrap_with: { class: "form-text" } end # Floating Labels form # # floating labels default_wrapper - config.wrappers :floating_labels_form, class: 'form-floating mb-3' do |b| + config.wrappers :floating_labels_form, class: "form-floating mb-3" do |b| b.use :html5 b.use :placeholder b.optional :maxlength @@ -340,20 +340,20 @@ b.optional :pattern b.optional :min_max b.optional :readonly - b.use :input, class: 'form-control', error_class: 'is-invalid', valid_class: 'is-valid' + b.use :input, class: "form-control", error_class: "is-invalid", valid_class: "is-valid" b.use :label - b.use :full_error, wrap_with: { class: 'invalid-feedback' } - b.use :hint, wrap_with: { class: 'form-text' } + b.use :full_error, wrap_with: { class: "invalid-feedback" } + b.use :hint, wrap_with: { class: "form-text" } end # custom multi select - config.wrappers :floating_labels_select, class: 'form-floating mb-3' do |b| + config.wrappers :floating_labels_select, class: "form-floating mb-3" do |b| b.use :html5 b.optional :readonly - b.use :input, class: 'form-select', error_class: 'is-invalid', valid_class: 'is-valid' + b.use :input, class: "form-select", error_class: "is-invalid", valid_class: "is-valid" b.use :label - b.use :full_error, wrap_with: { class: 'invalid-feedback' } - b.use :hint, wrap_with: { class: 'form-text' } + b.use :full_error, wrap_with: { class: "invalid-feedback" } + b.use :hint, wrap_with: { class: "form-text" } end # The default wrapper to be used by the FormBuilder. diff --git a/config/puma.rb b/config/puma.rb index d398337..a248513 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - # This configuration file will be evaluated by Puma. The top-level methods that # are invoked here are part of Puma's configuration DSL. For more information # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. @@ -26,18 +24,18 @@ # Any libraries that use a connection pool or another resource pool should # be configured to provide at least as many connections as the number of # threads. This includes Active Record's `pool` parameter in `database.yml`. -threads_count = ENV.fetch('RAILS_MAX_THREADS', 3) +threads_count = ENV.fetch("RAILS_MAX_THREADS", 3) threads threads_count, threads_count # Specifies the `port` that Puma will listen on to receive requests; default is 3000. -port ENV.fetch('PORT', 3000) +port ENV.fetch("PORT", 3000) # Allow puma to be restarted by `bin/rails restart` command. plugin :tmp_restart # Run the Solid Queue supervisor inside of Puma for single-server deployments -plugin :solid_queue if ENV['SOLID_QUEUE_IN_PUMA'] +plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"] # Specify the PID file. Defaults to tmp/pids/server.pid in development. # In other environments, only set the PID file if requested. -pidfile ENV['PIDFILE'] if ENV['PIDFILE'] +pidfile ENV["PIDFILE"] if ENV["PIDFILE"] diff --git a/config/queue.yml b/config/queue.yml new file mode 100644 index 0000000..9eace59 --- /dev/null +++ b/config/queue.yml @@ -0,0 +1,18 @@ +default: &default + dispatchers: + - polling_interval: 1 + batch_size: 500 + workers: + - queues: "*" + threads: 3 + processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %> + polling_interval: 0.1 + +development: + <<: *default + +test: + <<: *default + +production: + <<: *default diff --git a/config/recurring.yml b/config/recurring.yml new file mode 100644 index 0000000..d045b19 --- /dev/null +++ b/config/recurring.yml @@ -0,0 +1,10 @@ +# production: +# periodic_cleanup: +# class: CleanSoftDeletedRecordsJob +# queue: background +# args: [ 1000, { batch_size: 500 } ] +# schedule: every hour +# periodic_command: +# command: "SoftDeletedRecord.due.delete_all" +# priority: 2 +# schedule: at 5am every day diff --git a/config/routes.rb b/config/routes.rb index f8ad295..b56f8d8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,14 +1,14 @@ # frozen_string_literal: true Rails.application.routes.draw do - root to: 'home#index' + root to: "home#index" devise_for :users, controllers: { - registrations: 'users/registrations' + registrations: "users/registrations" } resources :clubs do - get 'dashboard' => 'dashboard#show' + get "dashboard" => "dashboard#show" resources :members do resources :payments @@ -19,23 +19,23 @@ resources :users resources :payments do - get 'send_receipt' + get "send_receipt" end resources :payment_reasons resources :expenses do - get 'send_receipt' + get "send_receipt" end resources :expense_reasons resources :events - resources :presences, only: [:index] - get 'check_presence' => 'presences#check' + resources :presences, only: [ :index ] + get "check_presence" => "presences#check" end - get 'up' => 'rails/health#show', as: :rails_health_check + get "up" => "rails/health#show", as: :rails_health_check - mount MissionControl::Jobs::Engine, at: '/jobs' - mount Yabeda::Prometheus::Exporter => '/metrics' + mount MissionControl::Jobs::Engine, at: "/jobs" + mount Yabeda::Prometheus::Exporter => "/metrics" end diff --git a/config/solid_queue.yml b/config/solid_queue.yml deleted file mode 100644 index 1649029..0000000 --- a/config/solid_queue.yml +++ /dev/null @@ -1,28 +0,0 @@ -default: &default - dispatchers: - - polling_interval: 1 - batch_size: 500 - # recurring_tasks: - # medical_certificate_reminder: - # class: MedicalCertificateReminderJob - # schedule: every day - # blsd_reminder: - # class: BlsdReminderJob - # schedule: every day - - workers: - - queues: - - urgent - - default - threads: 3 - processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %> - polling_interval: 1 - -development: - <<: *default - -test: - <<: *default - -production: - <<: *default diff --git a/db/cable_schema.rb b/db/cable_schema.rb new file mode 100644 index 0000000..d7fe776 --- /dev/null +++ b/db/cable_schema.rb @@ -0,0 +1,23 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema[8.0].define(version: 1) do + create_table "solid_cable_messages", force: :cascade do |t| + t.binary "channel", limit: 1024, null: false + t.binary "payload", limit: 536870912, null: false + t.datetime "created_at", null: false + t.integer "channel_hash", limit: 8, null: false + t.index ["channel"], name: "index_solid_cable_messages_on_channel" + t.index ["channel_hash"], name: "index_solid_cable_messages_on_channel_hash" + t.index ["created_at"], name: "index_solid_cable_messages_on_created_at" + end +end diff --git a/db/cache_schema.rb b/db/cache_schema.rb new file mode 100644 index 0000000..fc99b30 --- /dev/null +++ b/db/cache_schema.rb @@ -0,0 +1,24 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema[8.0].define(version: 1) do + create_table "solid_cache_entries", force: :cascade do |t| + t.binary "key", limit: 1024, null: false + t.binary "value", limit: 536870912, null: false + t.datetime "created_at", null: false + t.integer "key_hash", limit: 8, null: false + t.integer "byte_size", limit: 4, null: false + t.index ["byte_size"], name: "index_solid_cache_entries_on_byte_size" + t.index ["key_hash", "byte_size"], name: "index_solid_cache_entries_on_key_hash_and_byte_size" + t.index ["key_hash"], name: "index_solid_cache_entries_on_key_hash", unique: true + end +end diff --git a/db/migrate/20240720163937_create_active_storage_tables.active_storage.rb b/db/migrate/20240720163937_create_active_storage_tables.active_storage.rb index 4494141..41710b2 100644 --- a/db/migrate/20240720163937_create_active_storage_tables.active_storage.rb +++ b/db/migrate/20240720163937_create_active_storage_tables.active_storage.rb @@ -21,7 +21,7 @@ def change t.datetime :created_at, null: false end - t.index [:key], unique: true + t.index [ :key ], unique: true end create_table :active_storage_attachments, id: primary_key_type do |t| @@ -56,6 +56,6 @@ def primary_and_foreign_key_types setting = config.options[config.orm][:primary_key_type] primary_key_type = setting || :primary_key foreign_key_type = setting || :bigint - [primary_key_type, foreign_key_type] + [ primary_key_type, foreign_key_type ] end end diff --git a/db/queue_schema.rb b/db/queue_schema.rb new file mode 100644 index 0000000..4b2cdcd --- /dev/null +++ b/db/queue_schema.rb @@ -0,0 +1,141 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema[8.0].define(version: 1) do + create_table "solid_queue_blocked_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "queue_name", null: false + t.integer "priority", default: 0, null: false + t.string "concurrency_key", null: false + t.datetime "expires_at", null: false + t.datetime "created_at", null: false + t.index ["concurrency_key", "priority", "job_id"], name: "index_solid_queue_blocked_executions_for_release" + t.index ["expires_at", "concurrency_key"], name: "index_solid_queue_blocked_executions_for_maintenance" + t.index ["job_id"], name: "index_solid_queue_blocked_executions_on_job_id", unique: true + end + + create_table "solid_queue_claimed_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.bigint "process_id" + t.datetime "created_at", null: false + t.index ["job_id"], name: "index_solid_queue_claimed_executions_on_job_id", unique: true + t.index ["process_id", "job_id"], name: "index_solid_queue_claimed_executions_on_process_id_and_job_id" + end + + create_table "solid_queue_failed_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.text "error" + t.datetime "created_at", null: false + t.index ["job_id"], name: "index_solid_queue_failed_executions_on_job_id", unique: true + end + + create_table "solid_queue_jobs", force: :cascade do |t| + t.string "queue_name", null: false + t.string "class_name", null: false + t.text "arguments" + t.integer "priority", default: 0, null: false + t.string "active_job_id" + t.datetime "scheduled_at" + t.datetime "finished_at" + t.string "concurrency_key" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["active_job_id"], name: "index_solid_queue_jobs_on_active_job_id" + t.index ["class_name"], name: "index_solid_queue_jobs_on_class_name" + t.index ["finished_at"], name: "index_solid_queue_jobs_on_finished_at" + t.index ["queue_name", "finished_at"], name: "index_solid_queue_jobs_for_filtering" + t.index ["scheduled_at", "finished_at"], name: "index_solid_queue_jobs_for_alerting" + end + + create_table "solid_queue_pauses", force: :cascade do |t| + t.string "queue_name", null: false + t.datetime "created_at", null: false + t.index ["queue_name"], name: "index_solid_queue_pauses_on_queue_name", unique: true + end + + create_table "solid_queue_processes", force: :cascade do |t| + t.string "kind", null: false + t.datetime "last_heartbeat_at", null: false + t.bigint "supervisor_id" + t.integer "pid", null: false + t.string "hostname" + t.text "metadata" + t.datetime "created_at", null: false + t.string "name", null: false + t.index ["last_heartbeat_at"], name: "index_solid_queue_processes_on_last_heartbeat_at" + t.index ["name", "supervisor_id"], name: "index_solid_queue_processes_on_name_and_supervisor_id", unique: true + t.index ["supervisor_id"], name: "index_solid_queue_processes_on_supervisor_id" + end + + create_table "solid_queue_ready_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "queue_name", null: false + t.integer "priority", default: 0, null: false + t.datetime "created_at", null: false + t.index ["job_id"], name: "index_solid_queue_ready_executions_on_job_id", unique: true + t.index ["priority", "job_id"], name: "index_solid_queue_poll_all" + t.index ["queue_name", "priority", "job_id"], name: "index_solid_queue_poll_by_queue" + end + + create_table "solid_queue_recurring_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "task_key", null: false + t.datetime "run_at", null: false + t.datetime "created_at", null: false + t.index ["job_id"], name: "index_solid_queue_recurring_executions_on_job_id", unique: true + t.index ["task_key", "run_at"], name: "index_solid_queue_recurring_executions_on_task_key_and_run_at", unique: true + end + + create_table "solid_queue_recurring_tasks", force: :cascade do |t| + t.string "key", null: false + t.string "schedule", null: false + t.string "command", limit: 2048 + t.string "class_name" + t.text "arguments" + t.string "queue_name" + t.integer "priority", default: 0 + t.boolean "static", default: true, null: false + t.text "description" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["key"], name: "index_solid_queue_recurring_tasks_on_key", unique: true + t.index ["static"], name: "index_solid_queue_recurring_tasks_on_static" + end + + create_table "solid_queue_scheduled_executions", force: :cascade do |t| + t.bigint "job_id", null: false + t.string "queue_name", null: false + t.integer "priority", default: 0, null: false + t.datetime "scheduled_at", null: false + t.datetime "created_at", null: false + t.index ["job_id"], name: "index_solid_queue_scheduled_executions_on_job_id", unique: true + t.index ["scheduled_at", "priority", "job_id"], name: "index_solid_queue_dispatch_all" + end + + create_table "solid_queue_semaphores", force: :cascade do |t| + t.string "key", null: false + t.integer "value", default: 1, null: false + t.datetime "expires_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["expires_at"], name: "index_solid_queue_semaphores_on_expires_at" + t.index ["key", "value"], name: "index_solid_queue_semaphores_on_key_and_value" + t.index ["key"], name: "index_solid_queue_semaphores_on_key", unique: true + end + + add_foreign_key "solid_queue_blocked_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_claimed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_failed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_ready_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_recurring_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade + add_foreign_key "solid_queue_scheduled_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade +end diff --git a/db/schema.rb b/db/schema.rb index e3c8752..ca8220d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,10 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2024_09_16_085436) do - # These are extensions that must be enabled in order to support this database - enable_extension "plpgsql" - +ActiveRecord::Schema[8.0].define(version: 2024_09_16_085436) do create_table "active_storage_attachments", force: :cascade do |t| t.string "name", null: false t.string "record_type", null: false diff --git a/db/seeds.rb b/db/seeds.rb index 050100c..80a6b71 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -100,28 +100,28 @@ def random_member(club, groups: [], tags: []) payment_number = 0 10.times do - member = random_member(club, groups: [children_group], tags: [white_belt_tag]) + member = random_member(club, groups: [ children_group ], tags: [ white_belt_tag ]) Payment.create!(member:, payment_reason: payment_reason_quota, amount: 50, number: payment_number, kind: :bank) payment_number += 1 end 10.times do - member = random_member(club, groups: [adults_group], tags: [black_belt_tag]) + member = random_member(club, groups: [ adults_group ], tags: [ black_belt_tag ]) Payment.create!(member:, payment_reason: payment_reason_quota, amount: 50, number: payment_number, kind: :bank) payment_number += 1 end 5.times do - member = random_member(club, groups: [adults_group, children_group]) + member = random_member(club, groups: [ adults_group, children_group ]) Payment.create!(member:, payment_reason: payment_reason_quota, amount: 50, number: payment_number, kind: :bank) payment_number += 1 end 5.times do - member = random_member(club, groups: [children_group], tags: [white_belt_tag, black_belt_tag]) + member = random_member(club, groups: [ children_group ], tags: [ white_belt_tag, black_belt_tag ]) Payment.create!(member:, payment_reason: payment_reason_quota, amount: 50, number: payment_number, kind: :bank) payment_number += 1 diff --git a/docker-compose.yaml b/docker-compose.yaml deleted file mode 100644 index f7bdc5a..0000000 --- a/docker-compose.yaml +++ /dev/null @@ -1,43 +0,0 @@ -volumes: - db_storage: - -services: - db: - image: postgres:16.4 - restart: unless-stopped - volumes: - - db_storage:/var/lib/postgresql/data - ports: - - ${PG_PORT:-5432}:5432 - environment: - - POSTGRES_USER=opengas - - POSTGRES_PASSWORD=opengas - - redis: - image: redis:7.4 - restart: unless-stopped - ports: - - ${REDIS_PORT:-6379}:6379 - - app: - profiles: - - app - build: - context: . - dockerfile: Dockerfile.development - stdin_open: true - tty: true - command: bundle exec rails s -p 3000 -b '0.0.0.0' - ports: - - ${PORT:-3000}:3000 - depends_on: - - db - - redis - volumes: - - .:/rails - environment: - - PARALLEL_TEST_PROCESSORS=4 - - PG_HOST=db - - PG_PORT=5432 - - APP_VERSION=dockerDev - \ No newline at end of file diff --git a/public/400.html b/public/400.html new file mode 100644 index 0000000..282dbc8 --- /dev/null +++ b/public/400.html @@ -0,0 +1,114 @@ + + + + + + + The server cannot process the request due to a client error (400 Bad Request) + + + + + + + + + + + + + +
+
+ +
+
+

The server cannot process the request due to a client error. Please check the request and try again. If you’re the application owner check the logs for more information.

+
+
+ + + + diff --git a/public/404.html b/public/404.html index 2be3af2..c0670bc 100644 --- a/public/404.html +++ b/public/404.html @@ -1,67 +1,114 @@ - - - - The page you were looking for doesn't exist (404) - - - - - - -
-
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

If you are the application owner check the logs for more information.

-
- + + + + + + + The page you were looking for doesn’t exist (404 Not found) + + + + + + + + + + + + + +
+
+ +
+
+

The page you were looking for doesn’t exist. You may have mistyped the address or the page may have moved. If you’re the application owner check the logs for more information.

+
+
+ + + diff --git a/public/406-unsupported-browser.html b/public/406-unsupported-browser.html index 7cf1e16..9532a9c 100644 --- a/public/406-unsupported-browser.html +++ b/public/406-unsupported-browser.html @@ -1,66 +1,114 @@ - - - - Your browser is not supported (406) - - - - - - -
-
-

Your browser is not supported.

-

Please upgrade your browser to continue.

-
-
- + + + + + + + Your browser is not supported (406 Not Acceptable) + + + + + + + + + + + + + +
+
+ +
+
+

Your browser is not supported.
Please upgrade your browser to continue.

+
+
+ + + diff --git a/public/422.html b/public/422.html index c08eac0..8bcf060 100644 --- a/public/422.html +++ b/public/422.html @@ -1,67 +1,114 @@ - - - - The change you wanted was rejected (422) - - - - - - -
-
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
-

If you are the application owner check the logs for more information.

-
- + + + + + + + The change you wanted was rejected (422 Unprocessable Entity) + + + + + + + + + + + + + +
+
+ +
+
+

The change you wanted was rejected. Maybe you tried to change something you didn’t have access to. If you’re the application owner check the logs for more information.

+
+
+ + + diff --git a/public/500.html b/public/500.html index 78a030a..d77718c 100644 --- a/public/500.html +++ b/public/500.html @@ -1,66 +1,114 @@ - - - - We're sorry, but something went wrong (500) - - - - - - -
-
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

-
- + + + + + + + We’re sorry, but something went wrong (500 Internal Server Error) + + + + + + + + + + + + + +
+
+ +
+
+

We’re sorry, but something went wrong.
If you’re the application owner check the logs for more information.

+
+
+ + + diff --git a/public/icon.png b/public/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c4c9dbfbbd2f7c1421ffd5727188146213abbcef GIT binary patch literal 4166 zcmd6qU;WFw?|v@m)Sk^&NvB8tcujdV-r1b=i(NJxn&7{KTb zX$3(M+3TP2o^#KAo{#tIjl&t~(8D-k004kqPglzn0HFG(Q~(I*AKsD#M*g7!XK0T7 zN6P7j>HcT8rZgKl$v!xr806dyN19Bd4C0x_R*I-a?#zsTvb_89cyhuC&T**i|Rc zq5b8M;+{8KvoJ~uj9`u~d_f6`V&3+&ZX9x5pc8s)d175;@pjm(?dapmBcm0&vl9+W zx1ZD2o^nuyUHWj|^A8r>lUorO`wFF;>9XL-Jy!P}UXC{(z!FO%SH~8k`#|9;Q|eue zqWL0^Bp(fg_+Pkm!fDKRSY;+^@BF?AJE zCUWpXPst~hi_~u)SzYBDZroR+Z4xeHIlm_3Yc_9nZ(o_gg!jDgVa=E}Y8uDgem9`b zf=mfJ_@(BXSkW53B)F2s!&?_R4ptb1fYXlF++@vPhd=marQgEGRZS@B4g1Mu?euknL= z67P~tZ?*>-Hmi7GwlisNHHJDku-dSm7g@!=a}9cSL6Pa^w^2?&?$Oi8ibrr>w)xqx zOH_EMU@m05)9kuNR>>4@H%|){U$^yvVQ(YgOlh;5oU_-vivG-p4=LrN-k7D?*?u1u zsWly%tfAzKd6Fb=`eU2un_uaTXmcT#tlOL+aRS=kZZf}A7qT8lvcTx~7j` z*b>=z)mwg7%B2_!D0!1IZ?Nq{^Y$uI4Qx*6T!E2Col&2{k?ImCO=dD~A&9f9diXy^$x{6CwkBimn|1E09 zAMSezYtiL?O6hS37KpvDM?22&d{l)7h-!F)C-d3j8Z`c@($?mfd{R82)H>Qe`h{~G z!I}(2j(|49{LR?w4Jspl_i!(4T{31|dqCOpI52r5NhxYV+cDAu(xp*4iqZ2e-$YP= zoFOPmm|u*7C?S{Fp43y+V;>~@FFR76bCl@pTtyB93vNWy5yf;HKr8^0d7&GVIslYm zo3Tgt@M!`8B6IW&lK{Xk>%zp41G%`(DR&^u z5^pwD4>E6-w<8Kl2DzJ%a@~QDE$(e87lNhy?-Qgep!$b?5f7+&EM7$e>|WrX+=zCb z=!f5P>MxFyy;mIRxjc(H*}mceXw5a*IpC0PEYJ8Y3{JdoIW)@t97{wcUB@u+$FCCO z;s2Qe(d~oJC^`m$7DE-dsha`glrtu&v&93IZadvl_yjp!c89>zo;Krk+d&DEG4?x$ zufC1n+c1XD7dolX1q|7}uelR$`pT0Z)1jun<39$Sn2V5g&|(j~Z!wOddfYiZo7)A< z!dK`aBHOOk+-E_xbWCA3VR-+o$i5eO9`rMI#p_0xQ}rjEpGW;U!&&PKnivOcG(|m9 z!C8?WC6nCXw25WVa*eew)zQ=h45k8jSIPbq&?VE{oG%?4>9rwEeB4&qe#?-y_es4c|7ufw%+H5EY#oCgv!Lzv291#-oNlX~X+Jl5(riC~r z=0M|wMOP)Tt8@hNg&%V@Z9@J|Q#K*hE>sr6@oguas9&6^-=~$*2Gs%h#GF@h)i=Im z^iKk~ipWJg1VrvKS;_2lgs3n1zvNvxb27nGM=NXE!D4C!U`f*K2B@^^&ij9y}DTLB*FI zEnBL6y{jc?JqXWbkIZd7I16hA>(f9T!iwbIxJj~bKPfrO;>%*5nk&Lf?G@c2wvGrY&41$W{7HM9+b@&XY@>NZM5s|EK_Dp zQX60CBuantx>|d#DsaZ*8MW(we|#KTYZ=vNa#d*DJQe6hr~J6{_rI#?wi@s|&O}FR zG$kfPxheXh1?IZ{bDT-CWB4FTvO-k5scW^mi8?iY5Q`f8JcnnCxiy@m@D-%lO;y0pTLhh6i6l@x52j=#^$5_U^os}OFg zzdHbo(QI`%9#o*r8GCW~T3UdV`szO#~)^&X_(VW>o~umY9-ns9-V4lf~j z`QBD~pJ4a#b`*6bJ^3RS5y?RAgF7K5$ll97Y8#WZduZ`j?IEY~H(s^doZg>7-tk*t z4_QE1%%bb^p~4F5SB$t2i1>DBG1cIo;2(xTaj*Y~hlM{tSDHojL-QPg%Mo%6^7FrpB*{ z4G0@T{-77Por4DCMF zB_5Y~Phv%EQ64W8^GS6h?x6xh;w2{z3$rhC;m+;uD&pR74j+i22P5DS-tE8ABvH(U~indEbBUTAAAXfHZg5QpB@TgV9eI<)JrAkOI z8!TSOgfAJiWAXeM&vR4Glh;VxH}WG&V$bVb`a`g}GSpwggti*&)taV1@Ak|{WrV|5 zmNYx)Ans=S{c52qv@+jmGQ&vd6>6yX6IKq9O$3r&0xUTdZ!m1!irzn`SY+F23Rl6# zFRxws&gV-kM1NX(3(gnKpGi0Q)Dxi~#?nyzOR9!en;Ij>YJZVFAL*=R%7y%Mz9hU% zs>+ZB?qRmZ)nISx7wxY)y#cd$iaC~{k0avD>BjyF1q^mNQ1QcwsxiTySe<6C&cC6P zE`vwO9^k-d`9hZ!+r@Jnr+MF*2;2l8WjZ}DrwDUHzSF{WoG zucbSWguA!3KgB3MU%HH`R;XqVv0CcaGq?+;v_A5A2kpmk5V%qZE3yzQ7R5XWhq=eR zyUezH=@V)y>L9T-M-?tW(PQYTRBKZSVb_!$^H-Pn%ea;!vS_?M<~Tm>_rWIW43sPW z=!lY&fWc1g7+r?R)0p8(%zp&vl+FK4HRkns%BW+Up&wK8!lQ2~bja|9bD12WrKn#M zK)Yl9*8$SI7MAwSK$%)dMd>o+1UD<2&aQMhyjS5R{-vV+M;Q4bzl~Z~=4HFj_#2V9 zB)Gfzx3ncy@uzx?yzi}6>d%-?WE}h7v*w)Jr_gBl!2P&F3DX>j_1#--yjpL%<;JMR z*b70Gr)MMIBWDo~#<5F^Q0$VKI;SBIRneuR7)yVsN~A9I@gZTXe)E?iVII+X5h0~H zx^c(fP&4>!*q>fb6dAOC?MI>Cz3kld#J*;uik+Ps49cwm1B4 zZc1|ZxYyTv;{Z!?qS=D)sgRKx^1AYf%;y_V&VgZglfU>d+Ufk5&LV$sKv}Hoj+s; xK3FZRYdhbXT_@RW*ff3@`D1#ps#~H)p+y&j#(J|vk^lW{fF9OJt5(B-_&*Xgn9~3N literal 0 HcmV?d00001 diff --git a/public/icon.svg b/public/icon.svg new file mode 100644 index 0000000..04b34bf --- /dev/null +++ b/public/icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/test/application_system_test_case.rb b/test/application_system_test_case.rb index 46f6c6b..be126df 100644 --- a/test/application_system_test_case.rb +++ b/test/application_system_test_case.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true -require 'test_helper' +require "test_helper" class ApplicationSystemTestCase < ActionDispatch::SystemTestCase - driven_by :selenium, using: :headless_chrome, screen_size: [1400, 1400] + driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ] end diff --git a/test/mailers/medical_certificate_mailer_test.rb b/test/mailers/medical_certificate_mailer_test.rb index 2200daa..4fcf788 100644 --- a/test/mailers/medical_certificate_mailer_test.rb +++ b/test/mailers/medical_certificate_mailer_test.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true -require 'test_helper' +require "test_helper" class MedicalCertificateMailerTest < ActionMailer::TestCase - test 'expiring_email' do + test "expiring_email" do member = members(:adult) email = MedicalCertificateMailer.with(member:).expiring_email @@ -11,7 +11,7 @@ class MedicalCertificateMailerTest < ActionMailer::TestCase email.deliver_now end - assert_equal ['info@opengas.eu'], email.from - assert_equal [member.email], email.to + assert_equal [ "info@opengas.eu" ], email.from + assert_equal [ member.email ], email.to end end diff --git a/test/models/club_test.rb b/test/models/club_test.rb index d9cec5e..2776afb 100644 --- a/test/models/club_test.rb +++ b/test/models/club_test.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true -require 'test_helper' +require "test_helper" class ClubTest < ActiveSupport::TestCase - test 'valudates presence' do + test "valudates presence" do club = Club.create - assert(club.errors.key?('name')) + assert(club.errors.key?("name")) end end diff --git a/test/models/event_group_test.rb b/test/models/event_group_test.rb index 92fd1ec..2051591 100644 --- a/test/models/event_group_test.rb +++ b/test/models/event_group_test.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true -require 'test_helper' +require "test_helper" class EventGroupTest < ActiveSupport::TestCase - test 'valudates presence' do + test "valudates presence" do eg = EventGroup.create - assert(eg.errors.key?('event')) - assert(eg.errors.key?('group')) + assert(eg.errors.key?("event")) + assert(eg.errors.key?("group")) end end diff --git a/test/models/event_test.rb b/test/models/event_test.rb index a0c1137..1eef1e1 100644 --- a/test/models/event_test.rb +++ b/test/models/event_test.rb @@ -1,13 +1,13 @@ # frozen_string_literal: true -require 'test_helper' +require "test_helper" class EventTest < ActiveSupport::TestCase - test 'validates presence' do + test "validates presence" do event = Event.create - assert(event.errors.key?('title')) - assert(event.errors.key?('kind')) - assert(event.errors.key?('date_from')) + assert(event.errors.key?("title")) + assert(event.errors.key?("kind")) + assert(event.errors.key?("date_from")) end end diff --git a/test/models/group_test.rb b/test/models/group_test.rb index 1277c37..d4fc83e 100644 --- a/test/models/group_test.rb +++ b/test/models/group_test.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true -require 'test_helper' +require "test_helper" class GroupTest < ActiveSupport::TestCase - test 'valudates presence' do + test "valudates presence" do group = Group.create - assert(group.errors.key?('club')) - assert(group.errors.key?('name')) + assert(group.errors.key?("club")) + assert(group.errors.key?("name")) end end diff --git a/test/models/member_group_test.rb b/test/models/member_group_test.rb index cd259b6..3aee793 100644 --- a/test/models/member_group_test.rb +++ b/test/models/member_group_test.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true -require 'test_helper' +require "test_helper" class MemberGroupTest < ActiveSupport::TestCase - test 'valudates presence' do + test "valudates presence" do mb = MemberGroup.create - assert(mb.errors.key?('member')) - assert(mb.errors.key?('group')) + assert(mb.errors.key?("member")) + assert(mb.errors.key?("group")) end end diff --git a/test/models/member_test.rb b/test/models/member_test.rb index 4034de1..8dfcbc5 100644 --- a/test/models/member_test.rb +++ b/test/models/member_test.rb @@ -1,22 +1,22 @@ # frozen_string_literal: true -require 'test_helper' +require "test_helper" class MemberTest < ActiveSupport::TestCase - test 'valudates presence' do + test "valudates presence" do member = Member.create - assert(member.errors.key?('club')) - assert(member.errors.key?('first_name')) - assert(member.errors.key?('last_name')) - assert(member.errors.key?('born_at')) - assert(member.errors.key?('born_in')) - assert(member.errors.key?('citizenship')) - assert(member.errors.key?('address')) - assert(member.errors.key?('postal_code')) + assert(member.errors.key?("club")) + assert(member.errors.key?("first_name")) + assert(member.errors.key?("last_name")) + assert(member.errors.key?("born_at")) + assert(member.errors.key?("born_in")) + assert(member.errors.key?("citizenship")) + assert(member.errors.key?("address")) + assert(member.errors.key?("postal_code")) end - test 'has at least a parent if minor' do + test "has at least a parent if minor" do assert_not(members(:minor_with_no_parents).valid?) assert(members(:minor_with_first_parent).valid?) diff --git a/test/models/payment_test.rb b/test/models/payment_test.rb index 751801f..23b21fb 100644 --- a/test/models/payment_test.rb +++ b/test/models/payment_test.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true -require 'test_helper' +require "test_helper" class PaymentTest < ActiveSupport::TestCase - test 'valudates presence' do + test "valudates presence" do payment = Payment.create - assert(payment.errors.key?('member')) - assert(payment.errors.key?('amount')) + assert(payment.errors.key?("member")) + assert(payment.errors.key?("amount")) end end diff --git a/test/models/presence_test.rb b/test/models/presence_test.rb index dc647e4..d1e6ed0 100644 --- a/test/models/presence_test.rb +++ b/test/models/presence_test.rb @@ -1,12 +1,12 @@ # frozen_string_literal: true -require 'test_helper' +require "test_helper" class PresenceTest < ActiveSupport::TestCase - test 'valudates presence' do + test "valudates presence" do presence = Presence.create - assert(presence.errors.key?('member')) - assert(presence.errors.key?('date')) + assert(presence.errors.key?("member")) + assert(presence.errors.key?("date")) end end diff --git a/test/models/user_test.rb b/test/models/user_test.rb index 5cc44ed..e153b83 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'test_helper' +require "test_helper" class UserTest < ActiveSupport::TestCase # test "the truth" do diff --git a/test/system/registration_test.rb b/test/system/registration_test.rb index 4fa30df..0eb4341 100644 --- a/test/system/registration_test.rb +++ b/test/system/registration_test.rb @@ -1,27 +1,27 @@ # frozen_string_literal: true -require 'application_system_test_case' +require "application_system_test_case" class RegistrationTest < ApplicationSystemTestCase - test 'register user' do + test "register user" do visit new_user_registration_url - fill_in 'user_email', with: 'email@email.com' - fill_in 'user_first_name', with: 'Name' - fill_in 'user_last_name', with: 'Cognome' - fill_in 'user_club_name', with: 'Club Name' - fill_in 'user_club_email', with: 'email@club.com' - fill_in 'user_club_address', with: 'via delle vie' - fill_in 'user_club_postal_code', with: '12345' - fill_in 'user_club_municipality', with: 'comune' - fill_in 'user_club_province', with: 'RO' - fill_in 'user_club_tax_code', with: '123432123' - fill_in 'user_password', with: 'password' - fill_in 'user_password_confirmation', with: 'password' + fill_in "user_email", with: "email@email.com" + fill_in "user_first_name", with: "Name" + fill_in "user_last_name", with: "Cognome" + fill_in "user_club_name", with: "Club Name" + fill_in "user_club_email", with: "email@club.com" + fill_in "user_club_address", with: "via delle vie" + fill_in "user_club_postal_code", with: "12345" + fill_in "user_club_municipality", with: "comune" + fill_in "user_club_province", with: "RO" + fill_in "user_club_tax_code", with: "123432123" + fill_in "user_password", with: "password" + fill_in "user_password_confirmation", with: "password" - click_on 'commit' + click_on "commit" - assert_selector 'h1', text: I18n.t('gas_title') + assert_selector "h1", text: I18n.t("gas_title") registered_user = User.first assert registered_user.present? diff --git a/test/test_helper.rb b/test/test_helper.rb index 08fd581..e1e3b8f 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,11 +1,11 @@ # frozen_string_literal: true -require 'simplecov' +require "simplecov" SimpleCov.start -ENV['RAILS_ENV'] ||= 'test' -require_relative '../config/environment' -require 'rails/test_help' +ENV["RAILS_ENV"] ||= "test" +require_relative "../config/environment" +require "rails/test_help" module ActiveSupport class TestCase diff --git a/test/test_helpers/system_test_helper.rb b/test/test_helpers/system_test_helper.rb index 4b5deb1..ff49309 100644 --- a/test/test_helpers/system_test_helper.rb +++ b/test/test_helpers/system_test_helper.rb @@ -3,14 +3,14 @@ module SystemTestHelper include ActionView::Helpers::JavaScriptHelper - def sign_in(email_address, password = 'secret123456') + def sign_in(email_address, password = "secret123456") visit new_session_url - fill_in 'email_address', with: email_address - fill_in 'password', with: password + fill_in "email_address", with: email_address + fill_in "password", with: password - click_on 'log_in' + click_on "log_in" - assert_selector 'h1', text: 'Dashboard' + assert_selector "h1", text: "Dashboard" end end