fix some error-messages failing to render

would show a jinja-panic instead of explaining what went wrong
This commit is contained in:
ed 2025-07-20 23:39:08 +02:00
parent 8c32b0e7bb
commit 1afbff7335

View file

@ -922,6 +922,9 @@ class AuthSrv(object):
yield prev, True yield prev, True
def vf0(self):
return {"d2d": True, "tcolor": self.args.tcolor}
def idp_checkin( def idp_checkin(
self, broker: Optional["BrokerCli"], uname: str, gname: str self, broker: Optional["BrokerCli"], uname: str, gname: str
) -> bool: ) -> bool:
@ -1628,13 +1631,12 @@ class AuthSrv(object):
t = "Read-access has been disabled due to failsafe: No volumes were defined by the config-file. This failsafe is to prevent unintended access if this is due to accidental loss of config. You can override this safeguard and allow read/write to the working-directory by adding the following arguments: -v .::rw" t = "Read-access has been disabled due to failsafe: No volumes were defined by the config-file. This failsafe is to prevent unintended access if this is due to accidental loss of config. You can override this safeguard and allow read/write to the working-directory by adding the following arguments: -v .::rw"
self.log(t, 1) self.log(t, 1)
axs = AXS() axs = AXS()
vfs = VFS(self.log_func, absreal("."), "", "", axs, {}) vfs = VFS(self.log_func, absreal("."), "", "", axs, self.vf0())
if not axs.uread: if not axs.uread:
self.badcfg1 = True self.badcfg1 = True
elif "" not in mount: elif "" not in mount:
# there's volumes but no root; make root inaccessible # there's volumes but no root; make root inaccessible
zsd = {"d2d": True, "tcolor": self.args.tcolor} vfs = VFS(self.log_func, "", "", "", AXS(), self.vf0())
vfs = VFS(self.log_func, "", "", "", AXS(), zsd)
maxdepth = 0 maxdepth = 0
for dst in sorted(mount.keys(), key=lambda x: (x.count("/"), len(x))): for dst in sorted(mount.keys(), key=lambda x: (x.count("/"), len(x))):
@ -1683,8 +1685,7 @@ class AuthSrv(object):
if enshare: if enshare:
assert sqlite3 # type: ignore # !rm assert sqlite3 # type: ignore # !rm
zsd = {"d2d": True, "tcolor": self.args.tcolor} shv = VFS(self.log_func, "", shr, shr, AXS(), self.vf0())
shv = VFS(self.log_func, "", shr, shr, AXS(), zsd)
db_path = self.args.shr_db db_path = self.args.shr_db
db = sqlite3.connect(db_path) db = sqlite3.connect(db_path)
@ -2567,7 +2568,7 @@ class AuthSrv(object):
continue # also fine continue # also fine
for zs in svn.nodes.keys(): for zs in svn.nodes.keys():
# hide subvolume # hide subvolume
vn.nodes[zs] = VFS(self.log_func, "", "", "", AXS(), {}) vn.nodes[zs] = VFS(self.log_func, "", "", "", AXS(), self.vf0())
cur2.close() cur2.close()
cur.close() cur.close()