cmd/stepd: Add config key and arguments for the directory document
This commit is contained in:
parent
70a1194bca
commit
dc378008d6
@ -31,7 +31,11 @@ func main () {
|
|||||||
":8080", cli.ValString)
|
":8080", cli.ValString)
|
||||||
flagHTTPErrorDocument := cli.NewInputFlag (
|
flagHTTPErrorDocument := cli.NewInputFlag (
|
||||||
0, "http-error-document",
|
0, "http-error-document",
|
||||||
"The document to use for displaying http errors.",
|
"The document to use for displaying errors over http.",
|
||||||
|
"", cli.ValString)
|
||||||
|
flagHTTPDirectoryDocument := cli.NewInputFlag (
|
||||||
|
0, "http-directory-document",
|
||||||
|
"The document to use for displaying directory listings over http.",
|
||||||
"", cli.ValString)
|
"", cli.ValString)
|
||||||
flagDirectories := cli.NewFlag (
|
flagDirectories := cli.NewFlag (
|
||||||
'd', "directories",
|
'd', "directories",
|
||||||
@ -41,6 +45,7 @@ func main () {
|
|||||||
flagPidFile,
|
flagPidFile,
|
||||||
flagHTTPAddress,
|
flagHTTPAddress,
|
||||||
flagHTTPErrorDocument,
|
flagHTTPErrorDocument,
|
||||||
|
flagHTTPDirectoryDocument,
|
||||||
flagDirectories,
|
flagDirectories,
|
||||||
cli.NewHelp())
|
cli.NewHelp())
|
||||||
cmd.Syntax = "[OPTIONS]... [DIRECTORY]"
|
cmd.Syntax = "[OPTIONS]... [DIRECTORY]"
|
||||||
@ -111,12 +116,13 @@ func main () {
|
|||||||
|
|
||||||
// set up the HTTP handler
|
// set up the HTTP handler
|
||||||
handler := stephttp.Handler {
|
handler := stephttp.Handler {
|
||||||
Environment: &environment,
|
Environment: &environment,
|
||||||
Directories: config.Get("http.serve-directories") == "true",
|
Directories: config.Get("http.serve-directories") == "true",
|
||||||
StepExt: ucontainer.NewSet(slices.Clone(config["http.step-extension"])...),
|
StepExt: ucontainer.NewSet(slices.Clone(config["http.step-extension"])...),
|
||||||
Index: slices.Clone(config["http.index-file"]),
|
Index: slices.Clone(config["http.index-file"]),
|
||||||
ErrorDocument: config.Get("http.error-document"),
|
ErrorDocument: config.Get("http.error-document"),
|
||||||
DenyAll: ucontainer.NewSet(configFileName),
|
DirectoryDocument: config.Get("http.directory-document"),
|
||||||
|
DenyAll: ucontainer.NewSet(configFileName),
|
||||||
}
|
}
|
||||||
if len(handler.StepExt) == 0 {
|
if len(handler.StepExt) == 0 {
|
||||||
handler.StepExt.Add(".step")
|
handler.StepExt.Add(".step")
|
||||||
|
Loading…
Reference in New Issue
Block a user