From 16b7b2e0ba4ebe53997912ec0c988fb9c3b2f95b Mon Sep 17 00:00:00 2001 From: ahoemann Date: Thu, 5 Dec 2024 12:44:54 +0100 Subject: [PATCH 1/3] remove: unused variable; fix: debug mode off --- README.md | 37 +++++++++++++++++++++++++++++++++++++ app.py | 7 ++----- requirements.txt | 1 + 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e69de29..a741db1 100644 --- a/README.md +++ b/README.md @@ -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 +``` + diff --git a/app.py b/app.py index 4d9604b..3aa37fb 100755 --- a/app.py +++ b/app.py @@ -3,7 +3,7 @@ from flask import Flask, render_template, redirect, url_for import requests app = Flask(__name__) -navigation = {"Imprint":"imprint"} + @app.route("/imprint") def root(): return render_template("imprint.html") @@ -29,14 +29,11 @@ def get_status_code(link): def get_status(link): match get_status_code(link): case 200: - print(200) return "ONLINE" case 500: - print(500) return "ERROR" case _: - print("OTHER") return "OFFLINE" if __name__ == "__main__": - app.run(debug=True) + app.run(debug=False) diff --git a/requirements.txt b/requirements.txt index 4319354..3c94e51 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ flask waitress +requests -- 2.39.5 From 65561bce22a0d794488a2736160ef4c0eb933e50 Mon Sep 17 00:00:00 2001 From: ahoemann Date: Thu, 5 Dec 2024 12:58:02 +0100 Subject: [PATCH 2/3] remove: conflict --- .Dockerfile.kate-swp | Bin 0 -> 48 bytes requirements.txt | 1 - 2 files changed, 1 deletion(-) create mode 100644 .Dockerfile.kate-swp diff --git a/.Dockerfile.kate-swp b/.Dockerfile.kate-swp new file mode 100644 index 0000000000000000000000000000000000000000..a8084efee440019afc0244d14bfdb64ce6489480 GIT binary patch literal 48 zcmZQzU=Z?7EJ;-eE>A2_aLdd|RWQ;sU|?VnxmDcWxgb#UL*mU?MRu8>Tg!t&nuA>d DN^B2} literal 0 HcmV?d00001 diff --git a/requirements.txt b/requirements.txt index 3c94e51..4319354 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ flask waitress -requests -- 2.39.5 From 739875c1e4945cf361a93593658a59469d8f3011 Mon Sep 17 00:00:00 2001 From: ahoemann Date: Thu, 5 Dec 2024 11:59:04 +0000 Subject: [PATCH 3/3] Delete .Dockerfile.kate-swp --- .Dockerfile.kate-swp | Bin 48 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .Dockerfile.kate-swp diff --git a/.Dockerfile.kate-swp b/.Dockerfile.kate-swp deleted file mode 100644 index a8084efee440019afc0244d14bfdb64ce6489480..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48 zcmZQzU=Z?7EJ;-eE>A2_aLdd|RWQ;sU|?VnxmDcWxgb#UL*mU?MRu8>Tg!t&nuA>d DN^B2} -- 2.39.5