From 30cc9defcb4c88618a446da7a946a2c6e1bface1 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 31 Aug 2023 21:27:14 +0000 Subject: [PATCH] cosmetics: * in case someone gets a confusing access-related error message, include more context in serverlogs (exact path) * fix js console spam in search results * same markdown line-height in viewer and browser --- copyparty/authsrv.py | 10 ++++++++-- copyparty/web/browser.css | 2 +- copyparty/web/browser.js | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 9bab2f14..0eff094a 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -476,7 +476,8 @@ class VFS(object): self.log("vfs", "invalid relpath [{}]".format(vpath)) raise Pebkac(404) - vn, rem = self._find(undot(vpath)) + cvpath = undot(vpath) + vn, rem = self._find(cvpath) c: AXS = vn.axs for req, d, msg in [ @@ -487,6 +488,11 @@ class VFS(object): (will_get, c.uget, "get"), ]: if req and (uname not in d and "*" not in d) and uname != LEELOO_DALLAS: + if self.log and err != 999: + ap = vn.canonical(rem) + t = "{} has no {} in [{}] => [{}] => [{}]" + self.log("vfs", t.format(uname, msg, vpath, cvpath, ap), 6) + t = "you don't have {}-access for this location" raise Pebkac(err, t.format(msg)) @@ -1669,7 +1675,7 @@ class AuthSrv(object): self.log(t.format(zv.realpath), c=1) try: - zv, _ = vfs.get("/", "*", False, True) + zv, _ = vfs.get("/", "*", False, True, err=999) if self.warn_anonwrite and os.getcwd() == zv.realpath: t = "anyone can write to the current directory: {}\n" self.log(t.format(zv.realpath), c=1) diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 91b26814..0b11a7e4 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -860,7 +860,7 @@ html.y #path a:hover { } .mdo, .mdo * { - line-height: 1.4em; + line-height: 1.5em; } #srv_info, #srv_info2, diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 98e3342c..c582729b 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -7229,7 +7229,7 @@ function sandbox(tgt, rules, cls, html) { 'function say(m){window.parent.postMessage(m,"*")};' + 'setTimeout(function(){var its=0,pih=-1,f=function(){' + 'var ih=2+Math.min(parseInt(getComputedStyle(d).height),d.scrollHeight);' + - 'if(ih!=pih){pih=ih;say("iheight #' + tid + ' "+ih,"*")}' + + 'if(ih!=pih&&!isNaN(ih)){pih=ih;say("iheight #' + tid + ' "+ih,"*")}' + 'if(++its<20)return setTimeout(f,20);if(its==20)setInterval(f,200)' + '};f();' + 'window.onfocus=function(){say("igot #' + tid + '")};' +