mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Check session enabled instead of auth
This commit is contained in:
parent
3ecc90d21a
commit
4679121115
2 changed files with 18 additions and 14 deletions
|
@ -24,7 +24,7 @@ def get_session_info():
|
||||||
"""
|
"""
|
||||||
from plexpy.webauth import SESSION_KEY
|
from plexpy.webauth import SESSION_KEY
|
||||||
|
|
||||||
if cherrypy.config.get('tools.auth.on'):
|
if cherrypy.config.get('tools.sessions.on'):
|
||||||
_session = cherrypy.session.get(SESSION_KEY)
|
_session = cherrypy.session.get(SESSION_KEY)
|
||||||
if _session:
|
if _session:
|
||||||
return _session
|
return _session
|
||||||
|
|
|
@ -66,10 +66,11 @@ def initialize(options):
|
||||||
|
|
||||||
if options['http_password']:
|
if options['http_password']:
|
||||||
logger.info("Web server authentication is enabled, username is '%s'", options['http_username'])
|
logger.info("Web server authentication is enabled, username is '%s'", options['http_username'])
|
||||||
options_dict['tools.auth.on'] = True
|
auth_enabled = True
|
||||||
options_dict['tools.sessions.on'] = True
|
options_dict['tools.sessions.on'] = True
|
||||||
options_dict['tools.sessions.timeout'] = 30 * 24 * 60 # 30 days
|
|
||||||
cherrypy.tools.auth = cherrypy.Tool('before_handler', webauth.check_auth)
|
cherrypy.tools.auth = cherrypy.Tool('before_handler', webauth.check_auth)
|
||||||
|
else:
|
||||||
|
auth_enabled = False
|
||||||
|
|
||||||
if not options['http_root'] or options['http_root'] == '/':
|
if not options['http_root'] or options['http_root'] == '/':
|
||||||
plexpy.HTTP_ROOT = options['http_root'] = '/'
|
plexpy.HTTP_ROOT = options['http_root'] = '/'
|
||||||
|
@ -85,7 +86,10 @@ def initialize(options):
|
||||||
'tools.gzip.on': True,
|
'tools.gzip.on': True,
|
||||||
'tools.gzip.mime_types': ['text/html', 'text/plain', 'text/css',
|
'tools.gzip.mime_types': ['text/html', 'text/plain', 'text/css',
|
||||||
'text/javascript', 'application/json',
|
'text/javascript', 'application/json',
|
||||||
'application/javascript']
|
'application/javascript'],
|
||||||
|
'tools.auth.on': auth_enabled,
|
||||||
|
'tools.sessions.on': True,
|
||||||
|
'tools.sessions.timeout': 30 * 24 * 60 # 30 days
|
||||||
},
|
},
|
||||||
'/interfaces': {
|
'/interfaces': {
|
||||||
'tools.staticdir.on': True,
|
'tools.staticdir.on': True,
|
||||||
|
@ -94,7 +98,7 @@ def initialize(options):
|
||||||
'tools.caching.force': True,
|
'tools.caching.force': True,
|
||||||
'tools.caching.delay': 0,
|
'tools.caching.delay': 0,
|
||||||
'tools.expires.on': True,
|
'tools.expires.on': True,
|
||||||
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
||||||
'tools.auth.on': False,
|
'tools.auth.on': False,
|
||||||
'tools.sessions.on': False
|
'tools.sessions.on': False
|
||||||
},
|
},
|
||||||
|
@ -105,7 +109,7 @@ def initialize(options):
|
||||||
'tools.caching.force': True,
|
'tools.caching.force': True,
|
||||||
'tools.caching.delay': 0,
|
'tools.caching.delay': 0,
|
||||||
'tools.expires.on': True,
|
'tools.expires.on': True,
|
||||||
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
||||||
'tools.auth.on': False,
|
'tools.auth.on': False,
|
||||||
'tools.sessions.on': False
|
'tools.sessions.on': False
|
||||||
},
|
},
|
||||||
|
@ -116,7 +120,7 @@ def initialize(options):
|
||||||
'tools.caching.force': True,
|
'tools.caching.force': True,
|
||||||
'tools.caching.delay': 0,
|
'tools.caching.delay': 0,
|
||||||
'tools.expires.on': True,
|
'tools.expires.on': True,
|
||||||
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
||||||
'tools.auth.on': False,
|
'tools.auth.on': False,
|
||||||
'tools.sessions.on': False
|
'tools.sessions.on': False
|
||||||
},
|
},
|
||||||
|
@ -127,7 +131,7 @@ def initialize(options):
|
||||||
'tools.caching.force': True,
|
'tools.caching.force': True,
|
||||||
'tools.caching.delay': 0,
|
'tools.caching.delay': 0,
|
||||||
'tools.expires.on': True,
|
'tools.expires.on': True,
|
||||||
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
||||||
'tools.auth.on': False,
|
'tools.auth.on': False,
|
||||||
'tools.sessions.on': False
|
'tools.sessions.on': False
|
||||||
},
|
},
|
||||||
|
@ -138,7 +142,7 @@ def initialize(options):
|
||||||
'tools.caching.force': True,
|
'tools.caching.force': True,
|
||||||
'tools.caching.delay': 0,
|
'tools.caching.delay': 0,
|
||||||
'tools.expires.on': True,
|
'tools.expires.on': True,
|
||||||
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
||||||
'tools.auth.on': False,
|
'tools.auth.on': False,
|
||||||
'tools.sessions.on': False
|
'tools.sessions.on': False
|
||||||
},
|
},
|
||||||
|
@ -149,7 +153,7 @@ def initialize(options):
|
||||||
'tools.caching.force': True,
|
'tools.caching.force': True,
|
||||||
'tools.caching.delay': 0,
|
'tools.caching.delay': 0,
|
||||||
'tools.expires.on': True,
|
'tools.expires.on': True,
|
||||||
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
||||||
'tools.auth.on': False,
|
'tools.auth.on': False,
|
||||||
'tools.sessions.on': False
|
'tools.sessions.on': False
|
||||||
},
|
},
|
||||||
|
@ -160,7 +164,7 @@ def initialize(options):
|
||||||
'tools.caching.force': True,
|
'tools.caching.force': True,
|
||||||
'tools.caching.delay': 0,
|
'tools.caching.delay': 0,
|
||||||
'tools.expires.on': True,
|
'tools.expires.on': True,
|
||||||
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
||||||
'tools.auth.on': False,
|
'tools.auth.on': False,
|
||||||
'tools.sessions.on': False
|
'tools.sessions.on': False
|
||||||
},
|
},
|
||||||
|
@ -171,7 +175,7 @@ def initialize(options):
|
||||||
'tools.caching.force': True,
|
'tools.caching.force': True,
|
||||||
'tools.caching.delay': 0,
|
'tools.caching.delay': 0,
|
||||||
'tools.expires.on': True,
|
'tools.expires.on': True,
|
||||||
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
||||||
'tools.auth.on': False,
|
'tools.auth.on': False,
|
||||||
'tools.sessions.on': False
|
'tools.sessions.on': False
|
||||||
},
|
},
|
||||||
|
@ -182,7 +186,7 @@ def initialize(options):
|
||||||
'tools.caching.force': True,
|
'tools.caching.force': True,
|
||||||
'tools.caching.delay': 0,
|
'tools.caching.delay': 0,
|
||||||
'tools.expires.on': True,
|
'tools.expires.on': True,
|
||||||
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
'tools.expires.secs': 60 * 60 * 24 * 30, # 30 days
|
||||||
'tools.auth.on': False,
|
'tools.auth.on': False,
|
||||||
'tools.sessions.on': False
|
'tools.sessions.on': False
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue