diff --git a/copyparty/__main__.py b/copyparty/__main__.py index b30308a7..b3c793e6 100755 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -1102,7 +1102,8 @@ def main(argv: Optional[list[str]] = None) -> None: if da: argv.extend(["--qr"]) if ANYWIN or not os.geteuid(): - argv.extend(["-p80,443,3923", "--ign-ebind"]) + # win10 allows symlinks if admin; can be unexpected + argv.extend(["-p80,443,3923", "--ign-ebind", "--no-dedup"]) except: pass diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 4102e2e4..0e78cf5e 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -1003,6 +1003,18 @@ class AuthSrv(object): lns: list[str] = [] try: self._parse_config_file(cfg_fn, lns, acct, daxs, mflags, mount) + + zs = "#\033[36m cfg files in " + zst = [x[len(zs) :] for x in lns if x.startswith(zs)] + for zs in list(set(zst)): + self.log("discovered config files in " + zs, 6) + + zs = "#\033[36m opening cfg file" + zstt = [x.split(" -> ") for x in lns if x.startswith(zs)] + zst = [(max(0, len(x) - 2) * " ") + "└" + x[-1] for x in zstt] + t = "loaded {} config files:\n{}" + self.log(t.format(len(zst), "\n".join(zst))) + except: lns = lns[: self.line_ctr] slns = ["{:4}: {}".format(n, s) for n, s in enumerate(lns, 1)] @@ -1752,13 +1764,13 @@ def split_cfg_ln(ln: str) -> dict[str, Any]: def expand_config_file(ret: list[str], fp: str, ipath: str) -> None: """expand all % file includes""" fp = absreal(fp) - ipath += " -> " + fp - ret.append("#\033[36m opening cfg file{}\033[0m".format(ipath)) if len(ipath.split(" -> ")) > 64: raise Exception("hit max depth of 64 includes") if os.path.isdir(fp): - for fn in sorted(os.listdir(fp)): + names = os.listdir(fp) + ret.append("#\033[36m cfg files in {} => {}\033[0m".format(fp, names)) + for fn in sorted(names): fp2 = os.path.join(fp, fn) if not fp2.endswith(".conf") or fp2 in ipath: continue @@ -1766,6 +1778,9 @@ def expand_config_file(ret: list[str], fp: str, ipath: str) -> None: expand_config_file(ret, fp2, ipath) return + ipath += " -> " + fp + ret.append("#\033[36m opening cfg file{}\033[0m".format(ipath)) + with open(fp, "rb") as f: for oln in [x.decode("utf-8").rstrip() for x in f]: ln = oln.split(" #")[0].strip()