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

#2554 configure user session timeout #2753

Merged
merged 2 commits into from
Nov 2, 2023
Merged

Conversation

darddan
Copy link
Contributor

@darddan darddan commented Oct 9, 2023

Description
Session timeout is hardcoded to 2 hours. This PR makes that value configurable with a fallback to 2 hours. Related to #2554

There are two use-cases for me for this change. The first is that I wan't to be able to stay logged in for longer. The other one is if I'm downloading really large files and session expires in between then the upload is canceled at that point.

IMO for the second use-case this PR shouldn't be enough and it needs another proper fix.

@darddan darddan requested a review from o1egl as a code owner October 9, 2023 18:45
@darddan
Copy link
Contributor Author

darddan commented Oct 19, 2023

Hi @o1egl, can I get a review/comment on the changes? I fixed the linting issues after the CI failed last time

http/auth.go Outdated Show resolved Hide resolved
@o1egl o1egl merged commit 7fabadc into filebrowser:master Nov 2, 2023
7 of 8 checks passed
@StanislavJochman
Copy link

Where can I set a custom user session timeout? Is it only through API?

@akamkomputer
Copy link

Is it possible to set TokenExpirationTime in docker?

@fritx
Copy link
Contributor

fritx commented Nov 23, 2023

Update: I've submitted a PR for this feature. #2845


cfg file should work @StanislavJochman @akamkomputer

filebrowser -c your/path/to/filebrowser.json
// filebrowser.json
{
  "port": 8080,
  "baseURL": "",
  "address": "127.0.0.1",
  "log": "stdout",
  "database": "filebrowser.db",
  "root": ".",
  "tokenExpirationTime": "12h"
}

@StanislavJochman
Copy link

But can it be set using dockerfile? Or do I have to edit file manually?

fritx added a commit to we-fork/filebrowser that referenced this pull request Nov 25, 2023
@fritx
Copy link
Contributor

fritx commented Nov 25, 2023

@StanislavJochman oops, my fault/.. Update: I've submitted a PR for this feature. #2845

# One of the below should work:
filebrowser --token-expiration-time=12h
# or
filebrowser -c fb.json
# fb.json
{
  "token-expiration-time": "12h"
}

UPDATE: corrected: filebrowser --token-expiration-time=12h, as pointed out by baur.

fritx added a commit to we-fork/filebrowser that referenced this pull request Nov 25, 2023
@darddan darddan deleted the feature-2554 branch November 28, 2023 10:28
@baur
Copy link

baur commented Jan 3, 2024

implemented:

filebrowser --token-expiration-time=12h

not timeout

@k0gen
Copy link

k0gen commented May 23, 2024

implemented:

filebrowser --token-expiration-time=12h

not timeout

What are the allowable values and range here? Can "0" be used to disable the timeout?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants