diff --git a/README.md b/README.md
index 8e65790..027c401 100644
--- a/README.md
+++ b/README.md
@@ -161,6 +161,7 @@ You can specify configuration options either via a config file (default: `config
| `security.insecure_cookies` /
`WAKAPI_INSECURE_COOKIES` | `false` | Whether or not to allow cookies over HTTP |
| `security.cookie_max_age` /
`WAKAPI_COOKIE_MAX_AGE` | `172800` | Lifetime of authentication cookies in seconds or `0` to use [Session](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#Define_the_lifetime_of_a_cookie) cookies |
| `security.allow_signup` /
`WAKAPI_ALLOW_SIGNUP` | `true` | Whether to enable user registration |
+| `security.disable_frontpage` /
`WAKAPI_DISABLE_FRONTPAGE` | `false` | Whether to disable landing page (useful for personal instances) |
| `security.expose_metrics` /
`WAKAPI_EXPOSE_METRICS` | `false` | Whether to expose Prometheus metrics under `/api/metrics` |
| `db.host` /
`WAKAPI_DB_HOST` | - | Database host |
| `db.port` /
`WAKAPI_DB_PORT` | - | Database port |
diff --git a/config.default.yml b/config.default.yml
index 6cab403..5f089fe 100644
--- a/config.default.yml
+++ b/config.default.yml
@@ -55,6 +55,7 @@ security:
insecure_cookies: true # should be set to 'false', except when not running with HTTPS (e.g. on localhost)
cookie_max_age: 172800
allow_signup: true
+ disable_frontpage: false
expose_metrics: false
enable_proxy: false # only intended for production instance at wakapi.dev
diff --git a/config/config.go b/config/config.go
index 3613d8c..c48f941 100644
--- a/config/config.go
+++ b/config/config.go
@@ -87,9 +87,10 @@ type appConfig struct {
}
type securityConfig struct {
- AllowSignup bool `yaml:"allow_signup" default:"true" env:"WAKAPI_ALLOW_SIGNUP"`
- ExposeMetrics bool `yaml:"expose_metrics" default:"false" env:"WAKAPI_EXPOSE_METRICS"`
- EnableProxy bool `yaml:"enable_proxy" default:"false" env:"WAKAPI_ENABLE_PROXY"` // only intended for production instance at wakapi.dev
+ AllowSignup bool `yaml:"allow_signup" default:"true" env:"WAKAPI_ALLOW_SIGNUP"`
+ ExposeMetrics bool `yaml:"expose_metrics" default:"false" env:"WAKAPI_EXPOSE_METRICS"`
+ EnableProxy bool `yaml:"enable_proxy" default:"false" env:"WAKAPI_ENABLE_PROXY"` // only intended for production instance at wakapi.dev
+ DisableFrontpage bool `yaml:"disable_frontpage" default:"false" env:"WAKAPI_DISABLE_FRONTPAGE"`
// this is actually a pepper (https://en.wikipedia.org/wiki/Pepper_(cryptography))
PasswordSalt string `yaml:"password_salt" default:"" env:"WAKAPI_PASSWORD_SALT"`
InsecureCookies bool `yaml:"insecure_cookies" default:"false" env:"WAKAPI_INSECURE_COOKIES"`
diff --git a/routes/home.go b/routes/home.go
index 354fe2b..03df813 100644
--- a/routes/home.go
+++ b/routes/home.go
@@ -46,6 +46,10 @@ func (h *HomeHandler) GetIndex(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, fmt.Sprintf("%s/summary", h.config.Server.BasePath), http.StatusFound)
return
}
+ if h.config.Security.DisableFrontpage {
+ http.Redirect(w, r, fmt.Sprintf("%s/login", h.config.Server.BasePath), http.StatusFound)
+ return
+ }
templates[conf.IndexTemplate].Execute(w, h.buildViewModel(r, w))
}