diff --git a/README.md b/README.md index 11d0effb..4457c594 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ turn your phone or raspi into a portable file server with resumable uploads/down * [metadata from audio files](#metadata-from-audio-files) - set `-e2t` to index tags on upload * [file parser plugins](#file-parser-plugins) - provide custom parsers to index additional tags, also see [./bin/mtag/README.md](./bin/mtag/README.md) * [upload events](#upload-events) - trigger a script/program on each upload + * [hiding from google](#hiding-from-google) - tell search engines you dont wanna be indexed * [complete examples](#complete-examples) * [browser support](#browser-support) - TLDR: yes * [client examples](#client-examples) - interact with copyparty using non-browser clients @@ -792,6 +793,17 @@ and it will occupy the parsing threads, so fork anything expensive, or if you wa if this becomes popular maybe there should be a less janky way to do it actually +## hiding from google + +tell search engines you dont wanna be indexed, either using the good old [robots.txt](https://www.robotstxt.org/robotstxt.html) or through copyparty settings: + +* `--no-robots` adds HTTP (`X-Robots-Tag`) and HTML (``) headers with `noindex, nofollow` globally +* volume-flag `[...]:c,norobots` does the same thing for that single volume +* volume-flag `[...]:c,robots` ALLOWS search-engine crawling for that volume, even if `--no-robots` is set globally + +also, `--force-js` disables the plain HTML folder listing, making things harder to parse for search engines + + ## complete examples * read-only music server with bpm and key scanning diff --git a/copyparty/__version__.py b/copyparty/__version__.py index b59fafd8..10fdfe4e 100644 --- a/copyparty/__version__.py +++ b/copyparty/__version__.py @@ -1,8 +1,8 @@ # coding: utf-8 -VERSION = (1, 2, 1) +VERSION = (1, 2, 2) CODENAME = "ftp btw" -BUILD_DT = (2022, 3, 3) +BUILD_DT = (2022, 3, 20) S_VERSION = ".".join(map(str, VERSION)) S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT) diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 632a15dd..4c814e4b 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -37,7 +37,7 @@ pre, code, tt, #doc, #doc>code { display: inline-block; padding: .35em .5em .2em .5em; border-radius: 0 .3em .3em 0; - margin: 1.3em 0 0 0; + margin: 1.3em 0 -.2em 0; font-size: 1.4em; } #path #entree { diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 560ce593..7627c30a 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -2426,6 +2426,7 @@ var showfile = (function () { lnh = doc[1], txt = doc[2], name = url.split('/').pop(), + tname = uricom_dec(name)[0], lang = r.getlang(name), is_md = lang == 'md'; @@ -2472,14 +2473,14 @@ var showfile = (function () { wr.style.display = ''; set_tabindex(); - wintitle(name + ' \u2014 '); + wintitle(tname + ' \u2014 '); document.documentElement.scrollTop = 0; var hfun = no_push ? hist_replace : hist_push; hfun(get_evpath() + '?doc=' + url.split('/').pop()); qsr('#docname'); el = mknod('span'); - el.textContent = uricom_dec(name)[0]; + el.textContent = tname; el.setAttribute('id', 'docname'); ebi('path').appendChild(el); diff --git a/docs/notes.sh b/docs/notes.sh index a5223434..f17b6fe1 100644 --- a/docs/notes.sh +++ b/docs/notes.sh @@ -3,6 +3,12 @@ echo not a script exit 1 +## +## add index.html banners + +find -name index.html | sed -r 's/index.html$//' | while IFS= read -r dir; do f="$dir/.prologue.html"; [ -e "$f" ] || echo '