all repos — fsrv @ 96aeb8fa8fc95959f40f1a841e88b04e057ef211

filehost server for x.icyphox.sh

Add notes on filetype hooks
Anirudh Oppiliappan x@icyphox.sh
Mon, 16 Aug 2021 10:11:39 +0530
commit

96aeb8fa8fc95959f40f1a841e88b04e057ef211

parent

b00f8f23450ac8f362a2eaa234199b820fbd17a3

1 files changed, 12 insertions(+), 0 deletions(-)

jump to
M readmereadme

@@ -9,6 +9,7 @@ · Single-user

· Only handles file upload. Serving is left to the reverse proxy. · Bring your own index.html (-index flag) · Requires a key to upload. Change the default! +· Filetype hooks. (See HOOKS) USAGE

@@ -28,3 +29,14 @@ -url string

url for fsrv to serve files (default "localhost") Sample index.html is provided. Edit as required. + + +HOOKS + +Hooks can be defined in the 'hooks/' directory for specific filetypes. +These can be written in any language, provided the file is executable, +and accepts one argument: the file to execute against. + +For example: the hooks/7z.sh file will run against all 7z files, and will +recieve the filename as an argument ($1). The filetype is determined by +parsing magic bytes, and not by file extension.