Install filebrowser via docker. Give a path to the config file via command line. Basically my command to run the container looks like this:
docker run -v /home/mozzbozz/data:/srv -v /home/mozzbozz/config:/config -p 8080:80 hacdias/filebrowser --config /config/config.json
My /home/mozzbozz/config/config.json looks like the following:
{
"port": 80,
"address": "",
"database": "/config/database.db",
"scope": "/srv",
"allowCommands": true,
"allowEdit": true,
"allowNew": true,
"commands": []
}
A file with the name /home/mozzbozz/config/database.db should be created on my host system if it doesn't exist.
Well, that's not the case. Therefore stopping and running the container again, changes like new users, ... are not persistent. It doesn't matter if I pull the latest image or the v1.8.0 tag (also tried some older images).
If I clone this git repository and run a simple docker build -t test . inside the root directory and issue the following command (basically the same as shown above, just the image name is replaced):
docker run -v /home/mozzbozz/data:/srv -v /home/mozzbozz/config:/config -p 8080:80 test --config /config/config.json
...everything works as expected. Restarting the container doesn't result in a loose of the changes and the database.db file is created where expected.
I have honestly no idea, why this happens or how this can be fixed. I've even compared the Dockerfile shown on Dockerhub with the one inside this git repo and couldn't find any differences. Tested this on two different computers with different Linux distributions and different docker versions...
I also can't find database.db . where can i load database.db?
@mozzbozz , @EasyChris thanks for your report. I pushed a fix and it will be available as soon as it is merged and travis builds it.
@mozzbozz , @EasyChris this should be fixed now. Can you please try the latest image at https://hub.docker.com/r/filebrowser/filebrowser/tags/ and let us know if it works for you?
Hi @1138-4EB ! Sorry for the late answer... but I finally could test your fix (I always kept this in mind but didn't have the chance or time to do this much earlier; among other things, I mainly had to complete my master thesis and not completely miss social life...).
I tested your fix thoroughly and it works great. Thank you a lot! Respect for hunting down this bug, it was a really tough one. I spent a couple of hours on this and really couldn't figure it out (haven't worked with go or viper before, though).
Most helpful comment
@mozzbozz , @EasyChris this should be fixed now. Can you please try the
latestimage at https://hub.docker.com/r/filebrowser/filebrowser/tags/ and let us know if it works for you?