Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
a6a84d662b
|
|||
|
05d40b4bd8
|
|||
|
0f7fd55c7f
|
|||
|
beb96580d4
|
|||
|
524fc6ef54
|
|||
|
cdacbd9d8f
|
|||
|
c4d18aa680
|
|||
|
7da1443d09
|
|||
|
771f557bae
|
@@ -0,0 +1,16 @@
|
|||||||
|
# gunicorn.conf.py
|
||||||
|
# Arian Nasr
|
||||||
|
# April 4, 2026
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
BIND_ADDRESS = os.environ.get('BIND_ADDRESS', '0.0.0.0')
|
||||||
|
BIND_PORT = int(os.environ.get('BIND_PORT', 5001))
|
||||||
|
|
||||||
|
bind = f"{BIND_ADDRESS}:{BIND_PORT}"
|
||||||
|
workers = 2
|
||||||
|
accesslog = "-" # Log to stdout
|
||||||
|
errorlog = "-" # Log to stderr
|
||||||
|
|
||||||
|
# gunicorn -c gunicorn.conf.py main:app
|
||||||
@@ -7,8 +7,6 @@ from flask import Flask, request, render_template
|
|||||||
from werkzeug.utils import secure_filename
|
from werkzeug.utils import secure_filename
|
||||||
|
|
||||||
UPLOAD_FOLDER = os.environ.get('NAVIDROME_MUSIC_FOLDER', '/opt/navidrome/music')
|
UPLOAD_FOLDER = os.environ.get('NAVIDROME_MUSIC_FOLDER', '/opt/navidrome/music')
|
||||||
BIND_ADDRESS = os.environ.get('BIND_ADDRESS', '0.0.0.0')
|
|
||||||
BIND_PORT = int(os.environ.get('BIND_PORT', 5001))
|
|
||||||
ALLOWED_EXTENSIONS = {'flac', 'mp3', 'wav'}
|
ALLOWED_EXTENSIONS = {'flac', 'mp3', 'wav'}
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
@@ -18,6 +16,10 @@ def allowed_file(filename):
|
|||||||
return '.' in filename and \
|
return '.' in filename and \
|
||||||
filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
|
filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
|
||||||
|
|
||||||
|
@app.route('/ping')
|
||||||
|
def ping():
|
||||||
|
return 'pong', 200
|
||||||
|
|
||||||
@app.route('/', methods=['GET', 'POST'])
|
@app.route('/', methods=['GET', 'POST'])
|
||||||
def upload_file():
|
def upload_file():
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
@@ -31,7 +33,3 @@ def upload_file():
|
|||||||
return render_template('success.html', success_message=f'{len(request.files)} file(s) uploaded successfully!'), 200
|
return render_template('success.html', success_message=f'{len(request.files)} file(s) uploaded successfully!'), 200
|
||||||
|
|
||||||
return render_template('index.html'), 200
|
return render_template('index.html'), 200
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
app.run(host=BIND_ADDRESS, port=BIND_PORT, debug=False)
|
|
||||||
|
|||||||
+3
-2
@@ -1,7 +1,8 @@
|
|||||||
blinker==1.9.0
|
blinker==1.9.0
|
||||||
click==8.3.1
|
click==8.3.2
|
||||||
Flask==3.1.3
|
Flask==3.1.3
|
||||||
itsdangerous==2.2.0
|
itsdangerous==2.2.0
|
||||||
Jinja2==3.1.6
|
Jinja2==3.1.6
|
||||||
MarkupSafe==3.0.3
|
MarkupSafe==3.0.3
|
||||||
Werkzeug==3.1.6
|
Werkzeug==3.1.8
|
||||||
|
gunicorn==25.3.0
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<script>
|
<script>
|
||||||
Dropzone.options.myDropzone = {
|
Dropzone.options.myDropzone = {
|
||||||
parallelUploads: 2,
|
parallelUploads: 4,
|
||||||
uploadMultiple: true,
|
uploadMultiple: true,
|
||||||
acceptedFiles: 'audio/*'
|
acceptedFiles: 'audio/*'
|
||||||
};
|
};
|
||||||
@@ -20,4 +20,4 @@
|
|||||||
class="dropzone"
|
class="dropzone"
|
||||||
id="my-dropzone"></form>
|
id="my-dropzone"></form>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user