flask init

This commit is contained in:
fram3d 2023-10-03 20:25:35 +02:00
parent b833ac96ea
commit aba3a484b7
Signed by: fram3d
GPG Key ID: 938920E709EEA32A
11 changed files with 101 additions and 0 deletions

17
build-deb/Makefile Normal file
View File

@ -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/

View File

@ -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 <dmz@dmz.rs>
Description: Web app that tracks bus transport ticket numbers
Version: 1.0.0

View File

@ -0,0 +1,3 @@
#!/bin/sh
/usr/bin/systemctl enable freeriders.service
/sbin/service freeriders start

View File

@ -0,0 +1,3 @@
#!/bin/sh
/sbin/service freeriders stop
/usr/bin/systemdctl disable freeriders.service

View File

@ -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

View File

@ -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 <https://gnu.org/licenses/agpl.html>
This is *free* software: you are free to change and redistribute it.
There is **NO WARRANTY**, to the extent permitted by law.

5
freeriders/__init__.py Normal file
View File

@ -0,0 +1,5 @@
from flask import Flask
app = Flask(__name__)
from freeriders import routes

10
freeriders/routes.py Normal file
View File

@ -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'

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/styles/style.css">
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
<title>Ticket tracking</title>
</head>
<body>
<main>
</main>
</body>
</html>

1
requirments.txt Normal file
View File

@ -0,0 +1 @@
flask

4
run.py Executable file
View File

@ -0,0 +1,4 @@
from freeriders import app
if __name__ == '__main__':
app.run(debug=False)