dotenv instead of Rails credentials

The deployment is done on a Dokku server. It sets the DATABASE_URL
automatically.
This commit is contained in:
Christoph Haas 2025-04-07 22:25:55 +02:00
parent 85d12b5c77
commit e4af4c21ae
6 changed files with 12 additions and 17 deletions

View file

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

View file

@ -9,7 +9,7 @@ production:
primary:
<<: *default
# database: storage/production.sqlite3
url: <%= Rails.application.credentials.db.url %>
url: <%= ENV['DATABASE_URL'] %>
pool: 10
cache:
<<: *default

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.
@ -17,10 +17,10 @@ Rails.application.configure do
# 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?
if Rails.root.join('tmp/caching-dev.txt').exist?
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true
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
end
@ -34,12 +34,12 @@ Rails.application.configure do
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
config.action_mailer.smtp_settings = {
address: 'localhost',
port: 25,
address: 'localhost',
port: 25,
enable_starttls_auto: false
}
config.action_mailer.default_url_options = {
host: "screenshots.debian.net",
host: 'screenshots.debian.net',
protocol: 'https'
}
@ -47,7 +47,7 @@ Rails.application.configure do
config.action_mailer.perform_caching = false
# Set localhost to be used by links generated in mailer templates.
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
@ -77,8 +77,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']
}
]
@ -101,4 +101,3 @@ Rails.application.configure do
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
# config.generators.apply_rubocop_autocorrect_after_generate!
end

View file

@ -53,7 +53,7 @@ Rails.application.configure do
config.active_job.queue_adapter = :solid_queue
config.solid_queue.connects_to = { database: { writing: :queue } }
config.action_mailer.smtp_settings = {
address: Rails.application.credentials.smtp.server,
address: ENV['SMTP_SERVER'],
port: 25,
enable_starttls_auto: false
}