From 8df21f06b1c2c643270a06c9acddeb73b222b359 Mon Sep 17 00:00:00 2001 From: kytwb <412895+kytwb@users.noreply.github.com> Date: Tue, 28 Dec 2021 23:03:19 +0100 Subject: Add "Deploy to DigitalOcean" button (#94) --- .do/deploy.template.yaml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ README.md | 7 +++++++ config/database.js | 5 ++++- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .do/deploy.template.yaml diff --git a/.do/deploy.template.yaml b/.do/deploy.template.yaml new file mode 100644 index 0000000..b4bbece --- /dev/null +++ b/.do/deploy.template.yaml @@ -0,0 +1,47 @@ +spec: + alerts: + - rule: DEPLOYMENT_FAILED + - rule: DOMAIN_FAILED + databases: + - engine: PG + name: ferdi-db + num_nodes: 1 + size: db-s-dev-database + version: "12" + name: ferdi-server + region: lon + services: + - dockerfile_path: Dockerfile + github: + branch: master + deploy_on_push: true + repo: getferdi/server + envs: + - key: DB_HOST + scope: RUN_AND_BUILD_TIME + value: ${ferdi-db.HOSTNAME} + - key: DB_PORT + scope: RUN_AND_BUILD_TIME + value: ${ferdi-db.PORT} + - key: DB_USER + scope: RUN_AND_BUILD_TIME + value: ${ferdi-db.USERNAME} + - key: DB_PASSWORD + scope: RUN_AND_BUILD_TIME + value: ${ferdi-db.PASSWORD} + - key: DB_DATABASE + scope: RUN_AND_BUILD_TIME + value: ${ferdi-db.DATABASE} + - key: DB_CA_CERT + scope: RUN_AND_BUILD_TIME + value: ${ferdi-db.CA_CERT} + - key: DB_CONNECTION + scope: RUN_AND_BUILD_TIME + value: pg + http_port: 8080 + instance_count: 1 + instance_size_slug: basic-xxs + name: ferdi-server + routes: + - path: / + source_dir: / diff --git a/README.md b/README.md index 62e6613..f8c4329 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,13 @@ A custom server allows you to manage the data of all registered users yourself a - [x] Password recovery - [ ] Recipe update +## Deploying the App + +Click this button to deploy the app to the DigitalOcean App Platform. + +[![Deploy to DigitalOcean](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/getferdi/server/tree/master) + +
Setup with Docker The easiest way to set up Ferdi-server on your server is with Docker. diff --git a/config/database.js b/config/database.js index 9372eda..de86a6c 100644 --- a/config/database.js +++ b/config/database.js @@ -78,7 +78,10 @@ module.exports = { user: Env.get('DB_USER', 'root'), password: Env.get('DB_PASSWORD', ''), database: Env.get('DB_DATABASE', 'ferdi'), - ssl: JSON.parse(Env.get('DB_SSL', 'true')), + ssl: Env.get('DB_CA_CERT') ? { + rejectUnauthorized: false, + ca: Env.get('DB_CA_CERT'), + } : JSON.parse(Env.get('DB_SSL', 'true')), }, debug: Env.get('DB_DEBUG', false), }, -- cgit v1.2.3-54-g00ecf