diff --git a/Dockerfile b/Dockerfile index 97177615..77b8788c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,22 +7,16 @@ RUN npm run build FROM golang:alpine as base WORKDIR /app COPY ./src/backend ./ -RUN go build -ldflags='-w -s' -o filebrowser . +RUN go build -ldflags="-w -s" -o filebrowser . FROM alpine:latest RUN apk --no-cache add \ ca-certificates \ - mailcap \ - curl - -HEALTHCHECK --start-period=2s --interval=5s --timeout=3s \ - CMD curl -f http://localhost/health || exit 1 - + mailcap VOLUME /srv EXPOSE 80 - -COPY --from=base /app/docker_config.json /.filebrowser.json -COPY --from=base /app/filebrowser /filebrowser +WORKDIR /app +COPY --from=base /app/docker_config.json ./.filebrowser.json +COPY --from=base /app/filebrowser ./filebrowser COPY --from=nbuild /app/dist/ ./frontend/dist/ - -ENTRYPOINT [ "/filebrowser" ] \ No newline at end of file +ENTRYPOINT [ "./filebrowser" ] \ No newline at end of file diff --git a/README.md b/README.md index 93a9eb42..172d2eda 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,22 @@ -## My fork of filebrowser +## Gtstef fork of filebrowser **Note: Intended to be used in docker only.** This fork makes the following significant changes to filebrowser for origin: - 1. Improves search to use index instead of filesystem. - - lightning fast - - realtime results as you type - 1. Preview enhancments + 1. [x] Improves search to use index instead of filesystem. + - [x] Lightning fast + - [x] Realtime results as you type + - [ ] Works with file type filter + 1. [ ] Preview enhancements - preview default view is constrained to files subwindow, which can be toggled to fullscreen. - 1. Updated node version and dependancies - - uses latest npm and node version - - removes deprecated npm packages - 1. Improved routing - - fixed bugs in original version - 1. Added authentication type - - Using bearer token with remote authentication server + 1. [ ] Updated version and dependencies + - [ ] uses latest npm and node version + - [ ] removes deprecated npm packages + - [x] Updates golang dependencies + 1. [ ] Added authentication type + - [ ] Using bearer token with remote authentication server ## About @@ -26,9 +26,10 @@ filebrowser provides a file managing interface within a specified directory and Using docker: -1. docker run: +1. docker run: ``` +docker run -it -v /path/to/folder:/srv -p 8080:80 gtstef/filebrowser:0.1.0 ``` 1. docker-compose: @@ -56,7 +57,7 @@ services: filebrowser: volumes: - 'nas:/srv' - #- './database/:/database/' + #- './database/:/database/' #- './config.json:/.filebrowser.json' ports: - '8080:80' diff --git a/src/backend/auth/auth.go b/src/backend/auth/auth.go index 53d5d839..c3b143a8 100644 --- a/src/backend/auth/auth.go +++ b/src/backend/auth/auth.go @@ -3,8 +3,8 @@ package auth import ( "net/http" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/users" ) // Auther is the authentication interface. diff --git a/src/backend/auth/hook.go b/src/backend/auth/hook.go index 3e57560e..0517699e 100644 --- a/src/backend/auth/hook.go +++ b/src/backend/auth/hook.go @@ -9,10 +9,10 @@ import ( "os/exec" "strings" - "github.com/filebrowser/filebrowser/v2/errors" - "github.com/filebrowser/filebrowser/v2/files" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/errors" + "github.com/gtsteffaniak/filebrowser/files" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/users" ) // MethodHookAuth is used to identify hook auth. diff --git a/src/backend/auth/json.go b/src/backend/auth/json.go index 48f4c599..36e1d14a 100644 --- a/src/backend/auth/json.go +++ b/src/backend/auth/json.go @@ -7,8 +7,8 @@ import ( "os" "strings" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/users" ) // MethodJSONAuth is used to identify json auth. diff --git a/src/backend/auth/none.go b/src/backend/auth/none.go index f137ebc1..2621e870 100644 --- a/src/backend/auth/none.go +++ b/src/backend/auth/none.go @@ -3,8 +3,8 @@ package auth import ( "net/http" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/users" ) // MethodNoAuth is used to identify no auth. diff --git a/src/backend/auth/proxy.go b/src/backend/auth/proxy.go index d4b19315..ec313ce1 100644 --- a/src/backend/auth/proxy.go +++ b/src/backend/auth/proxy.go @@ -4,9 +4,9 @@ import ( "net/http" "os" - "github.com/filebrowser/filebrowser/v2/errors" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/errors" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/users" ) // MethodProxyAuth is used to identify no auth. diff --git a/src/backend/auth/storage.go b/src/backend/auth/storage.go index c0723ba5..0b011391 100644 --- a/src/backend/auth/storage.go +++ b/src/backend/auth/storage.go @@ -1,8 +1,8 @@ package auth import ( - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/users" ) // StorageBackend is a storage backend for auth storage. diff --git a/src/backend/cmd/config.go b/src/backend/cmd/config.go index 4287f3c2..47d9cd42 100644 --- a/src/backend/cmd/config.go +++ b/src/backend/cmd/config.go @@ -11,9 +11,9 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - "github.com/filebrowser/filebrowser/v2/auth" - "github.com/filebrowser/filebrowser/v2/errors" - "github.com/filebrowser/filebrowser/v2/settings" + "github.com/gtsteffaniak/filebrowser/auth" + "github.com/gtsteffaniak/filebrowser/errors" + "github.com/gtsteffaniak/filebrowser/settings" ) func init() { diff --git a/src/backend/cmd/config_import.go b/src/backend/cmd/config_import.go index b87eb4e3..98309612 100644 --- a/src/backend/cmd/config_import.go +++ b/src/backend/cmd/config_import.go @@ -8,8 +8,8 @@ import ( "github.com/spf13/cobra" - "github.com/filebrowser/filebrowser/v2/auth" - "github.com/filebrowser/filebrowser/v2/settings" + "github.com/gtsteffaniak/filebrowser/auth" + "github.com/gtsteffaniak/filebrowser/settings" ) func init() { diff --git a/src/backend/cmd/config_init.go b/src/backend/cmd/config_init.go index 7848e706..9e3773fc 100644 --- a/src/backend/cmd/config_init.go +++ b/src/backend/cmd/config_init.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - "github.com/filebrowser/filebrowser/v2/settings" + "github.com/gtsteffaniak/filebrowser/settings" ) func init() { diff --git a/src/backend/cmd/hash.go b/src/backend/cmd/hash.go index 1d472a3c..41718afa 100644 --- a/src/backend/cmd/hash.go +++ b/src/backend/cmd/hash.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/users" ) func init() { diff --git a/src/backend/cmd/root.go b/src/backend/cmd/root.go index 9a175b17..5ace8718 100644 --- a/src/backend/cmd/root.go +++ b/src/backend/cmd/root.go @@ -13,6 +13,7 @@ import ( "path/filepath" "strings" "syscall" + "strconv" homedir "github.com/mitchellh/go-homedir" "github.com/spf13/afero" @@ -21,13 +22,14 @@ import ( v "github.com/spf13/viper" lumberjack "gopkg.in/natefinch/lumberjack.v2" - "github.com/filebrowser/filebrowser/v2/auth" - "github.com/filebrowser/filebrowser/v2/diskcache" - fbhttp "github.com/filebrowser/filebrowser/v2/http" - "github.com/filebrowser/filebrowser/v2/img" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/storage" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/auth" + "github.com/gtsteffaniak/filebrowser/search" + "github.com/gtsteffaniak/filebrowser/diskcache" + fbhttp "github.com/gtsteffaniak/filebrowser/http" + "github.com/gtsteffaniak/filebrowser/img" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/storage" + "github.com/gtsteffaniak/filebrowser/users" ) var ( @@ -45,10 +47,13 @@ func (d dirFS) Open(name string) (fs.File, error) { func init() { cobra.OnInitialize(initConfig) cobra.MousetrapHelpText = "" - rootCmd.SetVersionTemplate("File Browser version {{printf \"%s\" .Version}}\n") flags := rootCmd.Flags() + // initialize indexing and schedule indexing ever n minutes (default 5) + indexingInterval := getEnvVariableAsUint32("INDEXING_INTERVAL") + go search.InitializeIndex(indexingInterval) + persistent := rootCmd.PersistentFlags() persistent.StringVarP(&cfgFile, "config", "c", "", "config file path") @@ -60,6 +65,15 @@ func init() { addServerFlags(flags) } +func getEnvVariableAsUint32(key string) uint32 { + valueStr := os.Getenv(key) + value, err := strconv.ParseUint(valueStr, 10, 32) + if err != nil { + return 5 // default value every 5 minutes + } + return uint32(value) +} + func addServerFlags(flags *pflag.FlagSet) { flags.StringP("address", "a", "127.0.0.1", "address to listen on") flags.StringP("log", "l", "stdout", "log output") @@ -408,7 +422,6 @@ func initConfig() { v.SetEnvPrefix("FB") v.AutomaticEnv() v.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) - if err := v.ReadInConfig(); err != nil { if _, ok := err.(v.ConfigParseError); ok { panic(err) diff --git a/src/backend/cmd/rule_rm.go b/src/backend/cmd/rule_rm.go index 77751069..0aea796c 100644 --- a/src/backend/cmd/rule_rm.go +++ b/src/backend/cmd/rule_rm.go @@ -5,8 +5,8 @@ import ( "github.com/spf13/cobra" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/users" ) func init() { diff --git a/src/backend/cmd/rules.go b/src/backend/cmd/rules.go index 3bf91dd1..69df0d33 100644 --- a/src/backend/cmd/rules.go +++ b/src/backend/cmd/rules.go @@ -6,10 +6,10 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - "github.com/filebrowser/filebrowser/v2/rules" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/storage" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/rules" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/storage" + "github.com/gtsteffaniak/filebrowser/users" ) func init() { diff --git a/src/backend/cmd/rules_add.go b/src/backend/cmd/rules_add.go index fcdc7fb4..768717bd 100644 --- a/src/backend/cmd/rules_add.go +++ b/src/backend/cmd/rules_add.go @@ -5,9 +5,9 @@ import ( "github.com/spf13/cobra" - "github.com/filebrowser/filebrowser/v2/rules" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/rules" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/users" ) func init() { diff --git a/src/backend/cmd/upgrade.go b/src/backend/cmd/upgrade.go index 9f747c9c..be9769c2 100644 --- a/src/backend/cmd/upgrade.go +++ b/src/backend/cmd/upgrade.go @@ -3,7 +3,7 @@ package cmd import ( "github.com/spf13/cobra" - "github.com/filebrowser/filebrowser/v2/storage/bolt/importer" + "github.com/gtsteffaniak/filebrowser/storage/bolt/importer" ) func init() { diff --git a/src/backend/cmd/users.go b/src/backend/cmd/users.go index 894a162c..3c835a18 100644 --- a/src/backend/cmd/users.go +++ b/src/backend/cmd/users.go @@ -10,8 +10,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/users" ) func init() { diff --git a/src/backend/cmd/users_add.go b/src/backend/cmd/users_add.go index a51725da..f133a464 100644 --- a/src/backend/cmd/users_add.go +++ b/src/backend/cmd/users_add.go @@ -3,7 +3,7 @@ package cmd import ( "github.com/spf13/cobra" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/users" ) func init() { diff --git a/src/backend/cmd/users_find.go b/src/backend/cmd/users_find.go index b1b03bc1..b00959c4 100644 --- a/src/backend/cmd/users_find.go +++ b/src/backend/cmd/users_find.go @@ -3,7 +3,7 @@ package cmd import ( "github.com/spf13/cobra" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/users" ) func init() { diff --git a/src/backend/cmd/users_import.go b/src/backend/cmd/users_import.go index f0e1a513..d5be6e9c 100644 --- a/src/backend/cmd/users_import.go +++ b/src/backend/cmd/users_import.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/cobra" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/users" ) func init() { diff --git a/src/backend/cmd/users_update.go b/src/backend/cmd/users_update.go index 822bb6dc..09bb4b8d 100644 --- a/src/backend/cmd/users_update.go +++ b/src/backend/cmd/users_update.go @@ -3,8 +3,8 @@ package cmd import ( "github.com/spf13/cobra" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/users" ) func init() { diff --git a/src/backend/cmd/utils.go b/src/backend/cmd/utils.go index 2bd9e760..ef0b9a7c 100644 --- a/src/backend/cmd/utils.go +++ b/src/backend/cmd/utils.go @@ -14,9 +14,9 @@ import ( "github.com/spf13/pflag" yaml "gopkg.in/yaml.v2" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/storage" - "github.com/filebrowser/filebrowser/v2/storage/bolt" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/storage" + "github.com/gtsteffaniak/filebrowser/storage/bolt" ) func checkErr(err error) { diff --git a/src/backend/cmd/version.go b/src/backend/cmd/version.go index 5877505e..2e085103 100644 --- a/src/backend/cmd/version.go +++ b/src/backend/cmd/version.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/cobra" - "github.com/filebrowser/filebrowser/v2/version" + "github.com/gtsteffaniak/filebrowser/version" ) func init() { diff --git a/src/backend/docker/root/defaults/settings.json b/src/backend/docker/root/defaults/settings.json deleted file mode 100644 index e787ef87..00000000 --- a/src/backend/docker/root/defaults/settings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "port": 80, - "baseURL": "", - "address": "", - "log": "stdout", - "database": "/database/filebrowser.db", - "root": "/srv" -} \ No newline at end of file diff --git a/src/backend/docker/root/etc/cont-init.d/20-config b/src/backend/docker/root/etc/cont-init.d/20-config deleted file mode 100644 index e9fa26b2..00000000 --- a/src/backend/docker/root/etc/cont-init.d/20-config +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/with-contenv bash - -# make folders -mkdir -p /database - -# copy config -if [ ! -f "/config/settings.json" ]; then - cp -a /defaults/settings.json /config/settings.json -fi - -# permissions -chown abc:abc \ - /config/settings.json \ - /database \ - /srv \ No newline at end of file diff --git a/src/backend/docker/root/etc/services.d/filebrowser/run b/src/backend/docker/root/etc/services.d/filebrowser/run deleted file mode 100644 index 1d633757..00000000 --- a/src/backend/docker/root/etc/services.d/filebrowser/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/with-contenv bash - -exec s6-setuidgid abc filebrowser -c /config/settings.json -d /database/filebrowser.db; \ No newline at end of file diff --git a/src/backend/docker_config.json b/src/backend/docker_config.json index f0fa64a6..b491ee6e 100644 --- a/src/backend/docker_config.json +++ b/src/backend/docker_config.json @@ -1,5 +1,5 @@ { - "port": 80, + "port": 8080, "baseURL": "", "address": "", "log": "stdout", diff --git a/src/backend/files/file.go b/src/backend/files/file.go index 1daf384b..ac1ca0fe 100644 --- a/src/backend/files/file.go +++ b/src/backend/files/file.go @@ -19,8 +19,8 @@ import ( "github.com/spf13/afero" - "github.com/filebrowser/filebrowser/v2/errors" - "github.com/filebrowser/filebrowser/v2/rules" + "github.com/gtsteffaniak/filebrowser/errors" + "github.com/gtsteffaniak/filebrowser/rules" ) // FileInfo describes a file. diff --git a/src/backend/go.mod b/src/backend/go.mod index bea98202..69400f2c 100644 --- a/src/backend/go.mod +++ b/src/backend/go.mod @@ -1,4 +1,4 @@ -module filebrowser +module github.com/gtsteffaniak/filebrowser go 1.20 @@ -6,7 +6,6 @@ require ( github.com/asdine/storm/v3 v3.2.1 github.com/disintegration/imaging v1.6.2 github.com/dsoprea/go-exif/v3 v3.0.1 - github.com/filebrowser/filebrowser/v2 v2.23.0 github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 github.com/golang-jwt/jwt/v4 v4.5.0 github.com/gorilla/mux v1.8.0 diff --git a/src/backend/go.sum b/src/backend/go.sum index 3c329e72..171f4b0e 100644 --- a/src/backend/go.sum +++ b/src/backend/go.sum @@ -86,8 +86,6 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/filebrowser/filebrowser/v2 v2.23.0 h1:t/crFqwgD7WBo/1xNCdWcD+Ba/m7qJHiareCxeiomF8= -github.com/filebrowser/filebrowser/v2 v2.23.0/go.mod h1:21YATGQ81ia3RgvnvkFGXx8E7JYgDqC1pfNI5AggfKQ= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= diff --git a/src/backend/http/auth.go b/src/backend/http/auth.go index 4df68262..e5cb2a7e 100644 --- a/src/backend/http/auth.go +++ b/src/backend/http/auth.go @@ -11,8 +11,8 @@ import ( "github.com/golang-jwt/jwt/v4" "github.com/golang-jwt/jwt/v4/request" - "github.com/filebrowser/filebrowser/v2/errors" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/errors" + "github.com/gtsteffaniak/filebrowser/users" ) const ( diff --git a/src/backend/http/commands.go b/src/backend/http/commands.go index 55075db4..cf886541 100644 --- a/src/backend/http/commands.go +++ b/src/backend/http/commands.go @@ -11,7 +11,7 @@ import ( "github.com/gorilla/websocket" - "github.com/filebrowser/filebrowser/v2/runner" + "github.com/gtsteffaniak/filebrowser/runner" ) const ( diff --git a/src/backend/http/data.go b/src/backend/http/data.go index 37345d3c..904e10b5 100644 --- a/src/backend/http/data.go +++ b/src/backend/http/data.go @@ -7,11 +7,11 @@ import ( "github.com/tomasen/realip" - "github.com/filebrowser/filebrowser/v2/rules" - "github.com/filebrowser/filebrowser/v2/runner" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/storage" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/rules" + "github.com/gtsteffaniak/filebrowser/runner" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/storage" + "github.com/gtsteffaniak/filebrowser/users" ) type handleFunc func(w http.ResponseWriter, r *http.Request, d *data) (int, error) diff --git a/src/backend/http/http.go b/src/backend/http/http.go index 1c23b242..2ef52c10 100644 --- a/src/backend/http/http.go +++ b/src/backend/http/http.go @@ -6,8 +6,8 @@ import ( "github.com/gorilla/mux" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/storage" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/storage" ) type modifyRequest struct { diff --git a/src/backend/http/preview.go b/src/backend/http/preview.go index 163d7e49..c7f87ca0 100644 --- a/src/backend/http/preview.go +++ b/src/backend/http/preview.go @@ -10,8 +10,8 @@ import ( "github.com/gorilla/mux" - "github.com/filebrowser/filebrowser/v2/files" - "github.com/filebrowser/filebrowser/v2/img" + "github.com/gtsteffaniak/filebrowser/files" + "github.com/gtsteffaniak/filebrowser/img" ) /* diff --git a/src/backend/http/public.go b/src/backend/http/public.go index 7f3a309f..890ded35 100644 --- a/src/backend/http/public.go +++ b/src/backend/http/public.go @@ -11,8 +11,8 @@ import ( "github.com/spf13/afero" "golang.org/x/crypto/bcrypt" - "github.com/filebrowser/filebrowser/v2/files" - "github.com/filebrowser/filebrowser/v2/share" + "github.com/gtsteffaniak/filebrowser/files" + "github.com/gtsteffaniak/filebrowser/share" ) var withHashFile = func(fn handleFunc) handleFunc { diff --git a/src/backend/http/public_test.go b/src/backend/http/public_test.go index 9f89cbc0..5c010e19 100644 --- a/src/backend/http/public_test.go +++ b/src/backend/http/public_test.go @@ -10,10 +10,10 @@ import ( "github.com/asdine/storm/v3" "github.com/spf13/afero" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/share" - "github.com/filebrowser/filebrowser/v2/storage/bolt" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/share" + "github.com/gtsteffaniak/filebrowser/storage/bolt" + "github.com/gtsteffaniak/filebrowser/users" ) func TestPublicShareHandlerAuthentication(t *testing.T) { diff --git a/src/backend/http/raw.go b/src/backend/http/raw.go index 1312510b..41efa4a5 100644 --- a/src/backend/http/raw.go +++ b/src/backend/http/raw.go @@ -11,9 +11,9 @@ import ( "github.com/mholt/archiver/v3" - "github.com/filebrowser/filebrowser/v2/files" - "github.com/filebrowser/filebrowser/v2/fileutils" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/files" + "github.com/gtsteffaniak/filebrowser/fileutils" + "github.com/gtsteffaniak/filebrowser/users" ) func slashClean(name string) string { diff --git a/src/backend/http/resource.go b/src/backend/http/resource.go index 3a12538a..2dc43ffc 100644 --- a/src/backend/http/resource.go +++ b/src/backend/http/resource.go @@ -14,9 +14,9 @@ import ( "github.com/shirou/gopsutil/v3/disk" "github.com/spf13/afero" - "github.com/filebrowser/filebrowser/v2/errors" - "github.com/filebrowser/filebrowser/v2/files" - "github.com/filebrowser/filebrowser/v2/fileutils" + "github.com/gtsteffaniak/filebrowser/errors" + "github.com/gtsteffaniak/filebrowser/files" + "github.com/gtsteffaniak/filebrowser/fileutils" ) var resourceGetHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) { diff --git a/src/backend/http/search.go b/src/backend/http/search.go index 1c78b781..b088fa88 100644 --- a/src/backend/http/search.go +++ b/src/backend/http/search.go @@ -2,27 +2,37 @@ package http import ( "net/http" - "os" - - "github.com/filebrowser/filebrowser/v2/search" + "github.com/gtsteffaniak/filebrowser/search" ) var searchHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) { response := []map[string]interface{}{} query := r.URL.Query().Get("query") - - err := search.Search(d.user.Fs, r.URL.Path, query, d, func(path string, f os.FileInfo) error { + var files []string + var dirs []string + files, dirs = search.IndexedSearch(query,r.URL.Path,&files,&dirs) + for _,v := range(files){ response = append(response, map[string]interface{}{ - "dir": f.IsDir(), - "path": path, + "dir": false, + "path": v, }) - - return nil - }) - - if err != nil { - return http.StatusInternalServerError, err } + for _,v := range(dirs){ + response = append(response, map[string]interface{}{ + "dir": true, + "path": v, + }) + } + files = files[:0] + dirs = dirs[:0] +// err := search.Search(d.user.Fs, r.URL.Path, query, d, func(path string, f os.FileInfo) error { +// response = append(response, map[string]interface{}{ +// "dir": f.IsDir(), +// "path": path, +// }) +// +// return nil +// }) return renderJSON(w, r, response) }) diff --git a/src/backend/http/settings.go b/src/backend/http/settings.go index 78ce9b0d..c412148b 100644 --- a/src/backend/http/settings.go +++ b/src/backend/http/settings.go @@ -4,8 +4,8 @@ import ( "encoding/json" "net/http" - "github.com/filebrowser/filebrowser/v2/rules" - "github.com/filebrowser/filebrowser/v2/settings" + "github.com/gtsteffaniak/filebrowser/rules" + "github.com/gtsteffaniak/filebrowser/settings" ) type settingsData struct { diff --git a/src/backend/http/share.go b/src/backend/http/share.go index 193f0913..36f2e4c0 100644 --- a/src/backend/http/share.go +++ b/src/backend/http/share.go @@ -13,8 +13,8 @@ import ( "golang.org/x/crypto/bcrypt" - "github.com/filebrowser/filebrowser/v2/errors" - "github.com/filebrowser/filebrowser/v2/share" + "github.com/gtsteffaniak/filebrowser/errors" + "github.com/gtsteffaniak/filebrowser/share" ) func withPermShare(fn handleFunc) handleFunc { diff --git a/src/backend/http/static.go b/src/backend/http/static.go index f438d76c..500bef8b 100644 --- a/src/backend/http/static.go +++ b/src/backend/http/static.go @@ -12,10 +12,10 @@ import ( "strings" "text/template" - "github.com/filebrowser/filebrowser/v2/auth" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/storage" - "github.com/filebrowser/filebrowser/v2/version" + "github.com/gtsteffaniak/filebrowser/auth" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/storage" + "github.com/gtsteffaniak/filebrowser/version" ) func handleWithStaticData(w http.ResponseWriter, _ *http.Request, d *data, fSys fs.FS, file, contentType string) (int, error) { diff --git a/src/backend/http/users.go b/src/backend/http/users.go index 446057a0..cdcc58f1 100644 --- a/src/backend/http/users.go +++ b/src/backend/http/users.go @@ -11,8 +11,8 @@ import ( "golang.org/x/text/cases" "golang.org/x/text/language" - "github.com/filebrowser/filebrowser/v2/errors" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/errors" + "github.com/gtsteffaniak/filebrowser/users" ) var ( diff --git a/src/backend/http/utils.go b/src/backend/http/utils.go index c1c3fa65..195f0c3f 100644 --- a/src/backend/http/utils.go +++ b/src/backend/http/utils.go @@ -8,7 +8,7 @@ import ( "os" "strings" - libErrors "github.com/filebrowser/filebrowser/v2/errors" + libErrors "github.com/gtsteffaniak/filebrowser/errors" ) func renderJSON(w http.ResponseWriter, _ *http.Request, data interface{}) (int, error) { diff --git a/src/backend/main.go b/src/backend/main.go index ab22ef45..0859625e 100644 --- a/src/backend/main.go +++ b/src/backend/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/filebrowser/filebrowser/v2/cmd" + "github.com/gtsteffaniak/filebrowser/cmd" ) func main() { diff --git a/src/backend/runner/parser.go b/src/backend/runner/parser.go index 65891f5f..84357cc5 100644 --- a/src/backend/runner/parser.go +++ b/src/backend/runner/parser.go @@ -3,7 +3,7 @@ package runner import ( "os/exec" - "github.com/filebrowser/filebrowser/v2/settings" + "github.com/gtsteffaniak/filebrowser/settings" ) // ParseCommand parses the command taking in account if the current diff --git a/src/backend/runner/runner.go b/src/backend/runner/runner.go index 2dbafa5c..066ef925 100644 --- a/src/backend/runner/runner.go +++ b/src/backend/runner/runner.go @@ -7,8 +7,8 @@ import ( "os/exec" "strings" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/users" ) // Runner is a commands runner. diff --git a/src/backend/search/indexing.go b/src/backend/search/indexing.go new file mode 100644 index 00000000..00d51df9 --- /dev/null +++ b/src/backend/search/indexing.go @@ -0,0 +1,182 @@ +package search + +import ( + "log" + "os" + "path/filepath" + "strings" + "sync" + "sort" + "time" +) + +var ( + rootPath = "/srv" // DO NOT include trailing slash + indexes map[string][]string + mutex sync.RWMutex + lastIndexed time.Time +) + +func InitializeIndex(intervalMinutes uint32) { + // Initialize the indexes map + indexes = make(map[string][]string) + var numFiles, numDirs int + log.Println("Indexing files...") + lastIndexedStart := time.Now() + // Call the function to index files and directories + totalNumFiles, totalNumDirs, err := indexFiles(rootPath,&numFiles,&numDirs) + if err != nil { + log.Fatal(err) + } + lastIndexed = lastIndexedStart + go indexingScheduler(intervalMinutes) + log.Println("Successfully indexed files.") + log.Println("Files found :",totalNumFiles) + log.Println("Directories found :",totalNumDirs) +} + +func indexingScheduler(intervalMinutes uint32) { + log.Printf("Indexing scheduler will run every %v minutes",intervalMinutes) + for { + time.Sleep(time.Duration(intervalMinutes) * time.Minute) + var numFiles, numDirs int + lastIndexedStart := time.Now() + totalNumFiles, totalNumDirs, err := indexFiles(rootPath,&numFiles,&numDirs) + if err != nil { + log.Fatal(err) + } + lastIndexed = lastIndexedStart + if totalNumFiles+totalNumDirs > 0 { + log.Println("re-indexing found changes and updated the index.") + } + } +} + +// Define a function to recursively index files and directories +func indexFiles(path string, numFiles *int, numDirs *int) (int,int,error) { + // Check if the current directory has been modified since last indexing + dir, err := os.Open(path) + if err != nil { + // directory must have been deleted, remove from index + delete(indexes, path) + } + defer dir.Close() + dirInfo, err := dir.Stat() + if err != nil { + return *numFiles,*numDirs,err + } + // Compare the last modified time of the directory with the last indexed time + if dirInfo.ModTime().Before(lastIndexed) { + return *numFiles,*numDirs,nil + } + // Read the directory contents + files, err := dir.Readdir(-1) + if err != nil { + return *numFiles,*numDirs,err + } + // Iterate over the files and directories + for _, file := range files { + if file.IsDir() { + *numDirs++ + indexFiles(path+"/"+file.Name(),numFiles,numDirs) + } + *numFiles++ + addToIndex(path, file.Name()) + } + return *numFiles,*numDirs,nil +} + +func addToIndex(path string, fileName string) { + mutex.Lock() + defer mutex.Unlock() + path = strings.TrimPrefix(path,rootPath+"/") + path = strings.TrimSuffix(path,"/") + if path == rootPath { + path = "/" + } + info, exists := indexes[path] + if !exists { + info = []string{} + } + info = append(info, fileName) + indexes[path] = info +} + +func SearchAllIndexes(searchTerm string, scope string, files []string, dirs []string) ([]string, []string) { + mutex.RLock() + defer mutex.RUnlock() + + var matchingFiles []string + var matchingDirs []string + + // Iterate over the indexes + for dirName, v := range indexes { + searchItems := v + // Iterate over the path names + for _, pathName := range searchItems { + if dirName != "/" { + pathName = dirName+"/"+pathName + } + // Check if the path name contains the search term + if !containsSearchTerm(pathName, searchTerm) { + continue + } + pathName = scopedPathNameFilter(pathName, scope) + if pathName == "" { + continue + } + matchingFiles = append(matchingFiles, pathName) + } + // Check if the path name contains the search term + if !containsSearchTerm(dirName, searchTerm) { + continue + } + pathName := scopedPathNameFilter(dirName, scope) + if pathName == "" { + continue + } + matchingDirs = append(matchingDirs, pathName) + } + + // Sort the strings based on the number of elements after splitting by "/" + sort.Slice(matchingFiles, func(i, j int) bool { + parts1 := strings.Split(matchingFiles[i], "/") + parts2 := strings.Split(matchingFiles[j], "/") + return len(parts1) < len(parts2) + }) + // Sort the strings based on the number of elements after splitting by "/" + sort.Slice(matchingDirs, func(i, j int) bool { + parts1 := strings.Split(matchingDirs[i], "/") + parts2 := strings.Split(matchingDirs[j], "/") + return len(parts1) < len(parts2) + }) + + // Copy the matching files and dirs to the final slices + files = append([]string{}, matchingFiles...) + dirs = append([]string{}, matchingDirs...) + + return files, dirs +} + +func scopedPathNameFilter(pathName string, scope string) string { + scope = strings.TrimPrefix(scope, "/") + if strings.HasPrefix(pathName, scope) { + pathName = strings.TrimPrefix(pathName, scope) + } else { + pathName = "" + } + return pathName +} + +func containsSearchTerm(pathName string, searchTerm string) bool { + path := getLastPathComponent(pathName) + // Perform case-insensitive search + pathNameLower := strings.ToLower(path) + searchTermLower := strings.ToLower(searchTerm) + + return strings.Contains(pathNameLower, searchTermLower) +} +func getLastPathComponent(path string) string { + // Use filepath.Base to extract the last component of the path + return filepath.Base(path) +} \ No newline at end of file diff --git a/src/backend/search/search.go b/src/backend/search/search.go index 8920f92c..612103e7 100644 --- a/src/backend/search/search.go +++ b/src/backend/search/search.go @@ -7,8 +7,7 @@ import ( "strings" "github.com/spf13/afero" - - "github.com/filebrowser/filebrowser/v2/rules" + "github.com/gtsteffaniak/filebrowser/rules" ) type searchOptions struct { @@ -17,6 +16,11 @@ type searchOptions struct { Terms []string } +func IndexedSearch(query string, scope string, files *[]string, dirs *[]string) ([]string, []string) { + *files, *dirs = SearchAllIndexes(query, scope, *files, *dirs) + return *files, *dirs +} + // Search searches for a query in a fs. func Search(fs afero.Fs, scope, query string, checker rules.Checker, found func(path string, f os.FileInfo) error) error { search := parseSearch(query) diff --git a/src/backend/settings/defaults.go b/src/backend/settings/defaults.go index d60e36dc..160d2dd2 100644 --- a/src/backend/settings/defaults.go +++ b/src/backend/settings/defaults.go @@ -1,8 +1,8 @@ package settings import ( - "github.com/filebrowser/filebrowser/v2/files" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/files" + "github.com/gtsteffaniak/filebrowser/users" ) // UserDefaults is a type that holds the default values diff --git a/src/backend/settings/settings.go b/src/backend/settings/settings.go index 7df81fc4..a8ed4e11 100644 --- a/src/backend/settings/settings.go +++ b/src/backend/settings/settings.go @@ -4,7 +4,7 @@ import ( "crypto/rand" "strings" - "github.com/filebrowser/filebrowser/v2/rules" + "github.com/gtsteffaniak/filebrowser/rules" ) const DefaultUsersHomeBasePath = "/users" diff --git a/src/backend/settings/storage.go b/src/backend/settings/storage.go index 8498d3bf..a027b4b3 100644 --- a/src/backend/settings/storage.go +++ b/src/backend/settings/storage.go @@ -1,9 +1,9 @@ package settings import ( - "github.com/filebrowser/filebrowser/v2/errors" - "github.com/filebrowser/filebrowser/v2/rules" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/errors" + "github.com/gtsteffaniak/filebrowser/rules" + "github.com/gtsteffaniak/filebrowser/users" ) // StorageBackend is a settings storage backend. diff --git a/src/backend/share/storage.go b/src/backend/share/storage.go index 4cd263de..41424242 100644 --- a/src/backend/share/storage.go +++ b/src/backend/share/storage.go @@ -3,7 +3,7 @@ package share import ( "time" - "github.com/filebrowser/filebrowser/v2/errors" + "github.com/gtsteffaniak/filebrowser/errors" ) // StorageBackend is the interface to implement for a share storage. diff --git a/src/backend/storage/bolt/auth.go b/src/backend/storage/bolt/auth.go index cf15a8fe..a0e8d1c8 100644 --- a/src/backend/storage/bolt/auth.go +++ b/src/backend/storage/bolt/auth.go @@ -3,9 +3,9 @@ package bolt import ( "github.com/asdine/storm/v3" - "github.com/filebrowser/filebrowser/v2/auth" - "github.com/filebrowser/filebrowser/v2/errors" - "github.com/filebrowser/filebrowser/v2/settings" + "github.com/gtsteffaniak/filebrowser/auth" + "github.com/gtsteffaniak/filebrowser/errors" + "github.com/gtsteffaniak/filebrowser/settings" ) type authBackend struct { diff --git a/src/backend/storage/bolt/bolt.go b/src/backend/storage/bolt/bolt.go index 6cf226d2..cc8c37fe 100644 --- a/src/backend/storage/bolt/bolt.go +++ b/src/backend/storage/bolt/bolt.go @@ -3,11 +3,11 @@ package bolt import ( "github.com/asdine/storm/v3" - "github.com/filebrowser/filebrowser/v2/auth" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/share" - "github.com/filebrowser/filebrowser/v2/storage" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/auth" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/share" + "github.com/gtsteffaniak/filebrowser/storage" + "github.com/gtsteffaniak/filebrowser/users" ) // NewStorage creates a storage.Storage based on Bolt DB. diff --git a/src/backend/storage/bolt/config.go b/src/backend/storage/bolt/config.go index a4d40064..67f9eed9 100644 --- a/src/backend/storage/bolt/config.go +++ b/src/backend/storage/bolt/config.go @@ -3,7 +3,7 @@ package bolt import ( "github.com/asdine/storm/v3" - "github.com/filebrowser/filebrowser/v2/settings" + "github.com/gtsteffaniak/filebrowser/settings" ) type settingsBackend struct { diff --git a/src/backend/storage/bolt/importer/conf.go b/src/backend/storage/bolt/importer/conf.go index bafeb452..e31ba3fc 100644 --- a/src/backend/storage/bolt/importer/conf.go +++ b/src/backend/storage/bolt/importer/conf.go @@ -11,10 +11,10 @@ import ( "github.com/pelletier/go-toml/v2" "gopkg.in/yaml.v2" - "github.com/filebrowser/filebrowser/v2/auth" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/storage" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/auth" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/storage" + "github.com/gtsteffaniak/filebrowser/users" ) type oldDefs struct { diff --git a/src/backend/storage/bolt/importer/importer.go b/src/backend/storage/bolt/importer/importer.go index 9c737756..1ecc70eb 100644 --- a/src/backend/storage/bolt/importer/importer.go +++ b/src/backend/storage/bolt/importer/importer.go @@ -3,7 +3,7 @@ package importer import ( "github.com/asdine/storm/v3" - "github.com/filebrowser/filebrowser/v2/storage/bolt" + "github.com/gtsteffaniak/filebrowser/storage/bolt" ) // Import imports an old configuration to a newer database. diff --git a/src/backend/storage/bolt/importer/users.go b/src/backend/storage/bolt/importer/users.go index 0483402d..4606fc2e 100644 --- a/src/backend/storage/bolt/importer/users.go +++ b/src/backend/storage/bolt/importer/users.go @@ -7,9 +7,9 @@ import ( "github.com/asdine/storm/v3" bolt "go.etcd.io/bbolt" - "github.com/filebrowser/filebrowser/v2/rules" - "github.com/filebrowser/filebrowser/v2/storage" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/rules" + "github.com/gtsteffaniak/filebrowser/storage" + "github.com/gtsteffaniak/filebrowser/users" ) type oldUser struct { diff --git a/src/backend/storage/bolt/share.go b/src/backend/storage/bolt/share.go index 99da8ad1..b08b2dc4 100644 --- a/src/backend/storage/bolt/share.go +++ b/src/backend/storage/bolt/share.go @@ -4,8 +4,8 @@ import ( "github.com/asdine/storm/v3" "github.com/asdine/storm/v3/q" - "github.com/filebrowser/filebrowser/v2/errors" - "github.com/filebrowser/filebrowser/v2/share" + "github.com/gtsteffaniak/filebrowser/errors" + "github.com/gtsteffaniak/filebrowser/share" ) type shareBackend struct { diff --git a/src/backend/storage/bolt/users.go b/src/backend/storage/bolt/users.go index b0984bbe..47876706 100644 --- a/src/backend/storage/bolt/users.go +++ b/src/backend/storage/bolt/users.go @@ -6,8 +6,8 @@ import ( "github.com/asdine/storm/v3" - "github.com/filebrowser/filebrowser/v2/errors" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/errors" + "github.com/gtsteffaniak/filebrowser/users" ) type usersBackend struct { diff --git a/src/backend/storage/bolt/utils.go b/src/backend/storage/bolt/utils.go index 20407e15..fa84e3c3 100644 --- a/src/backend/storage/bolt/utils.go +++ b/src/backend/storage/bolt/utils.go @@ -3,7 +3,7 @@ package bolt import ( "github.com/asdine/storm/v3" - "github.com/filebrowser/filebrowser/v2/errors" + "github.com/gtsteffaniak/filebrowser/errors" ) func get(db *storm.DB, name string, to interface{}) error { diff --git a/src/backend/storage/storage.go b/src/backend/storage/storage.go index d4f1a652..019c6e89 100644 --- a/src/backend/storage/storage.go +++ b/src/backend/storage/storage.go @@ -1,10 +1,10 @@ package storage import ( - "github.com/filebrowser/filebrowser/v2/auth" - "github.com/filebrowser/filebrowser/v2/settings" - "github.com/filebrowser/filebrowser/v2/share" - "github.com/filebrowser/filebrowser/v2/users" + "github.com/gtsteffaniak/filebrowser/auth" + "github.com/gtsteffaniak/filebrowser/settings" + "github.com/gtsteffaniak/filebrowser/share" + "github.com/gtsteffaniak/filebrowser/users" ) // Storage is a storage powered by a Backend which makes the necessary diff --git a/src/backend/tools/go.mod b/src/backend/tools/go.mod index bba93568..9f4c2c90 100644 --- a/src/backend/tools/go.mod +++ b/src/backend/tools/go.mod @@ -1,4 +1,4 @@ -module github.com/filebrowser/filebrowser/v2/tools +module github.com/gtsteffaniak/filebrowser/tools go 1.18 diff --git a/src/backend/users/storage.go b/src/backend/users/storage.go index 163082fb..de939586 100644 --- a/src/backend/users/storage.go +++ b/src/backend/users/storage.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "github.com/filebrowser/filebrowser/v2/errors" + "github.com/gtsteffaniak/filebrowser/errors" ) // StorageBackend is the interface to implement for a users storage. diff --git a/src/backend/users/users.go b/src/backend/users/users.go index ec613856..91dcea68 100644 --- a/src/backend/users/users.go +++ b/src/backend/users/users.go @@ -6,9 +6,9 @@ import ( "github.com/spf13/afero" - "github.com/filebrowser/filebrowser/v2/errors" - "github.com/filebrowser/filebrowser/v2/files" - "github.com/filebrowser/filebrowser/v2/rules" + "github.com/gtsteffaniak/filebrowser/errors" + "github.com/gtsteffaniak/filebrowser/files" + "github.com/gtsteffaniak/filebrowser/rules" ) // ViewMode describes a view mode. diff --git a/src/backend/version/version.go b/src/backend/version/version.go index 0564cd57..f383be1b 100644 --- a/src/backend/version/version.go +++ b/src/backend/version/version.go @@ -2,7 +2,7 @@ package version var ( // Version is the current File Browser version. - Version = "(untracked)" + Version = "(0.1.0)" // CommitSHA is the commmit sha. CommitSHA = "(unknown)" ) diff --git a/src/frontend/src/components/Search.vue b/src/frontend/src/components/Search.vue index 6b498218..ab2ec4a9 100644 --- a/src/frontend/src/components/Search.vue +++ b/src/frontend/src/components/Search.vue @@ -14,7 +14,7 @@ -