diff --git a/copyparty/__main__.py b/copyparty/__main__.py index 698fcbd4..3566aff1 100755 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -838,7 +838,7 @@ def add_general(ap, nc, srvname): ap2.add_argument("-nc", metavar="NUM", type=int, default=nc, help="max num clients") ap2.add_argument("-j", metavar="CORES", type=int, default=1, help="max num cpu cores, 0=all") ap2.add_argument("-a", metavar="ACCT", type=u, action="append", help="add account, \033[33mUSER\033[0m:\033[33mPASS\033[0m; example [\033[32med:wark\033[0m]") - ap2.add_argument("-v", metavar="VOL", type=u, action="append", help="add volume, \033[33mSRC\033[0m:\033[33mDST\033[0m:\033[33mFLAG\033[0m; examples [\033[32m.::r\033[0m], [\033[32m/mnt/nas/music:/music:r:aed\033[0m]") + ap2.add_argument("-v", metavar="VOL", type=u, action="append", help="add volume, \033[33mSRC\033[0m:\033[33mDST\033[0m:\033[33mFLAG\033[0m; examples [\033[32m.::r\033[0m], [\033[32m/mnt/nas/music:/music:r:aed\033[0m], see --help-accounts") ap2.add_argument("-ed", action="store_true", help="enable the ?dots url parameter / client option which allows clients to see dotfiles / hidden files (volflag=dots)") ap2.add_argument("--urlform", metavar="MODE", type=u, default="print,get", help="how to handle url-form POSTs; see \033[33m--help-urlform\033[0m") ap2.add_argument("--wintitle", metavar="TXT", type=u, default="cpp @ $pub", help="server terminal title, for example [\033[32m$ip-10.1.2.\033[0m] or [\033[32m$ip-]") diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 3b924064..cbb1d662 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -381,7 +381,7 @@ class VFS(object): def add(self, src: str, dst: str) -> "VFS": """get existing, or add new path to the vfs""" - assert not src.endswith("/") # nosec + assert src == "/" or not src.endswith("/") # nosec assert not dst.endswith("/") # nosec if "/" in dst: @@ -779,7 +779,6 @@ class AuthSrv(object): self.warn_anonwrite = warn_anonwrite self.line_ctr = 0 self.indent = "" - self.desc = [] self.mutex = threading.Lock() self.reload() @@ -862,7 +861,6 @@ class AuthSrv(object): mflags: dict[str, dict[str, Any]], mount: dict[str, str], ) -> None: - self.desc = [] self.line_ctr = 0 expand_config_file(cfg_lines, fp, "") @@ -1009,6 +1007,7 @@ class AuthSrv(object): raise Exception("invalid config value (volume or volflag): %s" % (t,)) if lvl == "c": + # here, 'uname' is not a username; it is a volflag name... sorry cval: Union[bool, str] = True try: # volflag with arguments, possibly with a preceding list of bools diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 95631136..ef7b7908 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -2961,9 +2961,11 @@ class HttpCli(object): # 512 kB is optimal for huge files, use 64k open_args = [fsenc(fs_path), "rb", 64 * 1024] use_sendfile = ( - not self.tls # + # fmt: off + not self.tls and not self.args.no_sendfile and (BITNESS > 32 or file_sz < 0x7fffFFFF) + # fmt: on ) # diff --git a/docs/examples/docker/idp/copyparty.conf b/docs/examples/docker/idp/copyparty.conf index 26b1e16b..bed00947 100644 --- a/docs/examples/docker/idp/copyparty.conf +++ b/docs/examples/docker/idp/copyparty.conf @@ -31,33 +31,33 @@ /w # share /w (the docker data volume) accs: rw: * # everyone gets read-access, but - rwmda: %su # the group "su" gets read-write-move-delete-admin + rwmda: @su # the group "su" gets read-write-move-delete-admin [/u/${u}] # each user gets their own home-folder at /u/username /w/u/${u} # which will be "u/username" in the docker data volume accs: r: * # read-access for anyone, and - rwmda: ${u}, %su # read-write-move-delete-admin for that username + the "su" group + rwmda: ${u}, @su # read-write-move-delete-admin for that username + the "su" group [/u/${u}/priv] # each user also gets a private area at /u/username/priv /w/u/${u}/priv # stored at DATAVOLUME/u/username/priv accs: - rwmda: ${u}, %su # read-write-move-delete-admin for that username + the "su" group + rwmda: ${u}, @su # read-write-move-delete-admin for that username + the "su" group [/lounge/${g}] # each group gets their own shared volume /w/lounge/${g} # stored at DATAVOLUME/lounge/groupname accs: r: * # read-access for anyone, and - rwmda: %${g}, %su # read-write-move-delete-admin for that group + the "su" group + rwmda: @${g}, @su # read-write-move-delete-admin for that group + the "su" group [/lounge/${g}/priv] # and a private area for each group too /w/lounge/${g}/priv # stored at DATAVOLUME/lounge/groupname/priv accs: - rwmda: %${g}, %su # read-write-move-delete-admin for that group + the "su" group + rwmda: @${g}, @su # read-write-move-delete-admin for that group + the "su" group # and create some strategic volumes to prevent anyone from gaining @@ -65,8 +65,8 @@ [/u] /w/u accs: - rwmda: %su + rwmda: @su [/lounge] /w/lounge accs: - rwmda: %su + rwmda: @su diff --git a/tests/util.py b/tests/util.py index 121210ed..60b955da 100644 --- a/tests/util.py +++ b/tests/util.py @@ -110,7 +110,7 @@ class Cfg(Namespace): def __init__(self, a=None, v=None, c=None, **ka0): ka = {} - ex = "daw dav_auth dav_inf dav_mac dav_rt e2d e2ds e2dsa e2t e2ts e2tsr e2v e2vu e2vp ed emp exp force_js getmod grid hardlink ih ihead magic never_symlink nid nih no_acode no_athumb no_dav no_dedup no_del no_dupe no_lifetime no_logues no_mv no_readme no_robots no_sb_md no_sb_lg no_scandir no_tarcmp no_thumb no_vthumb no_zip nrand nw rand smb srch_dbg stats th_no_crop vague_403 vc ver xdev xlink xvol" + ex = "daw dav_auth dav_inf dav_mac dav_rt e2d e2ds e2dsa e2t e2ts e2tsr e2v e2vu e2vp ed emp exp force_js getmod grid hardlink ih ihead magic never_symlink nid nih no_acode no_athumb no_dav no_dedup no_del no_dupe no_lifetime no_logues no_mv no_readme no_robots no_sb_md no_sb_lg no_scandir no_tarcmp no_thumb no_vthumb no_zip nrand nw q rand smb srch_dbg stats th_no_crop vague_403 vc ver xdev xlink xvol" ka.update(**{k: False for k in ex.split()}) ex = "dotpart dotsrch no_dhash no_fastboot no_rescan no_sendfile no_voldump re_dhash plain_ip" @@ -152,6 +152,7 @@ class Cfg(Namespace): mte={"a": True}, mth={}, mtp=[], + rm_retry="0/0", s_wr_sz=512 * 1024, sort="href", srch_hits=99999,