mirror of
https://github.com/filebrowser/filebrowser.git
synced 2026-01-23 02:35:10 +00:00
feat: configurable logout page URL for proxy/hook auth (#3884)
Co-authored-by: Henrique Dias <mail@hacdias.com>
This commit is contained in:
parent
701522a060
commit
b9ac45d5da
9 changed files with 52 additions and 9 deletions
|
|
@ -11,6 +11,7 @@ import (
|
|||
)
|
||||
|
||||
const DefaultUsersHomeBasePath = "/users"
|
||||
const DefaultLogoutPage = "/login"
|
||||
const DefaultMinimumPasswordLength = 12
|
||||
const DefaultFileMode = 0640
|
||||
const DefaultDirMode = 0750
|
||||
|
|
@ -27,6 +28,7 @@ type Settings struct {
|
|||
UserHomeBasePath string `json:"userHomeBasePath"`
|
||||
Defaults UserDefaults `json:"defaults"`
|
||||
AuthMethod AuthMethod `json:"authMethod"`
|
||||
LogoutPage string `json:"logoutPage"`
|
||||
Branding Branding `json:"branding"`
|
||||
Tus Tus `json:"tus"`
|
||||
Commands map[string][]string `json:"commands"`
|
||||
|
|
|
|||
|
|
@ -30,24 +30,34 @@ func (s *Storage) Get() (*Settings, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if set.UserHomeBasePath == "" {
|
||||
set.UserHomeBasePath = DefaultUsersHomeBasePath
|
||||
}
|
||||
|
||||
if set.LogoutPage == "" {
|
||||
set.LogoutPage = DefaultLogoutPage
|
||||
}
|
||||
|
||||
if set.MinimumPasswordLength == 0 {
|
||||
set.MinimumPasswordLength = DefaultMinimumPasswordLength
|
||||
}
|
||||
|
||||
if set.Tus == (Tus{}) {
|
||||
set.Tus = Tus{
|
||||
ChunkSize: DefaultTusChunkSize,
|
||||
RetryCount: DefaultTusRetryCount,
|
||||
}
|
||||
}
|
||||
|
||||
if set.FileMode == 0 {
|
||||
set.FileMode = DefaultFileMode
|
||||
}
|
||||
|
||||
if set.DirMode == 0 {
|
||||
set.DirMode = DefaultDirMode
|
||||
}
|
||||
|
||||
return set, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue