diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index e858cac5..f248e0df 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -1070,6 +1070,7 @@ class AuthSrv(object): "tcolor": self.args.tcolor, "du_iwho": self.args.du_iwho, "shr_who": self.args.shr_who if self.args.shr else "no", + "emb_all": FN_EMB, "ls_q_m": ("", ""), } self._vf0 = self._vf0b.copy() @@ -2573,16 +2574,22 @@ class AuthSrv(object): t = "WARNING: volume [/%s]: invalid value specified for ext-th: %s" self.log(t % (vol.vpath, etv), 3) + emb_all = vol.flags["emb_all"] = set() + zsl1 = [x for x in vol.flags["preadmes"].split(",") if x] zsl2 = [x for x in vol.flags["readmes"].split(",") if x] zsl3 = list(set([x.lower() for x in zsl1])) zsl4 = list(set([x.lower() for x in zsl2])) + emb_all.update(zsl3) + emb_all.update(zsl4) vol.flags["emb_mds"] = [[0, zsl1, zsl3], [1, zsl2, zsl4]] zsl1 = [x for x in vol.flags["prologues"].split(",") if x] zsl2 = [x for x in vol.flags["epilogues"].split(",") if x] zsl3 = list(set([x.lower() for x in zsl1])) zsl4 = list(set([x.lower() for x in zsl2])) + emb_all.update(zsl3) + emb_all.update(zsl4) vol.flags["emb_lgs"] = [[0, zsl1, zsl3], [1, zsl2, zsl4]] zs = str(vol.flags.get("html_head") or "") diff --git a/copyparty/ftpd.py b/copyparty/ftpd.py index c1bc543b..e5d8ff9e 100644 --- a/copyparty/ftpd.py +++ b/copyparty/ftpd.py @@ -19,7 +19,6 @@ from .__init__ import PY2, TYPE_CHECKING from .authsrv import VFS from .bos import bos from .util import ( - FN_EMB, VF_CAREFUL, Daemon, ODict, @@ -179,7 +178,7 @@ class FtpFs(AbstractedFS): vfs, rem = self.hub.asrv.vfs.get(vpath, self.uname, r, w, m, d) if ( w - and fn.lower() in FN_EMB + and fn.lower() in vfs.flags["emb_all"] and self.h.uname not in vfs.axs.uread and "wo_up_readme" not in vfs.flags ): diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 9d8092c2..785f85ac 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -45,7 +45,6 @@ from .util import ( BITNESS, DAV_ALLPROPS, E_SCK_WR, - FN_EMB, HAVE_SQLITE3, HTTPCODE, UTC, @@ -2922,7 +2921,7 @@ class HttpCli(object): if ( not self.can_read and self.can_write - and name.lower() in FN_EMB + and name.lower() in dbv.flags["emb_all"] and "wo_up_readme" not in dbv.flags ): name = "_wo_" + name diff --git a/copyparty/sftpd.py b/copyparty/sftpd.py index deb92042..790ff5b6 100644 --- a/copyparty/sftpd.py +++ b/copyparty/sftpd.py @@ -26,7 +26,6 @@ from .__init__ import ANYWIN, TYPE_CHECKING from .authsrv import LEELOO_DALLAS, VFS, AuthSrv from .bos import bos from .util import ( - FN_EMB, VF_CAREFUL, Daemon, ODict, @@ -328,7 +327,7 @@ class SFTP_Srv(paramiko.SFTPServerInterface): vn, rem = self.hub.asrv.vfs.get(vpath, self.uname, r, w, m, d) if ( w - and fn.lower() in FN_EMB + and fn.lower() in vn.flags["emb_all"] and self.uname not in vn.axs.uread and "wo_up_readme" not in vn.flags ): diff --git a/copyparty/tftpd.py b/copyparty/tftpd.py index 9eb76643..8e4c70b7 100644 --- a/copyparty/tftpd.py +++ b/copyparty/tftpd.py @@ -37,7 +37,6 @@ from .__init__ import EXE, PY2, TYPE_CHECKING from .authsrv import VFS from .bos import bos from .util import ( - FN_EMB, UTC, BytesIO, Daemon, @@ -268,7 +267,7 @@ class Tftpd(object): vfs, rem = self.asrv.vfs.get(vpath, "*", *perms) if perms[1] and "*" not in vfs.axs.uread and "wo_up_readme" not in vfs.flags: zs, fn = vsplit(vpath) - if fn.lower() in FN_EMB: + if fn.lower() in vfs.flags["emb_all"]: vpath = vjoin(zs, "_wo_" + fn) vfs, rem = self.asrv.vfs.get(vpath, "*", *perms) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 81c221f1..b5356bfd 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -1152,7 +1152,7 @@ class Up2k(object): ft = "\033[0;32m{}{:.0}" ff = "\033[0;35m{}{:.0}" fv = "\033[0;36m{}:\033[90m{}" - zs = "bcasechk du_iwho emb_lgs emb_mds ext_th_d html_head html_head_d html_head_s ls_q_m put_name2 mv_re_r mv_re_t rm_re_r rm_re_t srch_re_dots srch_re_nodot zipmax zipmaxn_v zipmaxs_v" + zs = "bcasechk du_iwho emb_all emb_lgs emb_mds ext_th_d html_head html_head_d html_head_s ls_q_m put_name2 mv_re_r mv_re_t rm_re_r rm_re_t srch_re_dots srch_re_nodot zipmax zipmaxn_v zipmaxs_v" fx = set(zs.split()) fd = vf_bmap() fd.update(vf_cmap())