gtsteffaniak / filebrowser

📂 Web File Browser
Apache License 2.0
13 stars 0 forks source link

mustGetBool: flag accessed but not defined: lockPassword #196

Open feklee opened 1 month ago

feklee commented 1 month ago

Description

Adding a new user via the command line does not work.

Expected behaviour

The user should be added, like with the equivalent command in the original File Browser.

What is happening instead?

I get an error message: mustGetBool: flag accessed but not defined: lockPassword

How to reproduce?

In BASH:

$ wget https://github.com/gtsteffaniak/filebrowser/releases/download/v0.2.8/linux-amd64-filebrowser
$ mv linux-amd64-filebrowser filebrowser
$ chmod +x filebrowser
$ cat >filebrowser.yaml <<EOF
server:
  port: 8080
  address: 10.0.0.1
  baseURL: "/"
  root: "/tmp"
  database: "/tmp/database.db"
auth:
  method: password
  signup: false
userDefaults:
  darkMode: false
  disableSettings: false
  scope: "."
  hideDotfiles: false
  singleClick: true
  permissions:
    admin: false
    create: false
    rename: false
    modify: false
    delete: false
    share: false
    download: false
EOF
$ USERNAME=someone
$ PASSWORD=secret
$ ./filebrowser users add "$USERNAME" "$PASSWORD"
2024/08/25 15:57:19 Initializing with config file: filebrowser.yaml
2024/08/25 15:57:19 Embeded Frontend: true
2024/08/25 15:57:19 mustGetBool: flag accessed but not defined: lockPassword
gtsteffaniak commented 1 week ago

This was intentionally removed to simplify the configuration process, but I can see the use case for adding users this way. I'll have this method of adding users added back as an option in the next release (v0.2.10)

feklee commented 6 days ago

I see, thank you, that's nice!

For my use case, I don't want to have any admin user. I prefer to have a single restricted user, whose permissions I can manage from the command line or through config files.

gtsteffaniak commented 6 days ago

Yep, good point. When I moved everything to configuration file, the purpose was to make configuration less confusing.

But it's true, usernames and passwords don't belong there. And maybe an admin user shouldn't be required either.

feklee commented 5 days ago

Thanks for explaining. I had a second look at Filebrowser Quantum, after reverting to the regular Filebrowser for the past weeks. First of all, thanks a lot for making this!

Actually, everything in a configuration file is OK. I figured, I can set the admin user name to something else. This suits my single-user case. For added security, I access Filebrowser via a VPN.

What confused me the last time, a few weeks ago, is that I couldn't see a way to even edit the user settings on the web interface. The Users tab is grayed out, or darkened. I was assuming that this means the functionality is not available. Only by chance I figured I can tap onto it, and then the tab becomes available. This is not a UI language that I am familiar with.