From 5e9fd46284c0987051eef6869ab801ab0000290a Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sun, 4 Jul 2021 21:32:13 +0200 Subject: [PATCH] Update conf files --- conf/app.src | 5 --- conf/app_api-gateway.src | 5 +++ conf/app_auth.src | 5 +++ conf/app_syncing-server-js.src | 5 +++ conf/env_api-gateway.env.sample | 9 ++++ conf/env_auth.env.sample | 30 ++++++++++++++ conf/env_syncing-server.env.sample | 41 +++++++++++++++++++ conf/systemd.service | 23 ----------- conf/systemd_api-gateway.service | 21 ++++++++++ conf/systemd_auth-worker.service | 22 ++++++++++ conf/systemd_auth.service | 22 ++++++++++ conf/systemd_syncing-server-js-worker.service | 22 ++++++++++ conf/systemd_syncing-server-js.service | 21 ++++++++++ 13 files changed, 203 insertions(+), 28 deletions(-) delete mode 100644 conf/app.src create mode 100644 conf/app_api-gateway.src create mode 100644 conf/app_auth.src create mode 100644 conf/app_syncing-server-js.src create mode 100644 conf/env_api-gateway.env.sample create mode 100644 conf/env_auth.env.sample create mode 100644 conf/env_syncing-server.env.sample delete mode 100644 conf/systemd.service create mode 100644 conf/systemd_api-gateway.service create mode 100644 conf/systemd_auth-worker.service create mode 100644 conf/systemd_auth.service create mode 100644 conf/systemd_syncing-server-js-worker.service create mode 100644 conf/systemd_syncing-server-js.service diff --git a/conf/app.src b/conf/app.src deleted file mode 100644 index 4d80c26..0000000 --- a/conf/app.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/standardnotes/syncing-server/archive/3.22.8.zip -SOURCE_SUM=DBAB9503D2E52392DB1A272D3C00AE267C9515119F48E2F20BF56E44FA1ECD28 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=zip -SOURCE_IN_SUBDIR=true diff --git a/conf/app_api-gateway.src b/conf/app_api-gateway.src new file mode 100644 index 0000000..c3258b0 --- /dev/null +++ b/conf/app_api-gateway.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/standardnotes/api-gateway/archive/1.19.6.tar.gz +SOURCE_SUM=837719F0811066722095594630453177D988374818EAF9DBA6B9D13FABBD7BE9 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true diff --git a/conf/app_auth.src b/conf/app_auth.src new file mode 100644 index 0000000..f5101e5 --- /dev/null +++ b/conf/app_auth.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/standardnotes/auth/archive/1.11.0.tar.gz +SOURCE_SUM=B6B4A08E49010BDFF83FB3522497ABD0153C95E67F99C2A20312AA38B40F453C +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true diff --git a/conf/app_syncing-server-js.src b/conf/app_syncing-server-js.src new file mode 100644 index 0000000..396431f --- /dev/null +++ b/conf/app_syncing-server-js.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/standardnotes/syncing-server-js/archive/1.35.1.tar.gz +SOURCE_SUM=1FC3F433C74AF3A419B9F49C4B5B469CDB6BDB51698DF0D1755A97FB1C08D1AD +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true diff --git a/conf/env_api-gateway.env.sample b/conf/env_api-gateway.env.sample new file mode 100644 index 0000000..9db0d4a --- /dev/null +++ b/conf/env_api-gateway.env.sample @@ -0,0 +1,9 @@ +LOG_LEVEL="info" +NODE_ENV="production" + +NEW_RELIC_ENABLED=false +NEW_RELIC_APP_NAME="API Gateway" +NEW_RELIC_NO_CONFIG_FILE=true + +SYNCING_SERVER_JS_URL="http://localhost:__PORT_SYNCING_SERVER_JS__" +AUTH_SERVER_URL="http://localhost:__PORT_AUTH__" diff --git a/conf/env_auth.env.sample b/conf/env_auth.env.sample new file mode 100644 index 0000000..4009ea1 --- /dev/null +++ b/conf/env_auth.env.sample @@ -0,0 +1,30 @@ +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__ diff --git a/conf/env_syncing-server.env.sample b/conf/env_syncing-server.env.sample new file mode 100644 index 0000000..baa11f6 --- /dev/null +++ b/conf/env_syncing-server.env.sample @@ -0,0 +1,41 @@ +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 diff --git a/conf/systemd.service b/conf/systemd.service deleted file mode 100644 index 1480dc7..0000000 --- a/conf/systemd.service +++ /dev/null @@ -1,23 +0,0 @@ -[Unit] -Description=__APP__ service -After=network.target -After=mysql.service -After=redis.service - -[Service] -Type=simple -User=__APP__ -Group=__APP__ -WorkingDirectory=__FINALPATH__/live -Environment="RAILS_ENV=production" -Environment="PORT=__PORT__" -ExecStart=__RBENV_INSTALL_DIR__/versions/__APP__/bin/bundle exec rails server -ExecReload=/bin/kill -SIGUSR1 $MAINPID -StandardOutput=append:/var/log/__APP__/__APP__.log -StandardError=append:/var/log/__APP__/__APP__.log -SyslogIdentifier=__APP__ -Restart=always -RestartSec=15 - -[Install] -WantedBy=multi-user.target diff --git a/conf/systemd_api-gateway.service b/conf/systemd_api-gateway.service new file mode 100644 index 0000000..78a2c8f --- /dev/null +++ b/conf/systemd_api-gateway.service @@ -0,0 +1,21 @@ +[Unit] +Description=StandardNotes api-gateway +After=network.target +After=__APP__-syncing-server-js.service +After=__APP__-auth.service + +[Service] +Type=simple +User=__APP__ +Group=__APP__ +WorkingDirectory=__FINALPATH__/live/api-gateway +Environment="PATH=__ENV_PATH__" +Environment="NODE_ENV=production" +Environment="__YNH_NODE_LOAD_PATH__" +ExecStart=/usr/bin/yarn start +StandardOutput=append:/var/log/__APP__/api-gateway.log +StandardError=inherit +Restart=always + +[Install] +WantedBy=default.target diff --git a/conf/systemd_auth-worker.service b/conf/systemd_auth-worker.service new file mode 100644 index 0000000..b2d79c3 --- /dev/null +++ b/conf/systemd_auth-worker.service @@ -0,0 +1,22 @@ +[Unit] +Description=StandardNotes auth worker +After=network.target +After=mysql.service +After=redis.service +After=__APP__-auth.service + +[Service] +Type=simple +User=__APP__ +Group=__APP__ +WorkingDirectory=__FINALPATH__/live/auth-worker +Environment="PATH=__ENV_PATH__" +Environment="NODE_ENV=production" +Environment="__YNH_NODE_LOAD_PATH__" +ExecStart=/usr/bin/yarn worker +StandardOutput=append:/var/log/__APP__/auth-worker.log +StandardError=inherit +Restart=always + +[Install] +WantedBy=default.target diff --git a/conf/systemd_auth.service b/conf/systemd_auth.service new file mode 100644 index 0000000..55f4c59 --- /dev/null +++ b/conf/systemd_auth.service @@ -0,0 +1,22 @@ +[Unit] +Description=StandardNotes auth +After=network.target +After=mysql.service +After=redis.service +After=__APP__-synicing-server-js.service + +[Service] +Type=simple +User=__APP__ +Group=__APP__ +WorkingDirectory=__FINALPATH__/live/auth +Environment="PATH=__ENV_PATH__" +Environment="NODE_ENV=production" +Environment="__YNH_NODE_LOAD_PATH__" +ExecStart=/usr/bin/yarn start +StandardOutput=append:/var/log/__APP__/auth.log +StandardError=inherit +Restart=always + +[Install] +WantedBy=default.target diff --git a/conf/systemd_syncing-server-js-worker.service b/conf/systemd_syncing-server-js-worker.service new file mode 100644 index 0000000..7a3fa16 --- /dev/null +++ b/conf/systemd_syncing-server-js-worker.service @@ -0,0 +1,22 @@ +[Unit] +Description=StandardNotes syncing server worker +After=network.target +After=mysql.service +After=redis.service +After=__APP__-syncing-server-js.service + +[Service] +Type=simple +User=__APP__ +Group=__APP__ +WorkingDirectory=__FINALPATH__/live/syncing-server-js-worker +Environment="PATH=__ENV_PATH__" +Environment="NODE_ENV=production" +Environment="__YNH_NODE_LOAD_PATH__" +ExecStart=/usr/bin/yarn worker +StandardOutput=append:/var/log/__APP__/syncing-server-js-worker.log +StandardError=inherit +Restart=always + +[Install] +WantedBy=default.target diff --git a/conf/systemd_syncing-server-js.service b/conf/systemd_syncing-server-js.service new file mode 100644 index 0000000..8d46b80 --- /dev/null +++ b/conf/systemd_syncing-server-js.service @@ -0,0 +1,21 @@ +[Unit] +Description=StandardNotes syncing server +After=network.target +After=mysql.service +After=redis.service + +[Service] +Type=simple +User=__APP__ +Group=__APP__ +WorkingDirectory=__FINALPATH__/live/syncing-server-js +Environment="PATH=__ENV_PATH__" +Environment="NODE_ENV=production" +Environment="__YNH_NODE_LOAD_PATH__" +ExecStart=/usr/bin/yarn start +StandardOutput=append:/var/log/__APP__/syncing-server-js.log +StandardError=append:inherit +Restart=always + +[Install] +WantedBy=default.target