Use ENV vars for database, secrets, and cable config (Docker support)

This commit is contained in:
Ubuntu
2026-02-06 06:34:50 +00:00
parent eb1010d8af
commit 942b8a54db
2 changed files with 12 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
redis: &redis redis: &redis
adapter: redis adapter: redis
url: redis://localhost:6379/1 url: <%= ENV.fetch('REDIS_URL', 'redis://localhost:6379/1') %>
production: *redis production: *redis
development: *redis development: *redis

View File

@@ -1,30 +1,16 @@
# Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rails secret` to generate a secure secret key.
# Make sure the secrets in this file are kept private
# if you're sharing your code publicly.
development: development:
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61 secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
sx_provision_url: connect.smartsales.asia/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api sx_provision_url: connect.smartsales.asia/api
server_mode: application server_mode: application
cipher_type: AES-256-CBC cipher_type: AES-256-CBC
sx_key: Wh@t1$C2L sx_key: Wh@t1$C2L
test: test:
secret_key_base: 5c92143fd4a844fdaf8b22aba0cda22ef1fc68f1b26dd3d40656866893718ae5e58625b4c3a5dc86b04c8be0a505ec0ebc0be3bf52249a3d1e0c1334ee591cf0 secret_key_base: 5c92143fd4a844fdaf8b22aba0cda22ef1fc68f1b26dd3d40656866893718ae5e58625b4c3a5dc86b04c8be0a505ec0ebc0be3bf52249a3d1e0c1334ee591cf0
# Do not keep production secrets in the repository,
# instead read values from the environment.
production: production:
secret_key_base: c4bc81065013f9a3506d385bcbd49586c42e586488144b0de90c7da36867de9fa880f46b5c4f86f0ce9b7c783bb5a73bdb0e5605a47716567294390e726d3e22 secret_key_base: <%= ENV.fetch('SECRET_KEY_BASE', 'c4bc81065013f9a3506d385bcbd49586c42e586488144b0de90c7da36867de9fa880f46b5c4f86f0ce9b7c783bb5a73bdb0e5605a47716567294390e726d3e22') %>
sx_provision_url: connect.smartsales.asia/api #l.doemal.app/api #52.221.188.144:9292/api #192.168.1.147:3002/api sx_provision_url: <%= ENV.fetch('SX_PROVISION_URL', 'connect.smartsales.asia/api') %>
server_mode: application server_mode: <%= ENV.fetch('SERVER_MODE', 'cloud') %>
cipher_type: AES-256-CBC cipher_type: <%= ENV.fetch('CIPHER_TYPE', 'AES-256-CBC') %>
sx_key: Wh@t1$C2L sx_key: <%= ENV.fetch('SX_KEY', 'Wh@t1$C2L') %>