aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed <git@gumx.cc>2026-06-17 14:41:47 +0300
committerAhmed <git@gumx.cc>2026-06-17 14:41:47 +0300
commit48f6bf9cff66607627480cd642ceae7fe349d959 (patch)
tree351d23001a03fe27a2411e8ca8057f95cf7aa7d2
parent1a9e60c8b1591bab60da50ab39723de77ab034bd (diff)
fix: remove clamav commands
-rw-r--r--alfred/files.py5
-rw-r--r--alfred/helpstrings.py6
-rw-r--r--alfred/server.py22
3 files changed, 2 insertions, 31 deletions
diff --git a/alfred/files.py b/alfred/files.py
index 5775bdf..5f01430 100644
--- a/alfred/files.py
+++ b/alfred/files.py
@@ -10,7 +10,6 @@ All commands are owner-only and work in channel or PM.
!files shorten <url> [wkfo|gumx] - shorten a URL (default: wkfo)
!files mirror <url> [wkfo|gumx] - mirror a remote URL to this instance
!files prune - delete expired files from disk
- !files vscan - run ClamAV scan on stored files
!files remove <filename> - permanently remove a file
"""
@@ -145,10 +144,6 @@ def cmd_files(bot, trigger):
bot.say("pruning expired files...")
bot.say(_flask(bot, "prune"))
- elif sub == "vscan":
- bot.say("running vscan - this may take a while...")
- bot.say(_flask(bot, "vscan", timeout=300))
-
elif sub == "remove" and len(args) == 2:
_cmd_remove(bot, args[1])
diff --git a/alfred/helpstrings.py b/alfred/helpstrings.py
index e81676b..d944799 100644
--- a/alfred/helpstrings.py
+++ b/alfred/helpstrings.py
@@ -1,6 +1,6 @@
TOPICS = "topics: srv, bot, files, irc, coffee, vpn, list, git. type !help <topic> for details"
-SRV_TOPIC = "srv: uptime disk mem load status net top topmem io conns who logs scan. type !help srv <cmd> for details"
+SRV_TOPIC = "srv: uptime disk mem load status net top topmem io conns who logs. type !help srv <cmd> for details"
SRV = {
"uptime": "srv uptime: system uptime and load averages. usage: !srv uptime",
"disk": "srv disk: disk usage for root. usage: !srv disk",
@@ -14,7 +14,6 @@ SRV = {
"conns": "srv conns: TCP connection summary. usage: !srv conns",
"who": "srv who: currently logged-in users. usage: !srv who",
"logs": "srv logs: last n lines from a service log. usage: !srv logs service or !srv logs service n",
- "scan": "srv scan: run clamscan on a path. usage: !srv scan or !srv scan path (allowed: mail, 0x0 files, tmp, quarantine)",
}
BOT_TOPIC = "bot: list, all, name start stop restart status. type !help bot <cmd> for details"
@@ -24,14 +23,13 @@ BOT = {
}
BOT_NAME = "bot name: control or check a specific bot. usage: !bot name start or stop or restart or status"
-FILES_TOPIC = "files: stats list shorten mirror prune vscan remove. type !help files <cmd> for details"
+FILES_TOPIC = "files: stats list shorten mirror prune remove. type !help files <cmd> for details"
FILES = {
"stats": "files stats: live permanent removed count and total size. usage: !files stats",
"list": "files list: last n uploads with name size and expiry. usage: !files list or !files list n",
"shorten": "files shorten: shorten a URL. usage: !files shorten url or !files shorten url wkfo or gumx",
"mirror": "files mirror: mirror a remote URL into this instance. usage: !files mirror url or !files mirror url wkfo or gumx",
"prune": "files prune: delete all expired files from disk. usage: !files prune",
- "vscan": "files vscan: run ClamAV scan on all stored files. usage: !files vscan",
"remove": "files remove: permanently delete a file by filename. usage: !files remove filename",
}
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,
}