From 2933dce3ef352915440051ef6a3b8c04189a5f93 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 24 Apr 2022 22:58:11 +0200 Subject: [PATCH] mtime blank uploads + helptext --- contrib/systemd/copyparty.service | 4 +++- copyparty/__main__.py | 8 ++++---- copyparty/up2k.py | 8 +++++++- copyparty/web/browser.css | 1 + 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/contrib/systemd/copyparty.service b/contrib/systemd/copyparty.service index 0ed56865..c9b04fdb 100644 --- a/contrib/systemd/copyparty.service +++ b/contrib/systemd/copyparty.service @@ -12,6 +12,8 @@ # change '/mnt::rw' to another location or permission-set # remove '-p 80,443,3923' to only listen on port 3923 # add '-i 127.0.0.1' to only allow local connections +# add '-e2dsa' to enable filesystem scanning + indexing +# add '-e2ts' to enable metadata indexing # # with `Type=notify`, copyparty will signal systemd when it is ready to # accept connections; correctly delaying units depending on copyparty. @@ -34,7 +36,7 @@ SyslogIdentifier=copyparty Environment=PYTHONUNBUFFERED=x ExecReload=/bin/kill -s USR1 $MAINPID ExecStartPre=/bin/bash -c 'mkdir -p /run/tmpfiles.d/ && echo "x /tmp/pe-copyparty*" > /run/tmpfiles.d/copyparty.conf' -ExecStart=/usr/bin/python3 /usr/local/bin/copyparty-sfx.py -q -p 80,443,3923 -v /mnt::rw +ExecStart=/usr/bin/python3 /usr/local/bin/copyparty-sfx.py -q -p 80,443,3923 -e2d -v /mnt::rw [Install] WantedBy=multi-user.target diff --git a/copyparty/__main__.py b/copyparty/__main__.py index 2662b0ac..2cd76ee1 100644 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -456,7 +456,7 @@ def run_argparse(argv, formatter): ap2 = ap.add_argument_group('opt-outs') ap2.add_argument("-nw", action="store_true", help="disable writes (benchmark)") - ap2.add_argument("--keep-qem", action="store_true", help="do not disable quick-edit-mode on windows") + ap2.add_argument("--keep-qem", action="store_true", help="do not disable quick-edit-mode on windows (it is disabled to avoid accidental text selection which will deadlock copyparty)") ap2.add_argument("--no-del", action="store_true", help="disable delete operations") ap2.add_argument("--no-mv", action="store_true", help="disable move/rename operations") ap2.add_argument("-nih", action="store_true", help="no info hostname") @@ -502,14 +502,14 @@ def run_argparse(argv, formatter): ap2.add_argument("--th-mt", metavar="CORES", type=int, default=cores, help="num cpu cores to use for generating thumbnails") ap2.add_argument("--th-convt", metavar="SEC", type=int, default=60, help="conversion timeout in seconds") ap2.add_argument("--th-no-crop", action="store_true", help="dynamic height; show full image") - ap2.add_argument("--th-dec", metavar="LIBS", default="vips,pil,ff", help="decoders, in order of preference") + ap2.add_argument("--th-dec", metavar="LIBS", default="vips,pil,ff", help="image decoders, in order of preference") ap2.add_argument("--th-no-jpg", action="store_true", help="disable jpg output") ap2.add_argument("--th-no-webp", action="store_true", help="disable webp output") ap2.add_argument("--th-ff-jpg", action="store_true", help="force jpg for video thumbs") ap2.add_argument("--th-ff-swr", action="store_true", help="use swresample instead of soxr for audio thumbs") - ap2.add_argument("--th-poke", metavar="SEC", type=int, default=300, help="activity labeling cooldown") + ap2.add_argument("--th-poke", metavar="SEC", type=int, default=300, help="activity labeling cooldown -- avoids doing keepalive pokes (updating the mtime) on thumbnail folders more often than SEC seconds") ap2.add_argument("--th-clean", metavar="SEC", type=int, default=43200, help="cleanup interval; 0=disabled") - ap2.add_argument("--th-maxage", metavar="SEC", type=int, default=604800, help="max folder age") + ap2.add_argument("--th-maxage", metavar="SEC", type=int, default=604800, help="max folder age -- folders which haven't been poked for longer than --th-poke seconds will get deleted every --th-clean seconds") ap2.add_argument("--th-covers", metavar="N,N", type=u, default="folder.png,folder.jpg,cover.png,cover.jpg", help="folder thumbnails to stat for") # https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html # https://github.com/libvips/libvips diff --git a/copyparty/up2k.py b/copyparty/up2k.py index d7fa9256..66509a98 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -1574,9 +1574,15 @@ class Up2k(object): # self.log("--- " + wark + " " + dst + " finish_upload atomic " + dst, 4) atomic_move(src, dst) + times = (int(time.time()), int(job["lmod"])) if ANYWIN: - a = [dst, job["size"], (int(time.time()), int(job["lmod"]))] + a = [dst, job["size"], times] self.lastmod_q.put(a) + elif not job["hash"]: + try: + bos.utime(dst, times) + except: + pass a = [job[x] for x in "ptop wark prel name lmod size addr".split()] a += [job.get("at") or time.time()] diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index abf37e8f..4feb4680 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -1330,6 +1330,7 @@ html.y .s1r:after { html.y #files thead th { background: #eaeaea; border-color: #ccc; + box-shadow: 0 -1px 0 #aaa inset; } html.y #files tbody td { background: #eaeaea;