Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Realign with master and add new features #1

Merged
merged 76 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
5994224
feat: add new folder button to move/create dialogs (#2667)
ArthurMousatov Aug 26, 2023
95fec7f
fix: refactor path resolution logic for project root (#2674)
maeryo Aug 27, 2023
a404fb0
feat: implement abort upload functionality (#2673)
maeryo Aug 27, 2023
aa00c1c
chore: fixes for vite dev server (#2678)
kloon15 Aug 29, 2023
d0c3b80
chore: update German translation (#2616)
derech1e Sep 10, 2023
36af01d
fix: tus upload with cloudflare proxy
o1egl Sep 14, 2023
ecdd684
feat: implement upload speed calculation and ETA estimation (#2677)
maeryo Sep 14, 2023
584b706
feat: added shell resizing (#2648)
cameronaw13 Sep 14, 2023
c1fb400
chore(release): 2.25.0
o1egl Sep 14, 2023
38f7788
build: fix deprecated goreleaser config options
o1egl Sep 14, 2023
01f7842
docs: add demo url to README
o1egl Sep 14, 2023
bd3c194
fix: revert fetchURL changes in auth (Fixes #2729) (#2739)
kloon15 Oct 1, 2023
9484454
chore: update en translation (#2776)
waseigo Nov 2, 2023
d0c3aea
chore: update en translation (#2777)
waseigo Nov 2, 2023
cdcd9a3
fix: display file size as base 2 (KiB instead of KB) (#2779)
kloon15 Nov 2, 2023
edd808f
fix: avoid the front-end calling api/renew loop (#2792)
bufubaoni Nov 2, 2023
bb4bb50
build(deps): bump @babel/traverse in /frontend (#2775)
dependabot[bot] Nov 2, 2023
d574fb6
build(deps): bump golang.org/x/net from 0.11.0 to 0.17.0 (#2758)
dependabot[bot] Nov 2, 2023
21d361a
build(deps-dev): bump postcss from 8.4.27 to 8.4.31 in /frontend (#2749)
dependabot[bot] Nov 2, 2023
6a31af6
fix: solve docker build failed issue (#2797)
shonge Nov 2, 2023
c3079d3
feat: add modern greek translation (#2778)
waseigo Nov 2, 2023
7fabadc
feat: make user session timeout configurable (#2753)
darddan Nov 2, 2023
da1fe7c
fix: disable static resource files listing
o1egl Nov 2, 2023
a744bd2
build(deps): bump golang.org/x/image from 0.5.0 to 0.10.0 (#2800)
dependabot[bot] Nov 2, 2023
4d0a68e
fix: goreleaser yaml
o1egl Nov 2, 2023
a4cb813
chore(release): 2.26.0
o1egl Nov 2, 2023
d59ad59
fix: set correct port in docker healthcheck (#2812)
efrecon Nov 8, 2023
4dbc802
fix: fix typo (#2843)
Nerahikada Nov 25, 2023
a09dfa8
feat: display image resolutions in file details (#2830)
maeryo Nov 25, 2023
fc2ee37
build(deps-dev): bump vite from 4.4.9 to 4.4.12 in /frontend (#2862)
dependabot[bot] Dec 6, 2023
391a078
feat: make user session timeout configurable by flags (#2845)
fritx Dec 6, 2023
cfafefa
chore: update Arabic and English translations (#2823)
omalk98 Dec 6, 2023
821fba4
build(deps): bump golang.org/x/crypto from 0.14.0 to 0.17.0 (#2890)
dependabot[bot] Dec 28, 2023
da59532
chore: update he.json (#2877)
ShlomoCode Dec 28, 2023
748af71
feat: allow setting theme via cli (#2881)
yardenshoham Dec 28, 2023
3264cea
fix: delete message when delete file from preview
ShlomoCode Dec 28, 2023
fc04578
Update zh-cn.json (#2875)
People-11 Dec 28, 2023
479d7e7
Merge branch 'master' into vue3
omalk98 Dec 29, 2023
72f3ae6
Fix modification hover date
omalk98 Dec 29, 2023
929a693
i18n language updates and cleaup
omalk98 Dec 30, 2023
c4e955a
fix: typo in build error #2903 (#2904)
Yogesh070 Dec 31, 2023
04e03a8
chore(release): 2.27.0
o1egl Jan 2, 2024
5c5ab6b
fix: files and directories are created with the correct permissions (…
Nerahikada Jan 30, 2024
a4b089a
feat: allow to configure if home directory is automatically created f…
Nerahikada Jan 30, 2024
0a05f8c
chore(i18n): improvement of Japanese translation (#2962)
Nerahikada Jan 30, 2024
883383a
fix: moment locale (#2952)
ShlomoCode Jan 30, 2024
bf36cc0
build(deps-dev): bump vite from 4.4.12 to 4.5.2 in /frontend (#2951)
dependabot[bot] Jan 30, 2024
2f6c473
chore: update pull request template (#2950)
ShlomoCode Jan 30, 2024
70c8261
feat: close editor when click escape key (#2947)
ShlomoCode Jan 30, 2024
81cd8fc
fix(healthcheck): use address configured if not empty (#2938)
qdm12 Jan 30, 2024
62f0dfb
chore: update he.json (#2933)
ShlomoCode Jan 30, 2024
ff9502f
fix: keyboard shortcut to confirm prompts (#2932)
ShlomoCode Jan 30, 2024
b19710e
feat: focus editor when opened (#2946)
ShlomoCode Jan 30, 2024
fb1a09c
feat: prompt to confirm discard editor changes (#2948)
ShlomoCode Jan 30, 2024
2cfee21
fix: dashboard buttons position in rtl layout (#2949)
ShlomoCode Jan 30, 2024
d49c3df
feat: select multiple files with ctrl even with singleClick option (#…
ShlomoCode Jan 30, 2024
34a0817
fix: editor discard prompt (#2990)
Zouizoui78 Feb 9, 2024
d5487ba
chore: add noindex (#2981)
Feriman22 Feb 9, 2024
6d7ba65
fix: shell direction (#2980)
ShlomoCode Feb 9, 2024
dfad873
chore: update github action versions (#2977)
Nerahikada Feb 9, 2024
fe5ca74
fix: fix lint warnings (#2976)
Nerahikada Feb 9, 2024
e167c3e
feat: freezing the list in the backgroud while previewing a file (#3004)
niubility000 Feb 22, 2024
cdf8def
fix: stay in the same position after renaming or deleting (#3039)
niubility000 Mar 7, 2024
8dddc8a
chore: show the current used filebrowser.db in cmd window (#3028)
niubility000 Mar 7, 2024
d706506
feat: auto hiding header bar in preview to enlarge the preview window…
niubility000 Mar 7, 2024
7797a4e
build(deps): bump google.golang.org/protobuf in /tools (#3044)
dependabot[bot] Mar 14, 2024
4c233c3
feat: enable preview in shared folder (#3055)
niubility000 Mar 17, 2024
05bfae2
build(deps): bump google.golang.org/protobuf from 1.31.0 to 1.33.0 (#…
dependabot[bot] Mar 17, 2024
9499d84
Merge branch 'master' into vue3
omalk98 Mar 25, 2024
9ce43cd
mapping functionality from "master" to "vue3"
omalk98 Mar 25, 2024
461d7a5
Merge branch 'vue3' into vue3
omalk98 Mar 25, 2024
baa55fa
fix build errors
omalk98 Mar 25, 2024
50d81f5
format according to prettier
omalk98 Mar 25, 2024
9c8a033
update new prompt to use pinia
omalk98 Mar 25, 2024
0709474
bug fixes due to merge
omalk98 Mar 27, 2024
e12b108
directory listing bug fix
omalk98 Mar 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*
!docker/*
!healthcheck.sh
!docker_config.json
!filebrowser
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ Please explain the changes you made here.
If the feature changes current behaviour, explain why your solution is better.
-->

:rotating_light: Before submitting your PR, please read [community](https://github.com/filebrowser/community), and indicate which issues (in any of the repos) are either fixed or closed by this PR. See [GitHub Help: Closing issues using keywords](https://help.github.com/articles/closing-issues-via-commit-messages/).
:rotating_light: Before submitting your PR, please indicate which issues are either fixed or closed by this PR. See [GitHub Help: Closing issues using keywords](https://help.github.com/articles/closing-issues-via-commit-messages/).

- [ ] DO make sure you are requesting to **pull a topic/feature/bugfix branch** (right side). Don't request your master!
- [ ] DO make sure you are making a pull request against the **master branch** (left side). Also you should start *your branch* off *our master*.
- [ ] DO make sure that File Browser can be successfully built. See [builds](https://github.com/filebrowser/community/blob/master/builds.md) and [development](https://github.com/filebrowser/community/blob/master/development.md).
- [ ] DO make sure that related issues are opened in other repositories. I.e., the frontend, caddy plugins or the web page need to be updated accordingly.
- [ ] AVOID breaking the continuous integration build.

**Further comments**
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ jobs:
lint-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: make lint-frontend
lint-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.0
- run: make lint-backend
lint-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: make lint-commits
Expand All @@ -46,16 +46,16 @@ jobs:
test-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: make test-frontend
test-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.0
- run: make test-backend
Expand All @@ -71,13 +71,13 @@ jobs:
needs: [lint, test]
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v2
- uses: actions/setup-go@v5
with:
go-version: 1.21.0
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Set up QEMU
Expand All @@ -95,6 +95,6 @@ jobs:
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
56 changes: 28 additions & 28 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ project_name: filebrowser
env:
- GO111MODULE=on

build:
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X github.com/filebrowser/filebrowser/v2/version.Version={{ .Version }} -X github.com/filebrowser/filebrowser/v2/version.CommitSHA={{ .ShortCommit }}
main: main.go
binary: filebrowser
goos:
- darwin
- linux
- windows
- freebsd
goarch:
- amd64
- 386
- arm
- arm64
- riscv64
goarm:
- 5
- 6
- 7
ignore:
- goos: darwin
goarch: 386
- goos: freebsd
goarch: arm
builds:
- env:
- CGO_ENABLED=0
ldflags:
- -s -w -X github.com/filebrowser/filebrowser/v2/version.Version={{ .Version }} -X github.com/filebrowser/filebrowser/v2/version.CommitSHA={{ .ShortCommit }}
main: main.go
binary: filebrowser
goos:
- darwin
- linux
- windows
- freebsd
goarch:
- amd64
- 386
- arm
- arm64
- riscv64
goarm:
- 5
- 6
- 7
ignore:
- goos: darwin
goarch: 386
- goos: freebsd
goarch: arm

archives:
-
Expand Down Expand Up @@ -186,7 +186,7 @@ docker_manifests:
- "filebrowser/filebrowser:v{{ .Major }}-arm64-s6"
brews:
- name: filebrowser
tap:
repository:
owner: filebrowser
name: homebrew-tap
folder: Formula
Expand Down
82 changes: 82 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,88 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.27.0](https://github.com/filebrowser/filebrowser/compare/v2.26.0...v2.27.0) (2024-01-02)


### Features

* allow setting theme via cli ([#2881](https://github.com/filebrowser/filebrowser/issues/2881)) ([748af71](https://github.com/filebrowser/filebrowser/commit/748af7172ce96f0b66c394e88839bd57c194ffc7))
* display image resolutions in file details ([#2830](https://github.com/filebrowser/filebrowser/issues/2830)) ([a09dfa8](https://github.com/filebrowser/filebrowser/commit/a09dfa8d9f190243d811a841de44c4abb4403d87))
* make user session timeout configurable by flags ([#2845](https://github.com/filebrowser/filebrowser/issues/2845)) ([391a078](https://github.com/filebrowser/filebrowser/commit/391a078cd486e618c95a0c5850326076cbc025b6))


### Bug Fixes

* delete message when delete file from preview ([3264cea](https://github.com/filebrowser/filebrowser/commit/3264cea8307dca9ab5463dc81f2a10a817eb3d54))
* fix typo ([#2843](https://github.com/filebrowser/filebrowser/issues/2843)) ([4dbc802](https://github.com/filebrowser/filebrowser/commit/4dbc802972c930f5f42fc27507fac35c28c42afd))
* set correct port in docker healthcheck ([#2812](https://github.com/filebrowser/filebrowser/issues/2812)) ([d59ad59](https://github.com/filebrowser/filebrowser/commit/d59ad594b8649f57f61453b0dfbc350c57b690a2))
* typo in build error [#2903](https://github.com/filebrowser/filebrowser/issues/2903) ([#2904](https://github.com/filebrowser/filebrowser/issues/2904)) ([c4e955a](https://github.com/filebrowser/filebrowser/commit/c4e955acf4a1a8f8e8e94f697ffc838515e69a60))


### Build

* **deps-dev:** bump vite from 4.4.9 to 4.4.12 in /frontend ([#2862](https://github.com/filebrowser/filebrowser/issues/2862)) ([fc2ee37](https://github.com/filebrowser/filebrowser/commit/fc2ee373536584d024f7def62f350bdbb712d927))
* **deps:** bump golang.org/x/crypto from 0.14.0 to 0.17.0 ([#2890](https://github.com/filebrowser/filebrowser/issues/2890)) ([821fba4](https://github.com/filebrowser/filebrowser/commit/821fba41a25ba99d47641f01b10ac51960157888))

## [2.26.0](https://github.com/filebrowser/filebrowser/compare/v2.25.0...v2.26.0) (2023-11-02)


### Features

* add modern greek translation ([#2778](https://github.com/filebrowser/filebrowser/issues/2778)) ([c3079d3](https://github.com/filebrowser/filebrowser/commit/c3079d30e22385d7e677f172324cd9cbab6487ce))
* make user session timeout configurable ([#2753](https://github.com/filebrowser/filebrowser/issues/2753)) ([7fabadc](https://github.com/filebrowser/filebrowser/commit/7fabadc871ea91ea22fe9454e2ca4b33e5c211be))


### Bug Fixes

* avoid the front-end calling api/renew loop ([#2792](https://github.com/filebrowser/filebrowser/issues/2792)) ([edd808f](https://github.com/filebrowser/filebrowser/commit/edd808f124f4ada99bcbe4bca98ddbe20e5a424c))
* disable static resource files listing ([da1fe7c](https://github.com/filebrowser/filebrowser/commit/da1fe7c9d76a9c6a25bfa19ebd6cf8023eff5d62))
* display file size as base 2 (KiB instead of KB) ([#2779](https://github.com/filebrowser/filebrowser/issues/2779)) ([cdcd9a3](https://github.com/filebrowser/filebrowser/commit/cdcd9a313aa50c2e6806a182b6838462d42dcafe))
* goreleaser yaml ([4d0a68e](https://github.com/filebrowser/filebrowser/commit/4d0a68e7875274f4c939f2bfa15739a9b0ecf70a))
* revert fetchURL changes in auth (Fixes [#2729](https://github.com/filebrowser/filebrowser/issues/2729)) ([#2739](https://github.com/filebrowser/filebrowser/issues/2739)) ([bd3c194](https://github.com/filebrowser/filebrowser/commit/bd3c1941ff8289a5dae877e08f7e25fa9b2a92c5))
* solve docker build failed issue ([#2797](https://github.com/filebrowser/filebrowser/issues/2797)) ([6a31af6](https://github.com/filebrowser/filebrowser/commit/6a31af6c0a144128af865d802c8039fa5250e946))


### Build

* **deps-dev:** bump postcss from 8.4.27 to 8.4.31 in /frontend ([#2749](https://github.com/filebrowser/filebrowser/issues/2749)) ([21d361a](https://github.com/filebrowser/filebrowser/commit/21d361ad308d109d2a6b323597019aaa09ce1781))
* **deps:** bump @babel/traverse in /frontend ([#2775](https://github.com/filebrowser/filebrowser/issues/2775)) ([bb4bb50](https://github.com/filebrowser/filebrowser/commit/bb4bb508a9d71516e8fa80b3a6285fe002a059d2))
* **deps:** bump golang.org/x/image from 0.5.0 to 0.10.0 ([#2800](https://github.com/filebrowser/filebrowser/issues/2800)) ([a744bd2](https://github.com/filebrowser/filebrowser/commit/a744bd224f0ff1efc53ab94481fa76ef68788df1))
* **deps:** bump golang.org/x/net from 0.11.0 to 0.17.0 ([#2758](https://github.com/filebrowser/filebrowser/issues/2758)) ([d574fb6](https://github.com/filebrowser/filebrowser/commit/d574fb6d1af41ec31778b0f402674e5111a7875d))
* fix deprecated goreleaser config options ([38f7788](https://github.com/filebrowser/filebrowser/commit/38f77882559133b9ff330cfb955a9d4ea4728cf8))

## [2.25.0](https://github.com/filebrowser/filebrowser/compare/v2.24.2...v2.25.0) (2023-09-14)


### Features

* add new folder button to move/create dialogs ([#2667](https://github.com/filebrowser/filebrowser/issues/2667)) ([5994224](https://github.com/filebrowser/filebrowser/commit/599422446849fa37d5ab448bbf464afb7304b99d))
* added shell resizing ([#2648](https://github.com/filebrowser/filebrowser/issues/2648)) ([584b706](https://github.com/filebrowser/filebrowser/commit/584b706b1e310297acc2580c60442ff5c11ae432))
* implement abort upload functionality ([#2673](https://github.com/filebrowser/filebrowser/issues/2673)) ([a404fb0](https://github.com/filebrowser/filebrowser/commit/a404fb043da2573bf04385863b2d34b1f918b8e1))
* implement upload speed calculation and ETA estimation ([#2677](https://github.com/filebrowser/filebrowser/issues/2677)) ([ecdd684](https://github.com/filebrowser/filebrowser/commit/ecdd684bf1d537a4591caa38348102b61dd51e5d))


### Bug Fixes

* refactor path resolution logic for project root ([#2674](https://github.com/filebrowser/filebrowser/issues/2674)) ([95fec7f](https://github.com/filebrowser/filebrowser/commit/95fec7f69430c108e5cf95c428db9d671cd97a94))
* tus upload with cloudflare proxy ([36af01d](https://github.com/filebrowser/filebrowser/commit/36af01daa6e04005ce3d18985eebaeef06f7393d)), closes [#2593](https://github.com/filebrowser/filebrowser/issues/2593)


### Refactorings

* migrate frontend tooling to vite 4 ([#2645](https://github.com/filebrowser/filebrowser/issues/2645)) ([8838a09](https://github.com/filebrowser/filebrowser/commit/8838a09cf5104deac22b6143050588040c6825e6))


### Build

* bump go version to 1.21.0 ([#2672](https://github.com/filebrowser/filebrowser/issues/2672)) ([2c97573](https://github.com/filebrowser/filebrowser/commit/2c97573301a1b13179678fb7f9bd8316539ecdff))
* bump node version to 18 ([#2671](https://github.com/filebrowser/filebrowser/issues/2671)) ([70eba7e](https://github.com/filebrowser/filebrowser/commit/70eba7ecc9d19545c0899ae40eb3897a7c48562f))


### Performance improvements

* **backend:** optimize subtitles detection performance ([#2637](https://github.com/filebrowser/filebrowser/issues/2637)) ([374bbd3](https://github.com/filebrowser/filebrowser/commit/374bbd3ec199fddbe491ab2b74e520a10a73e54b))

### [2.24.2](https://github.com/filebrowser/filebrowser/compare/v2.24.1...v2.24.2) (2023-08-08)


Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

filebrowser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app.

## Demo

url: https://demo.filebrowser.org/

credentials: `demo`/`demo`

## Features

Please refer to our docs at [https://filebrowser.org/features](https://filebrowser.org/features)
Expand Down
3 changes: 3 additions & 0 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func addConfigFlags(flags *pflag.FlagSet) {
addServerFlags(flags)
addUserFlags(flags)
flags.BoolP("signup", "s", false, "allow users to signup")
flags.Bool("create-user-dir", false, "generate user's home directory automatically")
flags.String("shell", "", "shell command to which other commands should be appended")

flags.String("auth.method", string(auth.MethodJSONAuth), "authentication type")
Expand All @@ -42,6 +43,7 @@ func addConfigFlags(flags *pflag.FlagSet) {
flags.String("recaptcha.secret", "", "ReCaptcha secret")

flags.String("branding.name", "", "replace 'File Browser' by this name")
flags.String("branding.theme", "", "set the theme")
flags.String("branding.color", "", "set the theme color")
flags.String("branding.files", "", "path to directory with images and custom styles")
flags.Bool("branding.disableExternal", false, "disable external links such as GitHub links")
Expand Down Expand Up @@ -150,6 +152,7 @@ func printSettings(ser *settings.Server, set *settings.Settings, auther auth.Aut
fmt.Fprintf(w, "\tDisable external links:\t%t\n", set.Branding.DisableExternal)
fmt.Fprintf(w, "\tDisable used disk percentage graph:\t%t\n", set.Branding.DisableUsedPercentage)
fmt.Fprintf(w, "\tColor:\t%s\n", set.Branding.Color)
fmt.Fprintf(w, "\tTheme:\t%s\n", set.Branding.Theme)
fmt.Fprintln(w, "\nServer:")
fmt.Fprintf(w, "\tLog:\t%s\n", ser.Log)
fmt.Fprintf(w, "\tPort:\t%s\n", ser.Port)
Expand Down
12 changes: 7 additions & 5 deletions cmd/config_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ override the options.`,
authMethod, auther := getAuthentication(flags)

s := &settings.Settings{
Key: generateKey(),
Signup: mustGetBool(flags, "signup"),
Shell: convertCmdStrToCmdArray(mustGetString(flags, "shell")),
AuthMethod: authMethod,
Defaults: defaults,
Key: generateKey(),
Signup: mustGetBool(flags, "signup"),
CreateUserDir: mustGetBool(flags, "create-user-dir"),
Shell: convertCmdStrToCmdArray(mustGetString(flags, "shell")),
AuthMethod: authMethod,
Defaults: defaults,
Branding: settings.Branding{
Name: mustGetString(flags, "branding.name"),
DisableExternal: mustGetBool(flags, "branding.disableExternal"),
DisableUsedPercentage: mustGetBool(flags, "branding.disableUsedPercentage"),
Theme: mustGetString(flags, "branding.theme"),
Files: mustGetString(flags, "branding.files"),
},
}
Expand Down
4 changes: 4 additions & 0 deletions cmd/config_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ you want to change. Other options will remain unchanged.`,
hasAuth = true
case "shell":
set.Shell = convertCmdStrToCmdArray(mustGetString(flags, flag.Name))
case "create-user-dir":
set.CreateUserDir = mustGetBool(flags, flag.Name)
case "branding.name":
set.Branding.Name = mustGetString(flags, flag.Name)
case "branding.color":
set.Branding.Color = mustGetString(flags, flag.Name)
case "branding.theme":
set.Branding.Theme = mustGetString(flags, flag.Name)
case "branding.disableExternal":
set.Branding.DisableExternal = mustGetBool(flags, flag.Name)
case "branding.disableUsedPercentage":
Expand Down
5 changes: 5 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func addServerFlags(flags *pflag.FlagSet) {
flags.Uint32("socket-perm", 0666, "unix socket file permissions") //nolint:gomnd
flags.StringP("baseurl", "b", "", "base url")
flags.String("cache-dir", "", "file cache directory (disabled if empty)")
flags.String("token-expiration-time", "2h", "user session timeout")
flags.Int("img-processors", 4, "image processors count") //nolint:gomnd
flags.Bool("disable-thumbnails", false, "disable image thumbnails")
flags.Bool("disable-preview-resize", false, "disable resize of image previews")
Expand Down Expand Up @@ -261,6 +262,10 @@ func getRunParams(flags *pflag.FlagSet, st *storage.Storage) *settings.Server {
_, disableExec := getParamB(flags, "disable-exec")
server.EnableExec = !disableExec

if val, set := getParamB(flags, "token-expiration-time"); set {
server.TokenExpirationTime = val
}

return server
}

Expand Down
11 changes: 9 additions & 2 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,23 @@ func python(fn pythonFunc, cfg pythonConfig) cobraFunc {
data := pythonData{hadDB: true}

path := getParam(cmd.Flags(), "database")
absPath, err := filepath.Abs(path)
if err != nil {
panic(err)
}
exists, err := dbExists(path)

if err != nil {
panic(err)
} else if exists && cfg.noDB {
log.Fatal(path + " already exists")
log.Fatal(absPath + " already exists")
} else if !exists && !cfg.noDB && !cfg.allowNoDB {
log.Fatal(path + " does not exist. Please run 'filebrowser config init' first.")
log.Fatal(absPath + " does not exist. Please run 'filebrowser config init' first.")
} else if !exists && !cfg.noDB {
log.Println("Warning: filebrowser.db can't be found. Initialing in " + strings.TrimSuffix(absPath, "filebrowser.db"))
}

log.Println("Using database: " + absPath)
data.hadDB = exists
db, err := storm.Open(path)
checkErr(err)
Expand Down
Loading