aboutsummaryrefslogtreecommitdiff
path: root/input.go
diff options
context:
space:
mode:
authorYotam Nachum <me@yotam.net>2019-12-20 19:19:46 +0200
committerYotam Nachum <me@yotam.net>2019-12-20 19:24:42 +0200
commit770c42463ec01396bd8f0c5719b725c4f2716392 (patch)
treed480cfbabcf539da16a83e4843559955b59360b6 /input.go
parentAdd systemd service file (diff)
downloadshavit-770c42463ec01396bd8f0c5719b725c4f2716392.tar.gz
shavit-770c42463ec01396bd8f0c5719b725c4f2716392.zip
Execute requested file if it's executable
This is only an MVP for this feature. The executable can't set the status and meta of the response and the whole response body must fit in memory.
Diffstat (limited to 'input.go')
-rw-r--r--input.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/input.go b/input.go
index 26e65f5..6b3d0e8 100644
--- a/input.go
+++ b/input.go
@@ -39,6 +39,9 @@ type Config struct {
// default to ["index.gmi"]
IndexFiles []string `toml:"index_files"`
+ // default to 5
+ ExecTimeout int64 `toml:"exec_timeout"`
+
TLSCert string `toml:"tls_certificate"`
TLSKey string `toml:"tls_key"`
}
@@ -64,5 +67,9 @@ func getConfig(path string) (Config, error) {
cfg.IndexFiles = []string{"index.gmi"}
}
+ if cfg.ExecTimeout == 0 {
+ cfg.ExecTimeout = 5
+ }
+
return cfg, nil
}