mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
basic support for rclone sync
This commit is contained in:
parent
bb72e6bf30
commit
5ac2c20959
|
@ -758,7 +758,7 @@ def add_ftp(ap):
|
||||||
|
|
||||||
def add_webdav(ap):
|
def add_webdav(ap):
|
||||||
ap2 = ap.add_argument_group('WebDAV options')
|
ap2 = ap.add_argument_group('WebDAV options')
|
||||||
ap2.add_argument("--daw", action="store_true", help="enable full write support. \033[1;31mWARNING:\033[0m This has side-effects -- PUT-operations will now \033[1;31mOVERWRITE\033[0m existing files, rather than inventing new filenames to avoid loss of data. You might want to instead set this as a volflag where needed. By not setting this flag, uploaded files can get written to a filename which the client does not expect (which might be okay, depending on client)")
|
ap2.add_argument("--daw", action="store_true", help="enable full write support, even if client may not be webdav. \033[1;31mWARNING:\033[0m This has side-effects -- PUT-operations will now \033[1;31mOVERWRITE\033[0m existing files, rather than inventing new filenames to avoid loss of data. You might want to instead set this as a volflag where needed. By not setting this flag, uploaded files can get written to a filename which the client does not expect (which might be okay, depending on client)")
|
||||||
ap2.add_argument("--dav-inf", action="store_true", help="allow depth:infinite requests (recursive file listing); extremely server-heavy but required for spec compliance -- luckily few clients rely on this")
|
ap2.add_argument("--dav-inf", action="store_true", help="allow depth:infinite requests (recursive file listing); extremely server-heavy but required for spec compliance -- luckily few clients rely on this")
|
||||||
ap2.add_argument("--dav-mac", action="store_true", help="disable apple-garbage filter -- allow macos to create junk files (._* and .DS_Store, .Spotlight-*, .fseventsd, .Trashes, .AppleDouble, __MACOS)")
|
ap2.add_argument("--dav-mac", action="store_true", help="disable apple-garbage filter -- allow macos to create junk files (._* and .DS_Store, .Spotlight-*, .fseventsd, .Trashes, .AppleDouble, __MACOS)")
|
||||||
|
|
||||||
|
|
|
@ -1429,9 +1429,9 @@ class HttpCli(object):
|
||||||
self.log(t, 1)
|
self.log(t, 1)
|
||||||
raise Pebkac(403, t)
|
raise Pebkac(403, t)
|
||||||
|
|
||||||
if is_put and not (self.args.no_dav or self.args.nw):
|
if is_put and not (self.args.no_dav or self.args.nw) and bos.path.exists(path):
|
||||||
# allow overwrite if...
|
# allow overwrite if...
|
||||||
# * volflag 'daw' is set
|
# * volflag 'daw' is set, or client is definitely webdav
|
||||||
# * and account has delete-access
|
# * and account has delete-access
|
||||||
# or...
|
# or...
|
||||||
# * file exists, is empty, sufficiently new
|
# * file exists, is empty, sufficiently new
|
||||||
|
@ -1441,9 +1441,11 @@ class HttpCli(object):
|
||||||
if self.args.dotpart:
|
if self.args.dotpart:
|
||||||
tnam = "." + tnam
|
tnam = "." + tnam
|
||||||
|
|
||||||
if (vfs.flags.get("daw") and self.can_delete) or (
|
if (
|
||||||
|
self.can_delete
|
||||||
|
and (vfs.flags.get("daw") or "x-oc-mtime" in self.headers)
|
||||||
|
) or (
|
||||||
not bos.path.exists(os.path.join(fdir, tnam))
|
not bos.path.exists(os.path.join(fdir, tnam))
|
||||||
and bos.path.exists(path)
|
|
||||||
and not bos.path.getsize(path)
|
and not bos.path.getsize(path)
|
||||||
and bos.path.getmtime(path) >= time.time() - self.args.blank_wt
|
and bos.path.getmtime(path) >= time.time() - self.args.blank_wt
|
||||||
):
|
):
|
||||||
|
|
Loading…
Reference in a new issue