mirror of
https://github.com/YunoHost-Apps/snserver_ynh.git
synced 2024-09-03 20:26:22 +02:00
Update conf, scripts
This commit is contained in:
parent
e9d0295aaa
commit
ff1dff02cd
12 changed files with 101 additions and 104 deletions
|
@ -1,85 +0,0 @@
|
||||||
# Sample ENV setup Variables
|
|
||||||
# Copy this file and update as needed.
|
|
||||||
#
|
|
||||||
# $ cp .env.sample .env
|
|
||||||
#
|
|
||||||
# Do not include this new file in source control
|
|
||||||
#
|
|
||||||
|
|
||||||
# Rails Settings
|
|
||||||
EXPOSED_PORT=3000
|
|
||||||
# change this to "production" for production use, otherwise the access token time is very short and forces re-login
|
|
||||||
RAILS_ENV=development
|
|
||||||
RAILS_LOG_TO_STDOUT=false
|
|
||||||
# Log Level options: "INFO" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL"
|
|
||||||
RAILS_LOG_LEVEL=INFO
|
|
||||||
#SQS_QUEUE=somequeue
|
|
||||||
#SQS_QUEUE_LOW_PRIORITY=low_priority_queue
|
|
||||||
#AWS_REGION=us-west1
|
|
||||||
#S3_BACKUP_BUCKET_NAME=
|
|
||||||
|
|
||||||
ACTIVE_JOB_QUEUE_ADAPTER=async
|
|
||||||
|
|
||||||
# Database Settings
|
|
||||||
DB_PORT=3306
|
|
||||||
DB_HOST=127.0.0.1
|
|
||||||
DB_DATABASE=standard_notes_db
|
|
||||||
DB_USERNAME=std_notes_user
|
|
||||||
# Please change this!
|
|
||||||
DB_PASSWORD=changeme123
|
|
||||||
DB_POOL_SIZE=30
|
|
||||||
DB_WAIT_TIMEOUT=180
|
|
||||||
|
|
||||||
# Secrets
|
|
||||||
# Use: "bundle exec rake secret" or "openssl rand -hex 64"
|
|
||||||
# To generate required secret key base below
|
|
||||||
|
|
||||||
SECRET_KEY_BASE=changeme123
|
|
||||||
PSEUDO_KEY_PARAMS_KEY=changeme456
|
|
||||||
|
|
||||||
# Disable user registration
|
|
||||||
#DISABLE_USER_REGISTRATION=true
|
|
||||||
|
|
||||||
# Datadog
|
|
||||||
DATADOG_ENABLED=false
|
|
||||||
|
|
||||||
# Mailer settings
|
|
||||||
SMTP_HOST=
|
|
||||||
SMTP_PORT=
|
|
||||||
#SMTP_USERNAME=
|
|
||||||
#SMTP_PASSWORD=
|
|
||||||
SMTP_DOMAIN=
|
|
||||||
# Enalbe STARTTLS
|
|
||||||
# Empty is disabled
|
|
||||||
# Any value is enabled
|
|
||||||
SMTP_STARTTLS=
|
|
||||||
EMAIL_ATTACHMENT_MAX_SIZE=10485760
|
|
||||||
|
|
||||||
# SNS EVENTS
|
|
||||||
#SNS_TOPIC_ARN=
|
|
||||||
|
|
||||||
# (Optional) Database Replication
|
|
||||||
#DB_REPLICA_HOST=
|
|
||||||
|
|
||||||
# Revisions persistency
|
|
||||||
REVISIONS_FREQUENCY=300
|
|
||||||
|
|
||||||
# (Optional) Redis Cache for ephemeral sessions
|
|
||||||
REDIS_URL=redis://cache:6379
|
|
||||||
|
|
||||||
# (Optional) Change URLs to Internal DNS
|
|
||||||
#INTERNAL_DNS_REROUTE_ENABLED=false
|
|
||||||
|
|
||||||
# (Optional) Auth Proxy JWT Secret
|
|
||||||
#AUTH_JWT_SECRET=changeme123
|
|
||||||
|
|
||||||
# (Optional) User Management Server - registration emails, subscriptions etc.
|
|
||||||
#USER_MANAGEMENT_SERVER=
|
|
||||||
|
|
||||||
# Sub-URI
|
|
||||||
RAILS_RELATIVE_URL_ROOT=/
|
|
||||||
|
|
||||||
# Public file server
|
|
||||||
# Empty is disabled
|
|
||||||
# Any value is enabled
|
|
||||||
RAILS_SERVE_STATIC_FILES=
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
Environment="__YNH_NODE_LOAD_PATH__"
|
||||||
|
PORT="__PORT_API_GATEWAY__"
|
||||||
|
|
||||||
LOG_LEVEL="info"
|
LOG_LEVEL="info"
|
||||||
NODE_ENV="production"
|
NODE_ENV="production"
|
||||||
|
|
||||||
|
|
33
conf/env_auth-worker.env.sample
Normal file
33
conf/env_auth-worker.env.sample
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
Environment="__YNH_NODE_LOAD_PATH__"
|
||||||
|
PORT="__PORT_AUTH__"
|
||||||
|
|
||||||
|
LOG_LEVEL="info"
|
||||||
|
NODE_ENV="production"
|
||||||
|
|
||||||
|
AUTH_JWT_TTL=60000
|
||||||
|
JWT_SECRET=__JWT_SECRET__
|
||||||
|
LEGACY_JWT_SECRET=__LEGACY_JWT_SECTRET__
|
||||||
|
|
||||||
|
NEW_RELIC_ENABLED=false
|
||||||
|
NEW_RELIC_APP_NAME=Auth
|
||||||
|
NEW_RELIC_NO_CONFIG_FILE=true
|
||||||
|
|
||||||
|
REDIS_EVENTS_CHANNEL="auth-events"
|
||||||
|
|
||||||
|
DISABLE_USER_REGISTRATION=false
|
||||||
|
|
||||||
|
PSEUDO_KEY_PARAMS_KEY=__PSEUDO_KEY_PARAMS_KEY__
|
||||||
|
|
||||||
|
ACCESS_TOKEN_AGE=5184000
|
||||||
|
REFRESH_TOKEN_AGE=31556926
|
||||||
|
|
||||||
|
MAX_LOGIN_ATTEMPTS=6
|
||||||
|
FAILED_LOGIN_LOCKOUT=3600
|
||||||
|
|
||||||
|
EPHEMERAL_SESSION_AGE=259200
|
||||||
|
|
||||||
|
# Must be a hex string exactly 32 bytes long
|
||||||
|
# e.g. feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308
|
||||||
|
ENCRYPTION_SERVER_KEY=__ENCRYPTION_SERVER_KEY__
|
||||||
|
|
||||||
|
SYNCING_SERVER_URL=http://localhost:__PORT_SYNCING_SERVER_JS__
|
|
@ -1,3 +1,6 @@
|
||||||
|
Environment="__YNH_NODE_LOAD_PATH__"
|
||||||
|
PORT="__PORT_AUTH_WORKER__"
|
||||||
|
|
||||||
LOG_LEVEL="info"
|
LOG_LEVEL="info"
|
||||||
NODE_ENV="production"
|
NODE_ENV="production"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
Environment="__YNH_NODE_LOAD_PATH__"
|
||||||
|
PORT="__PORT_SYNCING_SERVER_JS__"
|
||||||
|
|
||||||
LOG_LEVEL="info"
|
LOG_LEVEL="info"
|
||||||
NODE_ENV="production"
|
NODE_ENV="production"
|
||||||
|
|
44
conf/env_syncing-server-js.env.sample
Normal file
44
conf/env_syncing-server-js.env.sample
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
Environment="__YNH_NODE_LOAD_PATH__"
|
||||||
|
PORT="__PORT_SYNCING_SERVER_JS__"
|
||||||
|
|
||||||
|
LOG_LEVEL="info"
|
||||||
|
NODE_ENV="production"
|
||||||
|
|
||||||
|
AUTH_JWT_SECRET=__JWT_SECRET__
|
||||||
|
|
||||||
|
EXPOSED_PORT=__PORT_SYNCING_SERVER_JS__
|
||||||
|
|
||||||
|
DB_HOST=localhost
|
||||||
|
DB_REPLICA_HOST=localhost
|
||||||
|
DB_PORT=3306
|
||||||
|
DB_USERNAME=__DB_USER__
|
||||||
|
DB_PASSWORD=__DB_PWD__
|
||||||
|
DB_DATABASE=__DB_NAME__
|
||||||
|
DB_DEBUG_LEVEL=all # "all" | "query" | "schema" | "error" | "warn" | "info" | "log" | "migration"
|
||||||
|
DB_MIGRATIONS_PATH=dist/migrations/*.js
|
||||||
|
|
||||||
|
REDIS_URL=redis://localhost:6379/__REDIS_DB__
|
||||||
|
|
||||||
|
SNS_TOPIC_ARN=
|
||||||
|
SNS_AWS_REGION=
|
||||||
|
SQS_QUEUE_URL=
|
||||||
|
SQS_AWS_REGION=
|
||||||
|
S3_AWS_REGION=
|
||||||
|
S3_BACKUP_BUCKET_NAME=
|
||||||
|
|
||||||
|
REDIS_EVENTS_CHANNEL=events
|
||||||
|
|
||||||
|
AUTH_SERVER_URL=http://localhost:__PORT_AUTH__
|
||||||
|
|
||||||
|
EMAIL_ATTACHMENT_MAX_BYTE_SIZE=10485760
|
||||||
|
|
||||||
|
REVISIONS_FREQUENCY=300
|
||||||
|
|
||||||
|
# (Optional) New Relic Setup
|
||||||
|
NEW_RELIC_ENABLED=false
|
||||||
|
NEW_RELIC_APP_NAME="Syncing Server JS"
|
||||||
|
NEW_RELIC_LICENSE_KEY=
|
||||||
|
NEW_RELIC_NO_CONFIG_FILE=true
|
||||||
|
NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=false
|
||||||
|
NEW_RELIC_LOG_ENABLED=false
|
||||||
|
NEW_RELIC_LOG_LEVEL=info
|
|
@ -9,9 +9,7 @@ Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
WorkingDirectory=__FINALPATH__/live/api-gateway
|
WorkingDirectory=__FINALPATH__/live/api-gateway
|
||||||
Environment="PATH=__ENV_PATH__"
|
EnvironmentFile=__FINALPATH__/live/api-gateway/.env
|
||||||
Environment="NODE_ENV=production"
|
|
||||||
Environment="__YNH_NODE_LOAD_PATH__"
|
|
||||||
ExecStart=/usr/bin/yarn start
|
ExecStart=/usr/bin/yarn start
|
||||||
StandardOutput=append:/var/log/__APP__/api-gateway.log
|
StandardOutput=append:/var/log/__APP__/api-gateway.log
|
||||||
StandardError=inherit
|
StandardError=inherit
|
||||||
|
|
|
@ -10,9 +10,7 @@ Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
WorkingDirectory=__FINALPATH__/live/auth-worker
|
WorkingDirectory=__FINALPATH__/live/auth-worker
|
||||||
Environment="PATH=__ENV_PATH__"
|
EnvironmentFile=__FINALPATH__/live/auth-worker/.env
|
||||||
Environment="NODE_ENV=production"
|
|
||||||
Environment="__YNH_NODE_LOAD_PATH__"
|
|
||||||
ExecStart=/usr/bin/yarn worker
|
ExecStart=/usr/bin/yarn worker
|
||||||
StandardOutput=append:/var/log/__APP__/auth-worker.log
|
StandardOutput=append:/var/log/__APP__/auth-worker.log
|
||||||
StandardError=inherit
|
StandardError=inherit
|
||||||
|
|
|
@ -10,9 +10,7 @@ Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
WorkingDirectory=__FINALPATH__/live/auth
|
WorkingDirectory=__FINALPATH__/live/auth
|
||||||
Environment="PATH=__ENV_PATH__"
|
EnvironmentFile=__FINALPATH__/live/auth/.env
|
||||||
Environment="NODE_ENV=production"
|
|
||||||
Environment="__YNH_NODE_LOAD_PATH__"
|
|
||||||
ExecStart=/usr/bin/yarn start
|
ExecStart=/usr/bin/yarn start
|
||||||
StandardOutput=append:/var/log/__APP__/auth.log
|
StandardOutput=append:/var/log/__APP__/auth.log
|
||||||
StandardError=inherit
|
StandardError=inherit
|
||||||
|
|
|
@ -10,9 +10,7 @@ Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
WorkingDirectory=__FINALPATH__/live/syncing-server-js-worker
|
WorkingDirectory=__FINALPATH__/live/syncing-server-js-worker
|
||||||
Environment="PATH=__ENV_PATH__"
|
EnvironmentFile=__FINALPATH__/live/syncing-server-js-worker/.env
|
||||||
Environment="NODE_ENV=production"
|
|
||||||
Environment="__YNH_NODE_LOAD_PATH__"
|
|
||||||
ExecStart=/usr/bin/yarn worker
|
ExecStart=/usr/bin/yarn worker
|
||||||
StandardOutput=append:/var/log/__APP__/syncing-server-js-worker.log
|
StandardOutput=append:/var/log/__APP__/syncing-server-js-worker.log
|
||||||
StandardError=inherit
|
StandardError=inherit
|
||||||
|
|
|
@ -9,9 +9,7 @@ Type=simple
|
||||||
User=__APP__
|
User=__APP__
|
||||||
Group=__APP__
|
Group=__APP__
|
||||||
WorkingDirectory=__FINALPATH__/live/syncing-server-js
|
WorkingDirectory=__FINALPATH__/live/syncing-server-js
|
||||||
Environment="PATH=__ENV_PATH__"
|
EnvironmentFile=__FINALPATH__/live/syncing-server-js/.env
|
||||||
Environment="NODE_ENV=production"
|
|
||||||
Environment="__YNH_NODE_LOAD_PATH__"
|
|
||||||
ExecStart=/usr/bin/yarn start
|
ExecStart=/usr/bin/yarn start
|
||||||
StandardOutput=append:/var/log/__APP__/syncing-server-js.log
|
StandardOutput=append:/var/log/__APP__/syncing-server-js.log
|
||||||
StandardError=append:inherit
|
StandardError=append:inherit
|
||||||
|
|
|
@ -71,7 +71,7 @@ port_syncing_server_js=$(ynh_find_port --port=3000)
|
||||||
port_syncing_server_js_worker=$(ynh_find_port --port=$((port_syncing_server_js+1)))
|
port_syncing_server_js_worker=$(ynh_find_port --port=$((port_syncing_server_js+1)))
|
||||||
port_auth=$(ynh_find_port --port=$((port_syncing_server_js_worker+1)))
|
port_auth=$(ynh_find_port --port=$((port_syncing_server_js_worker+1)))
|
||||||
port_auth_worker=$(ynh_find_port --port=$((port_auth+1)))
|
port_auth_worker=$(ynh_find_port --port=$((port_auth+1)))
|
||||||
port_api_gateway=$(ynh_find_port --port=$((port_autho_worker+1)))
|
port_api_gateway=$(ynh_find_port --port=$((port_auth_worker+1)))
|
||||||
# Open the port
|
# Open the port
|
||||||
ynh_app_setting_set --app=$app --key=port --value=$port_syncing_server_js
|
ynh_app_setting_set --app=$app --key=port --value=$port_syncing_server_js
|
||||||
ynh_app_setting_set --app=$app --key=port --value=$port_syncing_server_js_worker
|
ynh_app_setting_set --app=$app --key=port --value=$port_syncing_server_js_worker
|
||||||
|
@ -136,9 +136,11 @@ ynh_system_user_create --username=$app --home_dir=$final_path
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Modifying a config file..." --weight=2
|
ynh_script_progression --message="Modifying a config file..." --weight=2
|
||||||
|
|
||||||
config_syncing_server_js="$final_path/live/syncing-server-js.env"
|
config_syncing_server_js="$final_path/live/syncing-server-js/.env"
|
||||||
config_auth="$final_path/live/auth.env"
|
config_syncing_server_js_worker="$final_path/live/syncing-server-js-worker/.env"
|
||||||
config_api_gateway="$final_path/live/api-gateway.env"
|
config_auth="$final_path/live/auth/.env"
|
||||||
|
config_auth_worker="$final_path/live/auth-worker/.env"
|
||||||
|
config_api_gateway="$final_path/live/api-gateway/.env"
|
||||||
|
|
||||||
|
|
||||||
jwt_sectret=$(ynh_string_random --length=48 | base64)
|
jwt_sectret=$(ynh_string_random --length=48 | base64)
|
||||||
|
@ -157,7 +159,9 @@ ynh_app_setting_set --app=$app --key=encryption_server_key --value=$encryption_s
|
||||||
#ynh_replace_string --match_string="SMTP_STARTTLS=.*$" --replace_string="SMTP_STARTTLS=" --target_file="$config_file"
|
#ynh_replace_string --match_string="SMTP_STARTTLS=.*$" --replace_string="SMTP_STARTTLS=" --target_file="$config_file"
|
||||||
|
|
||||||
ynh_add_config --template="env_syncing-server-js.env.sample" --destination="$config_syncing_server_js"
|
ynh_add_config --template="env_syncing-server-js.env.sample" --destination="$config_syncing_server_js"
|
||||||
|
ynh_add_config --template="env_syncing-server-js-worker.env.sample" --destination="$config_syncing_server_js_worker"
|
||||||
ynh_add_config --template="env_auth.env.sample" --destination="$config_auth"
|
ynh_add_config --template="env_auth.env.sample" --destination="$config_auth"
|
||||||
|
ynh_add_config --template="env_auth-worker.env.sample" --destination="$config_auth_worker"
|
||||||
ynh_add_config --template="env_api-gateway.env.sample" --destination="$config_api_gateway"
|
ynh_add_config --template="env_api-gateway.env.sample" --destination="$config_api_gateway"
|
||||||
|
|
||||||
#ynh_replace_string --match_string="__MAIL__" --replace_string="$mail" --target_file="$final_path/live/app/mailers/application_mailer.rb"
|
#ynh_replace_string --match_string="__MAIL__" --replace_string="$mail" --target_file="$final_path/live/app/mailers/application_mailer.rb"
|
||||||
|
@ -239,7 +243,9 @@ ynh_script_progression --message="Storing the config file checksum..." --weight=
|
||||||
|
|
||||||
# Calculate and store the config file checksum into the app settings
|
# Calculate and store the config file checksum into the app settings
|
||||||
ynh_store_file_checksum --file="$onfig_syncing_server_js"
|
ynh_store_file_checksum --file="$onfig_syncing_server_js"
|
||||||
|
ynh_store_file_checksum --file="$onfig_syncing_server_js_worker"
|
||||||
ynh_store_file_checksum --file="$onfig_auth"
|
ynh_store_file_checksum --file="$onfig_auth"
|
||||||
|
ynh_store_file_checksum --file="$onfig_auth_worker"
|
||||||
ynh_store_file_checksum --file="$onfig_api_gateway"
|
ynh_store_file_checksum --file="$onfig_api_gateway"
|
||||||
ynh_store_file_checksum --file="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_store_file_checksum --file="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue