aboutsummaryrefslogtreecommitdiff
path: root/hex_zero.py
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-12-19 14:40:20 -0500
committerB Stack <bgstack15@gmail.com>2020-12-19 14:40:20 -0500
commitf6ec759890a86981942fd144400df3e8ac856644 (patch)
treec26541f8ad3a6d4c1f80dd09398bbd00aa6c6277 /hex_zero.py
parentadd drag-and-drop /upload/ route (diff)
downloadhex-zero-stack.tar.gz
hex-zero-stack.tar.bz2
hex-zero-stack.zip
add hex-zeroctl which calls flask managerstack
and the function descriptions so hex-zeroctl can describe available functions
Diffstat (limited to 'hex_zero.py')
-rwxr-xr-xhex_zero.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/hex_zero.py b/hex_zero.py
index bcd8bb3..c91a326 100755
--- a/hex_zero.py
+++ b/hex_zero.py
@@ -464,6 +464,9 @@ def debug():
@manager.command
def permadelete(name):
+ """
+ Remove file from disk and mark it as removed in db
+ """
id = su.debase(name)
f = File.query.get(id)
@@ -475,6 +478,9 @@ def permadelete(name):
@manager.command
def query(name):
+ """
+ Find file with this name sans extension, e.g., E
+ """
id = su.debase(name)
f = File.query.get(id)
@@ -483,6 +489,9 @@ def query(name):
@manager.command
def queryhash(h):
+ """
+ Find file by this sha256 hash
+ """
f = File.query.filter_by(sha256=h).first()
if f:
@@ -490,6 +499,9 @@ def queryhash(h):
@manager.command
def queryaddr(a, nsfw=False, removed=False):
+ """
+ Find all files uploaded from this IP address
+ """
res = File.query.filter_by(addr=a)
if not removed:
@@ -503,6 +515,9 @@ def queryaddr(a, nsfw=False, removed=False):
@manager.command
def deladdr(a):
+ """
+ Delete all files uploaded from this IP address
+ """
res = File.query.filter_by(addr=a).filter(File.removed != True)
for f in res:
bgstack15