diff --git a/copyparty/__main__.py b/copyparty/__main__.py index a48921bd..892c66c7 100755 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -514,8 +514,12 @@ def get_sects(): """ volflags are appended to volume definitions, for example, to create a write-only volume with the \033[33mnodupe\033[0m and \033[32mnosub\033[0m flags: - \033[35m-v /mnt/inc:/inc:w\033[33m:c,nodupe\033[32m:c,nosub""" - ) + \033[35m-v /mnt/inc:/inc:w\033[33m:c,nodupe\033[32m:c,nosub\033[0m + + if global config defines a volflag for all volumes, + you can unset it for a specific volume with -flag + """ + ).rstrip() + build_flags_desc(), ], [ diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 84d3713e..c76718cc 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -859,7 +859,7 @@ class AuthSrv(object): zd = split_cfg_ln(ln) fstr = "" for sk, sv in zd.items(): - bad = re.sub(r"[a-z0-9_]", "", sk) + bad = re.sub(r"[a-z0-9_-]", "", sk).lstrip("-") if bad: err = "bad characters [{}] in volflag name [{}]; " err = err.format(bad, sk) @@ -935,7 +935,14 @@ class AuthSrv(object): value: Union[str, bool, list[str]], is_list: bool, ) -> None: - desc = flagdescs.get(name, "?").replace("\n", " ") + desc = flagdescs.get(name.lstrip("-"), "?").replace("\n", " ") + + if re.match("^-[^-]+$", name): + t = "└─unset volflag [{}] ({})" + self._e(t.format(name[1:], desc)) + flags[name] = True + return + if name not in "mtp xbu xau xiu xbr xar xbd xad xm".split(): if value is True: t = "└─add volflag [{}] = {} ({})" @@ -1441,6 +1448,12 @@ class AuthSrv(object): self.log(t, 1) errors = True + for vol in vfs.all_vols.values(): + for k in list(vol.flags.keys()): + if re.match("^-[^-]+$", k): + vol.flags.pop(k[1:], None) + vol.flags.pop(k) + if errors: sys.exit(1) diff --git a/docs/protocol-reference.sh b/docs/protocol-reference.sh new file mode 100644 index 00000000..38b22716 --- /dev/null +++ b/docs/protocol-reference.sh @@ -0,0 +1,2 @@ +vsftpd a.conf -olisten=YES -olisten_port=3921 -orun_as_launching_user=YES -obackground=NO -olog_ftp_protocol=YES +