Commit b04bc52a authored by echel0n's avatar echel0n

Added ability to set application URL web root from general interface settings

Added requirements-dev.txt as extra requirements in setup.py
parent 32beab22
......@@ -4,4 +4,4 @@ babel
wheel
tox
wheel
vcr_unittest
\ No newline at end of file
vcrpy-unittest
\ No newline at end of file
......@@ -10,11 +10,16 @@ def version():
return f.read()
def requires():
def requirements():
with open(os.path.abspath(os.path.join(os.path.dirname(__file__), 'requirements.txt'))) as f:
return f.read().splitlines()
def requirements_dev():
with open(os.path.abspath(os.path.join(os.path.dirname(__file__), 'requirements-dev.txt'))) as f:
return f.read().splitlines()
class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""
user_options = []
......@@ -58,7 +63,10 @@ setup(
url='https://git.sickrage.ca',
keywords=['sickrage', 'sickragetv', 'tv', 'torrent', 'nzb', 'video', 'echel0n'],
packages=['sickrage'],
install_requires=requires(),
install_requires=requirements(),
extras_require={
'dev': requirements_dev()
},
include_package_data=True,
python_requires='>=3',
platforms='any',
......
......@@ -93,8 +93,8 @@ class SaveAddShowDefaultsHandler(BaseHandler, ABC):
class SaveGeneralHandler(BaseHandler, ABC):
@authenticated
def post(self, *args, **kwargs):
log_nr = self.get_argument('log_nr', 5)
log_size = self.get_argument('log_size', 1048576)
log_nr = self.get_argument('log_nr', '5')
log_size = self.get_argument('log_size', '1048576')
web_port = self.get_argument('web_port', None)
web_ipv6 = self.get_argument('web_ipv6', None)
trash_remove_show = self.get_argument('trash_remove_show', None)
......@@ -104,7 +104,7 @@ class SaveGeneralHandler(BaseHandler, ABC):
indexerDefaultLang = self.get_argument('indexerDefaultLang', 'en')
ep_default_deleted_status = self.get_argument('ep_default_deleted_status', None)
launch_browser = self.get_argument('launch_browser', None)
showupdate_hour = self.get_argument('showupdate_hour', 3)
showupdate_hour = self.get_argument('showupdate_hour', '3')
api_key = self.get_argument('api_key', None)
indexer_default = self.get_argument('indexer_default', None)
timezone_display = self.get_argument('timezone_display', None)
......@@ -149,6 +149,7 @@ class SaveGeneralHandler(BaseHandler, ABC):
enable_upnp = self.get_argument('enable_upnp', None)
strip_special_file_bits = self.get_argument('strip_special_file_bits', None)
max_queue_workers = self.get_argument('max_queue_workers', None)
web_root = self.get_argument('web_root', '')
results = []
......@@ -212,6 +213,8 @@ class SaveGeneralHandler(BaseHandler, ABC):
sickrage.app.config.strip_special_file_bits = checkbox_to_value(strip_special_file_bits)
sickrage.app.config.web_root = web_root
# sickrage.app.config.change_web_external_port(web_external_port)
if date_preset:
......
......@@ -721,18 +721,6 @@ c<%inherit file="../layouts/config.mako"/>
</div>
<fieldset class="col-lg-9 col-md-8 col-sm-8 card-text">
<div class="form-row form-group">
<div class="col-lg-3 col-md-4 col-sm-5">
<label class="component-title">${_('Enable UPnP')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 component-desc">
<label for="enable_upnp">
<input type="checkbox" class="enabler toggle color-primary is-material" name="enable_upnp"
id="enable_upnp" ${('', 'checked')[bool(sickrage.app.config.enable_upnp)]}/>
${_('automatically sets up port-forwarding from external IP to SiCKRAGE')}
</label>
</div>
</div>
<div id="content_enable_upnp">
<div class="form-row form-group">
......@@ -799,14 +787,33 @@ c<%inherit file="../layouts/config.mako"/>
<div class="form-row form-group">
<div class="col-lg-3 col-md-4 col-sm-5">
<label class="component-title">${_('HTTP logs')}</label>
<label class="component-title">${_('HTTP web root')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 component-desc">
<label for="web_log">
<input type="checkbox" class="toggle color-primary is-material" name="web_log"
id="web_log" ${('', 'checked')[bool(sickrage.app.config.web_log)]}/>
${_('enable logs from the internal Tornado web server')}
</label>
<div class="form-row">
<div class="col-md-12">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">
<span class="fas fa-globe"></span>
</span>
</div>
<input name="web_root" id="web_root"
value="${sickrage.app.config.web_root}"
placeholder="${'/'}"
title="web root used in URL to browse and access WebUI"
class="form-control"/>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-12">
<label class="text-info" for="web_root">
${_('used in URL to access SiCKRAGE WebUI, DO NOT include a trailing slash at end.')}<br>
<b>${_('this option require a manual restart to take effect.')}</b>
</label>
</div>
</div>
</div>
</div>
......@@ -847,6 +854,32 @@ c<%inherit file="../layouts/config.mako"/>
</div>
</div>
<div class="form-row form-group">
<div class="col-lg-3 col-md-4 col-sm-5">
<label class="component-title">${_('HTTP logs')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 component-desc">
<label for="web_log">
<input type="checkbox" class="toggle color-primary is-material" name="web_log"
id="web_log" ${('', 'checked')[bool(sickrage.app.config.web_log)]}/>
${_('enable logs from the internal Tornado web server')}
</label>
</div>
</div>
<div class="form-row form-group">
<div class="col-lg-3 col-md-4 col-sm-5">
<label class="component-title">${_('Enable UPnP')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 component-desc">
<label for="enable_upnp">
<input type="checkbox" class="enabler toggle color-primary is-material" name="enable_upnp"
id="enable_upnp" ${('', 'checked')[bool(sickrage.app.config.enable_upnp)]}/>
${_('automatically sets up port-forwarding from external IP to SiCKRAGE')}
</label>
</div>
</div>
<div class="form-row form-group">
<div class="col-lg-3 col-md-4 col-sm-5">
<label class="component-title">${_('Listen on IPv6')}</label>
......
Markdown is supported
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