mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-11-22 07:10:09 +01:00
added wsgi for gunicorn
This commit is contained in:
parent
99c42ff2c1
commit
ea0229a8ab
@ -1161,6 +1161,19 @@ def check_update():
|
||||
else:
|
||||
return "true"
|
||||
|
||||
def run_wsgi():
|
||||
init_dashboard()
|
||||
global config
|
||||
config = configparser.ConfigParser(strict=False)
|
||||
config.read('wg-dashboard.ini')
|
||||
global app_ip
|
||||
app_ip = config.get("Server", "app_ip")
|
||||
global app_port
|
||||
app_port = config.get("Server", "app_port")
|
||||
global wg_conf_path
|
||||
wg_conf_path = config.get("Server", "wg_conf_path")
|
||||
config.clear()
|
||||
return app
|
||||
|
||||
if __name__ == "__main__":
|
||||
init_dashboard()
|
||||
|
6
src/wsgi.py
Normal file
6
src/wsgi.py
Normal file
@ -0,0 +1,6 @@
|
||||
import dashboard
|
||||
|
||||
|
||||
if __name__ in "__main__":
|
||||
dashboard.run_wsgi()
|
||||
dashboard.app.run()
|
Loading…
Reference in New Issue
Block a user