mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
make some 403s less ambiguous in logs
This commit is contained in:
parent
4ef3526354
commit
b020fd4ad2
|
@ -4825,7 +4825,7 @@ class HttpCli(object):
|
|||
|
||||
def scanvol(self) -> bool:
|
||||
if not self.can_admin:
|
||||
raise Pebkac(403, "not allowed for user " + self.uname)
|
||||
raise Pebkac(403, "'scanvol' not allowed for user " + self.uname)
|
||||
|
||||
if self.args.no_rescan:
|
||||
raise Pebkac(403, "the rescan feature is disabled in server config")
|
||||
|
@ -4848,7 +4848,7 @@ class HttpCli(object):
|
|||
raise Pebkac(400, "only config files ('cfg') can be reloaded rn")
|
||||
|
||||
if not self.avol:
|
||||
raise Pebkac(403, "not allowed for user " + self.uname)
|
||||
raise Pebkac(403, "'reload' not allowed for user " + self.uname)
|
||||
|
||||
if self.args.no_reload:
|
||||
raise Pebkac(403, "the reload feature is disabled in server config")
|
||||
|
@ -4858,7 +4858,7 @@ class HttpCli(object):
|
|||
|
||||
def tx_stack(self) -> bool:
|
||||
if not self.avol and not [x for x in self.wvol if x in self.rvol]:
|
||||
raise Pebkac(403, "not allowed for user " + self.uname)
|
||||
raise Pebkac(403, "'stack' not allowed for user " + self.uname)
|
||||
|
||||
if self.args.no_stack:
|
||||
raise Pebkac(403, "the stackdump feature is disabled in server config")
|
||||
|
@ -5421,7 +5421,7 @@ class HttpCli(object):
|
|||
|
||||
def handle_rm(self, req: list[str]) -> bool:
|
||||
if not req and not self.can_delete:
|
||||
raise Pebkac(403, "not allowed for user " + self.uname)
|
||||
raise Pebkac(403, "'delete' not allowed for user " + self.uname)
|
||||
|
||||
if self.args.no_del:
|
||||
raise Pebkac(403, "the delete feature is disabled in server config")
|
||||
|
|
|
@ -18,7 +18,7 @@ class Metrics(object):
|
|||
|
||||
def tx(self, cli: "HttpCli") -> bool:
|
||||
if not cli.avol:
|
||||
raise Pebkac(403, "not allowed for user " + cli.uname)
|
||||
raise Pebkac(403, "'stats' not allowed for user " + cli.uname)
|
||||
|
||||
args = cli.args
|
||||
if not args.stats:
|
||||
|
|
|
@ -163,6 +163,7 @@ class MCast(object):
|
|||
sck.settimeout(None)
|
||||
sck.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
try:
|
||||
# safe for this purpose; https://lwn.net/Articles/853637/
|
||||
sck.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
|
||||
except:
|
||||
pass
|
||||
|
|
Loading…
Reference in a new issue