-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
247 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ rust-project.json | |
|
||
# secrets | ||
*.env* | ||
secrets/* | ||
!secrets/.gitkeep | ||
|
||
# Added by cargo | ||
target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Production Guide | ||
|
||
Notes I take as I attempt to deploy various services to various hosts | ||
|
||
## Production guide for `ant-on-the-web` | ||
|
||
Install dependencies and build the project with | ||
|
||
```bash | ||
cd ./projects/ant-on-the-web/website | ||
npm ci | ||
npm run build | ||
``` | ||
|
||
This will take a while, and will create a `./out` directory with static HTML, | ||
CSS, and JavaScript build artifacts. Copy these into the right location with: | ||
|
||
```bash | ||
mv ./out ../server/static | ||
``` | ||
|
||
for the Rust webserver to pick them up. Build the rust webserver with: | ||
|
||
```bash | ||
cd ../server | ||
cargo build | ||
``` | ||
|
||
which will also take a long time. It should be daemonized on this host (see | ||
[./libre-notes.md]), and we can restart it with: | ||
|
||
```bash | ||
sudo systemctl restart ant-on-the-web.service | ||
``` | ||
|
||
## Production guide for `ant-gateway` | ||
|
||
First, make sure that this host is the one being port-forwarded to on the local | ||
network. By going to <http://192.168.2.1> > Advanced > Port Forwarding, make | ||
sure that the right host is pointed to. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
data/certbot/* | ||
!data/certbot/.gitkeep | ||
secrets/* | ||
!secrets/.gitkeep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
FROM nginx | ||
COPY ./data/nginx/app.conf /etc/nginx/nginx.conf | ||
COPY ./index.html /etc/nginx/html/index.html | ||
|
||
ARG SSL_KEY_PATH | ||
ARG SSL_CERT_PATH | ||
ARG FQDN | ||
ARG ANT_WORKER_NUM=002 | ||
ARG WEBSERVER_PORT=3499 | ||
|
||
# Copy the templates nginx.conf into the container | ||
COPY ./data/nginx.conf.mo /tmp/ant-on-the-web/nginx.conf.mo | ||
RUN curl -sSL https://raw.githubusercontent.com/tests-always-included/mo/master/mo -o mo | ||
RUN chmod +x ./mo | ||
RUN ./mo /tmp/ant-on-the-web/nginx.conf.mo > /etc/nginx/nginx.conf | ||
|
||
# Copy the public and private keys into the container | ||
COPY "$SSL_CERT_PATH" "/ant-on-the-web/${FQDN}/cert.pem" | ||
COPY "$SSL_KEY_PATH" "/ant-on-the-web/${FQDN}/key.pem" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIEnDCCA4SgAwIBAgIUHGJFDqopEjM0lAv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
MAYIKwYBBQUHMAGGJGh0dHA6Ly9vY3NwLmNsb3VkZmxhcmUuY29tL29yaWdpbl9j | ||
YTAfBgNVHREEGDAWghRiZXRhLnR5cGVzb2ZhbnRzLm9yZzA4BgNVHR8EMTAvMC2g | ||
K6AphidodHRwOi8vY3JsLmNsb3VkZmxhcmUuY29tL29yaWdpbl9jYS5jcmwwDQYJ | ||
KoZIhvcNAQELBQADggEBAL+JfVcOFCiTSioBuJBbx6NZDfuttOoT20Wdq4ycXoU9 | ||
SNMn8STMzHnr/HhllUIHr+Cvzgsyccgoj8qCcK4N4hcyIx718O/cyDeRema137N3 | ||
GpbV/HrSOdvoIqJ7c63ahiKF/83M1BKmkTOA1WWgUD8gmtYibp22pmbCT/8C9gVz | ||
rdrqcL1hphMdoD2KXX3+jMu3gy2eGB3bTw4KoHqD1GmRJViBsuV1Pr5ZG+or7z97 | ||
j8hZeXF/tKc7kdBGBOANYc19Vobg8eQNu0LGhAere4uMcZBOgQ6v4QF/h8gNig7O | ||
F7Thjx4FpKCQmQNrXNZcq0ypwhe7DZiY3VP8FpYNorI= | ||
-----END CERTIFICATE----- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
events { | ||
|
||
} | ||
|
||
http { | ||
server { | ||
listen 80; | ||
server_name {{FQDN}}; | ||
return 301 https://$host$request_uri; | ||
} | ||
|
||
server { | ||
listen 443 ssl http2; | ||
listen [::]:443 ssl http2; | ||
server_name {{FQDN}}; | ||
|
||
location / { | ||
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 Host $http_host; | ||
proxy_set_header X-NginX-Proxy true; | ||
|
||
proxy_redirect off; | ||
proxy_pass https://antworker{{ANT_WORKER_NUM}}.hosts.typesofants.org:{{WEBSERVER_PORT}}; | ||
} | ||
|
||
ssl_certificate /ant-on-the-web/{{FQDN}}/cert.pem; | ||
ssl_certificate_key /ant-on-the-web/{{FQDN}}/key.pem; | ||
|
||
# SSL configuration | ||
ssl_session_cache shared:le_nginx_SSL:10m; | ||
ssl_session_timeout 1440m; | ||
ssl_session_tickets off; | ||
|
||
ssl_protocols TLSv1.2 TLSv1.3; | ||
ssl_prefer_server_ciphers off; | ||
|
||
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384"; | ||
} | ||
} |
Oops, something went wrong.