diff --git a/build-deb/Makefile b/build-deb/Makefile new file mode 100644 index 0000000..770b161 --- /dev/null +++ b/build-deb/Makefile @@ -0,0 +1,17 @@ +all: man deb + +man: man/freeriders.1.md + pandoc man/freeriders.1.md -f markdown+hard_line_breaks -s -t man -o man/freeriders.1 + cp man/freeriders.1 freeriders/usr/share/man/man1/ + gzip -f freeriders/usr/share/man/man1/freeriders.1 +deb: man ../requirments.txt ../run.py ../freeriders ../LICENSE + cp -r ../freeriders/* freeriders/var/freeriders/freeriders/ + cp ../run.py freeriders/var/freeriders/ + cp ../LICENSE freeriders/var/freeriders/ + dpkg-deb --build freeriders +clean: + rm -f freeriders.deb + rm -f man/freeriders.1 + rm -rf freeriders/var + mkdir -p freeriders/var/freeriders/freeriders + mkdir -p freeriders/usr/share/man/man1/ diff --git a/build-deb/freeriders/DEBIAN/control b/build-deb/freeriders/DEBIAN/control new file mode 100644 index 0000000..4d1f7cf --- /dev/null +++ b/build-deb/freeriders/DEBIAN/control @@ -0,0 +1,11 @@ +Package: freeriders +Section: net +Priority: optional +Architecture: all +Essential: no +Installed-Size: 2000 +Depends: python3-flask, gunicorn +Homepage: https://gitea.dmz.rs/Decentrala/freeriders +Maintainer: Decentrala +Description: Web app that tracks bus transport ticket numbers +Version: 1.0.0 diff --git a/build-deb/freeriders/DEBIAN/postinst b/build-deb/freeriders/DEBIAN/postinst new file mode 100755 index 0000000..2356bd9 --- /dev/null +++ b/build-deb/freeriders/DEBIAN/postinst @@ -0,0 +1,3 @@ +#!/bin/sh +/usr/bin/systemctl enable freeriders.service +/sbin/service freeriders start diff --git a/build-deb/freeriders/DEBIAN/prerm b/build-deb/freeriders/DEBIAN/prerm new file mode 100755 index 0000000..3bdc91f --- /dev/null +++ b/build-deb/freeriders/DEBIAN/prerm @@ -0,0 +1,3 @@ +#!/bin/sh +/sbin/service freeriders stop +/usr/bin/systemdctl disable freeriders.service diff --git a/build-deb/freeriders/lib/systemd/system/freeriders.service b/build-deb/freeriders/lib/systemd/system/freeriders.service new file mode 100644 index 0000000..c8a5271 --- /dev/null +++ b/build-deb/freeriders/lib/systemd/system/freeriders.service @@ -0,0 +1,12 @@ +[Unit] +Description=Gunicorn freeriders service +Documentation=man:gunicorn(1) +After=network.target nss-lookup.target + +[Service] +WorkingDirectory=/var/freeriders/ +ExecStart=/usr/bin/gunicorn --workers 3 --bind 127.0.0.1:5000 run:app + +[Install] +WantedBy=multi-user.target + diff --git a/build-deb/man/freeriders.1.md b/build-deb/man/freeriders.1.md new file mode 100644 index 0000000..a661ed8 --- /dev/null +++ b/build-deb/man/freeriders.1.md @@ -0,0 +1,21 @@ +% FREERIDERS(1) freeriders 1.0.0 +% Decentrala +% Jun 2023 + +# NAME +freeriders - Web app for tracking bus transport ticket numbers + +# SYNOPSIS +**python3 run.py** + +# DESCRIPTION +Web app for tracking bus transport ticket numbers + +# AUTHORS +Decentrala + +# COPYRIGHT +**AGPLv3+**: GNU AGPL version 3 +This is *free* software: you are free to change and redistribute it. +There is **NO WARRANTY**, to the extent permitted by law. + diff --git a/freeriders/__init__.py b/freeriders/__init__.py new file mode 100644 index 0000000..4e58cf5 --- /dev/null +++ b/freeriders/__init__.py @@ -0,0 +1,5 @@ +from flask import Flask + +app = Flask(__name__) + +from freeriders import routes diff --git a/freeriders/routes.py b/freeriders/routes.py new file mode 100644 index 0000000..b4126d7 --- /dev/null +++ b/freeriders/routes.py @@ -0,0 +1,10 @@ +from flask import render_template, request, redirect +from freeriders import app + +@app.route('/', methods=['POST', 'GET']) +def changepassword(): + if request.method == 'GET': + return render_template('index.html') + elif request.method == 'POST': + else: + return 'HTTP request method not recogniezed' diff --git a/freeriders/templates/index.html b/freeriders/templates/index.html new file mode 100644 index 0000000..8d81d5b --- /dev/null +++ b/freeriders/templates/index.html @@ -0,0 +1,14 @@ + + + + + + + + Ticket tracking + + +
+
+ + diff --git a/requirments.txt b/requirments.txt new file mode 100644 index 0000000..7e10602 --- /dev/null +++ b/requirments.txt @@ -0,0 +1 @@ +flask diff --git a/run.py b/run.py new file mode 100755 index 0000000..168b19c --- /dev/null +++ b/run.py @@ -0,0 +1,4 @@ +from freeriders import app + +if __name__ == '__main__': + app.run(debug=False)