From 134e378e3a023a810fbbd7f2a394b213d561b82c Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 22 Mar 2026 16:22:22 +0000 Subject: [PATCH] docs: dothidden, unlist, descript.ion --- README.md | 27 +++++++++++++++++++++++++++ copyparty/__main__.py | 1 + copyparty/cfg.py | 2 ++ copyparty/httpcli.py | 1 - tests/util.py | 2 +- 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0f4df8ff..02afcc05 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,8 @@ built in Norway 🇳🇴 with contributions from [not-norway](https://github.com * [compress uploads](#compress-uploads) - files can be autocompressed on upload * [chmod and chown](#chmod-and-chown) - per-volume filesystem-permissions and ownership * [other flags](#other-flags) + * [descript.ion](#description) - add a description to each file in a folder + * [dothidden](#dothidden) - cosmetically hide specific files in a folder * [database location](#database-location) - in-volume (`.hist/up2k.db`, default) or somewhere else * [metadata from audio files](#metadata-from-audio-files) - set `-e2t` to index tags on upload * [metadata from xattrs](#metadata-from-xattrs) - unix extended file attributes @@ -1877,6 +1879,31 @@ notes: * adding `?cache` to a link will override this with "fully cache this for 69 seconds"; `?cache=321` is 321 seconds, and `?cache=i` is 7 days +## descript.ion + +add a description to each file in a folder by adding them to a textfile named `descript.ion` + +see https://copyparty.eu/beta/ for an example -- here's a basic `descript.ion` file: + +``` +bookmark.mp3 Taishi feat. Rita - Bookmark Memories +slowstep.mp3 Taishi feat. 向日葵 - Slow Step -F.L.C.A- +prsnlzr.mp3 Taishi feat. みとせのりこ - Personalizer +cosmos.mp3 Taishi feat. Rita - Into the cosmos +``` + + +## dothidden + +cosmetically hide specific files in a folder by adding them to a textfile named `.hidden` + +this option is default-disabled; enable the volflag and/or global-option `dothidden` + +this is **cosmetic only!** the files are still easily accessible in many ways, for example with download-as-zip/tar, so **do not** rely on this for security. + +> also see the [--unlist](https://copyparty.eu/cli/#g-unlist) option which is somewhat similar -- `unlist` applies to the whole volume instead of just one folder; however, while dothidden also affects sftp and ftp, the `unlist` option is http/https-only + + ## database location in-volume (`.hist/up2k.db`, default) or somewhere else diff --git a/copyparty/__main__.py b/copyparty/__main__.py index 955c5830..1caa829f 100644 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -1875,6 +1875,7 @@ def add_ui(ap, retry: int): ap2.add_argument("--qdel", metavar="LVL", type=int, default=2, help="number of confirmations to show when deleting files (2/1/0)") ap2.add_argument("--dlni", action="store_true", help="force download (don't show inline) when files are clicked (volflag:dlni)") ap2.add_argument("--unlist", metavar="REGEX", type=u, default="", help="don't show files/folders matching \033[33mREGEX\033[0m in file list. WARNING: Purely cosmetic! Does not affect API calls, just the browser. Example: [\033[32m\\.(js|css)$\033[0m] (volflag=unlist)") + ap2.add_argument("--dothidden", action="store_true", help="hide specific files in a folder by listing them in a file named .hidden -- WARNING: Mostly cosmetic! Download-as-zip/tar will still download them. Do not rely on this for security (volflag=dothidden)") ap2.add_argument("--favico", metavar="TXT", type=u, default="c 000 none" if retry else "🎉 000 none", help="\033[33mfavicon-text\033[0m [ \033[33mforeground\033[0m [ \033[33mbackground\033[0m ] ], set blank to disable") ap2.add_argument("--ufavico", metavar="TXT", type=u, default="", help="URL to .ico/png/gif/svg file; \033[33m--favico\033[0m takes precedence unless disabled (volflag=ufavico)") ap2.add_argument("--ext-th", metavar="E=VP", type=u, action="append", help="\033[34mREPEATABLE:\033[0m use thumbnail-image \033[33mVP\033[0m for file-extension \033[33mE\033[0m, example: [\033[32mexe=/.res/exe.png\033[0m] (volflag=ext_th)") diff --git a/copyparty/cfg.py b/copyparty/cfg.py index 677c7408..38ada9be 100644 --- a/copyparty/cfg.py +++ b/copyparty/cfg.py @@ -33,6 +33,7 @@ def vf_bmap() -> dict[str, str]: for k in ( "dedup", "dlni", + "dothidden", "dotsrch", "e2d", "e2ds", @@ -340,6 +341,7 @@ flagcats = { "hsortn": "number of sort-rules to add to media URLs", "ufavico=URL": "per-volume favicon (.ico/png/gif/svg)", "unlist": "dont list files matching REGEX", + "dothidden": "enable support for .hidden files", "dlni": "force-download (no-inline) files on click", "html_head=TXT": "includes TXT in the , or @PATH for file at PATH", "html_head_s=TXT": "additional static text in the html ", diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 561cafeb..37d3218f 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -83,7 +83,6 @@ from .util import ( has_resource, hashcopy, hidedir, - load_dothidden, html_bescape, html_escape, html_sh_esc, diff --git a/tests/util.py b/tests/util.py index 50052254..774564eb 100644 --- a/tests/util.py +++ b/tests/util.py @@ -143,7 +143,7 @@ class Cfg(Namespace): def __init__(self, a=None, v=None, c=None, **ka0): ka = {} - ex = "allow_flac allow_wav chpw cookie_lax daw dav_auth dav_mac dav_rt dlni e2d e2ds e2dsa e2t e2ts e2tsr e2v e2vu e2vp early_ban ed emp exp force_js getmod grid gsel hardlink hardlink_only http_no_tcp ih ihead localtime log_badxml magic md_no_br nid nih no_acode no_athumb no_bauth no_clone no_cp no_dav no_db_ip no_del no_dirsz no_dupe no_dupe_m no_fnugg no_lifetime no_logues no_mv no_pipe no_poll no_readme no_robots no_sb_md no_sb_lg no_scandir no_tail no_tarcmp no_thumb no_vthumb no_u2abrt no_zip no_zls nrand nsort nw og og_no_head og_s_title ohead opds q rand re_dirsz reflink rm_partial rmagic rss smb srch_dbg srch_excl srch_icase stats ui_noacci ui_nocpla ui_noctxb ui_nolbar ui_nombar ui_nonav ui_notree ui_norepl ui_nosrvi uqe usernames vague_403 vc ver vol_nospawn vol_or_crash wo_up_readme write_uplog xdev xlink xvol zipmaxu zs" + ex = "allow_flac allow_wav chpw cookie_lax daw dav_auth dav_mac dav_rt dlni dothidden e2d e2ds e2dsa e2t e2ts e2tsr e2v e2vu e2vp early_ban ed emp exp force_js getmod grid gsel hardlink hardlink_only http_no_tcp ih ihead localtime log_badxml magic md_no_br nid nih no_acode no_athumb no_bauth no_clone no_cp no_dav no_db_ip no_del no_dirsz no_dupe no_dupe_m no_fnugg no_lifetime no_logues no_mv no_pipe no_poll no_readme no_robots no_sb_md no_sb_lg no_scandir no_tail no_tarcmp no_thumb no_vthumb no_u2abrt no_zip no_zls nrand nsort nw og og_no_head og_s_title ohead opds q rand re_dirsz reflink rm_partial rmagic rss smb srch_dbg srch_excl srch_icase stats ui_noacci ui_nocpla ui_noctxb ui_nolbar ui_nombar ui_nonav ui_notree ui_norepl ui_nosrvi uqe usernames vague_403 vc ver vol_nospawn vol_or_crash wo_up_readme write_uplog xdev xlink xvol zipmaxu zs" ka.update(**{k: False for k in ex.split()}) ex = "dav_inf dedup dotpart dotsrch hook_v no_dhash no_fastboot no_fpool no_htp no_rescan no_sendfile no_ses no_snap no_up_list no_voldump wram re_dhash see_dots plain_ip"