-
This commit is contained in:
parent
411f0bd3b6
commit
88cf8d753d
11
app.py
11
app.py
@ -3,11 +3,19 @@ import db
|
|||||||
import os
|
import os
|
||||||
from werkzeug.utils import secure_filename
|
from werkzeug.utils import secure_filename
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import threading
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.config['UPLOAD_FOLDER'] = "configs/squash"
|
app.config['UPLOAD_FOLDER'] = "configs/squash"
|
||||||
app.config['MAX_CONTENT_LENGTH'] = 1024 * 1024 * 512 #512MB
|
app.config['MAX_CONTENT_LENGTH'] = 1024 * 1024 * 512 #512MB
|
||||||
|
|
||||||
|
def ssh_thread_function():
|
||||||
|
subprocess.run(['wssh','--fbidhttp=False'])
|
||||||
|
|
||||||
|
ssh_thread = threading.Thread(target=ssh_thread_function)
|
||||||
|
ssh_thread.setDaemon()
|
||||||
|
ssh_thread.start()
|
||||||
|
|
||||||
@app.route("/api/addimage", methods=['POST'])
|
@app.route("/api/addimage", methods=['POST'])
|
||||||
def add_image():
|
def add_image():
|
||||||
db.Connect()
|
db.Connect()
|
||||||
@ -61,6 +69,3 @@ def get_image():
|
|||||||
filename = "default.squashfs"
|
filename = "default.squashfs"
|
||||||
|
|
||||||
return send_file(os.path.join(app.config['UPLOAD_FOLDER'], filename))
|
return send_file(os.path.join(app.config['UPLOAD_FOLDER'], filename))
|
||||||
|
|
||||||
|
|
||||||
process = subprocess.run(['wssh','--fbidhttp=False'])
|
|
Loading…
Reference in New Issue
Block a user