Security: Add "disable-tls" config option to always disable HTTPS

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer 2022-10-22 22:53:42 +02:00
parent eb3831d841
commit 9de5662c75
2 changed files with 6 additions and 1 deletions

View file

@ -209,6 +209,11 @@ var Flags = CliFlags{
Usage: "enable experimental features",
EnvVar: "PHOTOPRISM_EXPERIMENTAL",
}}, {
Flag: cli.BoolFlag{
Name: "disable-tls",
Usage: "disable HTTPS even if a certificate is available",
EnvVar: "PHOTOPRISM_DISABLE_TLS",
}}, {
Flag: cli.BoolFlag{
Name: "disable-webdav",
Usage: "disable built-in WebDAV server",

View file

@ -72,6 +72,7 @@ func (c *Config) Report() (rows [][]string, cols []string) {
// Feature Flags.
{"read-only", fmt.Sprintf("%t", c.ReadOnly())},
{"experimental", fmt.Sprintf("%t", c.Experimental())},
{"disable-tls", fmt.Sprintf("%t", c.DisableTLS())},
{"disable-webdav", fmt.Sprintf("%t", c.DisableWebDAV())},
{"disable-settings", fmt.Sprintf("%t", c.DisableSettings())},
{"disable-places", fmt.Sprintf("%t", c.DisablePlaces())},
@ -139,7 +140,6 @@ func (c *Config) Report() (rows [][]string, cols []string) {
{"tls-email", c.TLSEmail()},
{"tls-cert", c.TLSCert()},
{"tls-key", c.TLSKey()},
{"disable-tls", fmt.Sprintf("%t", c.DisableTLS())},
// Database.
{"database-driver", c.DatabaseDriver()},