1
0
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:
Galonza Peter 2021-10-17 23:37:45 +03:00
parent 99c42ff2c1
commit ea0229a8ab
2 changed files with 19 additions and 0 deletions

View File

@ -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
View File

@ -0,0 +1,6 @@
import dashboard
if __name__ in "__main__":
dashboard.run_wsgi()
dashboard.app.run()