Add the service the serves status.ente.io

This commit is contained in:
Manav Rathi 2024-03-18 21:19:42 +05:30
parent 19799957c0
commit 2486a94d21
No known key found for this signature in database
3 changed files with 74 additions and 0 deletions

View file

@ -0,0 +1,39 @@
# Status
Our status page ([status.ente.io](https://status.ente.io)) is a self-hosted
[Uptime Kuma](https://github.com/louislam/uptime-kuma).
## Installing
Install [nginx](../nginx/README.md).
Create a directory where Uptime Kuma will keep its state. This is the directory
we can optionally backup if we wish to preserve history and settings when moving
instances in the future.
```sh
sudo mkdir -p /root/uptime-kuma
```
Add the service definition and nginx configuration.
```sh
scp services/status/uptime-kuma.* <instance>:
sudo mv uptime-kuma.service /etc/systemd/system/uptime-kuma.service
sudo mv uptime-kuma.nginx.conf /root/nginx/conf.d
```
Tell systemd to pick up new service definitions, enable the unit (so that it
automatically starts on boot), and start it this time around.
```sh
sudo systemctl daemon-reload
sudo systemctl enable --now uptime-kuma
```
Restart nginx
```sh
sudo systemctl restart nginx
```

View file

@ -0,0 +1,19 @@
# This file gets loaded in a top level http block by the default nginx.conf
# See infra/services/nginx/README.md for more details.
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/ssl/certs/cert.pem;
ssl_certificate_key /etc/ssl/private/key.pem;
server_name status.ente.io;
location / {
proxy_pass http://host.docker.internal:3001;
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;
}
}

View file

@ -0,0 +1,16 @@
[Unit]
Documentation=https://github.com/louislam/uptime-kuma
Requires=docker.service
After=docker.service
[Install]
WantedBy=multi-user.target
[Service]
ExecStartPre=docker pull louislam/uptime-kuma:1
ExecStartPre=-docker stop uptime-kuma
ExecStartPre=-docker rm uptime-kuma
ExecStart=docker run --name uptime-kuma \
-p 3001:3001 \
-v /root/uptime-kuma:/app/data \
louislam/uptime-kuma:1