mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 19:27:52 +01:00
Rename some env vars
This commit is contained in:
4
.github/workflows/run-tests.yml
vendored
4
.github/workflows/run-tests.yml
vendored
@@ -17,10 +17,10 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set PRIVATE_ACTIVE_STORAGE_SERVICE to local in docker-compose.yml
|
||||
- name: Set ACTIVE_STORAGE_PRIVATE_SERVICE to local in docker-compose.yml
|
||||
uses: mikefarah/yq@master
|
||||
with:
|
||||
cmd: yq eval '.services.web.environment["PRIVATE_ACTIVE_STORAGE_SERVICE"] = "test"' -i docker-compose.yml
|
||||
cmd: yq eval '.services.web.environment["ACTIVE_STORAGE_PRIVATE_SERVICE"] = "test"' -i docker-compose.yml
|
||||
|
||||
- name: Build Docker production image
|
||||
run: docker compose -f docker-compose.yml -f docker-compose-prod.yml build --build-arg ENVIRONMENT=production
|
||||
|
||||
@@ -42,7 +42,7 @@ RUN RSWAG_SWAGGERIZE=true RAILS_ENV=test bundle exec rake rswag:specs:swaggerize
|
||||
|
||||
# Compile assets if production
|
||||
# SECRET_KEY_BASE=1 is a workaround (see https://github.com/rails/rails/issues/32947)
|
||||
RUN if [ "$ENVIRONMENT" = "production" ]; then SECRET_KEY_BASE=1 PRIVATE_ACTIVE_STORAGE_SERVICE=test ./bin/rails assets:precompile; fi
|
||||
RUN if [ "$ENVIRONMENT" = "production" ]; then SECRET_KEY_BASE=1 ACTIVE_STORAGE_PRIVATE_SERVICE=test ./bin/rails assets:precompile; fi
|
||||
|
||||
###
|
||||
### Dev stage ###
|
||||
|
||||
@@ -11,7 +11,7 @@ class User < ApplicationRecord
|
||||
has_many :likes, dependent: :destroy
|
||||
has_many :comments, dependent: :destroy
|
||||
has_one :api_key, dependent: :destroy
|
||||
has_one_attached :avatar, service: ENV.fetch('PUBLIC_ACTIVE_STORAGE_SERVICE', :local).to_sym
|
||||
has_one_attached :avatar, service: ENV.fetch('ACTIVE_STORAGE_PUBLIC_SERVICE', :local).to_sym
|
||||
|
||||
enum role: [:user, :moderator, :admin, :owner]
|
||||
enum status: [:active, :blocked, :deleted]
|
||||
|
||||
@@ -64,7 +64,7 @@ Rails.application.configure do
|
||||
}
|
||||
|
||||
# Store uploaded files on the local file system (see config/storage.yml for options).
|
||||
config.active_storage.service = ENV.fetch('PRIVATE_ACTIVE_STORAGE_SERVICE') { :local }
|
||||
config.active_storage.service = ENV.fetch('ACTIVE_STORAGE_PRIVATE_SERVICE') { :local }
|
||||
|
||||
# Don't care if the mailer can't send.
|
||||
config.action_mailer.raise_delivery_errors = ActiveModel::Type::Boolean.new.cast(ENV.fetch("EMAIL_RAISE_DELIVERY_ERRORS", "false"))
|
||||
|
||||
@@ -36,7 +36,7 @@ Rails.application.configure do
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
||||
|
||||
# Store uploaded files on the local file system (see config/storage.yml for options).
|
||||
config.active_storage.service = ENV.fetch('PRIVATE_ACTIVE_STORAGE_SERVICE') { :local }
|
||||
config.active_storage.service = ENV.fetch('ACTIVE_STORAGE_PRIVATE_SERVICE') { :local }
|
||||
|
||||
# Mount Action Cable outside main process or domain.
|
||||
# config.action_cable.mount_path = nil
|
||||
|
||||
Reference in New Issue
Block a user