From d53426b580a81f1f77c4e790da74951b15999f2e Mon Sep 17 00:00:00 2001 From: Graham Steffaniak <42989099+gtsteffaniak@users.noreply.github.com> Date: Tue, 10 Oct 2023 20:03:33 -0500 Subject: [PATCH] V0.2.1 - update signup (#47) Co-authored-by: Graham Steffaniak --- backend/cmd/root.go | 6 +- backend/filebrowser.yaml | 3 +- backend/http/auth.go | 8 +- backend/http/public_test.go | 6 +- backend/http/settings.go | 11 +- backend/http/static.go | 3 +- backend/settings/config.go | 9 +- backend/settings/dir.go | 4 +- backend/settings/dir_test.go | 23 +-- backend/settings/storage.go | 6 +- backend/settings/structs.go | 39 +++-- backend/storage/bolt/users.go | 2 - backend/users/password.go | 3 - configuration.md | 21 ++- .../public/img/icons/safari-pinned-tab.svg | 42 ----- frontend/public/img/logo.png | Bin 0 -> 15614 bytes frontend/public/img/logo.svg | 147 ------------------ frontend/public/index.html | 15 +- frontend/src/css/login.css | 2 +- frontend/src/utils/constants.js | 5 +- frontend/src/views/Login.vue | 6 +- frontend/src/views/Settings.vue | 2 +- frontend/src/views/files/Preview.vue | 7 +- frontend/src/views/settings/User.vue | 8 +- 24 files changed, 102 insertions(+), 276 deletions(-) delete mode 100644 frontend/public/img/icons/safari-pinned-tab.svg create mode 100644 frontend/public/img/logo.png delete mode 100644 frontend/public/img/logo.svg diff --git a/backend/cmd/root.go b/backend/cmd/root.go index 58493985..84080622 100644 --- a/backend/cmd/root.go +++ b/backend/cmd/root.go @@ -118,7 +118,7 @@ func cleanupHandler(listener net.Listener, c chan os.Signal) { //nolint:interfac } func quickSetup(d pythonData) { - settings.GlobalConfiguration.Key = generateKey() + settings.GlobalConfiguration.Auth.Key = generateKey() if settings.GlobalConfiguration.Auth.Method == "noauth" { err := d.store.Auth.Save(&auth.NoAuth{}) checkErr(err) @@ -131,8 +131,8 @@ func quickSetup(d pythonData) { checkErr(err) err = d.store.Settings.SaveServer(&settings.GlobalConfiguration.Server) checkErr(err) - username := settings.GlobalConfiguration.AdminUsername - password := settings.GlobalConfiguration.AdminPassword + username := settings.GlobalConfiguration.Auth.AdminUsername + password := settings.GlobalConfiguration.Auth.AdminPassword if username == "" || password == "" { log.Fatal("username and password cannot be empty during quick setup") } diff --git a/backend/filebrowser.yaml b/backend/filebrowser.yaml index 3fc41d26..4718e8a1 100644 --- a/backend/filebrowser.yaml +++ b/backend/filebrowser.yaml @@ -1,9 +1,10 @@ server: port: 8080 baseURL: "/" + root: "/Users/steffag/git/go" auth: method: password - signup: true + signup: false userDefaults: darkMode: true disableSettings: false diff --git a/backend/http/auth.go b/backend/http/auth.go index a2f67895..612efca6 100644 --- a/backend/http/auth.go +++ b/backend/http/auth.go @@ -55,7 +55,7 @@ func (e extractor) ExtractToken(r *http.Request) (string, error) { func withUser(fn handleFunc) handleFunc { return func(w http.ResponseWriter, r *http.Request, d *data) (int, error) { keyFunc := func(token *jwt.Token) (interface{}, error) { - return d.settings.Key, nil + return d.settings.Auth.Key, nil } var tk authToken @@ -112,7 +112,7 @@ type signupBody struct { } var signupHandler = func(w http.ResponseWriter, r *http.Request, d *data) (int, error) { - if !d.settings.Signup { + if !settings.GlobalConfiguration.Auth.Signup { return http.StatusMethodNotAllowed, nil } @@ -142,7 +142,7 @@ var signupHandler = func(w http.ResponseWriter, r *http.Request, d *data) (int, } user.Scope = userHome log.Printf("new user: %s, home dir: [%s].", user.Username, userHome) - + settings.GlobalConfiguration.UserDefaults.Apply(user) err = d.store.Users.Save(user) if err == errors.ErrExist { return http.StatusConflict, err @@ -168,7 +168,7 @@ func printToken(w http.ResponseWriter, _ *http.Request, d *data, user *users.Use } token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) - signed, err := token.SignedString(d.settings.Key) + signed, err := token.SignedString(d.settings.Auth.Key) if err != nil { return http.StatusInternalServerError, err } diff --git a/backend/http/public_test.go b/backend/http/public_test.go index 5c010e19..ad61a6d3 100644 --- a/backend/http/public_test.go +++ b/backend/http/public_test.go @@ -85,7 +85,11 @@ func TestPublicShareHandlerAuthentication(t *testing.T) { if err := storage.Users.Save(&users.User{Username: "username", Password: "pw"}); err != nil { t.Fatalf("failed to save user: %v", err) } - if err := storage.Settings.Save(&settings.Settings{Key: []byte("key")}); err != nil { + if err := storage.Settings.Save(&settings.Settings{ + Auth: settings.Auth{ + Key: []byte("key"), + }, + }); err != nil { t.Fatalf("failed to save settings: %v", err) } diff --git a/backend/http/settings.go b/backend/http/settings.go index 9591df5d..1acebf83 100644 --- a/backend/http/settings.go +++ b/backend/http/settings.go @@ -21,9 +21,9 @@ type settingsData struct { var settingsGetHandler = withAdmin(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) { data := &settingsData{ - Signup: d.settings.Signup, - CreateUserDir: d.settings.CreateUserDir, - UserHomeBasePath: d.settings.UserHomeBasePath, + Signup: settings.GlobalConfiguration.Auth.Signup, + CreateUserDir: settings.GlobalConfiguration.Server.CreateUserDir, + UserHomeBasePath: settings.GlobalConfiguration.Server.UserHomeBasePath, Defaults: d.settings.UserDefaults, Rules: d.settings.Rules, Frontend: d.settings.Frontend, @@ -41,9 +41,8 @@ var settingsPutHandler = withAdmin(func(w http.ResponseWriter, r *http.Request, return http.StatusBadRequest, err } - d.settings.Signup = req.Signup - d.settings.CreateUserDir = req.CreateUserDir - d.settings.UserHomeBasePath = req.UserHomeBasePath + d.settings.Server.CreateUserDir = req.CreateUserDir + d.settings.Server.UserHomeBasePath = req.UserHomeBasePath d.settings.UserDefaults = req.Defaults d.settings.Rules = req.Rules d.settings.Frontend = req.Frontend diff --git a/backend/http/static.go b/backend/http/static.go index fa06de3a..f2f7b860 100644 --- a/backend/http/static.go +++ b/backend/http/static.go @@ -30,11 +30,12 @@ func handleWithStaticData(w http.ResponseWriter, _ *http.Request, d *data, fSys "Name": d.settings.Frontend.Name, "DisableExternal": d.settings.Frontend.DisableExternal, "DisableUsedPercentage": d.settings.Frontend.DisableUsedPercentage, + "darkMode": settings.GlobalConfiguration.UserDefaults.DarkMode, "Color": d.settings.Frontend.Color, "BaseURL": d.server.BaseURL, "Version": version.Version, "StaticURL": path.Join(d.server.BaseURL, "/static"), - "Signup": d.settings.Signup, + "Signup": settings.GlobalConfiguration.Auth.Signup, "NoAuth": d.settings.Auth.Method == "noauth", "AuthMethod": d.settings.Auth.Method, "LoginPage": auther.LoginPage(), diff --git a/backend/settings/config.go b/backend/settings/config.go index b7f7ef51..a4a839e5 100644 --- a/backend/settings/config.go +++ b/backend/settings/config.go @@ -45,9 +45,6 @@ func loadConfigFile(configFile string) []byte { func setDefaults() Settings { return Settings{ - Signup: true, - AdminUsername: "admin", - AdminPassword: "admin", Server: Server{ EnableThumbnails: true, EnableExec: false, @@ -60,8 +57,10 @@ func setDefaults() Settings { Root: "/srv", }, Auth: Auth{ - Method: "password", - Signup: true, + AdminUsername: "admin", + AdminPassword: "admin", + Method: "password", + Signup: true, Recaptcha: Recaptcha{ Host: "", }, diff --git a/backend/settings/dir.go b/backend/settings/dir.go index 25289ee4..369e74a1 100644 --- a/backend/settings/dir.go +++ b/backend/settings/dir.go @@ -21,13 +21,13 @@ var ( // MakeUserDir makes the user directory according to settings. func (s *Settings) MakeUserDir(username, userScope, serverRoot string) (string, error) { userScope = strings.TrimSpace(userScope) - if userScope == "" && s.CreateUserDir { + if userScope == "" && s.Server.CreateUserDir { username = cleanUsername(username) if username == "" || username == "-" || username == "." { log.Printf("create user: invalid user for home dir creation: [%s]", username) return "", errors.New("invalid user for home dir creation") } - userScope = path.Join(s.UserHomeBasePath, username) + userScope = path.Join(s.Server.UserHomeBasePath, username) } userScope = path.Join("/", userScope) diff --git a/backend/settings/dir_test.go b/backend/settings/dir_test.go index 1b3abc4e..fd28e5b1 100644 --- a/backend/settings/dir_test.go +++ b/backend/settings/dir_test.go @@ -8,7 +8,6 @@ import ( func TestSettings_MakeUserDir(t *testing.T) { type fields struct { - Key []byte Signup bool CreateUserDir bool UserHomeBasePath string @@ -40,20 +39,14 @@ func TestSettings_MakeUserDir(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { s := &Settings{ - Key: tt.fields.Key, - Signup: tt.fields.Signup, - CreateUserDir: tt.fields.CreateUserDir, - UserHomeBasePath: tt.fields.UserHomeBasePath, - Commands: tt.fields.Commands, - Shell: tt.fields.Shell, - AdminUsername: tt.fields.AdminUsername, - AdminPassword: tt.fields.AdminPassword, - Rules: tt.fields.Rules, - Server: tt.fields.Server, - Auth: tt.fields.Auth, - Frontend: tt.fields.Frontend, - Users: tt.fields.Users, - UserDefaults: tt.fields.UserDefaults, + Commands: tt.fields.Commands, + Shell: tt.fields.Shell, + Rules: tt.fields.Rules, + Server: tt.fields.Server, + Auth: tt.fields.Auth, + Frontend: tt.fields.Frontend, + Users: tt.fields.Users, + UserDefaults: tt.fields.UserDefaults, } got, err := s.MakeUserDir(tt.args.username, tt.args.userScope, tt.args.serverRoot) if (err != nil) != tt.wantErr { diff --git a/backend/settings/storage.go b/backend/settings/storage.go index f54acc62..522b6e0c 100644 --- a/backend/settings/storage.go +++ b/backend/settings/storage.go @@ -29,8 +29,8 @@ func (s *Storage) Get() (*Settings, error) { if err != nil { return nil, err } - if set.UserHomeBasePath == "" { - set.UserHomeBasePath = DefaultUsersHomeBasePath + if set.Server.UserHomeBasePath == "" { + set.Server.UserHomeBasePath = DefaultUsersHomeBasePath } return set, nil } @@ -45,7 +45,7 @@ var defaultEvents = []string{ // Save saves the settings for the current instance. func (s *Storage) Save(set *Settings) error { - if len(set.Key) == 0 { + if len(set.Auth.Key) == 0 { return errors.ErrEmptyKey } diff --git a/backend/settings/structs.go b/backend/settings/structs.go index 6afa9fda..03ea86ab 100644 --- a/backend/settings/structs.go +++ b/backend/settings/structs.go @@ -6,29 +6,26 @@ import ( ) type Settings struct { - Key []byte `json:"key"` - Signup bool `json:"signup"` - CreateUserDir bool `json:"createUserDir"` - UserHomeBasePath string `json:"userHomeBasePath"` - Commands map[string][]string `json:"commands"` - Shell []string `json:"shell"` - AdminUsername string `json:"adminUsername"` - AdminPassword string `json:"adminPassword"` - Rules []rules.Rule `json:"rules"` - Server Server `json:"server"` - Auth Auth `json:"auth"` - Frontend Frontend `json:"frontend"` - Users []UserDefaults `json:"users,omitempty"` - UserDefaults UserDefaults `json:"userDefaults"` + Commands map[string][]string `json:"commands"` + Shell []string `json:"shell"` + Rules []rules.Rule `json:"rules"` + Server Server `json:"server"` + Auth Auth `json:"auth"` + Frontend Frontend `json:"frontend"` + Users []UserDefaults `json:"users,omitempty"` + UserDefaults UserDefaults `json:"userDefaults"` } type Auth struct { - Recaptcha Recaptcha `json:"recaptcha"` - Header string `json:"header"` - Method string `json:"method"` - Command string `json:"command"` - Signup bool `json:"signup"` - Shell string `json:"shell"` + Recaptcha Recaptcha `json:"recaptcha"` + Header string `json:"header"` + Method string `json:"method"` + Command string `json:"command"` + Signup bool `json:"signup"` + Shell string `json:"shell"` + AdminUsername string `json:"adminUsername"` + AdminPassword string `json:"adminPassword"` + Key []byte `json:"key"` } type Recaptcha struct { @@ -54,6 +51,8 @@ type Server struct { Log string `json:"log"` Database string `json:"database"` Root string `json:"root"` + UserHomeBasePath string `json:"userHomeBasePath"` + CreateUserDir bool `json:"createUserDir"` } type Frontend struct { diff --git a/backend/storage/bolt/users.go b/backend/storage/bolt/users.go index c4837136..b7eeaac4 100644 --- a/backend/storage/bolt/users.go +++ b/backend/storage/bolt/users.go @@ -2,7 +2,6 @@ package bolt import ( "fmt" - "log" "reflect" "github.com/asdine/storm/v3" @@ -74,7 +73,6 @@ func (st usersBackend) Update(user *users.User, fields ...string) error { } func (st usersBackend) Save(user *users.User) error { - log.Println("userinfo", user.Password) pass, err := users.HashPwd(user.Password) if err != nil { return err diff --git a/backend/users/password.go b/backend/users/password.go index e5b5f72b..d7ef250a 100644 --- a/backend/users/password.go +++ b/backend/users/password.go @@ -1,14 +1,11 @@ package users import ( - "log" - "golang.org/x/crypto/bcrypt" ) // HashPwd hashes a password. func HashPwd(password string) (string, error) { - log.Println("hashing password", password) bytes, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) return string(bytes), err } diff --git a/configuration.md b/configuration.md index 802ef80c..6284522e 100644 --- a/configuration.md +++ b/configuration.md @@ -7,10 +7,11 @@ This document covers the available configuration options, their defaults, and ho Here is an expanded config file which includes all possible configurations: ``` -signup: false adminUsername: admin adminPassword: admin server: + CreateUserDir: false + UserHomeBasePath: "" indexingInterval: 5 numImageProcessors: 4 socket: "" @@ -33,6 +34,7 @@ auth: header: "" method: json command: "" + signup: false shell: "" frontend: name: "" @@ -67,7 +69,6 @@ userDefaults: Here are the defaults if nothing is set: ``` -signup: true adminUsername: admin adminPassword: admin server: @@ -107,12 +108,6 @@ userDefaults: ## About each configuration -- `Signup`: This boolean value indicates whether user signup is enabled on the login page. NOTE: Be mindful of `userDefaults` settings if enabled. Default: `false` - -- `AdminUsername`: This is the username of the admin user. Default: `admin` - -- `AdminPassword`: This is the password of the admin user. Default: `admin` - ### Server configuration settings - `indexingInterval`: This is the time in minutes the system waits before checking for filesystem changes. Default: `5` @@ -143,6 +138,10 @@ userDefaults: - `root`: This is the root directory path. Default: `/srv` +- `CreateUserDir`: Boolean to create user directory on user creation. Default: `false` + +- `UserHomeBasePath`: String to define user home directory base path. Default: `""` + ### Auth configuration settings - `recaptcha`: @@ -166,6 +165,12 @@ userDefaults: - `shell`: This is the shell configuration. +- `Signup`: This boolean value indicates whether user signup is enabled on the login page. NOTE: Be mindful of `userDefaults` settings if enabled. Default: `false` + +- `AdminUsername`: This is the username of the admin user. Default: `admin` + +- `AdminPassword`: This is the password of the admin user. Default: `admin` + ### Frontend configuration settings - `name`: This is the name of the frontend. diff --git a/frontend/public/img/icons/safari-pinned-tab.svg b/frontend/public/img/icons/safari-pinned-tab.svg deleted file mode 100644 index 0119c21a..00000000 --- a/frontend/public/img/icons/safari-pinned-tab.svg +++ /dev/null @@ -1,42 +0,0 @@ - - - - -Created by potrace 1.11, written by Peter Selinger 2001-2013 - - - - - - - - - - diff --git a/frontend/public/img/logo.png b/frontend/public/img/logo.png new file mode 100644 index 0000000000000000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+;wke}`J~1dRyv6Q?TI%$`-++ysMhZ;7 zUzXVGVR^qkN2CV3X4_nYFS^M?SnA$JB`XVS=H;vV%_X?}+C=gsT~_#W2<1?EHp>Tj zB|#}FRiexHMdIYJyXR|WtVgsF{xhBa{?CcW@C+2SiLa_s#rWZ7IKXjA*jQXl|)Rj?|yJWWhBa+j20v$Gd zqt~ZCA%FP*Jf4AYX^MZR(iA~@!xP8%)f>4YWJDgv!L&-YJ?oA!0-r? zFb&N8Mf-@*Sn}g zMrr4rd*v=RJJqo~*a~}QCO3OK-@}lsc8hZL+1=3(>w7clE0e0nAQ^K-0dZSp8&hnR zV#;-R2N|siYkWbzWT6hfKffV2^Eh{?rLbym?Ac0pKyFOmk@v7IpjpHy4r*5&CKTB( z)hrEo68ehN4hM>m?RmeNqPQPKxo zR`l8BU2f&?XT?;0RZ7@52e_hqyn)k>%tPR7s|jaDwe|S9!olwG9hciHQyf7O3fN6y z35BIG`wER?*qpd&yHaQ|xV*$Mn7+i}7lgM-_p2aOR+MQ|ZO+2m1+Yzdy>%oD%>$pv z?S^Bbi6}k~yr23z_*V%KroTu4Jiz~(5(td;_xd<{t}&Pb1#HmO%lcY*8n%!B7vsQ6 AJ^%m! literal 0 HcmV?d00001 diff --git a/frontend/public/img/logo.svg b/frontend/public/img/logo.svg deleted file mode 100644 index 5e78eccf..00000000 --- a/frontend/public/img/logo.svg +++ /dev/null @@ -1,147 +0,0 @@ - -image/svg+xml - - - - - \ No newline at end of file diff --git a/frontend/public/index.html b/frontend/public/index.html index d8cbd347..b6da58f5 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -120,17 +120,22 @@
-
+ [{[ if .darkMode -]}] +
- - [{[ if .darkMode -]}] - - [{[ end ]}] + [{[ else ]}] +
+
+
+
+
+
+
[{[ end ]}] [{[ if .CSS -]}] [{[ end ]}] diff --git a/frontend/src/css/login.css b/frontend/src/css/login.css index b97ae7cd..322396b1 100644 --- a/frontend/src/css/login.css +++ b/frontend/src/css/login.css @@ -1,5 +1,5 @@ #login { - background: #fff; + background: var(--background); position: fixed; top: 0; left: 0; diff --git a/frontend/src/utils/constants.js b/frontend/src/utils/constants.js index d1bd6a3e..58a8679f 100644 --- a/frontend/src/utils/constants.js +++ b/frontend/src/utils/constants.js @@ -3,11 +3,12 @@ const disableExternal = window.FileBrowser.DisableExternal; const disableUsedPercentage = window.FileBrowser.DisableUsedPercentage; const baseURL = window.FileBrowser.BaseURL; const staticURL = window.FileBrowser.StaticURL; +const darkMode = window.FileBrowser.darkMode; const recaptcha = window.FileBrowser.ReCaptcha; const recaptchaKey = window.FileBrowser.ReCaptchaKey; const signup = window.FileBrowser.Signup; const version = window.FileBrowser.Version; -const logoURL = `${staticURL}/img/logo.svg`; +const logoURL = `${staticURL}/img/logo.png`; const noAuth = window.FileBrowser.NoAuth; const authMethod = window.FileBrowser.AuthMethod; const loginPage = window.FileBrowser.LoginPage; @@ -16,6 +17,7 @@ const resizePreview = window.FileBrowser.ResizePreview; const enableExec = window.FileBrowser.EnableExec; const origin = window.location.origin; +console.log(window.FileBrowser) export { name, disableExternal, @@ -33,4 +35,5 @@ export { resizePreview, enableExec, origin, + darkMode }; diff --git a/frontend/src/views/Login.vue b/frontend/src/views/Login.vue index 51e5d1cb..57021133 100644 --- a/frontend/src/views/Login.vue +++ b/frontend/src/views/Login.vue @@ -1,5 +1,5 @@