From 603d0ed72bca70b01e73f66e3ee760731302f044 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 5 May 2024 17:32:50 +0000 Subject: [PATCH] misc: messages, docs, ie4 / win311 support * docker: improve config-not-found warning message * readme: mention markdown variable expansion * basic-browser: use zip=crc to support ie4 / win-3.11 --- README.md | 9 +++++++++ copyparty/authsrv.py | 4 ++-- copyparty/httpcli.py | 6 ++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 46cfa25f..9df71430 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ turn almost any device into a file server with resumable uploads/downloads using * [audio equalizer](#audio-equalizer) - and [dynamic range compressor](https://en.wikipedia.org/wiki/Dynamic_range_compression) * [fix unreliable playback on android](#fix-unreliable-playback-on-android) - due to phone / app settings * [markdown viewer](#markdown-viewer) - and there are *two* editors + * [markdown vars](#markdown-vars) - dynamic docs with serverside variable expansion * [other tricks](#other-tricks) * [searching](#searching) - search by size, date, path/name, mp3-tags, ... * [server config](#server-config) - using arguments or config files, or a mix of both @@ -239,6 +240,7 @@ also see [comparison to similar software](./docs/versus.md) * markdown * ☑ [viewer](#markdown-viewer) * ☑ editor (sure why not) + * ☑ [variables](#markdown-vars) PS: something missing? post any crazy ideas you've got as a [feature request](https://github.com/9001/copyparty/issues/new?assignees=9001&labels=enhancement&template=feature_request.md) or [discussion](https://github.com/9001/copyparty/discussions/new?category=ideas) 🤙 @@ -845,6 +847,13 @@ other notes, * the document preview has a max-width which is the same as an A4 paper when printed +### markdown vars + +dynamic docs with serverside variable expansion to replace stuff like `{{self.ip}}` with the client's IP, or `{{srv.htime}}` with the current time on the server + +see [./srv/expand/](./srv/expand/) for usage and examples + + ## other tricks * you can link a particular timestamp in an audio file by adding it to the URL, such as `&20` / `&20s` / `&1m20` / `&t=1:20` after the `.../#af-c8960dab` diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index e6b35a0c..a9947bc8 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -1783,7 +1783,7 @@ class AuthSrv(object): zs = str(vol.flags.get("tcolor", "")) if len(zs) == 3: # fc5 => ffcc55 - vol.flags["tcolor"] = "".join([x*2 for x in zs]) + vol.flags["tcolor"] = "".join([x * 2 for x in zs]) for k1, k2 in IMPLICATIONS: if k1 in vol.flags: @@ -2422,7 +2422,7 @@ def expand_config_file( if not cnames: t = "warning: tried to read config-files from folder '%s' but it does not contain any " if names: - t += ".conf files; the following files were ignored: %s" + t += ".conf files; the following files/subfolders were ignored: %s" t = t % (fp, ", ".join(names[:8])) else: t += "files at all" diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 246c5f7e..5c13c96a 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -4536,12 +4536,14 @@ class HttpCli(object): margin = "DIR" elif add_dk: zs = absreal(fspath) - margin = 'zip' % ( + margin = 'zip' % ( quotep(href), self.gen_fk(2, self.args.dk_salt, zs, 0, 0)[:add_dk], ) else: - margin = 'zip' % (quotep(href),) + margin = 'zip' % ( + quotep(href), + ) elif fn in hist: margin = '#%s' % ( base,