mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-01-07 23:11:50 +08:00
added wsgi for gunicorn
This commit is contained in:
parent
99c42ff2c1
commit
ea0229a8ab
2 changed files with 19 additions and 0 deletions
|
@ -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 a new issue