Compare commits

...

5 commits

Author SHA1 Message Date
4c76eb3f1b Merge pull request 'monitor' (#6) from monitor into master
All checks were successful
/ update (push) Successful in 0s
Reviewed-on: #6
2024-12-06 07:05:09 +00:00
2af3ea3605 Merge branch 'master' into monitor
All checks were successful
/ update (push) Successful in 0s
2024-12-05 12:00:38 +00:00
739875c1e4 Delete .Dockerfile.kate-swp
All checks were successful
/ update (push) Successful in 0s
2024-12-05 11:59:04 +00:00
65561bce22 remove: conflict
All checks were successful
/ update (push) Successful in 0s
2024-12-05 12:58:02 +01:00
16b7b2e0ba remove: unused variable; fix: debug mode off
All checks were successful
/ update (push) Successful in 0s
2024-12-05 12:44:54 +01:00
2 changed files with 39 additions and 5 deletions

View file

@ -0,0 +1,37 @@
# Installation
## Setting up the environment
1. Create a virtual environment:
```bash
python3 -m venv .venv
```
2. Activate the virtual environment:
```bash
. .venv/bin/activate
```
3. Install dependencies:
```bash
pip install requirements.txt
```
```systemd
# /etc/systemd/system/adrianux.service
[Unit]
Description=WSGI app
After=network.target
[Service]
Type=simple
User=adrianux
WorkingDirectory=/opt/Adrianux.net
ExecStart=/opt/Adrianux.net/.venv/bin/waitress-serve --listen=127.0.0.1:8080 app:app
Restart=always
[Install]
WantedBy=multi-user.target
```

7
app.py
View file

@ -3,7 +3,7 @@ from flask import Flask, render_template, redirect, url_for
import requests import requests
app = Flask(__name__) app = Flask(__name__)
navigation = {"Imprint":"imprint"}
@app.route("/imprint") @app.route("/imprint")
def root(): def root():
return render_template("imprint.html") return render_template("imprint.html")
@ -29,14 +29,11 @@ def get_status_code(link):
def get_status(link): def get_status(link):
match get_status_code(link): match get_status_code(link):
case 200: case 200:
print(200)
return "ONLINE" return "ONLINE"
case 500: case 500:
print(500)
return "ERROR" return "ERROR"
case _: case _:
print("OTHER")
return "OFFLINE" return "OFFLINE"
if __name__ == "__main__": if __name__ == "__main__":
app.run(debug=True) app.run(debug=False)