Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion target_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# This is stored in a separate file so we can share it between the template and
# our CI configuration.
target_rails_major_minor: '8.0' # specify as major.minor
target_rails_major_minor: '8.1' # specify as major.minor

# Set this to the minimum version of Ruby that the chosen Rails version supports.
minimum_ruby_major_minor: '3.2'
2 changes: 0 additions & 2 deletions variants/backend-base/app/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,3 @@

remove_dir ".github/"
remove_dir "app/views/pwa"
remove_file "bin/dev"
remove_file "bin/thrust"
4 changes: 4 additions & 0 deletions variants/backend-base/bin/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
copy_file "variants/backend-base/bin/#{bin}", "bin/#{bin}", force: true
chmod "bin/#{bin}", "+x"
end

remove_file "bin/ci"
remove_file "bin/dev"
remove_file "bin/thrust"
2 changes: 1 addition & 1 deletion variants/backend-base/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
RUBY
gsub_file! "config/environments/production.rb",
<<-RUBY,
# Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
# Specify outgoing SMTP server. Remember to add smtp/* credentials via bin/rails credentials:edit.
# config.action_mailer.smtp_settings = {
# user_name: Rails.application.credentials.dig(:smtp, :user_name),
# password: Rails.application.credentials.dig(:smtp, :password),
Expand Down
1 change: 0 additions & 1 deletion variants/backend-base/config/environments/staging.rb.tt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
require_relative "production"

Rails.application.configure do

config.action_mailer.default_url_options = {
host: "<%= TEMPLATE_CONFIG.staging_hostname %>",
protocol: "https"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,13 @@
# Configure nonce
# ###############

# If you are using UJS then enable automatic nonce generation
# Generate session nonces for permitted importmap, inline scripts, and inline styles.
config.content_security_policy_nonce_generator = ->(_request) { SecureRandom.base64(16) }
# config.content_security_policy_nonce_directives = %w(script-src style-src)

# Set the nonce only to specific directives
# config.content_security_policy_nonce_directives = %w(script-src)
# Automatically add `nonce` to `javascript_tag`, `javascript_include_tag`, and `stylesheet_link_tag`
# if the corresponding directives are specified in `content_security_policy_nonce_directives`.
# config.content_security_policy_nonce_auto = true

# ################################
# Configure reporting vs enforcing
Expand Down
39 changes: 20 additions & 19 deletions variants/backend-base/config/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
remove_file "config/master.key"
remove_file "config/credentials.yml.enc"

remove_file "config/ci"
remove_file "config/bundler-audit.yml"

copy_file "variants/backend-base/config/puma.rb", "config/puma.rb", force: true

copy_file "variants/backend-base/config/initializers/generators.rb", "config/initializers/generators.rb"
Expand Down Expand Up @@ -57,23 +60,21 @@
root "home#index"
EO_ROUTES

if File.exist? "config/storage.yml"
gsub_file! "config/storage.yml", /# service: S3/ do
<<~YAML
# service: S3
# upload:
# # TEAM DECISION REQUIRED: The correct caching duration for files
# # stored by Active Storage is project dependent so you should discuss
# # this with you team if you don't feel able to make the decision solo.
# #
# # These options are are not well documented in ActiveStorage. They
# # are passed directly to the S3 SDK. Details:
# # https://github.com/rails/rails/blob/master/activestorage/lib/active_storage/service/s3_service.rb
# #
# # * private: the browser should cache but intermediate proxies (e.g. CDNs) should not
# # * max-age: the number of seconds to cache the file for
# #
# cache_control: 'private, max-age=<%= 365.days.seconds %>'
YAML
end
gsub_file! "config/storage.yml", /# service: S3/ do
<<~YAML
# service: S3
# upload:
# # TEAM DECISION REQUIRED: The correct caching duration for files
# # stored by Active Storage is project dependent so you should discuss
# # this with you team if you don't feel able to make the decision solo.
# #
# # These options are are not well documented in ActiveStorage. They
# # are passed directly to the S3 SDK. Details:
# # https://github.com/rails/rails/blob/master/activestorage/lib/active_storage/service/s3_service.rb
# #
# # * private: the browser should cache but intermediate proxies (e.g. CDNs) should not
# # * max-age: the number of seconds to cache the file for
# #
# cache_control: 'private, max-age=<%= 365.days.seconds %>'
YAML
end
Loading