fix license, update docs
parent
3b9b4751ad
commit
3f4adda0c9
16
README.md
16
README.md
|
@ -26,10 +26,24 @@ That's a little more complicated.
|
|||
Eventually we'll have 2 different environments, development and production, each with different logging and such.
|
||||
|
||||
0. Make sure you have a /supported/ database installed and working, either sqlite, or Postgres.
|
||||
1. Initialise the database with the following command `sqlite3 ephemeral.db < schema.sql`
|
||||
1. Initialise the database with the following command `sqlite3 ephemeral.db < schema.sql`
|
||||
1.1. If you want to speed up sqlite a little bit more, run `sqlite3 ephemeral.db` and then `PRAGMA synchronous = OFF;` and then Ctrl+D
|
||||
2. Compile and run ephemeral with `LOG=debug cargo run` for the debug build. `LOG=info cargo run -r` will run the release build.
|
||||
|
||||
### Production (nginx proxy)
|
||||
|
||||
This is the exact setup I'm using to run the test instance <https://cz0.au>
|
||||
|
||||
0. git clone this repo. preferably as `/opt/ephemeral/`
|
||||
1. Create the DB `sqlite3 ephemeral.db < schema.sql` (Half broken, requires a dummy file to compile)
|
||||
2. If you want to speed up sqlite a little bit more, run `sqlite3 ephemeral.db` and then `PRAGMA synchronous = OFF;` and then Ctrl+D
|
||||
3. Copy the systemd service `sudo cp ephemeral.service /etc/systemd/system/`, editing if necessary
|
||||
4. Compile the release version. `cargo build --release`
|
||||
5. Use `/docs/nginx.conf` as a base for your nginx config. You're on your own for this.
|
||||
6. `sudo systemctl daemon-reload` then `sudo systemctl enable ephemeral` and `sudo systemctl start ephemeral` to reload systemd, get ephemeral to run at startup, and run it.
|
||||
|
||||
To see the logs (even in colour!) use `sudo journalctl -xefu ephemeral --output cat`
|
||||
|
||||
### Configuration Options
|
||||
|
||||
Configuration options are available in the `config.toml' file.
|
||||
|
|
|
@ -30,23 +30,18 @@ server {
|
|||
# access_log /var/log/nginx/example.com_access.log json_analytics;
|
||||
|
||||
|
||||
# SSL
|
||||
# SSL (You'll want to use certbot to get this working.)
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
||||
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
|
||||
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
|
||||
|
||||
# TODO: Test this!
|
||||
location /static/ {
|
||||
root /opt/ephemeral/static/$host/;
|
||||
}
|
||||
|
||||
# TODO: Test this!
|
||||
location /static/files {
|
||||
root /opt/ephemeral/static/;
|
||||
autoindex on;
|
||||
}
|
||||
|
||||
# Internal only redirect so we can serve files statically all while tracking files proeprly from flask.
|
||||
# Internal only redirect so we can serve files statically all while tracking files proeprly from ephemeral.
|
||||
location /files/ {
|
||||
include mime.types;
|
||||
types {
|
||||
|
@ -67,20 +62,17 @@ server {
|
|||
}
|
||||
|
||||
location / {
|
||||
include snippets/proxy.conf;
|
||||
uwsgi_buffering off;
|
||||
uwsgi_param Host $host;
|
||||
uwsgi_pass 127.0.0.1:3031;
|
||||
include uwsgi_params;
|
||||
|
||||
# Okay, I don't know if /all/ of these are needed, but you 100% need the host header.
|
||||
proxy_set_header Host $host;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
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;
|
||||
proxy_set_header X-Forwarded-Host $http_host;
|
||||
proxy_set_header X-Forwarded-Port $server_port;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
proxy_pass http://127.0.0.1:8282/;
|
||||
}
|
||||
|
||||
error_page 403 /error/403;
|
||||
error_page 404 /error/404;
|
||||
error_page 413 /error/413;
|
||||
error_page 418 /error/418;
|
||||
error_page 500 /error/500;
|
||||
|
||||
include snippets/general.conf;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue