mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2026-04-18 02:46:19 +00:00
Added full support for the app-prefix parameter
This commit is contained in:
@@ -72,7 +72,11 @@ def ResponseObject(status=True, message=None, data=None, status_code = 200) -> F
|
||||
'''
|
||||
Flask App
|
||||
'''
|
||||
app = Flask("WGDashboard", template_folder=os.path.abspath("./static/dist/WGDashboardAdmin"))
|
||||
_, APP_PREFIX_INIT = DashboardConfig().GetConfig("Server", "app_prefix")
|
||||
app = Flask("WGDashboard",
|
||||
template_folder=os.path.abspath("./static/dist/WGDashboardAdmin"),
|
||||
static_folder=os.path.abspath("./static/dist/WGDashboardAdmin"),
|
||||
static_url_path=APP_PREFIX_INIT if APP_PREFIX_INIT else '')
|
||||
|
||||
def peerInformationBackgroundThread():
|
||||
global WireguardConfigurations
|
||||
@@ -250,7 +254,8 @@ def auth_req():
|
||||
'/static/', 'validateAuthentication', 'authenticate', 'getDashboardConfiguration',
|
||||
'getDashboardTheme', 'getDashboardVersion', 'sharePeer/get', 'isTotpEnabled', 'locale',
|
||||
'/fileDownload',
|
||||
'/client'
|
||||
'/client',
|
||||
'/assets/', '/img/', '/json/'
|
||||
]
|
||||
|
||||
if (("username" not in session or session.get("role") != "admin")
|
||||
@@ -1698,7 +1703,7 @@ Index Page
|
||||
|
||||
@app.get(f'{APP_PREFIX}/')
|
||||
def index():
|
||||
return render_template('index.html')
|
||||
return render_template('index.html', APP_PREFIX=APP_PREFIX)
|
||||
|
||||
if __name__ == "__main__":
|
||||
startThreads()
|
||||
|
||||
Reference in New Issue
Block a user