diff --git a/__pycache__/app.cpython-312.pyc b/__pycache__/app.cpython-312.pyc index 6fa249e..db39331 100644 Binary files a/__pycache__/app.cpython-312.pyc and b/__pycache__/app.cpython-312.pyc differ diff --git a/app.py b/app.py index 438d9d8..c421cfe 100644 --- a/app.py +++ b/app.py @@ -56,6 +56,7 @@ class Player(db.Model): username = db.Column(db.String(80), unique=True, nullable=False) hostname = db.Column(db.String(120), unique=True, nullable=False) password = db.Column(db.String(120), nullable=False) + quickconnect_password = db.Column(db.String(120), nullable=False) class Group(db.Model): id = db.Column(db.Integer, primary_key=True) @@ -349,10 +350,18 @@ def player_fullscreen(player_id): if request.method == 'POST': hostname = request.form['hostname'] password = request.form['password'] - if player.hostname == hostname and bcrypt.check_password_hash(player.password, password): - authenticated = True + quickconnect_password = request.form.get('quickconnect_password') + + if quickconnect_password: + if player.hostname == hostname and bcrypt.check_password_hash(player.quickconnect_password, quickconnect_password): + authenticated = True + else: + authenticated = False else: - authenticated = False + if player.hostname == hostname and bcrypt.check_password_hash(player.password, password): + authenticated = True + else: + authenticated = False else: authenticated = False @@ -400,7 +409,8 @@ def add_player(): username = request.form['username'] hostname = request.form['hostname'] password = bcrypt.generate_password_hash(request.form['password']).decode('utf-8') - new_player = Player(username=username, hostname=hostname, password=password) + quickconnect_password = bcrypt.generate_password_hash(request.form['quickconnect_password']).decode('utf-8') + new_player = Player(username=username, hostname=hostname, password=password, quickconnect_password=quickconnect_password) db.session.add(new_player) db.session.commit() return redirect(url_for('dashboard')) diff --git a/docker-compose.yml b/docker-compose.yml index 5734442..2753521 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,7 @@ version: '3.8' services: web: + image: digi-server:latest ports: - "7100:5000" @@ -16,5 +17,5 @@ services: - /home/ske087/digi-server/db:/app/instance - /home/ske087/digi-server/static:/app/static/uploads # when setting allready exist and data are setted and is performed an update use second line of command - #command: sh -c "python clear_db.py && python init_db.py && gunicorn -w 4 -b 0.0.0.0:5000 app:app" - command: sh -c "python init_db.py && gunicorn -w 4 -b 0.0.0.0:5000 app:app" \ No newline at end of file + command: sh -c "python clear_db.py && python init_db.py && gunicorn -w 4 -b 0.0.0.0:5000 app:app" + #command: sh -c "python init_db.py && gunicorn -w 4 -b 0.0.0.0:5000 app:app" \ No newline at end of file diff --git a/instance/dashboard.db b/instance/dashboard.db index f4dbada..bfc3043 100644 Binary files a/instance/dashboard.db and b/instance/dashboard.db differ diff --git a/static/uploads/Ibex_450.jpg b/static/uploads/Ibex_450.jpg new file mode 100644 index 0000000..5f3b4b8 Binary files /dev/null and b/static/uploads/Ibex_450.jpg differ diff --git a/static/uploads/big_buck_bunny_720p_1mb.mp4 b/static/uploads/big_buck_bunny_720p_1mb.mp4 new file mode 100644 index 0000000..ed139d6 Binary files /dev/null and b/static/uploads/big_buck_bunny_720p_1mb.mp4 differ diff --git a/templates/add_player.html b/templates/add_player.html index 446b9b4..6cc91d5 100644 --- a/templates/add_player.html +++ b/templates/add_player.html @@ -33,6 +33,10 @@ +