Updat .env docs

This commit is contained in:
Ari Timonen 2020-04-11 16:17:07 +03:00
parent f8d6368f10
commit 2c0bde6219
4 changed files with 26 additions and 10 deletions

22
.env
View file

@ -21,8 +21,9 @@ STAGING_DOMAIN=www.ensl.org
STAGING_ROOT_DOMAIN=ensl.org
# FIXME: SCRYPT_SALT_OPTS doesn't work yet
# Options for: SCrypt::Engine.calibrate!(max_mem: 16 * 1024 * 1024)
SCRYPT_SALT_OPTS=
# Options for: SCrypt::Engine.calibrate!(max_mem: 16 * 1024 * 1024)
SCRYPT_MAX_TIME=0.01
# SMTP server
@ -31,7 +32,18 @@ MAIL_DOMAIN=ensl.org
# App path inside docker
APP_PATH=/var/www
APP_PATH_PUBLIC=/var/www/public
# Path to files. When Directory.recreate() is called it uses this as root.
FILES_PATH=/var/www/public/files
# Path to bundle directory
# Gems are added here to avoid reinstalling them all the time.
BUNDLE_PATH=/var/bundle
# This is a temp directory for assets before they are copied back
ASSETS_PATH=/home/web/assets
# Set 1 to precompile assets
ASSETS_PRECOMPILE=0
# Puma fails in cluster mode, so use 0 workers
@ -40,21 +52,21 @@ PUMA_WORKERS=0
# Threads and port
PUMA_MIN_THREADS=1
PUMA_MAX_THREADS=16
# Puma port. Only really used internally except for dev.
# This could be the same but because docker-compose exposes it, it has to change between envs.
PUMA_PORT=4000
# Use higher timeout if debug fails
PUMA_TIMEOUT=30
# Path to files
FILES_PATH=/var/www/public/files
# Docker adds mysql to hosts
MYSQL_HOST=db
# This is used by both rails + mysql
MYSQL_DATABASE=ensl
# These are for ENSL, edit at least password
# MariaDB creates user with these details.
MYSQL_USER=ensl
MYSQL_PASSWORD=ensl

View file

@ -4,7 +4,6 @@ RACK_ENV=test
RAILS_ENV=test
APP_SECRET=fe837ea72667ec3d8ecb94cfba1a1bba
APP_PATH=/var/www
PUMA_PORT=4000

View file

@ -1,4 +1,9 @@
require_relative 'boot'
require 'securerandom'
# FIXME
# Set random value for this
ENV["APP_SECRET_KEY_BASE"] ||= SecureRandom.alphanumeric(32)
require 'rails/all'

View file

@ -1,11 +1,11 @@
development:
secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] || SecureRandom.alphanumeric(32) %>
secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] %>
test:
secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] || SecureRandom.alphanumeric(32) %>
secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] %>
production:
secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] || SecureRandom.alphanumeric(32) %>
secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] %>
staging:
secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] || SecureRandom.alphanumeric(32) %>
secret_key_base: <%= ENV["APP_SECRET_KEY_BASE"] %>