From ad0760a827ba70f82f2f5e5399aa909032feb45e Mon Sep 17 00:00:00 2001 From: Your Name <56784875+ckbaker10@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:23:35 +0200 Subject: [PATCH] Documentation --- README.md | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/README.md b/README.md index 5cf4972..2f3e544 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,84 @@ python portable.py Then follow these simple steps +### Customizing listening host and port, Systemd / Reverse-proxy example + +## + +Installation using venv and running under specific bind address / port + +```sh +python3 -m venv venv +source venv/bin/activate +python -m pip install -r requirements.txt +FLASK_APP=app/portable.py flask run --host=127.0.0.1 --port=9982 +``` + +## Systemd Service + +``` +/lib/systemd/system/13ft.service +``` + +``` +[Unit] +Description=13ft Flask Service +Wants=network-online.target +After=network-online.target + +[Service] +Type=simple +Restart=on-failure +RestartSec=10 +User=www-data +Group=www-data +Environment=APP_PATH=/var/www/paywall-break +Environment=FLASK_APP=app/portable.py + +ExecStart=/bin/bash -c "cd ${APP_PATH};${APP_PATH}/venv/bin/flask run --host=127.0.0.1 --port=22113" + +# Make sure stderr/stdout is captured in the systemd journal. +StandardOutput=journal +StandardError=journal + +[Install] +WantedBy=multi-user.target +``` + +## Reverse Proxy + +``` + + ErrorLog ${APACHE_LOG_DIR}/13ft-error.log + CustomLog ${APACHE_LOG_DIR}/13ft-access.log combined + + ProxyRequests Off + + SSLEngine on + SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem + SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key + Header always set Strict-Transport-Security "max-age=63072000" + SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1 + + SSLHonorCipherOrder off + SSLSessionTickets off + + Protocols h2 http/1.1 + + + Order deny,allow + Allow from all + + + + ProxyPass / http://127.0.0.1:22113/ + ProxyPassReverse / http://127.0.0.1:22113/ + + + +``` + + ### Step 1 ![step 1 screenshot](screenshots/step-1.png)