diff options
-rw-r--r-- | .do/deploy.template.yaml | 47 | ||||
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | config/database.js | 5 |
3 files changed, 58 insertions, 1 deletions
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 @@ | |||
1 | spec: | ||
2 | alerts: | ||
3 | - rule: DEPLOYMENT_FAILED | ||
4 | - rule: DOMAIN_FAILED | ||
5 | databases: | ||
6 | - engine: PG | ||
7 | name: ferdi-db | ||
8 | num_nodes: 1 | ||
9 | size: db-s-dev-database | ||
10 | version: "12" | ||
11 | name: ferdi-server | ||
12 | region: lon | ||
13 | services: | ||
14 | - dockerfile_path: Dockerfile | ||
15 | github: | ||
16 | branch: master | ||
17 | deploy_on_push: true | ||
18 | repo: getferdi/server | ||
19 | envs: | ||
20 | - key: DB_HOST | ||
21 | scope: RUN_AND_BUILD_TIME | ||
22 | value: ${ferdi-db.HOSTNAME} | ||
23 | - key: DB_PORT | ||
24 | scope: RUN_AND_BUILD_TIME | ||
25 | value: ${ferdi-db.PORT} | ||
26 | - key: DB_USER | ||
27 | scope: RUN_AND_BUILD_TIME | ||
28 | value: ${ferdi-db.USERNAME} | ||
29 | - key: DB_PASSWORD | ||
30 | scope: RUN_AND_BUILD_TIME | ||
31 | value: ${ferdi-db.PASSWORD} | ||
32 | - key: DB_DATABASE | ||
33 | scope: RUN_AND_BUILD_TIME | ||
34 | value: ${ferdi-db.DATABASE} | ||
35 | - key: DB_CA_CERT | ||
36 | scope: RUN_AND_BUILD_TIME | ||
37 | value: ${ferdi-db.CA_CERT} | ||
38 | - key: DB_CONNECTION | ||
39 | scope: RUN_AND_BUILD_TIME | ||
40 | value: pg | ||
41 | http_port: 8080 | ||
42 | instance_count: 1 | ||
43 | instance_size_slug: basic-xxs | ||
44 | name: ferdi-server | ||
45 | routes: | ||
46 | - path: / | ||
47 | source_dir: / | ||
@@ -36,6 +36,13 @@ A custom server allows you to manage the data of all registered users yourself a | |||
36 | - [x] Password recovery | 36 | - [x] Password recovery |
37 | - [ ] Recipe update | 37 | - [ ] Recipe update |
38 | 38 | ||
39 | ## Deploying the App | ||
40 | |||
41 | Click this button to deploy the app to the DigitalOcean App Platform. | ||
42 | |||
43 | [![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) | ||
44 | |||
45 | |||
39 | <details> | 46 | <details> |
40 | <summary>Setup with Docker</summary> | 47 | <summary>Setup with Docker</summary> |
41 | The easiest way to set up Ferdi-server on your server is with Docker. | 48 | 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 = { | |||
78 | user: Env.get('DB_USER', 'root'), | 78 | user: Env.get('DB_USER', 'root'), |
79 | password: Env.get('DB_PASSWORD', ''), | 79 | password: Env.get('DB_PASSWORD', ''), |
80 | database: Env.get('DB_DATABASE', 'ferdi'), | 80 | database: Env.get('DB_DATABASE', 'ferdi'), |
81 | ssl: JSON.parse(Env.get('DB_SSL', 'true')), | 81 | ssl: Env.get('DB_CA_CERT') ? { |
82 | rejectUnauthorized: false, | ||
83 | ca: Env.get('DB_CA_CERT'), | ||
84 | } : JSON.parse(Env.get('DB_SSL', 'true')), | ||
82 | }, | 85 | }, |
83 | debug: Env.get('DB_DEBUG', false), | 86 | debug: Env.get('DB_DEBUG', false), |
84 | }, | 87 | }, |