34 lines
1.3 KiB
Markdown
34 lines
1.3 KiB
Markdown
# noteserver
|
|
|
|
Server for Notes
|
|
|
|
## Usage
|
|
This program is intended for and tested on Linux, but may work on other systems. The server, being a simple binary, can be deployed easily in several ways. The recommended method is using Docker. Simply run ``docker-deploy.sh`` after initializing the database. This will build the docker image and run the server on port 3002.
|
|
```sh
|
|
git clone https://git.miningtcup.me/MiningTcup/noteserver.git
|
|
cd noteserver
|
|
sh reload.sh
|
|
sh docker-deploy.sh
|
|
```
|
|
After starting the Docker container and checking that it's up, you should use [nginx](https://nginx.org/) or another reverse proxy.
|
|
```nginx
|
|
server
|
|
{
|
|
location / {
|
|
proxy_pass http://127.0.0.1:3002;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
server_name notes.miningtcup.me; # managed by Certbot
|
|
|
|
listen 443 ssl; # managed by Certbot
|
|
listen [::]:443 ssl; # managed by Certbot
|
|
ssl_certificate /etc/letsencrypt/live/miningtcup.me/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/miningtcup.me/privkey.pem; # managed by Certbot
|
|
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
}
|
|
``` |