mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-03 18:03:37 +00:00
Merge pull request #230 from JackDandy/feature/ChangeSecureAuthDisplay
Change authentication credentials to display more securely on config pages.
This commit is contained in:
commit
7d9e062760
8 changed files with 167 additions and 55 deletions
|
@ -7,6 +7,7 @@
|
|||
* Remove unused SickBeardURLOpener and AuthURLOpener classes
|
||||
* Update Pushbullet notifier (port from midgetspy/sickbeard)
|
||||
* Change startup code cleanup and PEP8
|
||||
* Change authentication credentials to display more securely on config pages
|
||||
|
||||
[develop changelog]
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
<label for="anidb_password">
|
||||
<span class="component-title">AniDB password</span>
|
||||
<span class="component-desc">
|
||||
<input type="password" name="anidb_password" id="anidb_password" value="$sickbeard.ANIDB_PASSWORD" class="form-control input-sm input350" />
|
||||
<input type="password" name="anidb_password" id="anidb_password" value="#echo '*' * len($sickbeard.ANIDB_PASSWORD)#" class="form-control input-sm input350" />
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
@ -342,7 +342,7 @@
|
|||
<label for="web_password">
|
||||
<span class="component-title">Password</span>
|
||||
<span class="component-desc">
|
||||
<input type="password" name="web_password" id="web_password" value="$sickbeard.WEB_PASSWORD" class="form-control input-sm input300">
|
||||
<input type="password" name="web_password" id="web_password" value="#echo '*' * len($sickbeard.WEB_PASSWORD)#" class="form-control input-sm input300">
|
||||
<p>blank = no authentication</p>
|
||||
<span class="clear-left">check autoProcessTV.cfg is set up for external apps to use post processing scripts
|
||||
</label>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#import sickbeard
|
||||
#import re
|
||||
#from sickbeard.helpers import anon_url
|
||||
#from sickbeard.helpers import anon_url, starify
|
||||
|
||||
#set global $title = 'Config - Notifications'
|
||||
#set global $header = 'Notifications'
|
||||
|
@ -139,7 +139,7 @@
|
|||
<div class="field-pair">
|
||||
<label for="xbmc_password">
|
||||
<span class="component-title">XBMC password</span>
|
||||
<input type="password" name="xbmc_password" id="xbmc_password" value="$sickbeard.XBMC_PASSWORD" class="form-control input-sm input250" />
|
||||
<input type="password" name="xbmc_password" id="xbmc_password" value="#echo '*' * len($sickbeard.XBMC_PASSWORD)#" class="form-control input-sm input250" />
|
||||
</label>
|
||||
<label>
|
||||
<span class="component-title"> </span>
|
||||
|
@ -189,7 +189,7 @@
|
|||
<label for="plex_password">
|
||||
<span class="component-title">Server/client password</span>
|
||||
<span class="component-desc">
|
||||
<input type="password" name="plex_password" id="plex_password" value="$sickbeard.PLEX_PASSWORD" class="form-control input-sm input250" />
|
||||
<input type="password" name="plex_password" id="plex_password" value="#echo '*' * len($sickbeard.PLEX_PASSWORD)#" class="form-control input-sm input250" />
|
||||
<p>blank = no authentication</p>
|
||||
</span>
|
||||
</label>
|
||||
|
@ -641,7 +641,7 @@
|
|||
<div class="field-pair">
|
||||
<label for="growl_password">
|
||||
<span class="component-title">Growl password</span>
|
||||
<input type="password" name="growl_password" id="growl_password" value="$sickbeard.GROWL_PASSWORD" class="form-control input-sm input250" />
|
||||
<input type="password" name="growl_password" id="growl_password" value="#echo '*' * len($sickbeard.GROWL_PASSWORD)#" class="form-control input-sm input250" />
|
||||
</label>
|
||||
<label>
|
||||
<span class="component-title"> </span>
|
||||
|
@ -709,7 +709,7 @@
|
|||
<div class="field-pair">
|
||||
<label for="prowl_api">
|
||||
<span class="component-title">Prowl API key:</span>
|
||||
<input type="text" name="prowl_api" id="prowl_api" value="$sickbeard.PROWL_API" class="form-control input-sm input250" />
|
||||
<input type="text" name="prowl_api" id="prowl_api" value="<%= starify(sickbeard.PROWL_API) %>" class="form-control input-sm input250" />
|
||||
</label>
|
||||
<label>
|
||||
<span class="component-title"> </span>
|
||||
|
@ -843,7 +843,7 @@
|
|||
<div class="field-pair">
|
||||
<label for="pushover_userkey">
|
||||
<span class="component-title">Pushover key</span>
|
||||
<input type="text" name="pushover_userkey" id="pushover_userkey" value="$sickbeard.PUSHOVER_USERKEY" class="form-control input-sm input250" />
|
||||
<input type="text" name="pushover_userkey" id="pushover_userkey" value="<%= starify(sickbeard.PUSHOVER_USERKEY) %>" class="form-control input-sm input250" />
|
||||
</label>
|
||||
<label>
|
||||
<span class="component-title"> </span>
|
||||
|
@ -853,7 +853,7 @@
|
|||
<div class="field-pair">
|
||||
<label for="pushover_apikey">
|
||||
<span class="component-title">Pushover API key</span>
|
||||
<input type="text" name="pushover_apikey" id="pushover_apikey" value="$sickbeard.PUSHOVER_APIKEY" class="form-control input-sm input250" />
|
||||
<input type="text" name="pushover_apikey" id="pushover_apikey" value="<%= starify(sickbeard.PUSHOVER_APIKEY) %>" class="form-control input-sm input250" />
|
||||
</label>
|
||||
<label>
|
||||
<span class="component-title"> </span>
|
||||
|
@ -916,7 +916,7 @@
|
|||
<div class="field-pair">
|
||||
<label for="boxcar2_accesstoken">
|
||||
<span class="component-title">Boxcar2 access token</span>
|
||||
<input type="text" name="boxcar2_accesstoken" id="boxcar2_accesstoken" value="$sickbeard.BOXCAR2_ACCESSTOKEN" class="form-control input-sm input250" />
|
||||
<input type="text" name="boxcar2_accesstoken" id="boxcar2_accesstoken" value="<%= starify(sickbeard.BOXCAR2_ACCESSTOKEN) %>" class="form-control input-sm input250" />
|
||||
</label>
|
||||
<label>
|
||||
<span class="component-title"> </span>
|
||||
|
@ -1020,7 +1020,7 @@
|
|||
<div class="field-pair">
|
||||
<label for="nma_api">
|
||||
<span class="component-title">NMA API key:</span>
|
||||
<input type="text" name="nma_api" id="nma_api" value="$sickbeard.NMA_API" class="form-control input-sm input350" />
|
||||
<input type="text" name="nma_api" id="nma_api" value="<%= starify(sickbeard.NMA_API) %>" class="form-control input-sm input350" />
|
||||
</label>
|
||||
<label>
|
||||
<span class="component-title"> </span>
|
||||
|
@ -1099,7 +1099,7 @@
|
|||
<div class="field-pair">
|
||||
<label for="pushalot_authorizationtoken">
|
||||
<span class="component-title">Pushalot authorization token</span>
|
||||
<input type="text" name="pushalot_authorizationtoken" id="pushalot_authorizationtoken" value="$sickbeard.PUSHALOT_AUTHORIZATIONTOKEN" class="form-control input-sm input350" />
|
||||
<input type="text" name="pushalot_authorizationtoken" id="pushalot_authorizationtoken" value="<%= starify(sickbeard.PUSHALOT_AUTHORIZATIONTOKEN) %>" class="form-control input-sm input350" />
|
||||
</label>
|
||||
<label>
|
||||
<span class="component-title"> </span>
|
||||
|
@ -1162,7 +1162,7 @@
|
|||
<div class="field-pair">
|
||||
<label for="pushbullet_access_token">
|
||||
<span class="component-title">Pushbullet access token</span>
|
||||
<input type="text" name="pushbullet_access_token" id="pushbullet_access_token" value="$sickbeard.PUSHBULLET_ACCESS_TOKEN" class="form-control input-sm input250" />
|
||||
<input type="text" name="pushbullet_access_token" id="pushbullet_access_token" value="<%= starify(sickbeard.PUSHBULLET_ACCESS_TOKEN) %>" class="form-control input-sm input250" />
|
||||
</label>
|
||||
<label>
|
||||
<span class="component-title"> </span>
|
||||
|
@ -1308,7 +1308,7 @@
|
|||
<div class="field-pair">
|
||||
<label for="trakt_password">
|
||||
<span class="component-title">Trakt password</span>
|
||||
<input type="password" name="trakt_password" id="trakt_password" value="$sickbeard.TRAKT_PASSWORD" class="form-control input-sm input250" />
|
||||
<input type="password" name="trakt_password" id="trakt_password" value="#echo '*' * len($sickbeard.TRAKT_PASSWORD)#" class="form-control input-sm input250" />
|
||||
</label>
|
||||
<label>
|
||||
<span class="component-title"> </span>
|
||||
|
@ -1318,7 +1318,7 @@
|
|||
<div class="field-pair">
|
||||
<label for="trakt_api">
|
||||
<span class="component-title">Trakt API key:</span>
|
||||
<input type="text" name="trakt_api" id="trakt_api" value="$sickbeard.TRAKT_API" class="form-control input-sm input250" />
|
||||
<input type="text" name="trakt_api" id="trakt_api" value="<%= starify(sickbeard.TRAKT_API) %>" class="form-control input-sm input250" />
|
||||
</label>
|
||||
<label>
|
||||
<span class="component-title"> </span>
|
||||
|
@ -1502,7 +1502,7 @@
|
|||
<div class="field-pair">
|
||||
<label for="email_password">
|
||||
<span class="component-title">SMTP password</span>
|
||||
<input type="password" name="email_password" id="email_password" value="$sickbeard.EMAIL_PASSWORD" class="form-control input-sm input250" />
|
||||
<input type="password" name="email_password" id="email_password" value="#echo '*' * len($sickbeard.EMAIL_PASSWORD)#" class="form-control input-sm input250" />
|
||||
</label>
|
||||
<label>
|
||||
<span class="component-title"> </span>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#import sickbeard
|
||||
#from sickbeard.providers.generic import GenericProvider
|
||||
#from sickbeard.providers import thepiratebay
|
||||
#from sickbeard.helpers import anon_url
|
||||
#from sickbeard.helpers import anon_url, starify
|
||||
|
||||
#set global $title="Config - Providers"
|
||||
#set global $header="Search Providers"
|
||||
|
@ -43,7 +43,7 @@
|
|||
|
||||
#for $curNewznabProvider in $sickbeard.newznabProviderList:
|
||||
|
||||
\$(this).addProvider('$curNewznabProvider.getID()', '$curNewznabProvider.name', '$curNewznabProvider.url', '$curNewznabProvider.key', '$curNewznabProvider.catIDs', $int($curNewznabProvider.default), show_nzb_providers);
|
||||
\$(this).addProvider('$curNewznabProvider.getID()', '$curNewznabProvider.name', '$curNewznabProvider.url', '<%= starify(curNewznabProvider.key) %>', '$curNewznabProvider.catIDs', $int($curNewznabProvider.default), show_nzb_providers);
|
||||
|
||||
#end for
|
||||
|
||||
|
@ -53,7 +53,7 @@
|
|||
|
||||
#for $curTorrentRssProvider in $sickbeard.torrentRssProviderList:
|
||||
|
||||
\$(this).addTorrentRssProvider('$curTorrentRssProvider.getID()', '$curTorrentRssProvider.name', '$curTorrentRssProvider.url', '$curTorrentRssProvider.cookies');
|
||||
\$(this).addTorrentRssProvider('$curTorrentRssProvider.getID()', '$curTorrentRssProvider.name', '$curTorrentRssProvider.url', '<%= starify(curTorrentRssProvider.cookies) %>');
|
||||
|
||||
#end for
|
||||
|
||||
|
@ -207,7 +207,7 @@
|
|||
<label for="${curNewznabProvider.getID()}_hash">
|
||||
<span class="component-title">API key</span>
|
||||
<span class="component-desc">
|
||||
<input type="text" id="${curNewznabProvider.getID()}_hash" value="$curNewznabProvider.key" newznab_name="${curNewznabProvider.getID()}_hash" class="newznab_key form-control input-sm input350" />
|
||||
<input type="text" id="${curNewznabProvider.getID()}_hash" value="<%= starify(curNewznabProvider.key) %>" newznab_name="${curNewznabProvider.getID()}_hash" class="newznab_key form-control input-sm input350" />
|
||||
<div class="clear-left"><p>get API key from provider website</p></div>
|
||||
</span>
|
||||
</label>
|
||||
|
@ -285,7 +285,7 @@
|
|||
<label for="${curNzbProvider.getID()}_api_key">
|
||||
<span class="component-title">API key</span>
|
||||
<span class="component-desc">
|
||||
<input type="text" name="${curNzbProvider.getID()}_api_key" value="$curNzbProvider.api_key" class="form-control input-sm input350" />
|
||||
<input type="text" name="${curNzbProvider.getID()}_api_key" value="<%= starify(curNzbProvider.api_key) %>" class="form-control input-sm input350" />
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
@ -361,7 +361,7 @@
|
|||
<label for="${curTorrentProvider.getID()}_api_key">
|
||||
<span class="component-title">Api key:</span>
|
||||
<span class="component-desc">
|
||||
<input type="text" name="${curTorrentProvider.getID()}_api_key" id="${curTorrentProvider.getID()}_api_key" value="$curTorrentProvider.api_key" class="form-control input-sm input350" />
|
||||
<input type="text" name="${curTorrentProvider.getID()}_api_key" id="${curTorrentProvider.getID()}_api_key" value="<%= starify(curTorrentProvider.api_key) %>" class="form-control input-sm input350" />
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
@ -405,7 +405,7 @@
|
|||
<label for="${curTorrentProvider.getID()}_password">
|
||||
<span class="component-title">Password:</span>
|
||||
<span class="component-desc">
|
||||
<input type="password" name="${curTorrentProvider.getID()}_password" id="${curTorrentProvider.getID()}_password" value="$curTorrentProvider.password" class="form-control input-sm input350" />
|
||||
<input type="password" name="${curTorrentProvider.getID()}_password" id="${curTorrentProvider.getID()}_password" value="#echo '*' * len($curTorrentProvider.password)#" class="form-control input-sm input350" />
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
@ -416,7 +416,7 @@
|
|||
<label for="${curTorrentProvider.getID()}_passkey">
|
||||
<span class="component-title">Passkey:</span>
|
||||
<span class="component-desc">
|
||||
<input type="text" name="${curTorrentProvider.getID()}_passkey" id="${curTorrentProvider.getID()}_passkey" value="$curTorrentProvider.passkey" class="form-control input-sm input350" />
|
||||
<input type="text" name="${curTorrentProvider.getID()}_passkey" id="${curTorrentProvider.getID()}_passkey" value="<%= starify(curTorrentProvider.passkey) %>" class="form-control input-sm input350" />
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#import sickbeard
|
||||
#from sickbeard import clients
|
||||
#from sickbeard.helpers import starify
|
||||
|
||||
#set global $title = 'Config - Episode Search'
|
||||
#set global $header = 'Search Settings'
|
||||
|
||||
|
@ -214,7 +216,7 @@
|
|||
<label>
|
||||
<span class="component-title">SABnzbd password</span>
|
||||
<span class="component-desc">
|
||||
<input type="password" name="sab_password" id="sab_password" value="$sickbeard.SAB_PASSWORD" class="form-control input-sm input200" />
|
||||
<input type="password" name="sab_password" id="sab_password" value="#echo '*' * len($sickbeard.SAB_PASSWORD)#" class="form-control input-sm input200" />
|
||||
<p>(blank for none)</p>
|
||||
</span>
|
||||
</label>
|
||||
|
@ -224,7 +226,7 @@
|
|||
<label>
|
||||
<span class="component-title">SABnzbd API key</span>
|
||||
<span class="component-desc">
|
||||
<input type="text" name="sab_apikey" id="sab_apikey" value="$sickbeard.SAB_APIKEY" class="form-control input-sm input350" />
|
||||
<input type="text" name="sab_apikey" id="sab_apikey" value="<%= starify(sickbeard.SAB_APIKEY) %>" class="form-control input-sm input350" />
|
||||
<div class="clear-left"><p>locate at... SABnzbd Config -> General -> API Key</p></div>
|
||||
</span>
|
||||
</label>
|
||||
|
@ -278,7 +280,7 @@
|
|||
<label>
|
||||
<span class="component-title">NZBget password</span>
|
||||
<span class="component-desc">
|
||||
<input type="password" name="nzbget_password" id="nzbget_password" value="$sickbeard.NZBGET_PASSWORD" class="form-control input-sm input200" />
|
||||
<input type="password" name="nzbget_password" id="nzbget_password" value="#echo '*' * len($sickbeard.NZBGET_PASSWORD)#" class="form-control input-sm input200" />
|
||||
<p>locate in nzbget.conf (default:tegbzn6789)</p>
|
||||
</span>
|
||||
</label>
|
||||
|
@ -431,7 +433,7 @@
|
|||
<label>
|
||||
<span class="component-title" id="password_title">Client password</span>
|
||||
<span class="component-desc">
|
||||
<input type="password" name="torrent_password" id="torrent_password" value="$sickbeard.TORRENT_PASSWORD" class="form-control input-sm input200" />
|
||||
<input type="password" name="torrent_password" id="torrent_password" value="#echo '*' * len($sickbeard.TORRENT_PASSWORD)#" class="form-control input-sm input200" />
|
||||
<p>(blank for none)</p>
|
||||
</span>
|
||||
</label>
|
||||
|
|
|
@ -959,6 +959,17 @@ def anon_url(*url):
|
|||
return '' if None in url else '%s%s' % (sickbeard.ANON_REDIRECT, ''.join(str(s) for s in url))
|
||||
|
||||
|
||||
def starify(text, verify=False):
|
||||
"""
|
||||
Return text input string with either its latter half or its centre area (if 12 chars or more)
|
||||
replaced with asterisks. Useful for securely presenting api keys to a ui.
|
||||
|
||||
If verify is true, return true if text is a star block created text else return false.
|
||||
"""
|
||||
return ((('%s%s' % (text[:len(text) / 2], '*' * (len(text) / 2))),
|
||||
('%s%s%s' % (text[:4], '*' * (len(text) - 8), text[-4:])))[12 <= len(text)],
|
||||
set('*') == set((text[len(text) / 2:], text[4:-4])[12 <= len(text)]))[verify]
|
||||
|
||||
"""
|
||||
Encryption
|
||||
==========
|
||||
|
@ -1358,6 +1369,9 @@ def getURL(url, post_data=None, params=None, headers=None, timeout=30, session=N
|
|||
except requests.exceptions.Timeout, e:
|
||||
logger.log(u"Connection timed out " + str(e.message) + " while loading URL " + url, logger.WARNING)
|
||||
return
|
||||
except requests.exceptions.ReadTimeout, e:
|
||||
logger.log(u'Read timed out ' + str(e.message) + ' while loading URL ' + url, logger.WARNING)
|
||||
return
|
||||
except Exception:
|
||||
logger.log(u"Unknown exception while loading URL " + url + ": " + traceback.format_exc(), logger.WARNING)
|
||||
return
|
||||
|
|
|
@ -39,7 +39,7 @@ from sickbeard.common import Quality, Overview, statusStrings, qualityPresetStri
|
|||
from sickbeard.common import SNATCHED, UNAIRED, IGNORED, ARCHIVED, WANTED, FAILED
|
||||
from sickbeard.common import SD, HD720p, HD1080p
|
||||
from sickbeard.exceptions import ex
|
||||
from sickbeard.helpers import remove_article
|
||||
from sickbeard.helpers import remove_article, starify
|
||||
from sickbeard.scene_exceptions import get_scene_exceptions
|
||||
from sickbeard.scene_numbering import get_scene_numbering, set_scene_numbering, get_scene_numbering_for_show, \
|
||||
get_xem_numbering_for_show, get_scene_absolute_numbering_for_show, get_xem_absolute_numbering_for_show, \
|
||||
|
@ -580,6 +580,10 @@ class Home(MainHandler):
|
|||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
host = config.clean_url(host)
|
||||
if None is not password and set('*') == set(password):
|
||||
password = sickbeard.SAB_PASSWORD
|
||||
if None is not apikey and starify(apikey, True):
|
||||
apikey = sickbeard.SAB_APIKEY
|
||||
|
||||
connection, accesMsg = sab.getSabAccesMethod(host, username, password, apikey)
|
||||
if connection:
|
||||
|
@ -595,6 +599,8 @@ class Home(MainHandler):
|
|||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
host = config.clean_url(host)
|
||||
if None is not password and set('*') == set(password):
|
||||
password = sickbeard.TORRENT_PASSWORD
|
||||
|
||||
client = clients.getClientIstance(torrent_method)
|
||||
|
||||
|
@ -606,6 +612,8 @@ class Home(MainHandler):
|
|||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
host = config.clean_host(host, default_port=23053)
|
||||
if None is not password and set('*') == set(password):
|
||||
password = sickbeard.GROWL_PASSWORD
|
||||
|
||||
result = notifiers.growl_notifier.test_notify(host, password)
|
||||
if password is None or password == '':
|
||||
|
@ -621,6 +629,9 @@ class Home(MainHandler):
|
|||
def testProwl(self, prowl_api=None, prowl_priority=0):
|
||||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
if None is not prowl_api and starify(prowl_api, True):
|
||||
prowl_api = sickbeard.PROWL_API
|
||||
|
||||
result = notifiers.prowl_notifier.test_notify(prowl_api, prowl_priority)
|
||||
if result:
|
||||
return 'Test prowl notice sent successfully'
|
||||
|
@ -630,6 +641,9 @@ class Home(MainHandler):
|
|||
def testBoxcar2(self, accesstoken=None, sound=None):
|
||||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
if None is not accesstoken and starify(accesstoken, True):
|
||||
accesstoken = sickbeard.BOXCAR2_ACCESSTOKEN
|
||||
|
||||
result = notifiers.boxcar2_notifier.test_notify(accesstoken, sound)
|
||||
if result:
|
||||
return 'Boxcar2 notification succeeded. Check your Boxcar2 clients to make sure it worked'
|
||||
|
@ -639,6 +653,12 @@ class Home(MainHandler):
|
|||
def testPushover(self, userKey=None, apiKey=None):
|
||||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
if None is not userKey and starify(userKey, True):
|
||||
userKey = sickbeard.PUSHOVER_USERKEY
|
||||
|
||||
if None is not apiKey and starify(apiKey, True):
|
||||
apiKey = sickbeard.PUSHOVER_APIKEY
|
||||
|
||||
result = notifiers.pushover_notifier.test_notify(userKey, apiKey)
|
||||
if result:
|
||||
return 'Pushover notification succeeded. Check your Pushover clients to make sure it worked'
|
||||
|
@ -673,6 +693,9 @@ class Home(MainHandler):
|
|||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
host = config.clean_hosts(host)
|
||||
if None is not password and set('*') == set(password):
|
||||
password = sickbeard.XBMC_PASSWORD
|
||||
|
||||
finalResult = ''
|
||||
for curHost in [x.strip() for x in host.split(',')]:
|
||||
curResult = notifiers.xbmc_notifier.test_notify(urllib.unquote_plus(curHost), username, password)
|
||||
|
@ -687,6 +710,9 @@ class Home(MainHandler):
|
|||
def testPMC(self, host=None, username=None, password=None):
|
||||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
if None is not password and set('*') == set(password):
|
||||
password = sickbeard.PLEX_PASSWORD
|
||||
|
||||
finalResult = ''
|
||||
for curHost in [x.strip() for x in host.split(',')]:
|
||||
curResult = notifiers.plex_notifier.test_notify_pmc(urllib.unquote_plus(curHost), username, password)
|
||||
|
@ -703,6 +729,9 @@ class Home(MainHandler):
|
|||
def testPMS(self, host=None, username=None, password=None):
|
||||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
if None is not password and set('*') == set(password):
|
||||
password = sickbeard.PLEX_PASSWORD
|
||||
|
||||
finalResult = ''
|
||||
|
||||
curResult = notifiers.plex_notifier.test_notify_pms(urllib.unquote_plus(host), username, password)
|
||||
|
@ -770,6 +799,11 @@ class Home(MainHandler):
|
|||
def testTrakt(self, api=None, username=None, password=None):
|
||||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
if None is not api and starify(api, True):
|
||||
api = sickbeard.TRAKT_API
|
||||
if None is not password and set('*') == set(password):
|
||||
password = sickbeard.TRAKT_PASSWORD
|
||||
|
||||
result = notifiers.trakt_notifier.test_notify(api, username, password)
|
||||
if result:
|
||||
return 'Test notice sent successfully to Trakt'
|
||||
|
@ -793,7 +827,10 @@ class Home(MainHandler):
|
|||
def testEmail(self, host=None, port=None, smtp_from=None, use_tls=None, user=None, pwd=None, to=None):
|
||||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
if None is not pwd and set('*') == set(pwd):
|
||||
pwd = sickbeard.EMAIL_PASSWORD
|
||||
host = config.clean_host(host)
|
||||
|
||||
if notifiers.email_notifier.test_notify(host, port, smtp_from, use_tls, user, pwd, to):
|
||||
return 'Test email sent successfully! Check inbox.'
|
||||
else:
|
||||
|
@ -802,6 +839,9 @@ class Home(MainHandler):
|
|||
def testNMA(self, nma_api=None, nma_priority=0):
|
||||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
if None is not nma_api and starify(nma_api, True):
|
||||
nma_api = sickbeard.NMA_API
|
||||
|
||||
result = notifiers.nma_notifier.test_notify(nma_api, nma_priority)
|
||||
if result:
|
||||
return 'Test NMA notice sent successfully'
|
||||
|
@ -811,6 +851,9 @@ class Home(MainHandler):
|
|||
def testPushalot(self, authorizationToken=None):
|
||||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
if None is not authorizationToken and starify(authorizationToken, True):
|
||||
authorizationToken = sickbeard.PUSHALOT_AUTHORIZATIONTOKEN
|
||||
|
||||
result = notifiers.pushalot_notifier.test_notify(authorizationToken)
|
||||
if result:
|
||||
return 'Pushalot notification succeeded. Check your Pushalot clients to make sure it worked'
|
||||
|
@ -820,6 +863,9 @@ class Home(MainHandler):
|
|||
def testPushbullet(self, accessToken=None, device_iden=None):
|
||||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
if None is not accessToken and starify(accessToken, True):
|
||||
accessToken = sickbeard.PUSHBULLET_ACCESS_TOKEN
|
||||
|
||||
result = notifiers.pushbullet_notifier.test_notify(accessToken, device_iden)
|
||||
if result:
|
||||
return 'Pushbullet notification succeeded. Check your device to make sure it worked'
|
||||
|
@ -829,6 +875,9 @@ class Home(MainHandler):
|
|||
def getPushbulletDevices(self, accessToken=None):
|
||||
self.set_header('Cache-Control', 'max-age=0,no-cache,no-store')
|
||||
|
||||
if None is not accessToken and starify(accessToken, True):
|
||||
accessToken = sickbeard.PUSHBULLET_ACCESS_TOKEN
|
||||
|
||||
result = notifiers.pushbullet_notifier.get_devices(accessToken)
|
||||
if result:
|
||||
return result
|
||||
|
@ -3272,6 +3321,7 @@ class ConfigGeneral(Config):
|
|||
# sickbeard.WEB_LOG is set in config.change_LOG_DIR()
|
||||
sickbeard.ENCRYPTION_VERSION = config.checkbox_to_value(encryption_version)
|
||||
sickbeard.WEB_USERNAME = web_username
|
||||
if set('*') != set(web_password):
|
||||
sickbeard.WEB_PASSWORD = web_password
|
||||
|
||||
sickbeard.FUZZY_DATING = config.checkbox_to_value(fuzzy_dating)
|
||||
|
@ -3372,12 +3422,16 @@ class ConfigSearch(Config):
|
|||
sickbeard.ALLOW_HIGH_PRIORITY = config.checkbox_to_value(allow_high_priority)
|
||||
|
||||
sickbeard.SAB_USERNAME = sab_username
|
||||
if set('*') != set(sab_password):
|
||||
sickbeard.SAB_PASSWORD = sab_password
|
||||
sickbeard.SAB_APIKEY = sab_apikey.strip()
|
||||
key = sab_apikey.strip()
|
||||
if not starify(key, True):
|
||||
sickbeard.SAB_APIKEY = key
|
||||
sickbeard.SAB_CATEGORY = sab_category
|
||||
sickbeard.SAB_HOST = config.clean_url(sab_host)
|
||||
|
||||
sickbeard.NZBGET_USERNAME = nzbget_username
|
||||
if set('*') != set(nzbget_password):
|
||||
sickbeard.NZBGET_PASSWORD = nzbget_password
|
||||
sickbeard.NZBGET_CATEGORY = nzbget_category
|
||||
sickbeard.NZBGET_HOST = config.clean_host(nzbget_host)
|
||||
|
@ -3385,6 +3439,7 @@ class ConfigSearch(Config):
|
|||
sickbeard.NZBGET_PRIORITY = config.to_int(nzbget_priority, default=100)
|
||||
|
||||
sickbeard.TORRENT_USERNAME = torrent_username
|
||||
if set('*') != set(torrent_password):
|
||||
sickbeard.TORRENT_PASSWORD = torrent_password
|
||||
sickbeard.TORRENT_LABEL = torrent_label
|
||||
sickbeard.TORRENT_VERIFY_CERT = config.checkbox_to_value(torrent_verify_cert)
|
||||
|
@ -3759,6 +3814,9 @@ class ConfigProviders(Config):
|
|||
cur_name, cur_url, cur_key, cur_cat = curNewznabProviderStr.split('|')
|
||||
cur_url = config.clean_url(cur_url)
|
||||
|
||||
if starify(cur_key, True):
|
||||
cur_key = ''
|
||||
|
||||
newProvider = newznab.NewznabProvider(cur_name, cur_url, key=cur_key)
|
||||
|
||||
cur_id = newProvider.getID()
|
||||
|
@ -3767,6 +3825,7 @@ class ConfigProviders(Config):
|
|||
if cur_id in newznabProviderDict:
|
||||
newznabProviderDict[cur_id].name = cur_name
|
||||
newznabProviderDict[cur_id].url = cur_url
|
||||
if cur_key:
|
||||
newznabProviderDict[cur_id].key = cur_key
|
||||
newznabProviderDict[cur_id].catIDs = cur_cat
|
||||
# a 0 in the key spot indicates that no key is needed
|
||||
|
@ -3820,6 +3879,9 @@ class ConfigProviders(Config):
|
|||
curName, curURL, curCookies = curTorrentRssProviderStr.split('|')
|
||||
curURL = config.clean_url(curURL, False)
|
||||
|
||||
if starify(curCookies, True):
|
||||
curCookies = ''
|
||||
|
||||
newProvider = rsstorrent.TorrentRssProvider(curName, curURL, curCookies)
|
||||
|
||||
curID = newProvider.getID()
|
||||
|
@ -3828,6 +3890,7 @@ class ConfigProviders(Config):
|
|||
if curID in torrentRssProviderDict:
|
||||
torrentRssProviderDict[curID].name = curName
|
||||
torrentRssProviderDict[curID].url = curURL
|
||||
if curCookies:
|
||||
torrentRssProviderDict[curID].cookies = curCookies
|
||||
else:
|
||||
sickbeard.torrentRssProviderList.append(newProvider)
|
||||
|
@ -3885,13 +3948,17 @@ class ConfigProviders(Config):
|
|||
|
||||
if hasattr(curTorrentProvider, 'hash'):
|
||||
try:
|
||||
curTorrentProvider.hash = str(kwargs[curTorrentProvider.getID() + '_hash']).strip()
|
||||
key = str(kwargs[curTorrentProvider.getID() + '_hash']).strip()
|
||||
if not starify(key, True):
|
||||
curTorrentProvider.hash = key
|
||||
except:
|
||||
curTorrentProvider.hash = None
|
||||
|
||||
if hasattr(curTorrentProvider, 'api_key'):
|
||||
try:
|
||||
curTorrentProvider.api_key = str(kwargs[curTorrentProvider.getID() + '_api_key']).strip()
|
||||
key = str(kwargs[curTorrentProvider.getID() + '_api_key']).strip()
|
||||
if not starify(key, True):
|
||||
curTorrentProvider.api_key = key
|
||||
except:
|
||||
curTorrentProvider.api_key = None
|
||||
|
||||
|
@ -3903,13 +3970,17 @@ class ConfigProviders(Config):
|
|||
|
||||
if hasattr(curTorrentProvider, 'password'):
|
||||
try:
|
||||
curTorrentProvider.password = str(kwargs[curTorrentProvider.getID() + '_password']).strip()
|
||||
key = str(kwargs[curTorrentProvider.getID() + '_password']).strip()
|
||||
if set('*') != set(key):
|
||||
curTorrentProvider.password = key
|
||||
except:
|
||||
curTorrentProvider.password = None
|
||||
|
||||
if hasattr(curTorrentProvider, 'passkey'):
|
||||
try:
|
||||
curTorrentProvider.passkey = str(kwargs[curTorrentProvider.getID() + '_passkey']).strip()
|
||||
key = str(kwargs[curTorrentProvider.getID() + '_passkey']).strip()
|
||||
if not starify(key, True):
|
||||
curTorrentProvider.passkey = key
|
||||
except:
|
||||
curTorrentProvider.passkey = None
|
||||
|
||||
|
@ -3972,7 +4043,9 @@ class ConfigProviders(Config):
|
|||
|
||||
if hasattr(curNzbProvider, 'api_key'):
|
||||
try:
|
||||
curNzbProvider.api_key = str(kwargs[curNzbProvider.getID() + '_api_key']).strip()
|
||||
key = str(kwargs[curNzbProvider.getID() + '_api_key']).strip()
|
||||
if not starify(key, True):
|
||||
curNzbProvider.api_key = key
|
||||
except:
|
||||
curNzbProvider.api_key = None
|
||||
|
||||
|
@ -4086,6 +4159,7 @@ class ConfigNotifications(Config):
|
|||
sickbeard.XBMC_UPDATE_ONLYFIRST = config.checkbox_to_value(xbmc_update_onlyfirst)
|
||||
sickbeard.XBMC_HOST = config.clean_hosts(xbmc_host)
|
||||
sickbeard.XBMC_USERNAME = xbmc_username
|
||||
if set('*') != set(xbmc_password):
|
||||
sickbeard.XBMC_PASSWORD = xbmc_password
|
||||
|
||||
sickbeard.USE_PLEX = config.checkbox_to_value(use_plex)
|
||||
|
@ -4096,6 +4170,7 @@ class ConfigNotifications(Config):
|
|||
sickbeard.PLEX_HOST = config.clean_hosts(plex_host)
|
||||
sickbeard.PLEX_SERVER_HOST = config.clean_hosts(plex_server_host)
|
||||
sickbeard.PLEX_USERNAME = plex_username
|
||||
if set('*') != set(plex_password):
|
||||
sickbeard.PLEX_PASSWORD = plex_password
|
||||
|
||||
sickbeard.USE_GROWL = config.checkbox_to_value(use_growl)
|
||||
|
@ -4103,13 +4178,16 @@ class ConfigNotifications(Config):
|
|||
sickbeard.GROWL_NOTIFY_ONDOWNLOAD = config.checkbox_to_value(growl_notify_ondownload)
|
||||
sickbeard.GROWL_NOTIFY_ONSUBTITLEDOWNLOAD = config.checkbox_to_value(growl_notify_onsubtitledownload)
|
||||
sickbeard.GROWL_HOST = config.clean_host(growl_host, default_port=23053)
|
||||
if set('*') != set(growl_password):
|
||||
sickbeard.GROWL_PASSWORD = growl_password
|
||||
|
||||
sickbeard.USE_PROWL = config.checkbox_to_value(use_prowl)
|
||||
sickbeard.PROWL_NOTIFY_ONSNATCH = config.checkbox_to_value(prowl_notify_onsnatch)
|
||||
sickbeard.PROWL_NOTIFY_ONDOWNLOAD = config.checkbox_to_value(prowl_notify_ondownload)
|
||||
sickbeard.PROWL_NOTIFY_ONSUBTITLEDOWNLOAD = config.checkbox_to_value(prowl_notify_onsubtitledownload)
|
||||
sickbeard.PROWL_API = prowl_api
|
||||
key = prowl_api.strip()
|
||||
if not starify(key, True):
|
||||
sickbeard.PROWL_API = key
|
||||
sickbeard.PROWL_PRIORITY = prowl_priority
|
||||
|
||||
sickbeard.USE_TWITTER = config.checkbox_to_value(use_twitter)
|
||||
|
@ -4121,15 +4199,21 @@ class ConfigNotifications(Config):
|
|||
sickbeard.BOXCAR2_NOTIFY_ONSNATCH = config.checkbox_to_value(boxcar2_notify_onsnatch)
|
||||
sickbeard.BOXCAR2_NOTIFY_ONDOWNLOAD = config.checkbox_to_value(boxcar2_notify_ondownload)
|
||||
sickbeard.BOXCAR2_NOTIFY_ONSUBTITLEDOWNLOAD = config.checkbox_to_value(boxcar2_notify_onsubtitledownload)
|
||||
sickbeard.BOXCAR2_ACCESSTOKEN = boxcar2_accesstoken
|
||||
key = boxcar2_accesstoken.strip()
|
||||
if not starify(key, True):
|
||||
sickbeard.BOXCAR2_ACCESSTOKEN = key
|
||||
sickbeard.BOXCAR2_SOUND = boxcar2_sound
|
||||
|
||||
sickbeard.USE_PUSHOVER = config.checkbox_to_value(use_pushover)
|
||||
sickbeard.PUSHOVER_NOTIFY_ONSNATCH = config.checkbox_to_value(pushover_notify_onsnatch)
|
||||
sickbeard.PUSHOVER_NOTIFY_ONDOWNLOAD = config.checkbox_to_value(pushover_notify_ondownload)
|
||||
sickbeard.PUSHOVER_NOTIFY_ONSUBTITLEDOWNLOAD = config.checkbox_to_value(pushover_notify_onsubtitledownload)
|
||||
sickbeard.PUSHOVER_USERKEY = pushover_userkey
|
||||
sickbeard.PUSHOVER_APIKEY = pushover_apikey
|
||||
key = pushover_userkey.strip()
|
||||
if not starify(key, True):
|
||||
sickbeard.PUSHOVER_USERKEY = key
|
||||
key = pushover_apikey.strip()
|
||||
if not starify(key, True):
|
||||
sickbeard.PUSHOVER_APIKEY = key
|
||||
|
||||
sickbeard.USE_LIBNOTIFY = config.checkbox_to_value(use_libnotify)
|
||||
sickbeard.LIBNOTIFY_NOTIFY_ONSNATCH = config.checkbox_to_value(libnotify_notify_onsnatch)
|
||||
|
@ -4156,8 +4240,11 @@ class ConfigNotifications(Config):
|
|||
|
||||
sickbeard.USE_TRAKT = config.checkbox_to_value(use_trakt)
|
||||
sickbeard.TRAKT_USERNAME = trakt_username
|
||||
if set('*') != set(trakt_password):
|
||||
sickbeard.TRAKT_PASSWORD = trakt_password
|
||||
sickbeard.TRAKT_API = trakt_api
|
||||
key = trakt_api.strip()
|
||||
if not starify(key, True):
|
||||
sickbeard.TRAKT_API = key
|
||||
sickbeard.TRAKT_REMOVE_WATCHLIST = config.checkbox_to_value(trakt_remove_watchlist)
|
||||
sickbeard.TRAKT_REMOVE_SERIESLIST = config.checkbox_to_value(trakt_remove_serieslist)
|
||||
sickbeard.TRAKT_USE_WATCHLIST = config.checkbox_to_value(trakt_use_watchlist)
|
||||
|
@ -4181,6 +4268,7 @@ class ConfigNotifications(Config):
|
|||
sickbeard.EMAIL_FROM = email_from
|
||||
sickbeard.EMAIL_TLS = config.checkbox_to_value(email_tls)
|
||||
sickbeard.EMAIL_USER = email_user
|
||||
if set('*') != set(email_password):
|
||||
sickbeard.EMAIL_PASSWORD = email_password
|
||||
sickbeard.EMAIL_LIST = email_list
|
||||
|
||||
|
@ -4197,20 +4285,26 @@ class ConfigNotifications(Config):
|
|||
sickbeard.NMA_NOTIFY_ONSNATCH = config.checkbox_to_value(nma_notify_onsnatch)
|
||||
sickbeard.NMA_NOTIFY_ONDOWNLOAD = config.checkbox_to_value(nma_notify_ondownload)
|
||||
sickbeard.NMA_NOTIFY_ONSUBTITLEDOWNLOAD = config.checkbox_to_value(nma_notify_onsubtitledownload)
|
||||
sickbeard.NMA_API = nma_api
|
||||
key = nma_api.strip()
|
||||
if not starify(key, True):
|
||||
sickbeard.NMA_API = key
|
||||
sickbeard.NMA_PRIORITY = nma_priority
|
||||
|
||||
sickbeard.USE_PUSHALOT = config.checkbox_to_value(use_pushalot)
|
||||
sickbeard.PUSHALOT_NOTIFY_ONSNATCH = config.checkbox_to_value(pushalot_notify_onsnatch)
|
||||
sickbeard.PUSHALOT_NOTIFY_ONDOWNLOAD = config.checkbox_to_value(pushalot_notify_ondownload)
|
||||
sickbeard.PUSHALOT_NOTIFY_ONSUBTITLEDOWNLOAD = config.checkbox_to_value(pushalot_notify_onsubtitledownload)
|
||||
sickbeard.PUSHALOT_AUTHORIZATIONTOKEN = pushalot_authorizationtoken
|
||||
key = pushalot_authorizationtoken.strip()
|
||||
if not starify(key, True):
|
||||
sickbeard.PUSHALOT_AUTHORIZATIONTOKEN = key
|
||||
|
||||
sickbeard.USE_PUSHBULLET = config.checkbox_to_value(use_pushbullet)
|
||||
sickbeard.PUSHBULLET_NOTIFY_ONSNATCH = config.checkbox_to_value(pushbullet_notify_onsnatch)
|
||||
sickbeard.PUSHBULLET_NOTIFY_ONDOWNLOAD = config.checkbox_to_value(pushbullet_notify_ondownload)
|
||||
sickbeard.PUSHBULLET_NOTIFY_ONSUBTITLEDOWNLOAD = config.checkbox_to_value(pushbullet_notify_onsubtitledownload)
|
||||
sickbeard.PUSHBULLET_ACCESS_TOKEN = pushbullet_access_token
|
||||
key = pushbullet_access_token.strip()
|
||||
if not starify(key, True):
|
||||
sickbeard.PUSHBULLET_ACCESS_TOKEN = key
|
||||
sickbeard.PUSHBULLET_DEVICE_IDEN = pushbullet_device_iden
|
||||
|
||||
sickbeard.save_config()
|
||||
|
@ -4297,6 +4391,7 @@ class ConfigAnime(Config):
|
|||
|
||||
sickbeard.USE_ANIDB = config.checkbox_to_value(use_anidb)
|
||||
sickbeard.ANIDB_USERNAME = anidb_username
|
||||
if set('*') != set(anidb_password):
|
||||
sickbeard.ANIDB_PASSWORD = anidb_password
|
||||
sickbeard.ANIDB_USE_MYLIST = config.checkbox_to_value(anidb_use_mylist)
|
||||
sickbeard.ANIME_SPLIT_HOME = config.checkbox_to_value(split_home)
|
||||
|
|
Loading…
Reference in a new issue