HTTP Plugins
Following I’ll explain how to configure HTTP plugins, by default Metronome will listen on port 5280 without security. For example to make it listen on port 5280 with TLS you’ll have to deactivate the HTTP default port first by emptying the http_ports table.
Host “*”
interfaces = { “127.0.0.1”, “::1” }
ssl = { key = “/etc/metronome/certs/localhost.key”, certificate = “/etc/metronome/certs/localhost.cert” }
http_ports = {}
https_ports = { 5280 }
Below is an example if you want to have Metronome listen on https port and set activate a HTTP upload component. Just beware that Metronome to bind on ports below 1024 either needs root or CAP_NET_BIND_SERVICE capabilities as a normal user.
Host “*”
interfaces = { “127.0.0.1”, “::1” }
ssl = { key = “/etc/metronome/certs/localhost.key”, certificate = “/etc/metronome/certs/localhost.cert” }
http_ports = {}
https_ports = { 443 }Component “upload.mydomain.tld” “http_upload”
http_file_quota = 120*1024*1024 — File quota per user
http_file_expire_after = 86400 — Time to expire files
To set the above capabilities to run on a normal user you need to have libcap2 installed then run as root setcap ‘cap_net_bind_service=+ep’ /path/to/executable … this command can only be used on actual executables not scripts, so if you want to add binding caps to Metronome just run the above on the Lua interpreter executable.