mirror of
https://github.com/iFargle/headscale-webui.git
synced 2026-03-19 07:35:29 +01:00
test
This commit is contained in:
19
server.py
19
server.py
@@ -76,20 +76,6 @@ if AUTH_TYPE == "oidc":
|
||||
from flask_oidc import OpenIDConnect
|
||||
oidc = OpenIDConnect(app)
|
||||
|
||||
# Decorate all functions with @oidc.require_login:
|
||||
# Get a list of all public pages:
|
||||
output = []
|
||||
for rule in app.url_map.iter_rules():
|
||||
options = {}
|
||||
for arg in rule.arguments:
|
||||
options[arg] = "[{0}]".format(arg)
|
||||
methods = ','.join(rule.methods)
|
||||
url = url_for(rule.endpoint, **options)
|
||||
line = urllib.unquote("{:50s} {:20s} {}".format(rule.endpoint, methods, url))
|
||||
output.append(line)
|
||||
for line in sorted(output):
|
||||
LOG.error(line)
|
||||
|
||||
elif AUTH_TYPE == "basic":
|
||||
# https://flask-basicauth.readthedocs.io/en/latest/
|
||||
LOG.error("Loading basic auth libraries and configuring app...")
|
||||
@@ -109,6 +95,11 @@ elif AUTH_TYPE == "basic":
|
||||
#def oidctest_page():
|
||||
# return 'Welcome %s' % oidc.user_getfield('email')
|
||||
|
||||
# Get URL list
|
||||
@app.route('/site-map')
|
||||
def site_map_page():
|
||||
return ['%s' % rule for rule in app.url_map.iter_rules()]
|
||||
|
||||
@app.route('/')
|
||||
@app.route('/overview')
|
||||
def overview_page():
|
||||
|
||||
Reference in New Issue
Block a user