Skip to content

Commit

Permalink
fix: public ecosystem-sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Nov 7, 2023
1 parent e6eb85c commit daf39b0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,3 @@ temp/
.ssl-key
.ssl-dhparam
.ssl-csr
ecosystem-sqlite-private.json
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,8 @@ Follow the [Deployment](#deployment) guide below for automatic provisioning and
pm2 deploy ecosystem-imap.json production setup
```
> NOTE: `ecosystem-sqlite-private.json` is ignored in `.gitignore` and not commited to repository as it contains the private IP of the SQLite server.
```sh
pm2 deploy ecosystem-sqlite-private.json production setup
pm2 deploy ecosystem-sqlite.json production setup
```
14. Create a SSL certificate at [Namecheap][] (we recommend a 5 year wildcard certificate), set up the certificate, and download and extract the ZIP file with the certificate (emailed to you) to your computer. We do not recommend using tools like [LetsEncrypt][] and `certbot` due to complexity when you have (or scale to) a cluster of servers set up behind load balancers. In other words, we've tried approaches like `lsyncd` in combination with `crontab` for `certbot` renewals and automatic checking. Furthermore, using this exposes the server(s) to downtime as ports `80` and `443` may need to be shut down so that `certbot` can use them for certificate generation. This is not a reliable approach, and simply renewing certificates once a year is vastly simpler and also makes using load balancers trivial. Instead you can use a provider like [Namecheap][] to get a cheap SSL certificate, then run a few commands as we've documented below. This command will prompt you for an absolute file path to the certificates you downloaded. Renewed your certificate after 1 year? Simply follow this step again. Do not set a password on the certificate files. When using the `openssl` command (see Namecheap instructions), you need to use `*.example.com` with an asterisk followed by a period if you are registering a wildcard certificate.
Expand All @@ -283,7 +281,7 @@ Follow the [Deployment](#deployment) guide below for automatic provisioning and
pm2 deploy ecosystem-api.json production exec "pm2 reload all"
pm2 deploy ecosystem-smtp.json production exec "pm2 reload all"
pm2 deploy ecosystem-imap.json production exec "pm2 reload all"
pm2 deploy ecosystem-sqlite-private.json production exec "pm2 reload all"
pm2 deploy ecosystem-sqlite.json production exec "pm2 reload all"
```
15. (Optional) Create a Google application credentials profile file and store it locally. You only need this if you want to support automatic translation. The following command will prompt you for the absolute file path (e.g. `/path/to/client-profile.json`). See the [mandarin][] docs for more information.
Expand Down Expand Up @@ -320,10 +318,8 @@ Follow the [Deployment](#deployment) guide below for automatic provisioning and
pm2 deploy ecosystem-imap.json production
```
> NOTE: `ecosystem-sqlite-private.json` is ignored in `.gitignore` and not commited to repository as it contains the private IP of the SQLite server.
```sh
pm2 deploy ecosystem-sqlite-private.json production
pm2 deploy ecosystem-sqlite.json production
```
18. Save the process list on the servers so when if the server were to reboot, it will automatically boot back up the processes:
Expand All @@ -348,10 +344,8 @@ Follow the [Deployment](#deployment) guide below for automatic provisioning and
pm2 deploy ecosystem-imap.json production exec "pm2 save"
```
> NOTE: `ecosystem-sqlite-private.json` is ignored in `.gitignore` and not commited to repository as it contains the private IP of the SQLite server.
```sh
pm2 deploy ecosystem-sqlite-private.json production exec "pm2 save"
pm2 deploy ecosystem-sqlite.json production exec "pm2 save"
```
19. Test by visiting your web and API server in your browser (click "proceed to unsafe" site and bypass certificate warning).
Expand Down
13 changes: 12 additions & 1 deletion ecosystem-sqlite.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,16 @@
"NODE_ENV": "production"
}
}
]
],
"deploy": {
"production": {
"user": "deploy",
"host": ["143.244.179.101"],
"ref": "origin/master",
"repo": "git@github.com:forwardemail/forwardemail.net.git",
"path": "/var/www/production",
"pre-deploy": "git reset --hard",
"post-deploy": "pnpm install && NODE_ENV=production npm start build && pm2 startOrGracefulReload ecosystem-sqlite.json --env production --update-env"
}
}
}

0 comments on commit daf39b0

Please sign in to comment.