From f1e05c583a4938e2b75ee13409c71ff5a73adabd Mon Sep 17 00:00:00 2001 From: Graham Steffaniak Date: Sat, 2 Sep 2023 13:02:50 -0500 Subject: [PATCH] updated readme --- CHANGELOG.md | 8 +++++--- backend/cmd/config.go | 4 ++-- backend/cmd/config_init.go | 14 ++++++-------- backend/cmd/config_set.go | 2 +- backend/{filebrowser.yml => filebrowser.yaml} | 0 backend/settings/config.go | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) rename backend/{filebrowser.yml => filebrowser.yaml} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index f40eb49e..ff9a43be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,14 @@ All notable changes to this project will be documented in this file. See [standa # v0.2.0 - - Works with new more advanced filebrowser.json - improved GUI - more unified coehisive look + - Adjusted header bar look and icon behavior - The shell is dead. - - If you need to use the shell, exec into the docker container. - - All configuration is done via filebrowser.yml + - If you need to use custom commands, exec into the docker container. + - All configuration is done via `filebrowser.yaml` + - Removed old code to migrate database veresions + - Removed all unused cmd code # v0.1.4 - various UI fixes diff --git a/backend/cmd/config.go b/backend/cmd/config.go index 9ee88b85..cfc7afe8 100644 --- a/backend/cmd/config.go +++ b/backend/cmd/config.go @@ -44,7 +44,7 @@ func addConfigFlags(flags *pflag.FlagSet) { } //nolint:gocyclo -func getAuthentication() (string, auth.Auther) { +func getAuthentication() auth.Auther { method := settings.GlobalConfiguration.Auth.Method var defaultAuther map[string]interface{} var auther auth.Auther @@ -111,7 +111,7 @@ func getAuthentication() (string, auth.Auther) { panic(errors.ErrInvalidAuthMethod) } - return method, auther + return auther } func printSettings(ser *settings.Server, set *settings.Settings, auther auth.Auther) { diff --git a/backend/cmd/config_init.go b/backend/cmd/config_init.go index 47bf8df7..b3eaa3f7 100644 --- a/backend/cmd/config_init.go +++ b/backend/cmd/config_init.go @@ -23,14 +23,12 @@ to the defaults when creating new users and you don't override the options.`, Args: cobra.NoArgs, Run: python(func(cmd *cobra.Command, args []string, d pythonData) { - defaults := settings.UserDefaults{} - flags := cmd.Flags() - getUserDefaults(flags, &defaults, true) - _, auther := getAuthentication() - ser := &settings.GlobalConfiguration.Server - err := d.store.Settings.Save(&settings.GlobalConfiguration) + auther := getAuthentication() + s := settings.GlobalConfiguration + s.Key = generateKey() + err := d.store.Settings.Save(&s) checkErr(err) - err = d.store.Settings.SaveServer(ser) + err = d.store.Settings.SaveServer(&s.Server) checkErr(err) err = d.store.Auth.Save(auther) checkErr(err) @@ -40,6 +38,6 @@ Congratulations! You've set up your database to use with File Browser. Now add your first user via 'filebrowser users add' and then you just need to call the main command to boot up the server. `) - printSettings(ser, &settings.GlobalConfiguration, auther) + printSettings(&s.Server, &s, auther) }, pythonConfig{noDB: true}), } diff --git a/backend/cmd/config_set.go b/backend/cmd/config_set.go index f30dd088..cb1b6917 100644 --- a/backend/cmd/config_set.go +++ b/backend/cmd/config_set.go @@ -62,7 +62,7 @@ you want to change. Other options will remain unchanged.`, getUserDefaults(flags, &set.UserDefaults, false) // read the defaults - _, auther := getAuthentication() + auther := getAuthentication() err = d.store.Auth.Save(auther) checkErr(err) err = d.store.Settings.Save(set) diff --git a/backend/filebrowser.yml b/backend/filebrowser.yaml similarity index 100% rename from backend/filebrowser.yml rename to backend/filebrowser.yaml diff --git a/backend/settings/config.go b/backend/settings/config.go index c0c427dd..153dd31b 100644 --- a/backend/settings/config.go +++ b/backend/settings/config.go @@ -11,7 +11,7 @@ var GlobalConfiguration Settings func init() { // Open and read the YAML file - yamlFile, err := os.Open("filebrowser.yml") + yamlFile, err := os.Open("filebrowser.yaml") if err != nil { log.Fatalf("Error opening YAML file: %v", err) }