From 19161425f3b3997a4022ede4d1c4e1ac0a280af6 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 29 Oct 2021 23:01:07 +0200 Subject: [PATCH] if no args, try to bind 80 and 443 as well --- copyparty/__main__.py | 8 +++++++- copyparty/authsrv.py | 2 +- copyparty/svchub.py | 8 ++++---- copyparty/web/up2k.js | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/copyparty/__main__.py b/copyparty/__main__.py index 0b2dd626..4d1786da 100644 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -20,7 +20,7 @@ import threading import traceback 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 .svchub import SvcHub from .util import py_desc, align_tab, IMPLICATIONS, ansi_re @@ -495,6 +495,12 @@ def main(argv=None): argv[idx] = nk time.sleep(2) + try: + if len(argv) == 1 and (ANYWIN or not os.geteuid()): + argv.extend(["-p80,443,3923", "--ign-ebind"]) + except: + pass + try: al = run_argparse(argv, RiceFormatter) except AssertionError: diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 76c0232e..e72dc0ce 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -1000,7 +1000,7 @@ class AuthSrv(object): v, _ = vfs.get("/", "*", False, True) if self.warn_anonwrite and os.getcwd() == v.realpath: 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) except Pebkac: self.warn_anonwrite = True diff --git a/copyparty/svchub.py b/copyparty/svchub.py index 1eef502a..b3a8522e 100644 --- a/copyparty/svchub.py +++ b/copyparty/svchub.py @@ -104,16 +104,16 @@ class SvcHub(object): if not failed: return - m = "{}/{} workers failed to start" - m = m.format(failed, expected) - self.log("root", m, 1) - if self.args.ign_ebind_all: return if self.args.ign_ebind and self.tcpsrv.srv: return + m = "{}/{} workers failed to start" + m = m.format(failed, expected) + self.log("root", m, 1) + self.retcode = 1 os.kill(os.getpid(), signal.SIGTERM) diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index d09f80de..36562a33 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -501,7 +501,7 @@ function Donut(uc, st) { if (r.eta) { if (r.eta < 10) { - fg = '#f4b'; + fg = '#fa0'; fsz = 72; } rc = 8;