diff options
author | Yotam Nachum <me@yotam.net> | 2019-12-20 19:19:46 +0200 |
---|---|---|
committer | Yotam Nachum <me@yotam.net> | 2019-12-20 19:24:42 +0200 |
commit | 770c42463ec01396bd8f0c5719b725c4f2716392 (patch) | |
tree | d480cfbabcf539da16a83e4843559955b59360b6 /input.go | |
parent | Add systemd service file (diff) | |
download | shavit-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.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 } |