diff options
| author | Ahmed <git@gumx.cc> | 2026-06-17 14:41:47 +0300 |
|---|---|---|
| committer | Ahmed <git@gumx.cc> | 2026-06-17 14:41:47 +0300 |
| commit | 48f6bf9cff66607627480cd642ceae7fe349d959 (patch) | |
| tree | 351d23001a03fe27a2411e8ca8057f95cf7aa7d2 /alfred/server.py | |
| parent | 1a9e60c8b1591bab60da50ab39723de77ab034bd (diff) | |
fix: remove clamav commands
Diffstat (limited to 'alfred/server.py')
| -rw-r--r-- | alfred/server.py | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/alfred/server.py b/alfred/server.py index a369b88..0ed514b 100644 --- a/alfred/server.py +++ b/alfred/server.py @@ -15,7 +15,6 @@ Commands (owner only) - use !server or !srv: !server conns - TCP connection summary !server who - logged-in users !server logs <service> [n] - last n lines of service log (default 10) - !server scan [path] - run clamscan on path (default: mail) """ import os @@ -229,26 +228,6 @@ def _who(bot, _args): bot.say(line) -def _scan(bot, args): - path = args[0] if args else "/home/ahmed/mail" - allowed = ("/home/ahmed/mail", "/var/0x0/files", "/tmp", "/var/quarantine") - if not any(path.startswith(p) for p in allowed): - bot.say(f"scan: path not allowed: {path}") - return - bot.say(f"scan: starting clamscan on {path} ...") - r = subprocess.run( - ["clamscan", "-r", "--quiet", "--infected", path], - capture_output=True, text=True, timeout=300 - ) - out = (r.stdout + r.stderr).strip() - if not out: - bot.say("scan: no infected files found") - else: - for line in out.splitlines()[:15]: - bot.say(line) - bot.say(f"scan: done (exit {r.returncode})") - - def _logs(bot, args): if not args: bot.say("usage: !srv logs <service> [n]") @@ -284,7 +263,6 @@ _SUBCOMMANDS = { "conns": _conns, "who": _who, "logs": _logs, - "scan": _scan, } |
