From 027ad0c3eefdfbc3cd6dd1afd9c2de6cdb5a97bc Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 18 Sep 2021 15:38:13 +0200 Subject: [PATCH] misc --- README.md | 6 +++- bin/mtag/install-deps.sh | 3 +- copyparty/web/browser.js | 9 +++-- scripts/make-sfx.sh | 9 +++++ scripts/sfx.ls | 77 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 scripts/sfx.ls diff --git a/README.md b/README.md index fbd7a5a1..80cf53db 100644 --- a/README.md +++ b/README.md @@ -237,7 +237,7 @@ some improvement ideas "frequently" asked questions * is it possible to block read-access to folders unless you know the exact URL for a particular file inside? - * no / not yet; current recommendation is to use nginx to provide the read-access, and only use copyparty for the other stuff (write-only or full read-access for other users) + * yes, using the [`g` permission](#accounts-and-volumes), see the examples there * can I make copyparty download a file to my server if I give it a URL? * not officially, but there is a [terrible hack](https://github.com/9001/copyparty/blob/hovudstraum/bin/mtag/wget.py) which makes it possible @@ -268,6 +268,10 @@ examples: * unauthorized users accessing the webroot can see that the `inc` folder exists, but cannot open it * `u1` can open the `inc` folder, but cannot see the contents, only upload new files to it * `u2` can browse it and move files *from* `/inc` into any folder where `u2` has write-access +* make folder `/mnt/ss` available at `/i`, read-write for u1, get-only for everyone else, and enable accesskeys: `-v /mnt/ss:i:rw,u1:g:c,fk=4` + * `c,fk=4` sets the `fk` volume-flag to 4, meaning each file gets a 4-character accesskey + * `u1` can upload files, browse the folder, and see the generated accesskeys + * other users cannot browse the folder, but can access the files if they have the full file URL with the accesskey # the browser diff --git a/bin/mtag/install-deps.sh b/bin/mtag/install-deps.sh index e90212b6..0815c70a 100755 --- a/bin/mtag/install-deps.sh +++ b/bin/mtag/install-deps.sh @@ -4,7 +4,8 @@ set -e # install dependencies for audio-*.py # -# linux: requires {python3,ffmpeg,fftw}-dev py3-{wheel,pip} py3-numpy{,-dev} vamp-sdk-dev patchelf +# linux/alpine: requires {python3,ffmpeg,fftw}-dev py3-{wheel,pip} py3-numpy{,-dev} vamp-sdk-dev patchelf cmake +# linux/debian: requires libav{codec,device,filter,format,resample,util}-dev {libfftw3,python3}-dev python3-{numpy,pip} vamp-{plugin-sdk,examples} patchelf cmake # win64: requires msys2-mingw64 environment # macos: requires macports # diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index d6c87e14..073848ec 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -3070,11 +3070,15 @@ var treectl = (function () { window.removeEventListener('scroll', onscroll); } - function onscroll() { + function unmenter() { if (mentered) { mentered.style.position = ''; mentered = null; } + } + + function onscroll() { + unmenter(); onscroll2(); } @@ -3239,6 +3243,7 @@ var treectl = (function () { links[a].setAttribute('dst', links[a].nextSibling.getAttribute('href')); links[a].onclick = treegrow; } + ebi('tree').onscroll = nowrap ? unmenter : null; } function menter(e) { @@ -3247,8 +3252,8 @@ var treectl = (function () { ppy = pp.offsetTop, y = this.offsetTop + p.offsetTop + ppy - p.scrollTop - pp.scrollTop - (ppy ? document.documentElement.scrollTop : 0); - this.style.position = 'fixed'; this.style.top = y + 'px'; + this.style.position = 'fixed'; mentered = this; } diff --git a/scripts/make-sfx.sh b/scripts/make-sfx.sh index bcaff171..16c46444 100755 --- a/scripts/make-sfx.sh +++ b/scripts/make-sfx.sh @@ -206,6 +206,15 @@ while IFS= read -r x; do tmv "$x" done +find copyparty | LC_ALL=C sort | sed 's/\.gz$//;s/$/,/' > have +cat have | while IFS= read -r x; do + grep -qF -- "$x" ../scripts/sfx.ls || { + echo "unexpected file: $x" + exit 1 + } +done +rm have + [ $no_ogv ] && rm -rf copyparty/web/deps/{dynamicaudio,ogv}* diff --git a/scripts/sfx.ls b/scripts/sfx.ls new file mode 100644 index 00000000..a65f5686 --- /dev/null +++ b/scripts/sfx.ls @@ -0,0 +1,77 @@ +copyparty, +copyparty/__init__.py, +copyparty/__main__.py, +copyparty/__version__.py, +copyparty/authsrv.py, +copyparty/bos, +copyparty/bos/__init__.py, +copyparty/bos/bos.py, +copyparty/bos/path.py, +copyparty/broker_mp.py, +copyparty/broker_mpw.py, +copyparty/broker_thr.py, +copyparty/broker_util.py, +copyparty/httpcli.py, +copyparty/httpconn.py, +copyparty/httpsrv.py, +copyparty/ico.py, +copyparty/mtag.py, +copyparty/res, +copyparty/res/insecure.pem, +copyparty/star.py, +copyparty/stolen, +copyparty/stolen/__init__.py, +copyparty/stolen/surrogateescape.py, +copyparty/sutil.py, +copyparty/svchub.py, +copyparty/szip.py, +copyparty/tcpsrv.py, +copyparty/th_cli.py, +copyparty/th_srv.py, +copyparty/u2idx.py, +copyparty/up2k.py, +copyparty/util.py, +copyparty/web, +copyparty/web/baguettebox.js, +copyparty/web/browser.css, +copyparty/web/browser.html, +copyparty/web/browser.js, +copyparty/web/browser2.html, +copyparty/web/copyparty.gif, +copyparty/web/dd, +copyparty/web/dd/2.png, +copyparty/web/dd/3.png, +copyparty/web/dd/4.png, +copyparty/web/dd/5.png, +copyparty/web/deps, +copyparty/web/deps/easymde.css, +copyparty/web/deps/easymde.js, +copyparty/web/deps/marked.js, +copyparty/web/deps/mini-fa.css, +copyparty/web/deps/mini-fa.woff, +copyparty/web/deps/ogv-decoder-audio-opus-wasm.js, +copyparty/web/deps/ogv-decoder-audio-opus-wasm.wasm, +copyparty/web/deps/ogv-decoder-audio-vorbis-wasm.js, +copyparty/web/deps/ogv-decoder-audio-vorbis-wasm.wasm, +copyparty/web/deps/ogv-demuxer-ogg-wasm.js, +copyparty/web/deps/ogv-demuxer-ogg-wasm.wasm, +copyparty/web/deps/ogv-worker-audio.js, +copyparty/web/deps/ogv.js, +copyparty/web/deps/scp.woff2, +copyparty/web/deps/sha512.ac.js, +copyparty/web/deps/sha512.hw.js, +copyparty/web/md.css, +copyparty/web/md.html, +copyparty/web/md.js, +copyparty/web/md2.css, +copyparty/web/md2.js, +copyparty/web/mde.css, +copyparty/web/mde.html, +copyparty/web/mde.js, +copyparty/web/msg.css, +copyparty/web/msg.html, +copyparty/web/splash.css, +copyparty/web/splash.html, +copyparty/web/ui.css, +copyparty/web/up2k.js, +copyparty/web/util.js,