From 60c6a10517ec875d3884f74e9a0519f26aa75353 Mon Sep 17 00:00:00 2001 From: roughnecks Date: Wed, 4 Sep 2024 19:28:43 +0200 Subject: [PATCH 1/2] Added blasta.service --- systemd/blasta.service | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 systemd/blasta.service diff --git a/systemd/blasta.service b/systemd/blasta.service new file mode 100644 index 0000000..948b508 --- /dev/null +++ b/systemd/blasta.service @@ -0,0 +1,16 @@ +# /etc/systemd/system/blasta.service +[Unit] +Description=Blasta Bookmarks Service +After=network.target +Requisite=network-online.target + +[Service] +ExecStart=/usr/bin/uvicorn blasta:app --port 11112 +User=blasta +Restart=always +RestartSec=20s +Type=simple +WorkingDirectory=/home/blasta/Blasta + +[Install] +WantedBy=multi-user.target \ No newline at end of file -- 2.45.2 From ecf8358ccad72cf73b5ac271357d54cc24f09213 Mon Sep 17 00:00:00 2001 From: roughnecks Date: Wed, 4 Sep 2024 19:35:00 +0200 Subject: [PATCH 2/2] Added nginx config --- proxy/nginx/blasta.conf | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 proxy/nginx/blasta.conf diff --git a/proxy/nginx/blasta.conf b/proxy/nginx/blasta.conf new file mode 100644 index 0000000..595ebbc --- /dev/null +++ b/proxy/nginx/blasta.conf @@ -0,0 +1,30 @@ +map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { + server_name blasta.example.tld; + + access_log /var/log/nginx/blasta/access.log; + error_log /var/log/nginx/blasta/error.log; + + location / { + proxy_pass http://127.0.0.1:11112; + 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; + proxy_read_timeout 3600; + } + + listen [::]:443 ssl http2; + listen 443 ssl http2; + ssl_certificate /etc/letsencrypt/live/blasta.example.tld/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/blasta.example.tld/privkey.pem; +} + +server { + listen [::]:80; + listen 80; + server_name blasta.example.tld; + + location / { + return 301 https://$host$request_uri; + } +} -- 2.45.2