updated something
This commit is contained in:
Binary file not shown.
12
app.py
12
app.py
@@ -56,6 +56,7 @@ class Player(db.Model):
|
|||||||
username = db.Column(db.String(80), unique=True, nullable=False)
|
username = db.Column(db.String(80), unique=True, nullable=False)
|
||||||
hostname = db.Column(db.String(120), unique=True, nullable=False)
|
hostname = db.Column(db.String(120), unique=True, nullable=False)
|
||||||
password = db.Column(db.String(120), nullable=False)
|
password = db.Column(db.String(120), nullable=False)
|
||||||
|
quickconnect_password = db.Column(db.String(120), nullable=False)
|
||||||
|
|
||||||
class Group(db.Model):
|
class Group(db.Model):
|
||||||
id = db.Column(db.Integer, primary_key=True)
|
id = db.Column(db.Integer, primary_key=True)
|
||||||
@@ -349,6 +350,14 @@ def player_fullscreen(player_id):
|
|||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
hostname = request.form['hostname']
|
hostname = request.form['hostname']
|
||||||
password = request.form['password']
|
password = request.form['password']
|
||||||
|
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:
|
||||||
if player.hostname == hostname and bcrypt.check_password_hash(player.password, password):
|
if player.hostname == hostname and bcrypt.check_password_hash(player.password, password):
|
||||||
authenticated = True
|
authenticated = True
|
||||||
else:
|
else:
|
||||||
@@ -400,7 +409,8 @@ def add_player():
|
|||||||
username = request.form['username']
|
username = request.form['username']
|
||||||
hostname = request.form['hostname']
|
hostname = request.form['hostname']
|
||||||
password = bcrypt.generate_password_hash(request.form['password']).decode('utf-8')
|
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.add(new_player)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return redirect(url_for('dashboard'))
|
return redirect(url_for('dashboard'))
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ version: '3.8'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
|
|
||||||
image: digi-server:latest
|
image: digi-server:latest
|
||||||
ports:
|
ports:
|
||||||
- "7100:5000"
|
- "7100:5000"
|
||||||
@@ -16,5 +17,5 @@ services:
|
|||||||
- /home/ske087/digi-server/db:/app/instance
|
- /home/ske087/digi-server/db:/app/instance
|
||||||
- /home/ske087/digi-server/static:/app/static/uploads
|
- /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
|
# 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 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"
|
#command: sh -c "python init_db.py && gunicorn -w 4 -b 0.0.0.0:5000 app:app"
|
||||||
Binary file not shown.
BIN
static/uploads/Ibex_450.jpg
Normal file
BIN
static/uploads/Ibex_450.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 148 KiB |
BIN
static/uploads/big_buck_bunny_720p_1mb.mp4
Normal file
BIN
static/uploads/big_buck_bunny_720p_1mb.mp4
Normal file
Binary file not shown.
@@ -33,6 +33,10 @@
|
|||||||
<label for="password" class="form-label">Password</label>
|
<label for="password" class="form-label">Password</label>
|
||||||
<input type="password" class="form-control" id="password" name="password" required>
|
<input type="password" class="form-control" id="password" name="password" required>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="quickconnect_password" class="form-label">Quick Connect Password</label>
|
||||||
|
<input type="password" class="form-control" id="quickconnect_password" name="quickconnect_password" required>
|
||||||
|
</div>
|
||||||
<button type="submit" class="btn btn-primary">Add Player</button>
|
<button type="submit" class="btn btn-primary">Add Player</button>
|
||||||
</form>
|
</form>
|
||||||
<a href="{{ url_for('dashboard') }}" class="btn btn-secondary mt-3">Back to Dashboard</a>
|
<a href="{{ url_for('dashboard') }}" class="btn btn-secondary mt-3">Back to Dashboard</a>
|
||||||
|
|||||||
@@ -29,6 +29,10 @@
|
|||||||
<label for="password" class="form-label">Password</label>
|
<label for="password" class="form-label">Password</label>
|
||||||
<input type="password" class="form-control" id="password" name="password" required>
|
<input type="password" class="form-control" id="password" name="password" required>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="quickconnect_password" class="form-label">Quick Connect Password</label>
|
||||||
|
<input type="password" class="form-control" id="quickconnect_password" name="quickconnect_password">
|
||||||
|
</div>
|
||||||
<button type="submit" class="btn btn-primary">Authenticate</button>
|
<button type="submit" class="btn btn-primary">Authenticate</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user