mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 14:10:52 -07:00
API enabled by default
This commit is contained in:
parent
3df7642193
commit
e51a425389
3 changed files with 11 additions and 4 deletions
|
@ -172,10 +172,18 @@ def initialize(config_file):
|
|||
|
||||
# Check if Tautulli has a uuid
|
||||
if CONFIG.PMS_UUID == '' or not CONFIG.PMS_UUID:
|
||||
logger.debug(u"Generating UUID...")
|
||||
my_uuid = generate_uuid()
|
||||
CONFIG.__setattr__('PMS_UUID', my_uuid)
|
||||
CONFIG.write()
|
||||
|
||||
|
||||
# Check if Tautulli has an API key
|
||||
if CONFIG.API_KEY == '':
|
||||
logger.debug(u"Generating API key...")
|
||||
api_key = generate_uuid()
|
||||
CONFIG.__setattr__('API_KEY', api_key)
|
||||
CONFIG.write()
|
||||
|
||||
# Get the currently installed version. Returns None, 'win32' or the git
|
||||
# hash.
|
||||
CURRENT_VERSION, CONFIG.GIT_REMOTE, CONFIG.GIT_BRANCH = versioncheck.getVersion()
|
||||
|
@ -1491,5 +1499,4 @@ def shutdown(restart=False, update=False, checkout=False):
|
|||
|
||||
|
||||
def generate_uuid():
|
||||
logger.debug(u"Generating UUID...")
|
||||
return uuid.uuid4().hex
|
||||
|
|
|
@ -66,7 +66,7 @@ _CONFIG_DEFINITIONS = {
|
|||
'PMS_WEB_URL': (str, 'PMS', 'https://app.plex.tv/desktop'),
|
||||
'TIME_FORMAT': (str, 'General', 'HH:mm'),
|
||||
'ANON_REDIRECT': (str, 'General', 'http://www.nullrefer.com/?'),
|
||||
'API_ENABLED': (int, 'General', 0),
|
||||
'API_ENABLED': (int, 'General', 1),
|
||||
'API_KEY': (str, 'General', ''),
|
||||
'API_SQL': (int, 'General', 0),
|
||||
'BOXCAR_ENABLED': (int, 'Boxcar', 0),
|
||||
|
|
|
@ -3539,7 +3539,7 @@ class WebInterface(object):
|
|||
def generate_api_key(self, device=None, **kwargs):
|
||||
apikey = ''
|
||||
while not apikey or apikey == plexpy.CONFIG.API_KEY or mobile_app.get_mobile_device_by_token(device_token=apikey):
|
||||
apikey = uuid.uuid4().hex
|
||||
apikey = plexpy.generate_uuid()
|
||||
|
||||
logger.info(u"New API key generated.")
|
||||
logger._BLACKLIST_WORDS.add(apikey)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue