From bb10c3dfa96c207f2dd3ac0ca66e77c7cb4e4d95 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 13 Nov 2025 17:39:51 +0100 Subject: [PATCH 001/120] docs: clarify release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ea3d811..2be8b2c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. See [commit ## [2.45.3](https://github.com/filebrowser/filebrowser/compare/v2.45.2...v2.45.3) (2025-11-13) +This is a test release to ensure the updated workflow works. + ## [2.45.2](https://github.com/filebrowser/filebrowser/compare/v2.45.1...v2.45.2) (2025-11-13) From 42d1b6f3aea5f563bc44176613fe1414eb193695 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 13 Nov 2025 18:03:51 +0100 Subject: [PATCH 002/120] docs: fix badge in readme --- README.md | 2 +- commitlint.config.js | 34 ---------------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 commitlint.config.js diff --git a/README.md b/README.md index b2873b7f..33ecbde1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

-[![Build](https://github.com/filebrowser/filebrowser/actions/workflows/main.yaml/badge.svg)](https://github.com/filebrowser/filebrowser/actions/workflows/main.yaml) +[![Build](https://github.com/filebrowser/filebrowser/actions/workflows/ci.yaml/badge.svg)](https://github.com/filebrowser/filebrowser/actions/workflows/ci.yaml) [![Go Report Card](https://goreportcard.com/badge/github.com/filebrowser/filebrowser/v2)](https://goreportcard.com/report/github.com/filebrowser/filebrowser/v2) [![Version](https://img.shields.io/github/release/filebrowser/filebrowser.svg)](https://github.com/filebrowser/filebrowser/releases/latest) diff --git a/commitlint.config.js b/commitlint.config.js deleted file mode 100644 index 23d00367..00000000 --- a/commitlint.config.js +++ /dev/null @@ -1,34 +0,0 @@ -module.exports = { - rules: { - 'body-leading-blank': [1, 'always'], - 'body-max-line-length': [2, 'always', 100], - 'footer-leading-blank': [1, 'always'], - 'footer-max-line-length': [2, 'always', 100], - 'header-max-length': [2, 'always', 100], - 'scope-case': [2, 'always', 'lower-case'], - 'subject-case': [ - 2, - 'never', - ['sentence-case', 'start-case', 'pascal-case', 'upper-case'], - ], - 'subject-full-stop': [2, 'never', '.'], - 'type-case': [2, 'always', 'lower-case'], - 'type-empty': [2, 'never'], - 'type-enum': [ - 2, - 'always', - [ - 'feat', - 'fix', - 'perf', - 'revert', - 'refactor', - 'build', - 'ci', - 'test', - 'chore', - 'docs', - ], - ], - }, -}; From cacc0999e95dbdedbe1ab5d1a12be4a7030e0de0 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Fri, 14 Nov 2025 08:11:10 +0100 Subject: [PATCH 003/120] chore: let functions be longer --- .golangci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 901a89b8..389e30d8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -41,7 +41,7 @@ linters: default-signifies-exhaustive: false funlen: lines: 100 - statements: 50 + statements: 100 gocritic: disabled-checks: - dupImport # https://github.com/go-critic/go-critic/issues/845 From 0d973d3aad70ceb88950f2cd9c297fc76e7955b1 Mon Sep 17 00:00:00 2001 From: Ahmad Hesam Date: Fri, 14 Nov 2025 08:19:03 +0100 Subject: [PATCH 004/120] feat: add 'hide-dotfiles' as command line parameter (#3802) Co-authored-by: Henrique Dias --- cmd/config.go | 1 + cmd/users.go | 3 +++ settings/settings.go | 1 + 3 files changed, 5 insertions(+) diff --git a/cmd/config.go b/cmd/config.go index ebb9c69f..230a532c 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -215,6 +215,7 @@ func printSettings(ser *settings.Server, set *settings.Settings, auther auth.Aut fmt.Fprintf(w, "\tExec Enabled:\t%t\n", ser.EnableExec) fmt.Fprintln(w, "\nDefaults:") fmt.Fprintf(w, "\tScope:\t%s\n", set.Defaults.Scope) + fmt.Fprintf(w, "\tHideDotfiles:\t%t\n", set.Defaults.HideDotfiles) fmt.Fprintf(w, "\tLocale:\t%s\n", set.Defaults.Locale) fmt.Fprintf(w, "\tView mode:\t%s\n", set.Defaults.ViewMode) fmt.Fprintf(w, "\tSingle Click:\t%t\n", set.Defaults.SingleClick) diff --git a/cmd/users.go b/cmd/users.go index 5b458a5a..64cd08ee 100644 --- a/cmd/users.go +++ b/cmd/users.go @@ -80,6 +80,7 @@ func addUserFlags(flags *pflag.FlagSet) { flags.Bool("dateFormat", false, "use date format (true for absolute time, false for relative)") flags.Bool("hideDotfiles", false, "hide dotfiles") flags.String("aceEditorTheme", "", "ace editor's syntax highlighting theme for users") + flags.Bool("hide-dotfiles", false, "Hide dotfiles by default") } func getViewMode(flags *pflag.FlagSet) (users.ViewMode, error) { @@ -135,6 +136,8 @@ func getUserDefaults(flags *pflag.FlagSet, defaults *settings.UserDefaults, all defaults.Sorting.By, err = getString(flags, flag.Name) case "sorting.asc": defaults.Sorting.Asc, err = getBool(flags, flag.Name) + case "hide-dotfiles": + defaults.HideDotfiles, err = getBool(flags, flag.Name) } if err != nil { visitErr = err diff --git a/settings/settings.go b/settings/settings.go index 787921e9..064094ab 100644 --- a/settings/settings.go +++ b/settings/settings.go @@ -34,6 +34,7 @@ type Settings struct { MinimumPasswordLength uint `json:"minimumPasswordLength"` FileMode fs.FileMode `json:"fileMode"` DirMode fs.FileMode `json:"dirMode"` + HideDotfiles bool `json:"hideDotfiles"` } // GetRules implements rules.Provider. From 9d44932dba30b082c46c6057bbcb81ee04ae8d78 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Fri, 14 Nov 2025 16:18:12 +0100 Subject: [PATCH 005/120] chore: use more standard golangci-lint options --- .golangci.yml | 125 +------------------------------------------ cmd/docs.go | 6 +-- http/preview.go | 6 +-- http/public.go | 4 +- http/raw.go | 2 +- http/resource.go | 4 +- search/conditions.go | 4 +- settings/dir.go | 2 +- 8 files changed, 15 insertions(+), 138 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 389e30d8..32d944f3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,132 +1,9 @@ version: "2" linters: - # inverted configuration with `default: all` and `disable` is not scalable during updates of golangci-lint - default: none - enable: - - bodyclose - - dogsled - - dupl - - errcheck - - errorlint - - exhaustive - - funlen - - gocheckcompilerdirectives - - gochecknoinits - - gocritic - - gocyclo - - godox - - goprintffuncname - - gosec - - govet - - ineffassign - - lll - - misspell - - mnd - - nakedret - - nolintlint - - prealloc - - revive - - rowserrcheck - - staticcheck - - testifylint - - unconvert - - unparam - - unused - - whitespace - settings: - dupl: - threshold: 100 - exhaustive: - default-signifies-exhaustive: false - funlen: - lines: 100 - statements: 100 - gocritic: - disabled-checks: - - dupImport # https://github.com/go-critic/go-critic/issues/845 - - ifElseChain - - octalLiteral - - whyNoLint - - wrapperFunc - enabled-tags: - - diagnostic - - experimental - - opinionated - - performance - - style - gocyclo: - min-complexity: 15 - govet: - enable: - - nilness - - shadow - lll: - line-length: 140 - misspell: - locale: US - mnd: - # don't include the "operation" and "assign" - checks: - - argument - - case - - condition - - return - ignored-numbers: - - "0" - - "1" - - "2" - - "3" - - "0666" - - "0700" - - "0700" - ignored-functions: - - strings.SplitN - - make - nolintlint: - allow-unused: false # report any unused nolint directives - require-explanation: false # require an explanation for nolint directives - require-specific: true # require nolint directives to be specific about which linter is being skipped - staticcheck: - checks: - - "all" - - "-QF*" + default: standard exclusions: - generated: lax presets: - - comments - - common-false-positives - - legacy - std-error-handling - rules: - - linters: - - gochecknoinits - path: cmd/.*.go - - linters: - - dupl - - funlen - - gochecknoinits - - gocyclo - - lll - - scopelint - path: .*_test.go - - linters: - - misspell - text: "[aA]uther" - - linters: - - mnd - text: strconv.Parse - paths: - - frontend/ - -formatters: - enable: - - goimports - settings: - goimports: - local-prefixes: - - github.com/filebrowser/filebrowser - exclusions: - generated: lax paths: - frontend/ diff --git a/cmd/docs.go b/cmd/docs.go index 5f26daf9..90e5a259 100644 --- a/cmd/docs.go +++ b/cmd/docs.go @@ -21,7 +21,7 @@ func init() { func printToc(names []string) { for i, name := range names { name = strings.TrimSuffix(name, filepath.Ext(name)) - name = strings.Replace(name, "-", " ", -1) + name = strings.ReplaceAll(name, "-", " ") names[i] = name } @@ -29,7 +29,7 @@ func printToc(names []string) { toc := "" for _, name := range names { - toc += "* [" + name + "](cli/" + strings.Replace(name, " ", "-", -1) + ".md)\n" + toc += "* [" + name + "](cli/" + strings.ReplaceAll(name, " ", "-") + ".md)\n" } fmt.Println(toc) @@ -84,7 +84,7 @@ func generateDocs(cmd *cobra.Command, dir string) error { } } - basename := strings.Replace(cmd.CommandPath(), " ", "-", -1) + ".md" + basename := strings.ReplaceAll(cmd.CommandPath(), " ", "-") + ".md" filename := filepath.Join(dir, basename) f, err := os.Create(filename) if err != nil { diff --git a/http/preview.go b/http/preview.go index 1abc6019..cb64ba9c 100644 --- a/http/preview.go +++ b/http/preview.go @@ -124,12 +124,12 @@ func createPreview(imgSvc ImgService, fileCache FileCache, options []img.Option ) - switch { - case previewSize == PreviewSizeBig: + switch previewSize { + case PreviewSizeBig: width = 1080 height = 1080 options = append(options, img.WithMode(img.ResizeModeFit), img.WithQuality(img.QualityMedium)) - case previewSize == PreviewSizeThumb: + case PreviewSizeThumb: width = 256 height = 256 options = append(options, img.WithMode(img.ResizeModeFill), img.WithQuality(img.QualityLow), img.WithFormat(img.FormatJpeg)) diff --git a/http/public.go b/http/public.go index 5e9e01ba..92c8102d 100644 --- a/http/public.go +++ b/http/public.go @@ -98,8 +98,8 @@ var publicShareHandler = withHashFile(func(w http.ResponseWriter, r *http.Reques file := d.raw.(*files.FileInfo) if file.IsDir { - file.Listing.Sorting = files.Sorting{By: "name", Asc: false} - file.Listing.ApplySort() + file.Sorting = files.Sorting{By: "name", Asc: false} + file.ApplySort() return renderJSON(w, r, file) } diff --git a/http/raw.go b/http/raw.go index cbddad59..f2548155 100644 --- a/http/raw.go +++ b/http/raw.go @@ -32,7 +32,7 @@ func parseQueryFiles(r *http.Request, f *files.FileInfo, _ *users.User) ([]strin fileSlice = append(fileSlice, f.Path) } else { for _, name := range names { - name, err := url.QueryUnescape(strings.Replace(name, "+", "%2B", -1)) //nolint:govet + name, err := url.QueryUnescape(strings.ReplaceAll(name, "+", "%2B")) if err != nil { return nil, err } diff --git a/http/resource.go b/http/resource.go index 8785c681..fba422df 100644 --- a/http/resource.go +++ b/http/resource.go @@ -37,8 +37,8 @@ var resourceGetHandler = withUser(func(w http.ResponseWriter, r *http.Request, d } if file.IsDir { - file.Listing.Sorting = d.user.Sorting - file.Listing.ApplySort() + file.Sorting = d.user.Sorting + file.ApplySort() return renderJSON(w, r, file) } diff --git a/search/conditions.go b/search/conditions.go index 970171a1..c7bcd3b9 100644 --- a/search/conditions.go +++ b/search/conditions.go @@ -48,8 +48,8 @@ func parseSearch(value string) *searchOptions { } // removes the options from the value - value = strings.Replace(value, "case:insensitive", "", -1) - value = strings.Replace(value, "case:sensitive", "", -1) + value = strings.ReplaceAll(value, "case:insensitive", "") + value = strings.ReplaceAll(value, "case:sensitive", "") value = strings.TrimSpace(value) types := typeRegexp.FindAllStringSubmatch(value, -1) diff --git a/settings/dir.go b/settings/dir.go index 25289ee4..0e857950 100644 --- a/settings/dir.go +++ b/settings/dir.go @@ -42,7 +42,7 @@ func (s *Settings) MakeUserDir(username, userScope, serverRoot string) (string, func cleanUsername(s string) string { // Remove any trailing space to avoid ending on - s = strings.Trim(s, " ") - s = strings.Replace(s, "..", "", -1) + s = strings.ReplaceAll(s, "..", "") // Replace all characters which not in the list `0-9A-Za-z@_\-.` with a dash s = invalidFilenameChars.ReplaceAllString(s, "-") From ac7b49c1484b4e27a1149310542ccd1e90659ee2 Mon Sep 17 00:00:00 2001 From: Lucky Jain <72547660+lostb053@users.noreply.github.com> Date: Fri, 14 Nov 2025 16:21:08 +0100 Subject: [PATCH 006/120] feat: add option to hide the login button from public-facing pages (#3922) Co-authored-by: Henrique Dias --- cmd/config.go | 4 +++- cmd/config_init.go | 6 ++++++ cmd/config_set.go | 2 ++ cmd/root.go | 1 + frontend/src/components/Sidebar.vue | 3 +++ frontend/src/i18n/en.json | 1 + frontend/src/types/settings.d.ts | 1 + frontend/src/utils/constants.ts | 2 ++ frontend/src/views/settings/Global.vue | 5 +++++ http/settings.go | 3 +++ http/static.go | 1 + settings/settings.go | 1 + 12 files changed, 29 insertions(+), 1 deletion(-) diff --git a/cmd/config.go b/cmd/config.go index 230a532c..84474f4c 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -31,6 +31,7 @@ func addConfigFlags(flags *pflag.FlagSet) { addServerFlags(flags) addUserFlags(flags) flags.BoolP("signup", "s", false, "allow users to signup") + flags.Bool("hide-login-button", false, "hide login button from public pages") flags.Bool("create-user-dir", false, "generate user's home directory automatically") flags.Uint("minimum-password-length", settings.DefaultMinimumPasswordLength, "minimum password length for new users") flags.String("shell", "", "shell command to which other commands should be appended") @@ -192,9 +193,10 @@ func printSettings(ser *settings.Server, set *settings.Settings, auther auth.Aut w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0) fmt.Fprintf(w, "Sign up:\t%t\n", set.Signup) + fmt.Fprintf(w, "Hide Login Button:\t%t\n", set.HideLoginButton) fmt.Fprintf(w, "Create User Dir:\t%t\n", set.CreateUserDir) fmt.Fprintf(w, "Minimum Password Length:\t%d\n", set.MinimumPasswordLength) - fmt.Fprintf(w, "Auth method:\t%s\n", set.AuthMethod) + fmt.Fprintf(w, "Auth Method:\t%s\n", set.AuthMethod) fmt.Fprintf(w, "Shell:\t%s\t\n", strings.Join(set.Shell, " ")) fmt.Fprintln(w, "\nBranding:") fmt.Fprintf(w, "\tName:\t%s\n", set.Branding.Name) diff --git a/cmd/config_init.go b/cmd/config_init.go index 26db2d27..693b6ace 100644 --- a/cmd/config_init.go +++ b/cmd/config_init.go @@ -41,6 +41,11 @@ override the options.`, return err } + hideLoginButton, err := getBool(flags, "hide-login-button") + if err != nil { + return err + } + createUserDir, err := getBool(flags, "create-user-dir") if err != nil { return err @@ -84,6 +89,7 @@ override the options.`, s := &settings.Settings{ Key: key, Signup: signup, + HideLoginButton: hideLoginButton, CreateUserDir: createUserDir, MinimumPasswordLength: minLength, Shell: convertCmdStrToCmdArray(shell), diff --git a/cmd/config_set.go b/cmd/config_set.go index a7f66902..255ef470 100644 --- a/cmd/config_set.go +++ b/cmd/config_set.go @@ -50,6 +50,8 @@ you want to change. Other options will remain unchanged.`, ser.Port, err = getString(flags, flag.Name) case "log": ser.Log, err = getString(flags, flag.Name) + case "hide-login-button": + set.HideLoginButton, err = getBool(flags, flag.Name) case "signup": set.Signup, err = getBool(flags, flag.Name) case "auth.method": diff --git a/cmd/root.go b/cmd/root.go index a9704cf4..8f793742 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -420,6 +420,7 @@ func quickSetup(flags *pflag.FlagSet, d pythonData) error { set := &settings.Settings{ Key: generateKey(), Signup: false, + HideLoginButton: true, CreateUserDir: false, MinimumPasswordLength: settings.DefaultMinimumPasswordLength, UserHomeBasePath: settings.DefaultUsersHomeBasePath, diff --git a/frontend/src/components/Sidebar.vue b/frontend/src/components/Sidebar.vue index 5bbf8847..531ec583 100644 --- a/frontend/src/components/Sidebar.vue +++ b/frontend/src/components/Sidebar.vue @@ -63,6 +63,7 @@