|
|
@ -147,6 +147,16 @@ def authorize():
|
|
|
|
aaa.require(fail_redirect=(base_url + 'login'))
|
|
|
|
aaa.require(fail_redirect=(base_url + 'login'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def api_authorize():
|
|
|
|
|
|
|
|
if 'apikey' in request.GET.dict:
|
|
|
|
|
|
|
|
if request.GET.dict['apikey'][0] == settings.auth.apikey:
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
abort(401, 'Unauthorized')
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
abort(401, 'Unauthorized')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def post_get(name, default=''):
|
|
|
|
def post_get(name, default=''):
|
|
|
|
return request.POST.get(name, default).strip()
|
|
|
|
return request.POST.get(name, default).strip()
|
|
|
|
|
|
|
|
|
|
|
@ -1429,6 +1439,7 @@ def save_settings():
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
aaa._beaker_session.delete()
|
|
|
|
aaa._beaker_session.delete()
|
|
|
|
|
|
|
|
settings.auth.apikey = request.forms.get('settings_auth_apikey')
|
|
|
|
|
|
|
|
|
|
|
|
settings_sonarr_ip = request.forms.get('settings_sonarr_ip')
|
|
|
|
settings_sonarr_ip = request.forms.get('settings_sonarr_ip')
|
|
|
|
settings_sonarr_port = request.forms.get('settings_sonarr_port')
|
|
|
|
settings_sonarr_port = request.forms.get('settings_sonarr_port')
|
|
|
@ -2230,6 +2241,17 @@ def movie_history(no):
|
|
|
|
return dict(data=movie_history)
|
|
|
|
return dict(data=movie_history)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Don't put any route under this one
|
|
|
|
|
|
|
|
@route(base_url + 'api/help')
|
|
|
|
|
|
|
|
def api_help():
|
|
|
|
|
|
|
|
endpoints = []
|
|
|
|
|
|
|
|
for route in app.app.routes:
|
|
|
|
|
|
|
|
if '/api/' in route.rule:
|
|
|
|
|
|
|
|
endpoints.append(route.rule)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return dict(endpoints=endpoints)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Mute DeprecationWarning
|
|
|
|
# Mute DeprecationWarning
|
|
|
|
warnings.simplefilter("ignore", DeprecationWarning)
|
|
|
|
warnings.simplefilter("ignore", DeprecationWarning)
|
|
|
|
server = CherryPyWSGIServer((str(settings.general.ip), (int(args.port) if args.port else int(settings.general.port))), app)
|
|
|
|
server = CherryPyWSGIServer((str(settings.general.ip), (int(args.port) if args.port else int(settings.general.port))), app)
|
|
|
|