Commit c17dc551 authored by echel0n's avatar echel0n

Removed ability to set web host from settings in UI, constrained to only setting from cli.

parent 8d1a3e96
......@@ -332,8 +332,6 @@ class Core(object):
self.config.general.web_port = self.web_port
if self.web_root:
self.config.general.web_root = self.web_root
if self.web_host:
self.config.general.web_host = self.web_host
# set language
change_gui_lang(self.config.gui.gui_lang)
......
......@@ -674,7 +674,6 @@ class Config(object):
field_type=str)
self.general.git_reset = self._get_config_file_value(config_object, 'General', 'git_reset', default=self.general.git_reset, field_type=bool)
self.general.web_port = self._get_config_file_value(config_object, 'General', 'web_port', default=self.general.web_port, field_type=int)
self.general.web_host = self._get_config_file_value(config_object, 'General', 'web_host', default=self.general.web_host, field_type=str)
self.general.web_log = self._get_config_file_value(config_object, 'General', 'web_log', default=self.general.web_log, field_type=str)
self.general.web_external_port = self._get_config_file_value(config_object, 'General', 'web_external_port', default=self.general.web_external_port,
field_type=int)
......
......@@ -213,7 +213,7 @@ class SRDatabase(object):
table = metadata.tables.get('series_provider_mapping')
table.drop(self.engine)
sickrage.app.log.info(f'Backing up {self.name} database')
sickrage.app.log.info(f'Backing up {self.name} database v{db_version}')
self.backup(backup_filename)
sickrage.app.log.info(f'Upgrading {self.name} database to v{alembic_version}')
......
......@@ -212,7 +212,6 @@ class ConfigDB(SRDatabase):
naming_custom_anime = Column(Boolean, default=False)
naming_anime_pattern = Column(Text, default='Season %0S/%SN - S%0SE%0E - %EN')
randomize_providers = Column(Boolean, default=False)
web_host = Column(Text, default='0.0.0.0')
process_automatically = Column(Boolean, default=False)
git_path = Column(Text, default='git')
sync_files = Column(Text, default=','.join(['!sync', 'lftp-pget-status', 'part', 'bts', '!qb']))
......
"""Initial migration
Revision ID: 1
Revises:
Create Date: 2017-12-29 14:39:27.854291
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '2'
down_revision = '1'
def upgrade():
with op.batch_alter_table('general') as batch_op:
batch_op.drop_column('web_host')
def downgrade():
pass
......@@ -24,9 +24,4 @@ def upgrade():
def downgrade():
conn = op.get_bind()
meta = sa.MetaData(bind=conn)
tv_shows = sa.Table('tv_shows', meta, autoload=True)
if hasattr(tv_shows.c, 'last_backlog_search'):
op.drop_column('tv_shows', 'last_backlog_search')
pass
......@@ -23,9 +23,4 @@ def upgrade():
def downgrade():
conn = op.get_bind()
meta = sa.MetaData(bind=conn)
tv_shows = sa.Table('tv_shows', meta, autoload=True)
if hasattr(tv_shows.c, 'last_proper_search'):
op.drop_column('tv_shows', 'last_proper_search')
pass
......@@ -23,9 +23,4 @@ def upgrade():
def downgrade():
conn = op.get_bind()
meta = sa.MetaData(bind=conn)
history = sa.Table('history', meta, autoload=True)
if hasattr(history.c, 'release_group'):
op.drop_column('history', 'release_group')
pass
......@@ -26,12 +26,4 @@ def upgrade():
def downgrade():
conn = op.get_bind()
meta = sa.MetaData(bind=conn)
tv_shows = sa.Table('tv_shows', meta, autoload=True)
if hasattr(tv_shows.c, 'scene_exceptions'):
op.drop_column('tv_shows', 'scene_exceptions')
if hasattr(tv_shows.c, 'last_scene_exceptions_refresh'):
op.drop_column('tv_shows', 'last_scene_exceptions_refresh')
pass
......@@ -1587,8 +1587,7 @@ def torrent_webui_url(reset=False):
sickrage.app.client_web_urls['torrent'] = ''
return sickrage.app.client_web_urls['torrent']
torrent_ui_url = re.sub('localhost|127.0.0.1', sickrage.app.config.general.web_host or get_lan_ip(),
sickrage.app.config.torrent.host or '', re.I)
torrent_ui_url = re.sub('localhost|127.0.0.1', sickrage.app.web_host or get_lan_ip(), sickrage.app.config.torrent.host or '', re.I)
def test_exists(url):
try:
......
......@@ -91,7 +91,7 @@ class UPNPClient(object):
NewExternalPort=sickrage.app.config.general.web_external_port,
NewProtocol=protocol,
NewInternalPort=sickrage.app.config.general.web_port,
NewInternalClient=sickrage.app.config.general.web_host,
NewInternalClient=sickrage.app.web_host or '0.0.0.0',
NewEnabled='1',
NewPortMappingDescription=description,
NewLeaseDuration=self._nat_portmap_lifetime,
......
......@@ -492,7 +492,7 @@ class WebServer(threading.Thread):
self.server = HTTPServer(self.app, ssl_options=ssl_ctx, xheaders=sickrage.app.config.general.handle_reverse_proxy)
try:
self.server.listen(sickrage.app.config.general.web_port, sickrage.app.config.general.web_host)
self.server.listen(sickrage.app.config.general.web_port, sickrage.app.web_host)
except socket.error as e:
sickrage.app.log.warning(e.strerror)
raise SystemExit
......@@ -501,7 +501,7 @@ class WebServer(threading.Thread):
if not sickrage.app.no_launch and sickrage.app.config.general.launch_browser:
sickrage.app.scheduler.add_job(launch_browser,
args=[('http', 'https')[sickrage.app.config.general.enable_https],
(sickrage.app.config.general.web_host, get_lan_ip())[sickrage.app.config.general.web_host == '0.0.0.0'],
(get_lan_ip(), sickrage.app.web_host)[sickrage.app.web_host != ''],
sickrage.app.config.general.web_port])
sickrage.app.log.info("SiCKRAGE :: STARTED")
......@@ -510,7 +510,7 @@ class WebServer(threading.Thread):
sickrage.app.log.info(f"SiCKRAGE :: DATABASE VERSION:[v{sickrage.app.main_db.version}]")
sickrage.app.log.info(f"SiCKRAGE :: DATABASE TYPE:[{sickrage.app.db_type}]")
sickrage.app.log.info(
f"SiCKRAGE :: URL:[{('http', 'https')[sickrage.app.config.general.enable_https]}://{(sickrage.app.config.general.web_host, get_lan_ip())[sickrage.app.config.general.web_host == '0.0.0.0']}:{sickrage.app.config.general.web_port}/{sickrage.app.config.general.web_root}]")
f"SiCKRAGE :: URL:[{('http', 'https')[sickrage.app.config.general.enable_https]}://{(get_lan_ip(), sickrage.app.web_host)[sickrage.app.web_host != '']}:{sickrage.app.config.general.web_port}/{sickrage.app.config.general.web_root}]")
self.io_loop.start()
......
......@@ -221,7 +221,6 @@ class SaveGeneralHandler(BaseHandler):
sickrage.app.config.general.strip_special_file_bits = checkbox_to_value(strip_special_file_bits)
sickrage.app.config.general.web_root = web_root
sickrage.app.config.general.web_host = web_host
sickrage.app.config.general.ip_whitelist_enabled = checkbox_to_value(ip_whitelist_enabled)
sickrage.app.config.general.ip_whitelist_localhost_enabled = checkbox_to_value(ip_whitelist_localhost_enabled)
......
......@@ -729,30 +729,6 @@ 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 web host')}</label>
</div>
<div class="col-lg-9 col-md-8 col-sm-7 component-desc">
<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_host" id="web_host"
value="${sickrage.app.config.general.web_host}"
placeholder="${'0.0.0.0'}"
title="${_('Web host SiCKRAGE server listens on for WebUI requests')}"
class="form-control"/>
</div>
</div>
</div>
</div>
</div>
<div class="form-row form-group">
<div class="col-lg-3 col-md-4 col-sm-5">
<label class="component-title">${_('HTTP web root')}</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