Compare commits

...
10 Commits
Author SHA1 Message Date
Henrique Dias 58cc874828 chore(release): 2.51.0 2025-12-06 11:37:24 +01:00
Henrique Dias 124def5cd7 chore: dependency updates 2025-12-06 11:33:43 +01:00
transifex-integration[bot] 2d88c06761 feat: update translations
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2025-12-06 11:23:24 +01:00
Ariel LeyvaandHenrique Dias 204a3f0eea fix: added column separator select (comma, semicolon and both) in CSV viewer (#5604)
Co-authored-by: Henrique Dias <mail@hacdias.com>
2025-12-06 11:08:50 +01:00
Henrique Dias f029c3005e refactor: cleanup package names (#5605) 2025-12-06 10:52:11 +01:00
Henrique Dias a6934e40ff ci: run renovate on weekends 2025-12-05 15:11:22 +01:00
renovate[bot] 98662ac5ec chore(deps): update all non-major dependencies (#5600)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-03 08:47:00 +01:00
renovate[bot] 5cf8ce8db5 chore(deps): update dependency vite to v7.2.6 (#5598)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-01 08:38:14 +01:00
renovate[bot] 062dc414f8 chore(deps): update module github.com/shirou/gopsutil/v4 to v4.25.11 (#5597)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-01 07:37:25 +01:00
Henrique Dias 63582b644c chore: run linter 2025-11-30 09:17:35 +01:00
72 changed files with 409 additions and 185 deletions

No files matched your search

+17
View File
@@ -2,6 +2,23 @@
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
## [2.51.0](https://github.com/filebrowser/filebrowser/compare/v2.50.0...v2.51.0) (2025-12-06)
### Features
* update translations ([2d88c06](https://github.com/filebrowser/filebrowser/commit/2d88c067611e936056dbbf04247f1c1c709b2a09))
### Bug Fixes
* added column separator select (comma, semicolon and both) in CSV viewer ([#5604](https://github.com/filebrowser/filebrowser/issues/5604)) ([204a3f0](https://github.com/filebrowser/filebrowser/commit/204a3f0eeaa0c68781b60651bf27c4b27eac44e6))
### Refactorings
* cleanup package names ([#5605](https://github.com/filebrowser/filebrowser/issues/5605)) ([f029c30](https://github.com/filebrowser/filebrowser/commit/f029c3005e450cfbebb074c42dbdf65db9c8d56a))
## [2.50.0](https://github.com/filebrowser/filebrowser/compare/v2.49.0...v2.50.0) (2025-11-30) ## [2.50.0](https://github.com/filebrowser/filebrowser/compare/v2.49.0...v2.50.0) (2025-11-30)
+1 -1
View File
@@ -1,5 +1,5 @@
## Multistage build: First stage fetches dependencies ## Multistage build: First stage fetches dependencies
FROM alpine:3.22 AS fetcher FROM alpine:3.23 AS fetcher
# install and copy ca-certificates, mailcap, and tini-static; download JSON.sh # install and copy ca-certificates, mailcap, and tini-static; download JSON.sh
RUN apk update && \ RUN apk update && \
+2 -2
View File
@@ -11,7 +11,7 @@ import (
"slices" "slices"
"strings" "strings"
fbErrors "github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/files" "github.com/filebrowser/filebrowser/v2/files"
"github.com/filebrowser/filebrowser/v2/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/v2/users" "github.com/filebrowser/filebrowser/v2/users"
@@ -146,7 +146,7 @@ func (a *HookAuth) GetValues(s string) {
// SaveUser updates the existing user or creates a new one when not found // SaveUser updates the existing user or creates a new one when not found
func (a *HookAuth) SaveUser() (*users.User, error) { func (a *HookAuth) SaveUser() (*users.User, error) {
u, err := a.Users.Get(a.Server.Root, a.Cred.Username) u, err := a.Users.Get(a.Server.Root, a.Cred.Username)
if err != nil && !errors.Is(err, fbErrors.ErrNotExist) { if err != nil && !errors.Is(err, fberrors.ErrNotExist) {
return nil, err return nil, err
} }
+2 -2
View File
@@ -4,7 +4,7 @@ import (
"errors" "errors"
"net/http" "net/http"
fbErrors "github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/v2/users" "github.com/filebrowser/filebrowser/v2/users"
) )
@@ -21,7 +21,7 @@ type ProxyAuth struct {
func (a ProxyAuth) Auth(r *http.Request, usr users.Store, setting *settings.Settings, srv *settings.Server) (*users.User, error) { func (a ProxyAuth) Auth(r *http.Request, usr users.Store, setting *settings.Settings, srv *settings.Server) (*users.User, error) {
username := r.Header.Get(a.Header) username := r.Header.Get(a.Header)
user, err := usr.Get(srv.Root, username) user, err := usr.Get(srv.Root, username)
if errors.Is(err, fbErrors.ErrNotExist) { if errors.Is(err, fberrors.ErrNotExist) {
return a.createUser(usr, setting, srv, username) return a.createUser(usr, setting, srv, username)
} }
return user, err return user, err
+6 -6
View File
@@ -2,7 +2,7 @@ package cmd
import ( import (
"encoding/json" "encoding/json"
nerrors "errors" "errors"
"fmt" "fmt"
"os" "os"
"strings" "strings"
@@ -12,7 +12,7 @@ import (
"github.com/spf13/pflag" "github.com/spf13/pflag"
"github.com/filebrowser/filebrowser/v2/auth" "github.com/filebrowser/filebrowser/v2/auth"
"github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/settings" "github.com/filebrowser/filebrowser/v2/settings"
) )
@@ -104,7 +104,7 @@ func getProxyAuth(flags *pflag.FlagSet, defaultAuther map[string]interface{}) (a
} }
if header == "" { if header == "" {
return nil, nerrors.New("you must set the flag 'auth.header' for method 'proxy'") return nil, errors.New("you must set the flag 'auth.header' for method 'proxy'")
} }
return &auth.ProxyAuth{Header: header}, nil return &auth.ProxyAuth{Header: header}, nil
@@ -163,7 +163,7 @@ func getHookAuth(flags *pflag.FlagSet, defaultAuther map[string]interface{}) (au
} }
if command == "" { if command == "" {
return nil, nerrors.New("you must set the flag 'auth.command' for method 'hook'") return nil, errors.New("you must set the flag 'auth.command' for method 'hook'")
} }
return &auth.HookAuth{Command: command}, nil return &auth.HookAuth{Command: command}, nil
@@ -186,7 +186,7 @@ func getAuthentication(flags *pflag.FlagSet, defaults ...interface{}) (settings.
case auth.MethodHookAuth: case auth.MethodHookAuth:
auther, err = getHookAuth(flags, defaultAuther) auther, err = getHookAuth(flags, defaultAuther)
default: default:
return "", nil, errors.ErrInvalidAuthMethod return "", nil, fberrors.ErrInvalidAuthMethod
} }
if err != nil { if err != nil {
@@ -361,7 +361,7 @@ func getSettings(flags *pflag.FlagSet, set *settings.Settings, ser *settings.Ser
flags.Visit(visit) flags.Visit(visit)
} }
err := nerrors.Join(errs...) err := errors.Join(errs...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
+1 -1
View File
@@ -1,4 +1,4 @@
package errors package fberrors
import ( import (
"errors" "errors"
+3 -3
View File
@@ -23,7 +23,7 @@ import (
"github.com/spf13/afero" "github.com/spf13/afero"
fbErrors "github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/rules" "github.com/filebrowser/filebrowser/v2/rules"
) )
@@ -168,7 +168,7 @@ func stat(opts *FileOptions) (*FileInfo, error) {
// algorithm. The checksums data is saved on File object. // algorithm. The checksums data is saved on File object.
func (i *FileInfo) Checksum(algo string) error { func (i *FileInfo) Checksum(algo string) error {
if i.IsDir { if i.IsDir {
return fbErrors.ErrIsDirectory return fberrors.ErrIsDirectory
} }
if i.Checksums == nil { if i.Checksums == nil {
@@ -193,7 +193,7 @@ func (i *FileInfo) Checksum(algo string) error {
case "sha512": case "sha512":
h = sha512.New() h = sha512.New()
default: default:
return fbErrors.ErrInvalidOption return fberrors.ErrInvalidOption
} }
_, err = io.Copy(h, reader) _, err = io.Copy(h, reader)
+73 -73
View File
@@ -19,7 +19,7 @@ importers:
version: 14.1.0(focus-trap@7.6.2)(jwt-decode@4.0.0)(vue@3.5.25(typescript@5.9.3)) version: 14.1.0(focus-trap@7.6.2)(jwt-decode@4.0.0)(vue@3.5.25(typescript@5.9.3))
ace-builds: ace-builds:
specifier: ^1.43.2 specifier: ^1.43.2
version: 1.43.4 version: 1.43.5
dayjs: dayjs:
specifier: ^1.11.13 specifier: ^1.11.13
version: 1.11.19 version: 1.11.19
@@ -110,16 +110,16 @@ importers:
version: 24.10.1 version: 24.10.1
'@typescript-eslint/eslint-plugin': '@typescript-eslint/eslint-plugin':
specifier: ^8.37.0 specifier: ^8.37.0
version: 8.48.0(@typescript-eslint/parser@8.37.0(eslint@9.39.1)(typescript@5.9.3))(eslint@9.39.1)(typescript@5.9.3) version: 8.48.1(@typescript-eslint/parser@8.37.0(eslint@9.39.1)(typescript@5.9.3))(eslint@9.39.1)(typescript@5.9.3)
'@vitejs/plugin-legacy': '@vitejs/plugin-legacy':
specifier: ^7.2.1 specifier: ^7.2.1
version: 7.2.1(terser@5.44.1)(vite@7.2.4(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0)) version: 7.2.1(terser@5.44.1)(vite@7.2.6(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0))
'@vitejs/plugin-vue': '@vitejs/plugin-vue':
specifier: ^6.0.1 specifier: ^6.0.1
version: 6.0.2(vite@7.2.4(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0))(vue@3.5.25(typescript@5.9.3)) version: 6.0.2(vite@7.2.6(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0))(vue@3.5.25(typescript@5.9.3))
'@vue/eslint-config-prettier': '@vue/eslint-config-prettier':
specifier: ^10.2.0 specifier: ^10.2.0
version: 10.2.0(eslint@9.39.1)(prettier@3.7.3) version: 10.2.0(eslint@9.39.1)(prettier@3.7.4)
'@vue/eslint-config-typescript': '@vue/eslint-config-typescript':
specifier: ^14.6.0 specifier: ^14.6.0
version: 14.6.0(eslint-plugin-vue@10.6.2(@typescript-eslint/parser@8.37.0(eslint@9.39.1)(typescript@5.9.3))(eslint@9.39.1)(vue-eslint-parser@10.2.0(eslint@9.39.1)))(eslint@9.39.1)(typescript@5.9.3) version: 14.6.0(eslint-plugin-vue@10.6.2(@typescript-eslint/parser@8.37.0(eslint@9.39.1)(typescript@5.9.3))(eslint@9.39.1)(vue-eslint-parser@10.2.0(eslint@9.39.1)))(eslint@9.39.1)(typescript@5.9.3)
@@ -137,7 +137,7 @@ importers:
version: 10.1.8(eslint@9.39.1) version: 10.1.8(eslint@9.39.1)
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: ^5.5.1 specifier: ^5.5.1
version: 5.5.4(eslint-config-prettier@10.1.8(eslint@9.39.1))(eslint@9.39.1)(prettier@3.7.3) version: 5.5.4(eslint-config-prettier@10.1.8(eslint@9.39.1))(eslint@9.39.1)(prettier@3.7.4)
eslint-plugin-vue: eslint-plugin-vue:
specifier: ^10.5.1 specifier: ^10.5.1
version: 10.6.2(@typescript-eslint/parser@8.37.0(eslint@9.39.1)(typescript@5.9.3))(eslint@9.39.1)(vue-eslint-parser@10.2.0(eslint@9.39.1)) version: 10.6.2(@typescript-eslint/parser@8.37.0(eslint@9.39.1)(typescript@5.9.3))(eslint@9.39.1)(vue-eslint-parser@10.2.0(eslint@9.39.1))
@@ -146,7 +146,7 @@ importers:
version: 8.5.6 version: 8.5.6
prettier: prettier:
specifier: ^3.6.2 specifier: ^3.6.2
version: 3.7.3 version: 3.7.4
terser: terser:
specifier: ^5.43.1 specifier: ^5.43.1
version: 5.44.1 version: 5.44.1
@@ -155,7 +155,7 @@ importers:
version: 5.9.3 version: 5.9.3
vite: vite:
specifier: ^7.2.2 specifier: ^7.2.2
version: 7.2.4(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0) version: 7.2.6(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0)
vite-plugin-compression2: vite-plugin-compression2:
specifier: ^2.3.1 specifier: ^2.3.1
version: 2.3.1(rollup@4.53.3) version: 2.3.1(rollup@4.53.3)
@@ -1127,11 +1127,11 @@ packages:
eslint: ^8.57.0 || ^9.0.0 eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <5.9.0' typescript: '>=4.8.4 <5.9.0'
'@typescript-eslint/eslint-plugin@8.48.0': '@typescript-eslint/eslint-plugin@8.48.1':
resolution: {integrity: sha512-XxXP5tL1txl13YFtrECECQYeZjBZad4fyd3cFV4a19LkAY/bIp9fev3US4S5fDVV2JaYFiKAZ/GRTOLer+mbyQ==} resolution: {integrity: sha512-X63hI1bxl5ohelzr0LY5coufyl0LJNthld+abwxpCoo6Gq+hSqhKwci7MUWkXo67mzgUK6YFByhmaHmUcuBJmA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies: peerDependencies:
'@typescript-eslint/parser': ^8.48.0 '@typescript-eslint/parser': ^8.48.1
eslint: ^8.57.0 || ^9.0.0 eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <6.0.0' typescript: '>=4.8.4 <6.0.0'
@@ -1154,8 +1154,8 @@ packages:
peerDependencies: peerDependencies:
typescript: '>=4.8.4 <6.0.0' typescript: '>=4.8.4 <6.0.0'
'@typescript-eslint/project-service@8.48.0': '@typescript-eslint/project-service@8.48.1':
resolution: {integrity: sha512-Ne4CTZyRh1BecBf84siv42wv5vQvVmgtk8AuiEffKTUo3DrBaGYZueJSxxBZ8fjk/N3DrgChH4TOdIOwOwiqqw==} resolution: {integrity: sha512-HQWSicah4s9z2/HifRPQ6b6R7G+SBx64JlFQpgSSHWPKdvCZX57XCbszg/bapbRsOEv42q5tayTYcEFpACcX1w==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies: peerDependencies:
typescript: '>=4.8.4 <6.0.0' typescript: '>=4.8.4 <6.0.0'
@@ -1168,8 +1168,8 @@ packages:
resolution: {integrity: sha512-tMDbLGXb1wC+McN1M6QeDx7P7c0UWO5z9CXqp7J8E+xGcJuUuevWKxuG8j41FoweS3+L41SkyKKkia16jpX7CA==} resolution: {integrity: sha512-tMDbLGXb1wC+McN1M6QeDx7P7c0UWO5z9CXqp7J8E+xGcJuUuevWKxuG8j41FoweS3+L41SkyKKkia16jpX7CA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/scope-manager@8.48.0': '@typescript-eslint/scope-manager@8.48.1':
resolution: {integrity: sha512-uGSSsbrtJrLduti0Q1Q9+BF1/iFKaxGoQwjWOIVNJv0o6omrdyR8ct37m4xIl5Zzpkp69Kkmvom7QFTtue89YQ==} resolution: {integrity: sha512-rj4vWQsytQbLxC5Bf4XwZ0/CKd362DkWMUkviT7DCS057SK64D5lH74sSGzhI6PDD2HCEq02xAP9cX68dYyg1w==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/tsconfig-utils@8.37.0': '@typescript-eslint/tsconfig-utils@8.37.0':
@@ -1184,8 +1184,8 @@ packages:
peerDependencies: peerDependencies:
typescript: '>=4.8.4 <6.0.0' typescript: '>=4.8.4 <6.0.0'
'@typescript-eslint/tsconfig-utils@8.48.0': '@typescript-eslint/tsconfig-utils@8.48.1':
resolution: {integrity: sha512-WNebjBdFdyu10sR1M4OXTt2OkMd5KWIL+LLfeH9KhgP+jzfDV/LI3eXzwJ1s9+Yc0Kzo2fQCdY/OpdusCMmh6w==} resolution: {integrity: sha512-k0Jhs4CpEffIBm6wPaCXBAD7jxBtrHjrSgtfCjUvPp9AZ78lXKdTR8fxyZO5y4vWNlOvYXRtngSZNSn+H53Jkw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies: peerDependencies:
typescript: '>=4.8.4 <6.0.0' typescript: '>=4.8.4 <6.0.0'
@@ -1197,8 +1197,8 @@ packages:
eslint: ^8.57.0 || ^9.0.0 eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <5.9.0' typescript: '>=4.8.4 <5.9.0'
'@typescript-eslint/type-utils@8.48.0': '@typescript-eslint/type-utils@8.48.1':
resolution: {integrity: sha512-zbeVaVqeXhhab6QNEKfK96Xyc7UQuoFWERhEnj3mLVnUWrQnv15cJNseUni7f3g557gm0e46LZ6IJ4NJVOgOpw==} resolution: {integrity: sha512-1jEop81a3LrJQLTf/1VfPQdhIY4PlGDBc/i67EVWObrtvcziysbLN3oReexHOM6N3jyXgCrkBsZpqwH0hiDOQg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies: peerDependencies:
eslint: ^8.57.0 || ^9.0.0 eslint: ^8.57.0 || ^9.0.0
@@ -1212,8 +1212,8 @@ packages:
resolution: {integrity: sha512-USjyxm3gQEePdUwJBFjjGNG18xY9A2grDVGuk7/9AkjIF1L+ZrVnwR5VAU5JXtUnBL/Nwt3H31KlRDaksnM7/w==} resolution: {integrity: sha512-USjyxm3gQEePdUwJBFjjGNG18xY9A2grDVGuk7/9AkjIF1L+ZrVnwR5VAU5JXtUnBL/Nwt3H31KlRDaksnM7/w==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/types@8.48.0': '@typescript-eslint/types@8.48.1':
resolution: {integrity: sha512-cQMcGQQH7kwKoVswD1xdOytxQR60MWKM1di26xSUtxehaDs/32Zpqsu5WJlXTtTTqyAVK8R7hvsUnIXRS+bjvA==} resolution: {integrity: sha512-+fZ3LZNeiELGmimrujsDCT4CRIbq5oXdHe7chLiW8qzqyPMnn1puNstCrMNVAqwcl2FdIxkuJ4tOs/RFDBVc/Q==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/typescript-estree@8.37.0': '@typescript-eslint/typescript-estree@8.37.0':
@@ -1228,8 +1228,8 @@ packages:
peerDependencies: peerDependencies:
typescript: '>=4.8.4 <6.0.0' typescript: '>=4.8.4 <6.0.0'
'@typescript-eslint/typescript-estree@8.48.0': '@typescript-eslint/typescript-estree@8.48.1':
resolution: {integrity: sha512-ljHab1CSO4rGrQIAyizUS6UGHHCiAYhbfcIZ1zVJr5nMryxlXMVWS3duFPSKvSUbFPwkXMFk1k0EMIjub4sRRQ==} resolution: {integrity: sha512-/9wQ4PqaefTK6POVTjJaYS0bynCgzh6ClJHGSBj06XEHjkfylzB+A3qvyaXnErEZSaxhIo4YdyBgq6j4RysxDg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies: peerDependencies:
typescript: '>=4.8.4 <6.0.0' typescript: '>=4.8.4 <6.0.0'
@@ -1241,8 +1241,8 @@ packages:
eslint: ^8.57.0 || ^9.0.0 eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <5.9.0' typescript: '>=4.8.4 <5.9.0'
'@typescript-eslint/utils@8.48.0': '@typescript-eslint/utils@8.48.1':
resolution: {integrity: sha512-yTJO1XuGxCsSfIVt1+1UrLHtue8xz16V8apzPYI06W0HbEbEWHxHXgZaAgavIkoh+GeV6hKKd5jm0sS6OYxWXQ==} resolution: {integrity: sha512-fAnhLrDjiVfey5wwFRwrweyRlCmdz5ZxXz2G/4cLn0YDLjTapmN4gcCsTBR1N2rWnZSDeWpYtgLDsJt+FpmcwA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies: peerDependencies:
eslint: ^8.57.0 || ^9.0.0 eslint: ^8.57.0 || ^9.0.0
@@ -1256,8 +1256,8 @@ packages:
resolution: {integrity: sha512-/++5CYLQqsO9HFGLI7APrxBJYo+5OCMpViuhV8q5/Qa3o5mMrF//eQHks+PXcsAVaLdn817fMuS7zqoXNNZGaw==} resolution: {integrity: sha512-/++5CYLQqsO9HFGLI7APrxBJYo+5OCMpViuhV8q5/Qa3o5mMrF//eQHks+PXcsAVaLdn817fMuS7zqoXNNZGaw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/visitor-keys@8.48.0': '@typescript-eslint/visitor-keys@8.48.1':
resolution: {integrity: sha512-T0XJMaRPOH3+LBbAfzR2jalckP1MSG/L9eUtY0DEzUyVaXJ/t6zN0nR7co5kz0Jko/nkSYCBRkz1djvjajVTTg==} resolution: {integrity: sha512-BmxxndzEWhE4TIEEMBs8lP3MBWN3jFPs/p6gPm/wkv02o41hI6cq9AuSmGAaTTHPtA1FTi2jBre4A9rm5ZmX+Q==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@videojs/http-streaming@3.17.2': '@videojs/http-streaming@3.17.2':
@@ -1437,8 +1437,8 @@ packages:
resolution: {integrity: sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==} resolution: {integrity: sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==}
engines: {node: '>=10.0.0'} engines: {node: '>=10.0.0'}
ace-builds@1.43.4: ace-builds@1.43.5:
resolution: {integrity: sha512-8hAxVfo2ImICd69BWlZwZlxe9rxDGDjuUhh+WeWgGDvfBCE+r3lkynkQvIovDz4jcMi8O7bsEaFygaDT+h9sBA==} resolution: {integrity: sha512-iH5FLBKdB7SVn9GR37UgA/tpQS8OTWIxWAuq3Ofaw+Qbc69FfPXsXd9jeW7KRG2xKpKMqBDnu0tHBrCWY5QI7A==}
acorn-jsx@5.3.2: acorn-jsx@5.3.2:
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
@@ -2167,8 +2167,8 @@ packages:
resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==}
engines: {node: '>=6.0.0'} engines: {node: '>=6.0.0'}
prettier@3.7.3: prettier@3.7.4:
resolution: {integrity: sha512-QgODejq9K3OzoBbuyobZlUhznP5SKwPqp+6Q6xw6o8gnhr4O85L2U915iM2IDcfF2NPXVaM9zlo9tdwipnYwzg==} resolution: {integrity: sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==}
engines: {node: '>=14'} engines: {node: '>=14'}
hasBin: true hasBin: true
@@ -2439,8 +2439,8 @@ packages:
vite-plugin-compression2@2.3.1: vite-plugin-compression2@2.3.1:
resolution: {integrity: sha512-bnhLTsurtvOiiP6EMISIKVsOMCeTAjE6FJbyqQus3W4mtAxF7pCuC4puUIAiCgNs98tOCpqo6GIXJXTLufzIaw==} resolution: {integrity: sha512-bnhLTsurtvOiiP6EMISIKVsOMCeTAjE6FJbyqQus3W4mtAxF7pCuC4puUIAiCgNs98tOCpqo6GIXJXTLufzIaw==}
vite@7.2.4: vite@7.2.6:
resolution: {integrity: sha512-NL8jTlbo0Tn4dUEXEsUg8KeyG/Lkmc4Fnzb8JXN/Ykm9G4HNImjtABMJgkQoVjOBN/j2WAwDTRytdqJbZsah7w==} resolution: {integrity: sha512-tI2l/nFHC5rLh7+5+o7QjKjSR04ivXDF4jcgV0f/bTQ+OJiITy5S6gaynVsEM+7RqzufMnVbIon6Sr5x1SDYaQ==}
engines: {node: ^20.19.0 || >=22.12.0} engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true hasBin: true
peerDependencies: peerDependencies:
@@ -3576,14 +3576,14 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@typescript-eslint/eslint-plugin@8.48.0(@typescript-eslint/parser@8.37.0(eslint@9.39.1)(typescript@5.9.3))(eslint@9.39.1)(typescript@5.9.3)': '@typescript-eslint/eslint-plugin@8.48.1(@typescript-eslint/parser@8.37.0(eslint@9.39.1)(typescript@5.9.3))(eslint@9.39.1)(typescript@5.9.3)':
dependencies: dependencies:
'@eslint-community/regexpp': 4.12.2 '@eslint-community/regexpp': 4.12.2
'@typescript-eslint/parser': 8.37.0(eslint@9.39.1)(typescript@5.9.3) '@typescript-eslint/parser': 8.37.0(eslint@9.39.1)(typescript@5.9.3)
'@typescript-eslint/scope-manager': 8.48.0 '@typescript-eslint/scope-manager': 8.48.1
'@typescript-eslint/type-utils': 8.48.0(eslint@9.39.1)(typescript@5.9.3) '@typescript-eslint/type-utils': 8.48.1(eslint@9.39.1)(typescript@5.9.3)
'@typescript-eslint/utils': 8.48.0(eslint@9.39.1)(typescript@5.9.3) '@typescript-eslint/utils': 8.48.1(eslint@9.39.1)(typescript@5.9.3)
'@typescript-eslint/visitor-keys': 8.48.0 '@typescript-eslint/visitor-keys': 8.48.1
eslint: 9.39.1 eslint: 9.39.1
graphemer: 1.4.0 graphemer: 1.4.0
ignore: 7.0.5 ignore: 7.0.5
@@ -3623,10 +3623,10 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@typescript-eslint/project-service@8.48.0(typescript@5.9.3)': '@typescript-eslint/project-service@8.48.1(typescript@5.9.3)':
dependencies: dependencies:
'@typescript-eslint/tsconfig-utils': 8.48.0(typescript@5.9.3) '@typescript-eslint/tsconfig-utils': 8.48.1(typescript@5.9.3)
'@typescript-eslint/types': 8.48.0 '@typescript-eslint/types': 8.48.1
debug: 4.4.3 debug: 4.4.3
typescript: 5.9.3 typescript: 5.9.3
transitivePeerDependencies: transitivePeerDependencies:
@@ -3642,10 +3642,10 @@ snapshots:
'@typescript-eslint/types': 8.46.4 '@typescript-eslint/types': 8.46.4
'@typescript-eslint/visitor-keys': 8.46.4 '@typescript-eslint/visitor-keys': 8.46.4
'@typescript-eslint/scope-manager@8.48.0': '@typescript-eslint/scope-manager@8.48.1':
dependencies: dependencies:
'@typescript-eslint/types': 8.48.0 '@typescript-eslint/types': 8.48.1
'@typescript-eslint/visitor-keys': 8.48.0 '@typescript-eslint/visitor-keys': 8.48.1
'@typescript-eslint/tsconfig-utils@8.37.0(typescript@5.9.3)': '@typescript-eslint/tsconfig-utils@8.37.0(typescript@5.9.3)':
dependencies: dependencies:
@@ -3655,7 +3655,7 @@ snapshots:
dependencies: dependencies:
typescript: 5.9.3 typescript: 5.9.3
'@typescript-eslint/tsconfig-utils@8.48.0(typescript@5.9.3)': '@typescript-eslint/tsconfig-utils@8.48.1(typescript@5.9.3)':
dependencies: dependencies:
typescript: 5.9.3 typescript: 5.9.3
@@ -3671,11 +3671,11 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@typescript-eslint/type-utils@8.48.0(eslint@9.39.1)(typescript@5.9.3)': '@typescript-eslint/type-utils@8.48.1(eslint@9.39.1)(typescript@5.9.3)':
dependencies: dependencies:
'@typescript-eslint/types': 8.48.0 '@typescript-eslint/types': 8.48.1
'@typescript-eslint/typescript-estree': 8.48.0(typescript@5.9.3) '@typescript-eslint/typescript-estree': 8.48.1(typescript@5.9.3)
'@typescript-eslint/utils': 8.48.0(eslint@9.39.1)(typescript@5.9.3) '@typescript-eslint/utils': 8.48.1(eslint@9.39.1)(typescript@5.9.3)
debug: 4.4.3 debug: 4.4.3
eslint: 9.39.1 eslint: 9.39.1
ts-api-utils: 2.1.0(typescript@5.9.3) ts-api-utils: 2.1.0(typescript@5.9.3)
@@ -3687,7 +3687,7 @@ snapshots:
'@typescript-eslint/types@8.46.4': {} '@typescript-eslint/types@8.46.4': {}
'@typescript-eslint/types@8.48.0': {} '@typescript-eslint/types@8.48.1': {}
'@typescript-eslint/typescript-estree@8.37.0(typescript@5.9.3)': '@typescript-eslint/typescript-estree@8.37.0(typescript@5.9.3)':
dependencies: dependencies:
@@ -3721,12 +3721,12 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@typescript-eslint/typescript-estree@8.48.0(typescript@5.9.3)': '@typescript-eslint/typescript-estree@8.48.1(typescript@5.9.3)':
dependencies: dependencies:
'@typescript-eslint/project-service': 8.48.0(typescript@5.9.3) '@typescript-eslint/project-service': 8.48.1(typescript@5.9.3)
'@typescript-eslint/tsconfig-utils': 8.48.0(typescript@5.9.3) '@typescript-eslint/tsconfig-utils': 8.48.1(typescript@5.9.3)
'@typescript-eslint/types': 8.48.0 '@typescript-eslint/types': 8.48.1
'@typescript-eslint/visitor-keys': 8.48.0 '@typescript-eslint/visitor-keys': 8.48.1
debug: 4.4.3 debug: 4.4.3
minimatch: 9.0.5 minimatch: 9.0.5
semver: 7.7.3 semver: 7.7.3
@@ -3747,12 +3747,12 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@typescript-eslint/utils@8.48.0(eslint@9.39.1)(typescript@5.9.3)': '@typescript-eslint/utils@8.48.1(eslint@9.39.1)(typescript@5.9.3)':
dependencies: dependencies:
'@eslint-community/eslint-utils': 4.9.0(eslint@9.39.1) '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.1)
'@typescript-eslint/scope-manager': 8.48.0 '@typescript-eslint/scope-manager': 8.48.1
'@typescript-eslint/types': 8.48.0 '@typescript-eslint/types': 8.48.1
'@typescript-eslint/typescript-estree': 8.48.0(typescript@5.9.3) '@typescript-eslint/typescript-estree': 8.48.1(typescript@5.9.3)
eslint: 9.39.1 eslint: 9.39.1
typescript: 5.9.3 typescript: 5.9.3
transitivePeerDependencies: transitivePeerDependencies:
@@ -3768,9 +3768,9 @@ snapshots:
'@typescript-eslint/types': 8.46.4 '@typescript-eslint/types': 8.46.4
eslint-visitor-keys: 4.2.1 eslint-visitor-keys: 4.2.1
'@typescript-eslint/visitor-keys@8.48.0': '@typescript-eslint/visitor-keys@8.48.1':
dependencies: dependencies:
'@typescript-eslint/types': 8.48.0 '@typescript-eslint/types': 8.48.1
eslint-visitor-keys: 4.2.1 eslint-visitor-keys: 4.2.1
'@videojs/http-streaming@3.17.2(video.js@8.23.4)': '@videojs/http-streaming@3.17.2(video.js@8.23.4)':
@@ -3795,7 +3795,7 @@ snapshots:
global: 4.4.0 global: 4.4.0
is-function: 1.0.2 is-function: 1.0.2
'@vitejs/plugin-legacy@7.2.1(terser@5.44.1)(vite@7.2.4(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0))': '@vitejs/plugin-legacy@7.2.1(terser@5.44.1)(vite@7.2.6(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0))':
dependencies: dependencies:
'@babel/core': 7.28.5 '@babel/core': 7.28.5
'@babel/plugin-transform-dynamic-import': 7.27.1(@babel/core@7.28.5) '@babel/plugin-transform-dynamic-import': 7.27.1(@babel/core@7.28.5)
@@ -3810,14 +3810,14 @@ snapshots:
regenerator-runtime: 0.14.1 regenerator-runtime: 0.14.1
systemjs: 6.15.1 systemjs: 6.15.1
terser: 5.44.1 terser: 5.44.1
vite: 7.2.4(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0) vite: 7.2.6(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@vitejs/plugin-vue@6.0.2(vite@7.2.4(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0))(vue@3.5.25(typescript@5.9.3))': '@vitejs/plugin-vue@6.0.2(vite@7.2.6(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0))(vue@3.5.25(typescript@5.9.3))':
dependencies: dependencies:
'@rolldown/pluginutils': 1.0.0-beta.50 '@rolldown/pluginutils': 1.0.0-beta.50
vite: 7.2.4(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0) vite: 7.2.6(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0)
vue: 3.5.25(typescript@5.9.3) vue: 3.5.25(typescript@5.9.3)
'@volar/language-core@2.4.23': '@volar/language-core@2.4.23':
@@ -3882,12 +3882,12 @@ snapshots:
dependencies: dependencies:
rfdc: 1.4.1 rfdc: 1.4.1
'@vue/eslint-config-prettier@10.2.0(eslint@9.39.1)(prettier@3.7.3)': '@vue/eslint-config-prettier@10.2.0(eslint@9.39.1)(prettier@3.7.4)':
dependencies: dependencies:
eslint: 9.39.1 eslint: 9.39.1
eslint-config-prettier: 10.1.8(eslint@9.39.1) eslint-config-prettier: 10.1.8(eslint@9.39.1)
eslint-plugin-prettier: 5.5.4(eslint-config-prettier@10.1.8(eslint@9.39.1))(eslint@9.39.1)(prettier@3.7.3) eslint-plugin-prettier: 5.5.4(eslint-config-prettier@10.1.8(eslint@9.39.1))(eslint@9.39.1)(prettier@3.7.4)
prettier: 3.7.3 prettier: 3.7.4
transitivePeerDependencies: transitivePeerDependencies:
- '@types/eslint' - '@types/eslint'
@@ -3971,7 +3971,7 @@ snapshots:
'@xmldom/xmldom@0.8.11': {} '@xmldom/xmldom@0.8.11': {}
ace-builds@1.43.4: {} ace-builds@1.43.5: {}
acorn-jsx@5.3.2(acorn@8.15.0): acorn-jsx@5.3.2(acorn@8.15.0):
dependencies: dependencies:
@@ -4219,10 +4219,10 @@ snapshots:
dependencies: dependencies:
eslint: 9.39.1 eslint: 9.39.1
eslint-plugin-prettier@5.5.4(eslint-config-prettier@10.1.8(eslint@9.39.1))(eslint@9.39.1)(prettier@3.7.3): eslint-plugin-prettier@5.5.4(eslint-config-prettier@10.1.8(eslint@9.39.1))(eslint@9.39.1)(prettier@3.7.4):
dependencies: dependencies:
eslint: 9.39.1 eslint: 9.39.1
prettier: 3.7.3 prettier: 3.7.4
prettier-linter-helpers: 1.0.0 prettier-linter-helpers: 1.0.0
synckit: 0.11.11 synckit: 0.11.11
optionalDependencies: optionalDependencies:
@@ -4697,7 +4697,7 @@ snapshots:
dependencies: dependencies:
fast-diff: 1.3.0 fast-diff: 1.3.0
prettier@3.7.3: {} prettier@3.7.4: {}
pretty-bytes@7.1.0: {} pretty-bytes@7.1.0: {}
@@ -4985,7 +4985,7 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- rollup - rollup
vite@7.2.4(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0): vite@7.2.6(@types/node@24.10.1)(terser@5.44.1)(yaml@2.7.0):
dependencies: dependencies:
esbuild: 0.25.12 esbuild: 0.25.12
fdir: 6.5.0(picomatch@4.0.3) fdir: 6.5.0(picomatch@4.0.3)
+60 -12
View File
@@ -8,12 +8,7 @@
<i class="material-icons">description</i> <i class="material-icons">description</i>
<p>{{ $t("files.lonely") }}</p> <p>{{ $t("files.lonely") }}</p>
</div> </div>
<div <div v-else class="csv-table-container" @wheel.stop @touchmove.stop>
v-else
class="csv-table-container"
@wheel.stop
@touchmove.stop
>
<table class="csv-table"> <table class="csv-table">
<thead> <thead>
<tr> <tr>
@@ -30,9 +25,29 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div v-if="data.rows.length > 100" class="csv-info"> <div class="csv-footer">
<i class="material-icons">info</i> <div class="csv-info" v-if="data.rows.length > 100">
<span>Showing {{ data.rows.length }} rows</span> <i class="material-icons">info</i>
<span>Showing {{ data.rows.length }} rows</span>
</div>
<div class="column-separator">
<label for="columnSeparator">Column Separator</label>
<select
id="columnSeparator"
class="input input--block"
v-model="columnSeparator"
>
<option :value="[',']">
{{ $t("available_csv_separators.comma") }}
</option>
<option :value="[';']">
{{ $t("available_csv_separators.semicolon") }}
</option>
<option :value="[',', ';']">
{{ $t("available_csv_separators.both") }}
</option>
</select>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -40,7 +55,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { parseCSV, type CsvData } from "@/utils/csv"; import { parseCSV, type CsvData } from "@/utils/csv";
import { computed } from "vue"; import { computed, ref } from "vue";
interface Props { interface Props {
content: string; content: string;
@@ -51,9 +66,11 @@ const props = withDefaults(defineProps<Props>(), {
error: "", error: "",
}); });
const columnSeparator = ref([","]);
const data = computed<CsvData>(() => { const data = computed<CsvData>(() => {
try { try {
return parseCSV(props.content); return parseCSV(props.content, columnSeparator.value);
} catch (e) { } catch (e) {
console.error("Failed to parse CSV:", e); console.error("Failed to parse CSV:", e);
return { headers: [], rows: [] }; return { headers: [], rows: [] };
@@ -66,7 +83,11 @@ const displayError = computed(() => {
return props.error; return props.error;
} }
// Check for parse errors // Check for parse errors
if (props.content && props.content.trim().length > 0 && data.value.headers.length === 0) { if (
props.content &&
props.content.trim().length > 0 &&
data.value.headers.length === 0
) {
return "Failed to parse CSV file"; return "Failed to parse CSV file";
} }
return null; return null;
@@ -182,6 +203,18 @@ const displayError = computed(() => {
transition: background-color 0.15s ease; transition: background-color 0.15s ease;
} }
.csv-footer {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
padding: 0.5rem;
}
.csv-footer > :only-child {
margin-left: auto;
}
.csv-info { .csv-info {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -195,6 +228,21 @@ const displayError = computed(() => {
font-size: 0.875rem; font-size: 0.875rem;
} }
.column-separator {
display: flex;
align-items: center;
gap: 0.5rem;
}
.column-separator > label {
font-size: small;
text-align: end;
}
.column-separator > select {
margin-bottom: 0;
}
.csv-info i { .csv-info i {
font-size: 1.2rem; font-size: 1.2rem;
color: var(--blue); color: var(--blue);
+5
View File
@@ -272,5 +272,10 @@
"minutes": "دقائق", "minutes": "دقائق",
"seconds": "ثواني", "seconds": "ثواني",
"unit": "وحدة الوقت" "unit": "وحدة الوقت"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Минути", "minutes": "Минути",
"seconds": "Секунди", "seconds": "Секунди",
"unit": "Единица за време" "unit": "Единица за време"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minuts", "minutes": "Minuts",
"seconds": "Segons", "seconds": "Segons",
"unit": "Unitat" "unit": "Unitat"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minuty", "minutes": "Minuty",
"seconds": "Sekundy", "seconds": "Sekundy",
"unit": "Časová jednotka" "unit": "Časová jednotka"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+14 -9
View File
@@ -43,8 +43,8 @@
"upload": "Upload", "upload": "Upload",
"openFile": "Datei öffnen", "openFile": "Datei öffnen",
"discardChanges": "Verwerfen", "discardChanges": "Verwerfen",
"saveChanges": "Save changes", "saveChanges": "Änderungen speichern",
"editAsText": "Edit as Text" "editAsText": "Als Text bearbeiten"
}, },
"download": { "download": {
"downloadFile": "Download Datei", "downloadFile": "Download Datei",
@@ -77,8 +77,8 @@
"sortByName": "Nach Namen sortieren", "sortByName": "Nach Namen sortieren",
"sortBySize": "Nach Größe sortieren", "sortBySize": "Nach Größe sortieren",
"noPreview": "Für diese Datei ist keine Vorschau verfügbar.", "noPreview": "Für diese Datei ist keine Vorschau verfügbar.",
"csvTooLarge": "CSV file is too large for preview (>5MB). Please download to view.", "csvTooLarge": "Die CSV-Datei ist zu groß für die Vorschau (>5 MB). Bitte herunterladen, um sie anzuzeigen.",
"csvLoadFailed": "Failed to load CSV file." "csvLoadFailed": "Fehler beim Laden der CSV-Datei."
}, },
"help": { "help": {
"click": "Wähle Datei oder Ordner", "click": "Wähle Datei oder Ordner",
@@ -105,9 +105,9 @@
"username": "Benutzername", "username": "Benutzername",
"usernameTaken": "Benutzername ist bereits vergeben", "usernameTaken": "Benutzername ist bereits vergeben",
"wrongCredentials": "Falsche Zugangsdaten", "wrongCredentials": "Falsche Zugangsdaten",
"passwordTooShort": "Password must be at least {min} characters", "passwordTooShort": "Passwort muss mindestens {min} Zeichen lang sein",
"logout_reasons": { "logout_reasons": {
"inactivity": "You have been logged out due to inactivity." "inactivity": "Du wurdest aufgrund von Inaktivität abgemeldet."
} }
}, },
"permanent": "Permanent", "permanent": "Permanent",
@@ -162,7 +162,7 @@
"video": "Video" "video": "Video"
}, },
"settings": { "settings": {
"aceEditorTheme": "Ace editor theme", "aceEditorTheme": "Ace Editor Theme",
"admin": "Admin", "admin": "Admin",
"administrator": "Administrator", "administrator": "Administrator",
"allowCommands": "Befehle ausführen", "allowCommands": "Befehle ausführen",
@@ -170,7 +170,7 @@
"allowNew": "Erstellen neuer Dateien und Ordner", "allowNew": "Erstellen neuer Dateien und Ordner",
"allowPublish": "Veröffentlichen von neuen Beiträgen und Seiten", "allowPublish": "Veröffentlichen von neuen Beiträgen und Seiten",
"allowSignup": "Erlaube Benutzern sich zu registrieren", "allowSignup": "Erlaube Benutzern sich zu registrieren",
"hideLoginButton": "Hide the login button from public pages", "hideLoginButton": "Den Login-Button auf öffentlichen Seiten ausblenden",
"avoidChanges": "(leer lassen, um Änderungen zu vermeiden)", "avoidChanges": "(leer lassen, um Änderungen zu vermeiden)",
"branding": "Design", "branding": "Design",
"brandingDirectoryPath": "Designverzeichnispfad", "brandingDirectoryPath": "Designverzeichnispfad",
@@ -180,7 +180,7 @@
"commandRunnerHelp": "Hier könne Sie Befehle eintragen, welche bei den benannten Aktionen ausgeführt werden. Sie müssen pro Zeile jeweils einen Befehl eingeben. Die Umgebungsvariable {0} und {1} sind verfügbar, wobei {0} relative zu {1} ist. Für mehr Informationen über diese Funktion und die verfügbaren Umgebungsvariablen lesen Sie bitte die {2}.", "commandRunnerHelp": "Hier könne Sie Befehle eintragen, welche bei den benannten Aktionen ausgeführt werden. Sie müssen pro Zeile jeweils einen Befehl eingeben. Die Umgebungsvariable {0} und {1} sind verfügbar, wobei {0} relative zu {1} ist. Für mehr Informationen über diese Funktion und die verfügbaren Umgebungsvariablen lesen Sie bitte die {2}.",
"commandsUpdated": "Befehle aktualisiert!", "commandsUpdated": "Befehle aktualisiert!",
"createUserDir": "Automatisches Erstellen des Home-Verzeichnisses beim Anlegen neuer Benutzer", "createUserDir": "Automatisches Erstellen des Home-Verzeichnisses beim Anlegen neuer Benutzer",
"minimumPasswordLength": "Minimum password length", "minimumPasswordLength": "Mindestlänge für Passwörter",
"tusUploads": "Gestückelter Upload", "tusUploads": "Gestückelter Upload",
"tusUploadsHelp": "File Browser unterstützt das Hochladen von gestückelten Dateien und ermöglicht so einen effizienten, zuverlässigen, fortsetzbaren und gestückelten Datei-Upload auch in unzuverlässigen Netzwerken.", "tusUploadsHelp": "File Browser unterstützt das Hochladen von gestückelten Dateien und ermöglicht so einen effizienten, zuverlässigen, fortsetzbaren und gestückelten Datei-Upload auch in unzuverlässigen Netzwerken.",
"tusUploadsChunkSize": "Gibt die maximale Größe pro Anfrage an (direkte Uploads werden für kleinere Uploads verwendet). Bitte geben Sie eine Byte-Angabe oder eine Zeichenfolge wie 10 MB, 1 GB usw. an", "tusUploadsChunkSize": "Gibt die maximale Größe pro Anfrage an (direkte Uploads werden für kleinere Uploads verwendet). Bitte geben Sie eine Byte-Angabe oder eine Zeichenfolge wie 10 MB, 1 GB usw. an",
@@ -272,5 +272,10 @@
"minutes": "Minuten", "minutes": "Minuten",
"seconds": "Sekunden", "seconds": "Sekunden",
"unit": "Zeiteinheit" "unit": "Zeiteinheit"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Λεπτά", "minutes": "Λεπτά",
"seconds": "Δευτερόλεπτα", "seconds": "Δευτερόλεπτα",
"unit": "Μονάδα χρόνου" "unit": "Μονάδα χρόνου"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minutes", "minutes": "Minutes",
"seconds": "Seconds", "seconds": "Seconds",
"unit": "Time Unit" "unit": "Time Unit"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minutos", "minutes": "Minutos",
"seconds": "Segundos", "seconds": "Segundos",
"unit": "Unidad" "unit": "Unidad"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "دقیقه", "minutes": "دقیقه",
"seconds": "ثانیه", "seconds": "ثانیه",
"unit": "واحد زمان" "unit": "واحد زمان"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minutes", "minutes": "Minutes",
"seconds": "Secondes", "seconds": "Secondes",
"unit": "Unité de temps" "unit": "Unité de temps"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "דקות", "minutes": "דקות",
"seconds": "שניות", "seconds": "שניות",
"unit": "יחידת זמן" "unit": "יחידת זמן"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minute", "minutes": "Minute",
"seconds": "Sekunde", "seconds": "Sekunde",
"unit": "Jedinica vremena" "unit": "Jedinica vremena"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Perc", "minutes": "Perc",
"seconds": "Másodperc", "seconds": "Másodperc",
"unit": "Időegység" "unit": "Időegység"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Mínútur", "minutes": "Mínútur",
"seconds": "Sekúndur", "seconds": "Sekúndur",
"unit": "Tímastilling" "unit": "Tímastilling"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minuti", "minutes": "Minuti",
"seconds": "Secondi", "seconds": "Secondi",
"unit": "Unità di tempo" "unit": "Unità di tempo"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "分", "minutes": "分",
"seconds": "秒", "seconds": "秒",
"unit": "時間の単位" "unit": "時間の単位"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "분", "minutes": "분",
"seconds": "초", "seconds": "초",
"unit": "Time Unit" "unit": "Time Unit"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minuten", "minutes": "Minuten",
"seconds": "Seconden", "seconds": "Seconden",
"unit": "Tijdseenheid" "unit": "Tijdseenheid"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minutt", "minutes": "Minutt",
"seconds": "Sekunder", "seconds": "Sekunder",
"unit": "Time format" "unit": "Time format"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minuty", "minutes": "Minuty",
"seconds": "Sekundy", "seconds": "Sekundy",
"unit": "Jednostka czasu" "unit": "Jednostka czasu"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minutos", "minutes": "Minutos",
"seconds": "Segundos", "seconds": "Segundos",
"unit": "Unidades de Tempo" "unit": "Unidades de Tempo"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minutos", "minutes": "Minutos",
"seconds": "Segundos", "seconds": "Segundos",
"unit": "Unidades de tempo" "unit": "Unidades de tempo"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minute", "minutes": "Minute",
"seconds": "Secunde", "seconds": "Secunde",
"unit": "Unitate de timp" "unit": "Unitate de timp"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Минуты", "minutes": "Минуты",
"seconds": "Секунды", "seconds": "Секунды",
"unit": "Единица времени" "unit": "Единица времени"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minúty", "minutes": "Minúty",
"seconds": "Sekundy", "seconds": "Sekundy",
"unit": "Jednotka času" "unit": "Jednotka času"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Minuter", "minutes": "Minuter",
"seconds": "Sekunder", "seconds": "Sekunder",
"unit": "Tidsenhet" "unit": "Tidsenhet"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Dakika", "minutes": "Dakika",
"seconds": "Saniye", "seconds": "Saniye",
"unit": "Zaman birimi" "unit": "Zaman birimi"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Хвилини", "minutes": "Хвилини",
"seconds": "Секунди", "seconds": "Секунди",
"unit": "Одиниця часу" "unit": "Одиниця часу"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "Phút", "minutes": "Phút",
"seconds": "Giây", "seconds": "Giây",
"unit": "Đơn vị" "unit": "Đơn vị"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "分钟", "minutes": "分钟",
"seconds": "秒", "seconds": "秒",
"unit": "时间单位" "unit": "时间单位"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5
View File
@@ -272,5 +272,10 @@
"minutes": "分鐘", "minutes": "分鐘",
"seconds": "秒", "seconds": "秒",
"unit": "時間單位" "unit": "時間單位"
},
"available_csv_separators": {
"comma": "Comma (,)",
"semicolon": "Semicolon (;)",
"both": "Both (,) and (;)"
} }
} }
+5 -2
View File
@@ -7,7 +7,10 @@ export interface CsvData {
* Parse CSV content into headers and rows * Parse CSV content into headers and rows
* Supports quoted fields and handles commas within quotes * Supports quoted fields and handles commas within quotes
*/ */
export function parseCSV(content: string): CsvData { export function parseCSV(
content: string,
columnSeparator: Array<string>
): CsvData {
if (!content || content.trim().length === 0) { if (!content || content.trim().length === 0) {
return { headers: [], rows: [] }; return { headers: [], rows: [] };
} }
@@ -35,7 +38,7 @@ export function parseCSV(content: string): CsvData {
// Toggle quote state // Toggle quote state
inQuotes = !inQuotes; inQuotes = !inQuotes;
} }
} else if (char === "," && !inQuotes) { } else if (columnSeparator.includes(char) && !inQuotes) {
// Field separator // Field separator
row.push(currentField); row.push(currentField);
currentField = ""; currentField = "";
+3 -3
View File
@@ -17,9 +17,9 @@ require (
github.com/mholt/archives v0.1.5 github.com/mholt/archives v0.1.5
github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-homedir v1.1.0
github.com/samber/lo v1.52.0 github.com/samber/lo v1.52.0
github.com/shirou/gopsutil/v4 v4.25.10 github.com/shirou/gopsutil/v4 v4.25.11
github.com/spf13/afero v1.15.0 github.com/spf13/afero v1.15.0
github.com/spf13/cobra v1.10.1 github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10 github.com/spf13/pflag v1.0.10
github.com/spf13/viper v1.21.0 github.com/spf13/viper v1.21.0
github.com/stretchr/testify v1.11.1 github.com/stretchr/testify v1.11.1
@@ -44,7 +44,7 @@ require (
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect
github.com/dsoprea/go-logging v0.0.0-20200710184922-b02d349568dd // indirect github.com/dsoprea/go-logging v0.0.0-20200710184922-b02d349568dd // indirect
github.com/dsoprea/go-utility/v2 v2.0.0-20221003172846-a3e1774ef349 // indirect github.com/dsoprea/go-utility/v2 v2.0.0-20221003172846-a3e1774ef349 // indirect
github.com/ebitengine/purego v0.9.0 // indirect github.com/ebitengine/purego v0.9.1 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-errors/errors v1.5.1 // indirect github.com/go-errors/errors v1.5.1 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-ole/go-ole v1.3.0 // indirect
+6 -6
View File
@@ -75,8 +75,8 @@ github.com/dsoprea/go-utility/v2 v2.0.0-20221003142440-7a1927d49d9d/go.mod h1:LV
github.com/dsoprea/go-utility/v2 v2.0.0-20221003160719-7bc88537c05e/go.mod h1:VZ7cB0pTjm1ADBWhJUOHESu4ZYy9JN+ZPqjfiW09EPU= github.com/dsoprea/go-utility/v2 v2.0.0-20221003160719-7bc88537c05e/go.mod h1:VZ7cB0pTjm1ADBWhJUOHESu4ZYy9JN+ZPqjfiW09EPU=
github.com/dsoprea/go-utility/v2 v2.0.0-20221003172846-a3e1774ef349 h1:DilThiXje0z+3UQ5YjYiSRRzVdtamFpvBQXKwMglWqw= github.com/dsoprea/go-utility/v2 v2.0.0-20221003172846-a3e1774ef349 h1:DilThiXje0z+3UQ5YjYiSRRzVdtamFpvBQXKwMglWqw=
github.com/dsoprea/go-utility/v2 v2.0.0-20221003172846-a3e1774ef349/go.mod h1:4GC5sXji84i/p+irqghpPFZBF8tRN/Q7+700G0/DLe8= github.com/dsoprea/go-utility/v2 v2.0.0-20221003172846-a3e1774ef349/go.mod h1:4GC5sXji84i/p+irqghpPFZBF8tRN/Q7+700G0/DLe8=
github.com/ebitengine/purego v0.9.0 h1:mh0zpKBIXDceC63hpvPuGLiJ8ZAa3DfrFTudmfi8A4k= github.com/ebitengine/purego v0.9.1 h1:a/k2f2HQU3Pi399RPW1MOaZyhKJL9w/xFpKAg4q1s0A=
github.com/ebitengine/purego v0.9.0/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/ebitengine/purego v0.9.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=
@@ -204,8 +204,8 @@ github.com/sagikazarmark/locafero v0.11.0 h1:1iurJgmM9G3PA/I+wWYIOw/5SyBtxapeHDc
github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik= github.com/sagikazarmark/locafero v0.11.0/go.mod h1:nVIGvgyzw595SUSUE6tvCp3YYTeHs15MvlmU87WwIik=
github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw= github.com/samber/lo v1.52.0 h1:Rvi+3BFHES3A8meP33VPAxiBZX/Aws5RxrschYGjomw=
github.com/samber/lo v1.52.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0= github.com/samber/lo v1.52.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
github.com/shirou/gopsutil/v4 v4.25.10 h1:at8lk/5T1OgtuCp+AwrDofFRjnvosn0nkN2OLQ6g8tA= github.com/shirou/gopsutil/v4 v4.25.11 h1:X53gB7muL9Gnwwo2evPSE+SfOrltMoR6V3xJAXZILTY=
github.com/shirou/gopsutil/v4 v4.25.10/go.mod h1:+kSwyC8DRUD9XXEHCAFjK+0nuArFJM0lva+StQAcskM= github.com/shirou/gopsutil/v4 v4.25.11/go.mod h1:EivAfP5x2EhLp2ovdpKSozecVXn1TmuG7SMzs/Wh4PU=
github.com/sorairolake/lzip-go v0.3.8 h1:j5Q2313INdTA80ureWYRhX+1K78mUXfMoPZCw/ivWik= github.com/sorairolake/lzip-go v0.3.8 h1:j5Q2313INdTA80ureWYRhX+1K78mUXfMoPZCw/ivWik=
github.com/sorairolake/lzip-go v0.3.8/go.mod h1:JcBqGMV0frlxwrsE9sMWXDjqn3EeVf0/54YPsw66qkU= github.com/sorairolake/lzip-go v0.3.8/go.mod h1:JcBqGMV0frlxwrsE9sMWXDjqn3EeVf0/54YPsw66qkU=
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw= github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 h1:+jumHNA0Wrelhe64i8F6HNlS8pkoyMv5sreGx2Ry5Rw=
@@ -214,8 +214,8 @@ github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=
github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=
github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=
github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s= github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0= github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+3 -3
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"encoding/json" "encoding/json"
@@ -13,7 +13,7 @@ import (
"github.com/golang-jwt/jwt/v5/request" "github.com/golang-jwt/jwt/v5/request"
fbAuth "github.com/filebrowser/filebrowser/v2/auth" fbAuth "github.com/filebrowser/filebrowser/v2/auth"
fbErrors "github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/v2/users" "github.com/filebrowser/filebrowser/v2/users"
) )
@@ -185,7 +185,7 @@ var signupHandler = func(_ http.ResponseWriter, r *http.Request, d *data) (int,
log.Printf("new user: %s, home dir: [%s].", user.Username, userHome) log.Printf("new user: %s, home dir: [%s].", user.Username, userHome)
err = d.store.Users.Save(user) err = d.store.Users.Save(user)
if errors.Is(err, fbErrors.ErrExist) { if errors.Is(err, fberrors.ErrExist) {
return http.StatusConflict, err return http.StatusConflict, err
} else if err != nil { } else if err != nil {
return http.StatusInternalServerError, err return http.StatusInternalServerError, err
+1 -1
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"bufio" "bufio"
+1 -1
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"log" "log"
+1 -1
View File
@@ -1,6 +1,6 @@
//go:build !dev //go:build !dev
package http package fbhttp
// global headers to append to every response // global headers to append to every response
var globalHeaders = map[string]string{ var globalHeaders = map[string]string{
+1 -1
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"io/fs" "io/fs"
+1 -1
View File
@@ -1,5 +1,5 @@
//go:generate go-enum --sql --marshal --names --file $GOFILE //go:generate go-enum --sql --marshal --names --file $GOFILE
package http package fbhttp
import ( import (
"bytes" "bytes"
+1 -1
View File
@@ -1,7 +1,7 @@
// Code generated by go-enum // Code generated by go-enum
// DO NOT EDIT! // DO NOT EDIT!
package http package fbhttp
import ( import (
"database/sql/driver" "database/sql/driver"
+1 -1
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"errors" "errors"
+1 -1
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"fmt" "fmt"
+1 -1
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"errors" "errors"
+7 -7
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"context" "context"
@@ -17,7 +17,7 @@ import (
"github.com/shirou/gopsutil/v4/disk" "github.com/shirou/gopsutil/v4/disk"
"github.com/spf13/afero" "github.com/spf13/afero"
fbErrors "github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/files" "github.com/filebrowser/filebrowser/v2/files"
"github.com/filebrowser/filebrowser/v2/fileutils" "github.com/filebrowser/filebrowser/v2/fileutils"
) )
@@ -44,7 +44,7 @@ var resourceGetHandler = withUser(func(w http.ResponseWriter, r *http.Request, d
if checksum := r.URL.Query().Get("checksum"); checksum != "" { if checksum := r.URL.Query().Get("checksum"); checksum != "" {
err := file.Checksum(checksum) err := file.Checksum(checksum)
if errors.Is(err, fbErrors.ErrInvalidOption) { if errors.Is(err, fberrors.ErrInvalidOption) {
return http.StatusBadRequest, nil return http.StatusBadRequest, nil
} else if err != nil { } else if err != nil {
return http.StatusInternalServerError, err return http.StatusInternalServerError, err
@@ -238,7 +238,7 @@ func checkParent(src, dst string) error {
rel = filepath.ToSlash(rel) rel = filepath.ToSlash(rel)
if !strings.HasPrefix(rel, "../") && rel != ".." && rel != "." { if !strings.HasPrefix(rel, "../") && rel != ".." && rel != "." {
return fbErrors.ErrSourceIsParent return fberrors.ErrSourceIsParent
} }
return nil return nil
@@ -304,13 +304,13 @@ func patchAction(ctx context.Context, action, src, dst string, d *data, fileCach
switch action { switch action {
case "copy": case "copy":
if !d.user.Perm.Create { if !d.user.Perm.Create {
return fbErrors.ErrPermissionDenied return fberrors.ErrPermissionDenied
} }
return fileutils.Copy(d.user.Fs, src, dst, d.settings.FileMode, d.settings.DirMode) return fileutils.Copy(d.user.Fs, src, dst, d.settings.FileMode, d.settings.DirMode)
case "rename": case "rename":
if !d.user.Perm.Rename { if !d.user.Perm.Rename {
return fbErrors.ErrPermissionDenied return fberrors.ErrPermissionDenied
} }
src = path.Clean("/" + src) src = path.Clean("/" + src)
dst = path.Clean("/" + dst) dst = path.Clean("/" + dst)
@@ -335,7 +335,7 @@ func patchAction(ctx context.Context, action, src, dst string, d *data, fileCach
return fileutils.MoveFile(d.user.Fs, src, dst, d.settings.FileMode, d.settings.DirMode) return fileutils.MoveFile(d.user.Fs, src, dst, d.settings.FileMode, d.settings.DirMode)
default: default:
return fmt.Errorf("unsupported action %s: %w", action, fbErrors.ErrInvalidRequestParams) return fmt.Errorf("unsupported action %s: %w", action, fberrors.ErrInvalidRequestParams)
} }
} }
+1 -1
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"net/http" "net/http"
+1 -1
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"encoding/json" "encoding/json"
+4 -4
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"crypto/rand" "crypto/rand"
@@ -14,7 +14,7 @@ import (
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
fbErrors "github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/share" "github.com/filebrowser/filebrowser/v2/share"
) )
@@ -38,7 +38,7 @@ var shareListHandler = withPermShare(func(w http.ResponseWriter, r *http.Request
} else { } else {
s, err = d.store.Share.FindByUserID(d.user.ID) s, err = d.store.Share.FindByUserID(d.user.ID)
} }
if errors.Is(err, fbErrors.ErrNotExist) { if errors.Is(err, fberrors.ErrNotExist) {
return renderJSON(w, r, []*share.Link{}) return renderJSON(w, r, []*share.Link{})
} }
@@ -58,7 +58,7 @@ var shareListHandler = withPermShare(func(w http.ResponseWriter, r *http.Request
var shareGetsHandler = withPermShare(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) { var shareGetsHandler = withPermShare(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) {
s, err := d.store.Share.Gets(r.URL.Path, d.user.ID) s, err := d.store.Share.Gets(r.URL.Path, d.user.ID)
if errors.Is(err, fbErrors.ErrNotExist) { if errors.Is(err, fberrors.ErrNotExist) {
return renderJSON(w, r, []*share.Link{}) return renderJSON(w, r, []*share.Link{})
} }
+1 -1
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"encoding/json" "encoding/json"
+1 -1
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"bytes" "bytes"
+1 -1
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"context" "context"
+6 -6
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"encoding/json" "encoding/json"
@@ -12,7 +12,7 @@ import (
"golang.org/x/text/cases" "golang.org/x/text/cases"
"golang.org/x/text/language" "golang.org/x/text/language"
fbErrors "github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/users" "github.com/filebrowser/filebrowser/v2/users"
) )
@@ -36,7 +36,7 @@ func getUserID(r *http.Request) (uint, error) {
func getUser(_ http.ResponseWriter, r *http.Request) (*modifyUserRequest, error) { func getUser(_ http.ResponseWriter, r *http.Request) (*modifyUserRequest, error) {
if r.Body == nil { if r.Body == nil {
return nil, fbErrors.ErrEmptyRequest return nil, fberrors.ErrEmptyRequest
} }
req := &modifyUserRequest{} req := &modifyUserRequest{}
@@ -46,7 +46,7 @@ func getUser(_ http.ResponseWriter, r *http.Request) (*modifyUserRequest, error)
} }
if req.What != "user" { if req.What != "user" {
return nil, fbErrors.ErrInvalidDataType return nil, fberrors.ErrInvalidDataType
} }
return req, nil return req, nil
@@ -87,7 +87,7 @@ var usersGetHandler = withAdmin(func(w http.ResponseWriter, r *http.Request, d *
var userGetHandler = withSelfOrAdmin(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) { var userGetHandler = withSelfOrAdmin(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) {
u, err := d.store.Users.Get(d.server.Root, d.raw.(uint)) u, err := d.store.Users.Get(d.server.Root, d.raw.(uint))
if errors.Is(err, fbErrors.ErrNotExist) { if errors.Is(err, fberrors.ErrNotExist) {
return http.StatusNotFound, err return http.StatusNotFound, err
} }
@@ -122,7 +122,7 @@ var userPostHandler = withAdmin(func(w http.ResponseWriter, r *http.Request, d *
} }
if req.Data.Password == "" { if req.Data.Password == "" {
return http.StatusBadRequest, fbErrors.ErrEmptyPassword return http.StatusBadRequest, fberrors.ErrEmptyPassword
} }
req.Data.Password, err = users.ValidateAndHashPwd(req.Data.Password, d.settings.MinimumPasswordLength) req.Data.Password, err = users.ValidateAndHashPwd(req.Data.Password, d.settings.MinimumPasswordLength)
+1 -1
View File
@@ -1,4 +1,4 @@
package http package fbhttp
import ( import (
"encoding/json" "encoding/json"
+2 -1
View File
@@ -10,5 +10,6 @@
"postUpdateOptions": [ "postUpdateOptions": [
"gomodUpdateImportPaths", "gomodUpdateImportPaths",
"gomodTidy" "gomodTidy"
] ],
"schedule": "* * * * 0,6"
} }
+2 -2
View File
@@ -1,7 +1,7 @@
package settings package settings
import ( import (
"github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/rules" "github.com/filebrowser/filebrowser/v2/rules"
"github.com/filebrowser/filebrowser/v2/users" "github.com/filebrowser/filebrowser/v2/users"
) )
@@ -72,7 +72,7 @@ var defaultEvents = []string{
// Save saves the settings for the current instance. // Save saves the settings for the current instance.
func (s *Storage) Save(set *Settings) error { func (s *Storage) Save(set *Settings) error {
if len(set.Key) == 0 { if len(set.Key) == 0 {
return errors.ErrEmptyKey return fberrors.ErrEmptyKey
} }
if set.Defaults.Locale == "" { if set.Defaults.Locale == "" {
+2 -2
View File
@@ -3,7 +3,7 @@ package share
import ( import (
"time" "time"
"github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
) )
// StorageBackend is the interface to implement for a share storage. // StorageBackend is the interface to implement for a share storage.
@@ -79,7 +79,7 @@ func (s *Storage) GetByHash(hash string) (*Link, error) {
if err := s.Delete(link.Hash); err != nil { if err := s.Delete(link.Hash); err != nil {
return nil, err return nil, err
} }
return nil, errors.ErrNotExist return nil, fberrors.ErrNotExist
} }
return link, nil return link, nil
+2 -2
View File
@@ -4,7 +4,7 @@ import (
"github.com/asdine/storm/v3" "github.com/asdine/storm/v3"
"github.com/filebrowser/filebrowser/v2/auth" "github.com/filebrowser/filebrowser/v2/auth"
"github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/settings" "github.com/filebrowser/filebrowser/v2/settings"
) )
@@ -25,7 +25,7 @@ func (s authBackend) Get(t settings.AuthMethod) (auth.Auther, error) {
case auth.MethodNoAuth: case auth.MethodNoAuth:
auther = &auth.NoAuth{} auther = &auth.NoAuth{}
default: default:
return nil, errors.ErrInvalidAuthMethod return nil, fberrors.ErrInvalidAuthMethod
} }
return auther, get(s.db, "auther", auther) return auther, get(s.db, "auther", auther)
+6 -6
View File
@@ -6,7 +6,7 @@ import (
"github.com/asdine/storm/v3" "github.com/asdine/storm/v3"
"github.com/asdine/storm/v3/q" "github.com/asdine/storm/v3/q"
fbErrors "github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/share" "github.com/filebrowser/filebrowser/v2/share"
) )
@@ -18,7 +18,7 @@ func (s shareBackend) All() ([]*share.Link, error) {
var v []*share.Link var v []*share.Link
err := s.db.All(&v) err := s.db.All(&v)
if errors.Is(err, storm.ErrNotFound) { if errors.Is(err, storm.ErrNotFound) {
return v, fbErrors.ErrNotExist return v, fberrors.ErrNotExist
} }
return v, err return v, err
@@ -28,7 +28,7 @@ func (s shareBackend) FindByUserID(id uint) ([]*share.Link, error) {
var v []*share.Link var v []*share.Link
err := s.db.Select(q.Eq("UserID", id)).Find(&v) err := s.db.Select(q.Eq("UserID", id)).Find(&v)
if errors.Is(err, storm.ErrNotFound) { if errors.Is(err, storm.ErrNotFound) {
return v, fbErrors.ErrNotExist return v, fberrors.ErrNotExist
} }
return v, err return v, err
@@ -38,7 +38,7 @@ func (s shareBackend) GetByHash(hash string) (*share.Link, error) {
var v share.Link var v share.Link
err := s.db.One("Hash", hash, &v) err := s.db.One("Hash", hash, &v)
if errors.Is(err, storm.ErrNotFound) { if errors.Is(err, storm.ErrNotFound) {
return nil, fbErrors.ErrNotExist return nil, fberrors.ErrNotExist
} }
return &v, err return &v, err
@@ -48,7 +48,7 @@ func (s shareBackend) GetPermanent(path string, id uint) (*share.Link, error) {
var v share.Link var v share.Link
err := s.db.Select(q.Eq("Path", path), q.Eq("Expire", 0), q.Eq("UserID", id)).First(&v) err := s.db.Select(q.Eq("Path", path), q.Eq("Expire", 0), q.Eq("UserID", id)).First(&v)
if errors.Is(err, storm.ErrNotFound) { if errors.Is(err, storm.ErrNotFound) {
return nil, fbErrors.ErrNotExist return nil, fberrors.ErrNotExist
} }
return &v, err return &v, err
@@ -58,7 +58,7 @@ func (s shareBackend) Gets(path string, id uint) ([]*share.Link, error) {
var v []*share.Link var v []*share.Link
err := s.db.Select(q.Eq("Path", path), q.Eq("UserID", id)).Find(&v) err := s.db.Select(q.Eq("Path", path), q.Eq("UserID", id)).Find(&v)
if errors.Is(err, storm.ErrNotFound) { if errors.Is(err, storm.ErrNotFound) {
return v, fbErrors.ErrNotExist return v, fberrors.ErrNotExist
} }
return v, err return v, err
+5 -5
View File
@@ -7,7 +7,7 @@ import (
"github.com/asdine/storm/v3" "github.com/asdine/storm/v3"
fbErrors "github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/users" "github.com/filebrowser/filebrowser/v2/users"
) )
@@ -25,14 +25,14 @@ func (st usersBackend) GetBy(i interface{}) (user *users.User, err error) {
case string: case string:
arg = "Username" arg = "Username"
default: default:
return nil, fbErrors.ErrInvalidDataType return nil, fberrors.ErrInvalidDataType
} }
err = st.db.One(arg, i, user) err = st.db.One(arg, i, user)
if err != nil { if err != nil {
if errors.Is(err, storm.ErrNotFound) { if errors.Is(err, storm.ErrNotFound) {
return nil, fbErrors.ErrNotExist return nil, fberrors.ErrNotExist
} }
return nil, err return nil, err
} }
@@ -44,7 +44,7 @@ func (st usersBackend) Gets() ([]*users.User, error) {
var allUsers []*users.User var allUsers []*users.User
err := st.db.All(&allUsers) err := st.db.All(&allUsers)
if errors.Is(err, storm.ErrNotFound) { if errors.Is(err, storm.ErrNotFound) {
return nil, fbErrors.ErrNotExist return nil, fberrors.ErrNotExist
} }
if err != nil { if err != nil {
@@ -76,7 +76,7 @@ func (st usersBackend) Update(user *users.User, fields ...string) error {
func (st usersBackend) Save(user *users.User) error { func (st usersBackend) Save(user *users.User) error {
err := st.db.Save(user) err := st.db.Save(user)
if errors.Is(err, storm.ErrAlreadyExists) { if errors.Is(err, storm.ErrAlreadyExists) {
return fbErrors.ErrExist return fberrors.ErrExist
} }
return err return err
} }
+2 -2
View File
@@ -5,13 +5,13 @@ import (
"github.com/asdine/storm/v3" "github.com/asdine/storm/v3"
fbErrors "github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
) )
func get(db *storm.DB, name string, to interface{}) error { func get(db *storm.DB, name string, to interface{}) error {
err := db.Get("config", name, to) err := db.Get("config", name, to)
if errors.Is(err, storm.ErrNotFound) { if errors.Is(err, storm.ErrNotFound) {
return fbErrors.ErrNotExist return fberrors.ErrNotExist
} }
return err return err
+3 -3
View File
@@ -6,17 +6,17 @@ import (
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
fbErrors "github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
) )
// ValidateAndHashPwd validates and hashes a password. // ValidateAndHashPwd validates and hashes a password.
func ValidateAndHashPwd(password string, minimumLength uint) (string, error) { func ValidateAndHashPwd(password string, minimumLength uint) (string, error) {
if uint(len(password)) < minimumLength { if uint(len(password)) < minimumLength {
return "", fbErrors.ErrShortPassword{MinimumLength: minimumLength} return "", fberrors.ErrShortPassword{MinimumLength: minimumLength}
} }
if _, ok := commonPasswords[password]; ok { if _, ok := commonPasswords[password]; ok {
return "", fbErrors.ErrEasyPassword return "", fberrors.ErrEasyPassword
} }
return HashPwd(password) return HashPwd(password)
+4 -4
View File
@@ -4,7 +4,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
) )
// StorageBackend is the interface to implement for a users storage. // StorageBackend is the interface to implement for a users storage.
@@ -109,16 +109,16 @@ func (s *Storage) Delete(id interface{}) error {
return err return err
} }
if user.ID == 1 { if user.ID == 1 {
return errors.ErrRootUserDeletion return fberrors.ErrRootUserDeletion
} }
return s.back.DeleteByUsername(id) return s.back.DeleteByUsername(id)
case uint: case uint:
if id == 1 { if id == 1 {
return errors.ErrRootUserDeletion return fberrors.ErrRootUserDeletion
} }
return s.back.DeleteByID(id) return s.back.DeleteByID(id)
default: default:
return errors.ErrInvalidDataType return fberrors.ErrInvalidDataType
} }
} }
+3 -3
View File
@@ -5,7 +5,7 @@ import (
"github.com/spf13/afero" "github.com/spf13/afero"
"github.com/filebrowser/filebrowser/v2/errors" fberrors "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/v2/files" "github.com/filebrowser/filebrowser/v2/files"
"github.com/filebrowser/filebrowser/v2/rules" "github.com/filebrowser/filebrowser/v2/rules"
) )
@@ -64,11 +64,11 @@ func (u *User) Clean(baseScope string, fields ...string) error {
switch field { switch field {
case "Username": case "Username":
if u.Username == "" { if u.Username == "" {
return errors.ErrEmptyUsername return fberrors.ErrEmptyUsername
} }
case "Password": case "Password":
if u.Password == "" { if u.Password == "" {
return errors.ErrEmptyPassword return fberrors.ErrEmptyPassword
} }
case "ViewMode": case "ViewMode":
if u.ViewMode == "" { if u.ViewMode == "" {