if no args, try to bind 80 and 443 as well

This commit is contained in:
ed 2021-10-29 23:01:07 +02:00
parent c69e8d5bf4
commit 19161425f3
4 changed files with 13 additions and 7 deletions

View file

@ -20,7 +20,7 @@ import threading
import traceback import traceback
from textwrap import dedent from textwrap import dedent
from .__init__ import E, WINDOWS, VT100, PY2, unicode from .__init__ import E, WINDOWS, ANYWIN, VT100, PY2, unicode
from .__version__ import S_VERSION, S_BUILD_DT, CODENAME from .__version__ import S_VERSION, S_BUILD_DT, CODENAME
from .svchub import SvcHub from .svchub import SvcHub
from .util import py_desc, align_tab, IMPLICATIONS, ansi_re from .util import py_desc, align_tab, IMPLICATIONS, ansi_re
@ -495,6 +495,12 @@ def main(argv=None):
argv[idx] = nk argv[idx] = nk
time.sleep(2) time.sleep(2)
try:
if len(argv) == 1 and (ANYWIN or not os.geteuid()):
argv.extend(["-p80,443,3923", "--ign-ebind"])
except:
pass
try: try:
al = run_argparse(argv, RiceFormatter) al = run_argparse(argv, RiceFormatter)
except AssertionError: except AssertionError:

View file

@ -1000,7 +1000,7 @@ class AuthSrv(object):
v, _ = vfs.get("/", "*", False, True) v, _ = vfs.get("/", "*", False, True)
if self.warn_anonwrite and os.getcwd() == v.realpath: if self.warn_anonwrite and os.getcwd() == v.realpath:
self.warn_anonwrite = False self.warn_anonwrite = False
msg = "anyone can read/write the current directory: {}" msg = "anyone can read/write the current directory: {}\n"
self.log(msg.format(v.realpath), c=1) self.log(msg.format(v.realpath), c=1)
except Pebkac: except Pebkac:
self.warn_anonwrite = True self.warn_anonwrite = True

View file

@ -104,16 +104,16 @@ class SvcHub(object):
if not failed: if not failed:
return return
m = "{}/{} workers failed to start"
m = m.format(failed, expected)
self.log("root", m, 1)
if self.args.ign_ebind_all: if self.args.ign_ebind_all:
return return
if self.args.ign_ebind and self.tcpsrv.srv: if self.args.ign_ebind and self.tcpsrv.srv:
return return
m = "{}/{} workers failed to start"
m = m.format(failed, expected)
self.log("root", m, 1)
self.retcode = 1 self.retcode = 1
os.kill(os.getpid(), signal.SIGTERM) os.kill(os.getpid(), signal.SIGTERM)

View file

@ -501,7 +501,7 @@ function Donut(uc, st) {
if (r.eta) { if (r.eta) {
if (r.eta < 10) { if (r.eta < 10) {
fg = '#f4b'; fg = '#fa0';
fsz = 72; fsz = 72;
} }
rc = 8; rc = 8;