Commit 8ee962a2 authored by echel0n's avatar echel0n
Browse files

Pre-Release v9.3.35.dev2

parent bcdcce3b
# Changelog
- * 5a118a8 - 2018-06-16: Pre-Release v9.3.35.dev1
- * 38a9d72 - 2018-06-16: Pre-Release v9.3.35.dev2
- * bcdcce3 - 2018-06-16: Pre-Release v9.3.35.dev1
- * 8f7a4e2 - 2018-06-16: Added UPNP functionality to app
- * 2eef0d8 - 2018-06-16: Fixed requirements issues
- * f316113 - 2018-06-11: Changed placement of announcement's for main layout
......
......@@ -140,6 +140,7 @@ class Core(object):
self.trakt_searcher = None
self.subtitle_searcher = None
self.auto_postprocessor = None
self.upnp_client = None
def start(self):
self.started = True
......@@ -174,7 +175,6 @@ class Core(object):
self.trakt_searcher = TraktSearcher()
self.subtitle_searcher = SubtitleSearcher()
self.auto_postprocessor = AutoPostProcessor()
self.upnp_client = UPNPClient()
# Check if we need to perform a restore first
if os.path.exists(os.path.abspath(os.path.join(self.data_dir, 'restore'))):
......@@ -439,7 +439,9 @@ class Core(object):
self.postprocessor_queue.start()
# start upnp client
self.upnp_client.start()
if self.config.enable_upnp:
self.upnp_client = UPNPClient()
self.upnp_client.start()
# start webserver
self.wserver.start()
......@@ -455,6 +457,7 @@ class Core(object):
if self.wserver:
self.wserver.shutdown()
# shutdown upnp client
if self.upnp_client:
self.upnp_client.shutdown()
......
......@@ -65,6 +65,7 @@ class Config(object):
self.api_username = ""
self.api_password = ""
self.enable_upnp = True
self.version_notify = True
self.auto_update = True
self.notify_on_update = True
......@@ -709,6 +710,7 @@ class Config(object):
'web_cookie_secret': generateCookieSecret(),
'ssl_verify': True,
'encryption_secret': generateCookieSecret(),
'enable_upnp': True,
'version_notify': True,
'web_root': '',
'add_shows_wo_dir': False,
......@@ -1400,6 +1402,7 @@ class Config(object):
self.quality_default = self.check_setting_int('General', 'quality_default')
self.status_default = self.check_setting_int('General', 'status_default')
self.status_default_after = self.check_setting_int('General', 'status_default_after')
self.enable_upnp = self.check_setting_bool('General', 'enable_upnp')
self.version_notify = self.check_setting_bool('General', 'version_notify')
self.auto_update = self.check_setting_bool('General', 'auto_update')
self.notify_on_update = self.check_setting_bool('General', 'notify_on_update')
......@@ -1910,6 +1913,7 @@ class Config(object):
'anime_default': int(self.anime_default),
'scene_default': int(self.scene_default),
'skip_downloaded_default': int(self.skip_downloaded_default),
'enable_upnp': int(self.enable_upnp),
'version_notify': int(self.version_notify),
'auto_update': int(self.auto_update),
'notify_on_update': int(self.notify_on_update),
......
......@@ -55,16 +55,16 @@ class UPNPClient(threading.Thread):
# didn't clean it up after it expired or it has been configured by other piece
# of software, either way we should not override it.
# https://tools.ietf.org/id/draft-ietf-pcp-upnp-igd-interworking-07.html#errors
sickrage.app.log.debug("UPNP port mapping already configured, not overriding it")
sickrage.app.log.debug("UPnP port mapping already configured, not overriding it")
else:
sickrage.app.log.exception("Failed to setup UPNP portmap")
sickrage.app.log.exception("Failed to setup UPnP portmap")
except Exception:
sickrage.app.log.exception("Failed to setup UPNP portmap")
sickrage.app.log.exception("Failed to setup UPnP portmap")
def _add_nat_portmap(self, upnp_dev):
internal_ip = self._find_internal_ip_on_device_network(upnp_dev)
if internal_ip is None:
sickrage.app.log.warn("Unable to detect internal IP address in order to setup UPNP portmap")
sickrage.app.log.warn("Unable to detect internal IP address in order to setup UPnP portmap")
return
for protocol, description in [('TCP', 'SiCKRAGE')]:
......@@ -79,7 +79,7 @@ class UPNPClient(threading.Thread):
NewLeaseDuration=self._nat_portmap_lifetime,
)
sickrage.app.log.debug("UPNP port forwarding successfully setup")
sickrage.app.log.debug("UPnP port forwarding successfully setup")
def delete_nat_portmap(self):
upnp_dev = self._discover_upnp_device()
......@@ -90,7 +90,7 @@ class UPNPClient(threading.Thread):
def _delete_nat_portmap(self, upnp_dev):
internal_ip = self._find_internal_ip_on_device_network(upnp_dev)
if internal_ip is None:
sickrage.app.log.warn("Unable to detect internal IP address in order to delete UPNP portmap")
sickrage.app.log.warn("Unable to detect internal IP address in order to delete UPnP portmap")
return
for protocol, description in [('TCP', 'SiCKRAGE')]:
......@@ -100,7 +100,7 @@ class UPNPClient(threading.Thread):
NewProtocol=protocol,
)
sickrage.app.log.debug("UPNP port forwarding successfully deleted")
sickrage.app.log.debug("UPnP port forwarding successfully deleted")
def _discover_upnp_device(self):
devices = upnpclient.discover()
......
......@@ -3790,7 +3790,7 @@ class ConfigGeneral(Config):
indexer_timeout=None, download_url=None, rootDir=None, theme_name=None, default_page=None,
git_reset=None, git_username=None, git_password=None, git_autoissues=None, gui_language=None,
display_all_seasons=None, showupdate_stale=None, notify_on_login=None, api_username=None,
api_password=None, use_api=None, enable_api_providers_cache=None, **kwargs):
api_password=None, use_api=None, enable_api_providers_cache=None, enable_upnp=None, **kwargs):
results = []
......@@ -3847,6 +3847,7 @@ class ConfigGeneral(Config):
sickrage.app.config.web_port = try_int(web_port)
sickrage.app.config.web_ipv6 = checkbox_to_value(web_ipv6)
sickrage.app.config.enable_upnp = checkbox_to_value(enable_upnp)
sickrage.app.config.encryption_version = (0, 2)[checkbox_to_value(encryption_version) == 1]
sickrage.app.config.web_username = web_username
sickrage.app.config.web_password = web_password
......
......@@ -835,7 +835,17 @@
</div>
<div class="row field-pair">
<div class="col-lg-3 col-md-4 col-sm-5 col-xs-12">
<label class="component-title">${_('Enable UPnP')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 col-xs-12 component-desc">
<input type="checkbox" name="enable_upnp"
id="enable_upnp" ${('', 'checked')[bool(sickrage.app.config.enable_upnp)]}/>
<label for="enable_upnp">${_('automatically sets up port-forwarding from external IP to SiCKRAGE')}</label>
</div>
</div>
<div class="row field-pair">
<div class="col-lg-3 col-md-4 col-sm-5 col-xs-12">
<label class="component-title">${_('Listen on IPv6')}</label>
</div>
......@@ -844,7 +854,6 @@
id="web_ipv6" ${('', 'checked')[bool(sickrage.app.config.web_ipv6)]}/>
<label for="web_ipv6">${_('attempt binding to any available IPv6 address')}</label>
</div>
</div>
<div class="row field-pair">
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment