Several changes to adapt Rails 8

This commit is contained in:
Christoph Haas 2025-04-04 00:58:27 +02:00
parent 7cb02d8a7d
commit 52777edb65
11 changed files with 112 additions and 83 deletions

View file

@ -2,16 +2,16 @@
# 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
development:
adapter: async
# test:
# adapter: test
test:
adapter: test
# production:
# adapter: solid_cable
# connects_to:
# database:
# writing: cable
# polling_interval: 0.1.seconds
# message_retention: 1.day
production:
adapter: solid_cable
connects_to:
database:
writing: cable
polling_interval: 0.1.seconds
message_retention: 1.day

16
config/cache.yml Normal file
View file

@ -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

View file

@ -0,0 +1 @@
p4iCDmwxjQ5zC6i3QVNCnlW++oxVLD0AKnflI6lsRBQ1bLTcBA3+8EFI9itIiv7WUJYF+0xGz1bqNq8e9Kk+tEq7C1GVgbuS3xEjG2I0Kt1GbTjvl0aeCd7WHR5xWHlCIXmZVhO/OL4SNc876WYpQqwWRwHkPND0QGAmfWOgy2H14V6LVYh1d7fhPdSYBr4b6oPMMQW6fqAjQ8Oq5TVUznRiRLQfFhAYz2DklMAoASjhAWK39U76JWYqu8VCq08+3V/geXYtQfcsvQ1twq08RFcJbZsCG7slOI8fPW5Oq2dCpw==--mvh3V6FOm1I5+pal--y0AKTyuXuwhXl6iMcT29tw==

View file

@ -1,39 +1,46 @@
# 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") { 5 } %>
timeout: 5000
production:
# Store production database in the storage/ directory, which by default
# is mounted as a persistent Docker volume in config/deploy.yml.
primary:
<<: *default
# database: storage/production.sqlite3
url: <%= Rails.application.credentials.db.url %>
pool: 10
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
development:
<<: *default
adapter: postgresql
database: debshots_dev
username: debshots_dev
password: GonwannEn0
host: localhost
pool: 5
timeout: 5000
# SQLite. Versions 3.8.0 and up are supported.
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem '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:
adapter: postgresql
database: debshots_test
username: debshots_test
password: GonwannEn0
host: localhost
pool: 5
timeout: 5000
# production:
# adapter: postgresql
# database: debshots
# # username: debshots
# # password: GonwannEn0
# # host: localhost
# pool: 10
# timeout: 5000
production:
url: <%= ENV['DATABASE_URL'] %>
adapter: postgresql
pool: 10
timeout: 5000
<<: *default
database: storage/test.sqlite3

View file

@ -1,4 +1,4 @@
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.
@ -16,7 +16,7 @@ Rails.application.configure do
config.action_controller.perform_caching = 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}" }
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"
@ -34,14 +34,14 @@ Rails.application.configure do
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
# Log to STDOUT with the current request id as a default log tag.
config.log_tags = [ :request_id ]
config.log_tags = [:request_id]
config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
# Change to "debug" to log everything (including potentially personally-identifiable information!)
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info')
# Prevent health checks from clogging up the logs.
config.silence_healthcheck_path = "/up"
config.silence_healthcheck_path = '/up'
# Don't log any deprecations.
config.active_support.report_deprecations = false
@ -53,13 +53,12 @@ Rails.application.configure do
config.active_job.queue_adapter = :solid_queue
config.solid_queue.connects_to = { database: { writing: :queue } }
config.action_mailer.smtp_settings = {
# TODO: make configurable through ENV variables
address: 'dokku2.workaround.org',
port: 25,
address: Rails.application.credentials.smtp.server,
port: 25,
enable_starttls_auto: false
}
config.action_mailer.default_url_options = {
host: "screenshots.debian.net",
host: 'screenshots.debian.net',
protocol: 'https'
}
@ -68,7 +67,7 @@ Rails.application.configure do
# 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" }
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 = {
@ -89,8 +88,8 @@ Rails.application.configure do
config.package_sources = [
{
description: 'Debian Unstable (Sid)', type: 'apt', url: 'http://ftp.de.debian.org/debian/dists/sid',
architectures: ['i386' ,'amd64']
#components: ['main','restricted','universe','multiverse']
architectures: %w[i386 amd64]
# components: ['main','restricted','universe','multiverse']
}
]
@ -107,7 +106,7 @@ Rails.application.configure do
# Only use :id for inspections in production.
# Needed (at least) for devise.rb to determine the oauth2 callback URL
config.base_url = ENV['DEBSHOTS_BASE_URL'] || 'http://localhost:3000'
config.active_record.attributes_for_inspect = [ :id ]
config.active_record.attributes_for_inspect = [:id]
# Enable DNS rebinding protection and other `Host` header attacks.
# config.hosts = [