From e4691798cc416bb570efd882330e3593c476fbb7 Mon Sep 17 00:00:00 2001 From: Manuel Meurer Date: Wed, 9 Oct 2024 22:44:26 +0200 Subject: [PATCH] replace envkey with credentials --- Gemfile | 1 - Gemfile.lock | 2 -- config/application.rb | 2 +- config/credentials.yml.enc | 1 + config/environments/development.rb | 2 +- config/initializers/postmark.rb | 2 +- config/storage.yml | 8 ++++---- 7 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 config/credentials.yml.enc diff --git a/Gemfile b/Gemfile index d92073e..b65b4fa 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,6 @@ gem "baseline", github: "manuelmeurer/baseline" gem "bootsnap", "~> 1.17", require: false gem "bootstrap", "~> 5.3" gem "dartsass-rails", "~> 0.5" -gem "envkey", "~> 2.0" gem "friendly_id", "~> 5.5" gem "haml", "~> 6.0" gem "importmap-rails", "~> 2.0" diff --git a/Gemfile.lock b/Gemfile.lock index fce53a5..744e741 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -139,7 +139,6 @@ GEM date (3.3.4) debug_inspector (1.2.0) drb (2.2.1) - envkey (2.4.2) erubi (1.13.0) execjs (2.9.1) friendly_id (5.5.1) @@ -335,7 +334,6 @@ DEPENDENCIES bootsnap (~> 1.17) bootstrap (~> 5.3) dartsass-rails (~> 0.5) - envkey (~> 2.0) friendly_id (~> 5.5) haml (~> 6.0) importmap-rails (~> 2.0) diff --git a/config/application.rb b/config/application.rb index de148f5..2b27c55 100644 --- a/config/application.rb +++ b/config/application.rb @@ -30,7 +30,7 @@ class Application < Rails::Application Rails.application.routes.default_url_options = config.action_mailer.default_url_options = { - host: ENV.fetch("HOST"), + host: Rails.application.env_credentials.host!, protocol: "https" } diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc new file mode 100644 index 0000000..342a26d --- /dev/null +++ b/config/credentials.yml.enc @@ -0,0 +1 @@ +2t4Ii8wPGfGq9G5WkbpnkethM+aAQi3xiKXq5zvdeJnaWlytHbhmOhBTjrg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XaPICoyMUA3IdoKQ4pSdky4Fu0Sy755xS0N77ZhneN0UkKkKSVhbEgVU7OeChr3fIFpEALl8cQCH/x3vH4lAM16JE/z9lIXOSxb6rSRCHA7RhCvt0Nobh4z/C4DCOLqI2a/Az3LePa+f43g9ZcTZpJ9X3fCBGscYVw+15RZvF96EfKAebEXmBdGgeK4RRt8/zH/WrBsJWl9Mq8yfX4zyODbSO/k1JxqX4hO7d3EqLU/wM4ONfdqZzBdZJTxWI/ZLMb0nEACjQKyrJ8xzwgx6q2kJbj902w==--VTHXaEU8Dpb5XFGR--tROw7PCE8/FH3bDcj3iLug== \ No newline at end of file diff --git a/config/environments/development.rb b/config/environments/development.rb index 02a5f84..59f01bb 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -69,5 +69,5 @@ # Raise error when a before_action's only/except options reference missing actions config.action_controller.raise_on_missing_callback_actions = true - config.hosts << /([a-z]+\.)?#{ENV.fetch "HOST"}/ + config.hosts << /([a-z]+\.)?#{Rails.application.env_credentials.host!}/ end diff --git a/config/initializers/postmark.rb b/config/initializers/postmark.rb index fd2b3d4..e979fb1 100644 --- a/config/initializers/postmark.rb +++ b/config/initializers/postmark.rb @@ -1,3 +1,3 @@ require "postmark" -Postmark.api_token = ENV["POSTMARK_API_TOKEN"] +Postmark.api_token = Rails.application.env_credentials.postmark_api_token diff --git a/config/storage.yml b/config/storage.yml index 711bd76..fedb2d1 100644 --- a/config/storage.yml +++ b/config/storage.yml @@ -8,9 +8,9 @@ test: cloudflare: service: S3 - access_key_id: <%= ENV["CLOUDFLARE_R2_ACCESS_KEY_ID"] %> - secret_access_key: <%= ENV["CLOUDFLARE_R2_SECRET_ACCESS_KEY"] %> - endpoint: https://<%= ENV["CLOUDFLARE_ACCOUNT_ID"] %>.r2.cloudflarestorage.com - bucket: rubydocs + access_key_id: <%= Rails.application.env_credentials.cloudflare.r2.access_key_id! %> + secret_access_key: <%= Rails.application.env_credentials.cloudflare.r2.secret_access_key! %> + endpoint: https://<%= Rails.application.env_credentials.cloudflare.account_id! %>.r2.cloudflarestorage.com + bucket: <%= Rails.application.env_credentials.cloudflare.r2.bucket %> region: auto force_path_style: true