mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
hide dotfiles from search results by default
This commit is contained in:
parent
6d1d3e48d8
commit
e413007eb0
|
@ -535,6 +535,8 @@ def get_sects():
|
|||
\033[36mxlink$\033[35m cross-volume dupe detection / linking
|
||||
\033[36mxdev\033[35m do not descend into other filesystems
|
||||
\033[36mxvol\033[35m skip symlinks leaving the volume root
|
||||
\033[36mdotsrch\033[35m show dotfiles in search results
|
||||
\033[36mnodotsrch\033[35m hide dotfiles in search results (default)
|
||||
|
||||
\033[0mdatabase, audio tags:
|
||||
"mte", "mth", "mtp", "mtm" all work the same as -mte, -mth, ...
|
||||
|
@ -552,6 +554,12 @@ def get_sects():
|
|||
\033[36mhtml_head=TXT\033[35m includes TXT in the <head>
|
||||
\033[36mrobots\033[35m allows indexing by search engines (default)
|
||||
\033[36mnorobots\033[35m kindly asks search engines to leave
|
||||
\033[36mno_sb_md\033[35m disable js sandbox for markdown files
|
||||
\033[36mno_sb_lg\033[35m disable js sandbox for prologue/epilogue
|
||||
\033[36msb_md\033[35m enable js sandbox for markdown files (default)
|
||||
\033[36msb_lg\033[35m enable js sandbox for prologue/epilogue (default)
|
||||
\033[36mmd_sbf\033[35m list of markdown-sandbox safeguards to disable
|
||||
\033[36mlg_sbf\033[35m list of *logue-sandbox safeguards to disable
|
||||
|
||||
\033[0mothers:
|
||||
\033[36mfk=8\033[35m generates per-file accesskeys,
|
||||
|
@ -944,6 +952,7 @@ def add_db_general(ap, hcores):
|
|||
ap2.add_argument("--db-act", metavar="SEC", type=float, default=10, help="defer any scheduled volume reindexing until SEC seconds after last db write (uploads, renames, ...)")
|
||||
ap2.add_argument("--srch-time", metavar="SEC", type=int, default=45, help="search deadline -- terminate searches running for more than SEC seconds")
|
||||
ap2.add_argument("--srch-hits", metavar="N", type=int, default=7999, help="max search results to allow clients to fetch; 125 results will be shown initially")
|
||||
ap2.add_argument("--dotsrch", action="store_true", help="show dotfiles in search results (volflags: dotsrch | nodotsrch)")
|
||||
|
||||
|
||||
def add_db_metadata(ap):
|
||||
|
|
|
@ -1128,6 +1128,7 @@ class AuthSrv(object):
|
|||
("no_dedup", "copydupes"),
|
||||
("magic", "magic"),
|
||||
("xlink", "xlink"),
|
||||
("dotsrch", "dotsrch"),
|
||||
):
|
||||
if getattr(self.args, ga):
|
||||
vol.flags[vf] = True
|
||||
|
@ -1135,6 +1136,7 @@ class AuthSrv(object):
|
|||
for ve, vd in (
|
||||
("sb_md", "no_sb_md"),
|
||||
("sb_lg", "no_sb_lg"),
|
||||
("nodotsrch", "dotsrch"),
|
||||
):
|
||||
if ve in vol.flags:
|
||||
vol.flags.pop(vd, None)
|
||||
|
|
|
@ -3355,7 +3355,7 @@ class HttpCli(object):
|
|||
if not self.args.no_readme and not logues[1]:
|
||||
for fn in ["README.md", "readme.md"]:
|
||||
fn = os.path.join(abspath, fn)
|
||||
if bos.path.exists(fn):
|
||||
if bos.path.isfile(fn):
|
||||
with open(fsenc(fn), "rb") as f:
|
||||
readme = f.read().decode("utf-8")
|
||||
break
|
||||
|
|
|
@ -311,6 +311,7 @@ class U2idx(object):
|
|||
|
||||
sret = []
|
||||
fk = flags.get("fk")
|
||||
dots = flags.get("dotsrch")
|
||||
c = cur.execute(uq, tuple(vuv))
|
||||
for hit in c:
|
||||
w, ts, sz, rd, fn, ip, at = hit[:7]
|
||||
|
@ -321,6 +322,10 @@ class U2idx(object):
|
|||
if rd.startswith("//") or fn.startswith("//"):
|
||||
rd, fn = s3dec(rd, fn)
|
||||
|
||||
rp = quotep("/".join([x for x in [vtop, rd, fn] if x]))
|
||||
if not dots and "/." in ("/" + rp):
|
||||
continue
|
||||
|
||||
if not fk:
|
||||
suf = ""
|
||||
else:
|
||||
|
@ -337,8 +342,7 @@ class U2idx(object):
|
|||
)[:fk]
|
||||
)
|
||||
|
||||
rp = quotep("/".join([x for x in [vtop, rd, fn] if x])) + suf
|
||||
sret.append({"ts": int(ts), "sz": sz, "rp": rp, "w": w[:16]})
|
||||
sret.append({"ts": int(ts), "sz": sz, "rp": rp + suf, "w": w[:16]})
|
||||
|
||||
for hit in sret:
|
||||
w = hit["w"]
|
||||
|
|
|
@ -98,7 +98,7 @@ class Cfg(Namespace):
|
|||
def __init__(self, a=None, v=None, c=None):
|
||||
ka = {}
|
||||
|
||||
ex = "daw dav_inf dav_mac e2d e2ds e2dsa e2t e2ts e2tsr e2v e2vu e2vp ed emp force_js getmod hardlink ihead magic never_symlink nid nih no_acode no_athumb no_dav no_dedup no_del no_dupe no_logues no_mv no_readme no_robots no_sb_md no_sb_lg no_scandir no_thumb no_vthumb no_zip nw xdev xlink xvol"
|
||||
ex = "daw dav_inf dav_mac dotsrch e2d e2ds e2dsa e2t e2ts e2tsr e2v e2vu e2vp ed emp force_js getmod hardlink ihead magic never_symlink nid nih no_acode no_athumb no_dav no_dedup no_del no_dupe no_logues no_mv no_readme no_robots no_sb_md no_sb_lg no_scandir no_thumb no_vthumb no_zip nw xdev xlink xvol"
|
||||
ka.update(**{k: False for k in ex.split()})
|
||||
|
||||
ex = "dotpart no_rescan no_sendfile no_voldump plain_ip"
|
||||
|
|
Loading…
Reference in a new issue