This commit is contained in:
√(noham)² committed 2024-03-03 15:52:50 +01:00
1 parent 5c5d9514ce
commit 828e481d1d
12 files changed
+353 -37

No files matched your search

+1 -1
View File
@@ -10,4 +10,4 @@ EXPOSE 3005
RUN pip install gunicorn
CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:3005", "--chdir", "/t", "app:app"]
CMD ["gunicorn", "-w", "1", "-b", "0.0.0.0:3005", "--chdir", "/t", "--log-level", "debug", "app:app"]
+4 -4
View File
@@ -1,7 +1,7 @@
from flask import Flask, request, jsonify
from flask_cors import CORS
import json
#import hashlib
import hashlib
app = Flask(__name__)
CORS(app, resources={r"/music/*": {"origins": "http://*"}})
@@ -16,12 +16,12 @@ def set_content():
data = request.get_json()
user = data.get('user')
password = data.get('password')
if data['user'] in users and users[data['user']] == data['password']:
# if user in users and users[user] == hashlib.sha256(password.encode()).hexdigest():
if user in users and users[user] == hashlib.sha256(password.encode()).hexdigest():
# cache.clear()
cache.update(data)
cache.pop('user', None)
cache.pop('password', None)
return jsonify({'message': 'Content set successfully.'})
return jsonify({'message': f'Content set successfully.'})
else:
return jsonify({'message': 'Invalid user or password.'}), 401
File renamed without changes.