all repos — honk @ 8f8660b7cb181753b38703e2b6d46d38046743ed

my fork of honk

debug mode
Ted Unangst tedu@tedunangst.com
Sun, 20 Oct 2019 16:39:01 -0400
commit

8f8660b7cb181753b38703e2b6d46d38046743ed

parent

fa45208b13120529dc3ca6876b5e9d7698a8d595

2 files changed, 17 insertions(+), 0 deletions(-)

jump to
M docs/honk.8docs/honk.8

@@ -123,6 +123,11 @@ .Nm

is not currently hardened against SSRF, server side request forgery. Be mindful of what other services may be exposed via localhost or the local network. +.Sh DEBUG +Debug mode may be enabled or disabled by running +.Ic debug Ar on|off . +In debug mode, secure cookies are disabled and templates are reloaded +every request. .Sh ENVIRONMENT Image processing and scaling requires considerable memory. It is recommended to adjust the datasize ulimit to at least 1GB.
M honk.gohonk.go

@@ -169,6 +169,18 @@ getconfig("usersep", &userSep)

getconfig("honksep", &honkSep) prepareStatements(db) switch cmd { + case "debug": + if len(os.Args) != 3 { + log.Fatal("need an argument: debug (on|off)") + } + switch os.Args[2] { + case "on": + saveconfig("debug", 1) + case "off": + saveconfig("debug", 0) + default: + log.Fatal("argument must be on or off") + } case "adduser": adduser() case "chpass":