From baf641396d9663cb5eb919f2a6ca7e12a36f3465 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 15 Jan 2023 20:52:38 +0000 Subject: [PATCH] add optional powered-by footnode --- copyparty/__main__.py | 2 ++ copyparty/web/splash.css | 15 +++++++++++++++ copyparty/web/splash.html | 3 +++ 3 files changed, 20 insertions(+) diff --git a/copyparty/__main__.py b/copyparty/__main__.py index b5c2132d..8fcccd3f 100755 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -764,6 +764,7 @@ def add_optouts(ap): ap2.add_argument("--no-mv", action="store_true", help="disable move/rename operations") ap2.add_argument("-nih", action="store_true", help="no info hostname -- don't show in UI") ap2.add_argument("-nid", action="store_true", help="no info disk-usage -- don't show in UI") + ap2.add_argument("-nb", action="store_true", help="no powered-by-copyparty branding in UI") ap2.add_argument("--no-zip", action="store_true", help="disable download as zip/tar") ap2.add_argument("--no-lifetime", action="store_true", help="disable automatic deletion of uploads after a certain time (as specified by the 'lifetime' volflag)") @@ -906,6 +907,7 @@ def add_ui(ap, retry): ap2.add_argument("--textfiles", metavar="CSV", type=u, default="txt,nfo,diz,cue,readme", help="file extensions to present as plaintext") ap2.add_argument("--txt-max", metavar="KiB", type=int, default=64, help="max size of embedded textfiles on ?doc= (anything bigger will be lazy-loaded by JS)") ap2.add_argument("--doctitle", metavar="TXT", type=u, default="copyparty", help="title / service-name to show in html documents") + ap2.add_argument("--pb-url", metavar="URL", type=u, default="https://github.com/9001/copyparty", help="powered-by link; disable with -np") def add_debug(ap): diff --git a/copyparty/web/splash.css b/copyparty/web/splash.css index 446e146f..c4796072 100644 --- a/copyparty/web/splash.css +++ b/copyparty/web/splash.css @@ -52,11 +52,26 @@ a.g { box-shadow: 0 .3em 1em #4c0; } #repl { + float: left; border: none; background: none; color: inherit; padding: 0; } +#pb { + opacity: .5; + text-align: right; +} +#pb span { + opacity: .6; +} +#pb a { + color: inherit; + background: none; + border: none; + padding: 0; + margin: 0; +} table { border-collapse: collapse; } diff --git a/copyparty/web/splash.html b/copyparty/web/splash.html index b8de295d..21319711 100644 --- a/copyparty/web/splash.html +++ b/copyparty/web/splash.html @@ -98,6 +98,9 @@ π + {%- if not this.args.nb %} +
powered by copyparty
+ {%- endif %}