Browse Source

Allow setting inet_exposure from command line

Closes #1872
pull/1876/head
Safihre 4 years ago
parent
commit
b5ce0e0766
  1. 13
      SABnzbd.py

13
SABnzbd.py

@ -186,7 +186,7 @@ def print_help():
print(" -s --server <srv:port> Listen on server:port [*]") print(" -s --server <srv:port> Listen on server:port [*]")
print(" -t --templates <templ> Template directory [*]") print(" -t --templates <templ> Template directory [*]")
print() print()
print(" -l --logging <-1..2> Set logging level (-1=off, 0= least, 2= most) [*]") print(" -l --logging <-1..2> Set logging level (-1=off, 0=least,2= most) [*]")
print(" -w --weblogging Enable cherrypy access logging") print(" -w --weblogging Enable cherrypy access logging")
print() print()
print(" -b --browser <0..1> Auto browser launch (0= off, 1= on) [*]") print(" -b --browser <0..1> Auto browser launch (0= off, 1= on) [*]")
@ -206,6 +206,7 @@ def print_help():
print(" with full data reconstruction") print(" with full data reconstruction")
print(" --https <port> Port to use for HTTPS server") print(" --https <port> Port to use for HTTPS server")
print(" --ipv6_hosting <0|1> Listen on IPv6 address [::1] [*]") print(" --ipv6_hosting <0|1> Listen on IPv6 address [::1] [*]")
print(" --inet_exposure <0..5> Set external internet access [*]")
print(" --no-login Start with username and password reset") print(" --no-login Start with username and password reset")
print(" --log-all Log all article handling (for developers)") print(" --log-all Log all article handling (for developers)")
print(" --disable-file-log Logging is only written to console") print(" --disable-file-log Logging is only written to console")
@ -778,10 +779,9 @@ def commandline_handler():
"server=", "server=",
"templates", "templates",
"ipv6_hosting=", "ipv6_hosting=",
"template2", "inet_exposure=",
"browser=", "browser=",
"config-file=", "config-file=",
"force",
"disable-file-log", "disable-file-log",
"version", "version",
"https=", "https=",
@ -872,6 +872,7 @@ def main():
pid_file = None pid_file = None
new_instance = False new_instance = False
ipv6_hosting = None ipv6_hosting = None
inet_exposure = None
_service, sab_opts, _serv_opts, upload_nzbs = commandline_handler() _service, sab_opts, _serv_opts, upload_nzbs = commandline_handler()
@ -951,6 +952,8 @@ def main():
new_instance = True new_instance = True
elif opt == "--ipv6_hosting": elif opt == "--ipv6_hosting":
ipv6_hosting = arg ipv6_hosting = arg
elif opt == "--inet_exposure":
inet_exposure = arg
sabnzbd.MY_FULLNAME = os.path.normpath(os.path.abspath(sabnzbd.MY_FULLNAME)) sabnzbd.MY_FULLNAME = os.path.normpath(os.path.abspath(sabnzbd.MY_FULLNAME))
sabnzbd.MY_NAME = os.path.basename(sabnzbd.MY_FULLNAME) sabnzbd.MY_NAME = os.path.basename(sabnzbd.MY_FULLNAME)
@ -1362,6 +1365,10 @@ def main():
sabnzbd.cfg.username.set("") sabnzbd.cfg.username.set("")
sabnzbd.cfg.password.set("") sabnzbd.cfg.password.set("")
# Overwrite inet_exposure from command-line for VPS-setups
if inet_exposure:
sabnzbd.cfg.inet_exposure.set(inet_exposure)
mime_gzip = ( mime_gzip = (
"text/*", "text/*",
"application/javascript", "application/javascript",

Loading…
Cancel
Save