Description
If you start from an empty database, and you import a configuration that uses the noauth authentication method (e.g. as part of a larger Kubernetes deployment that authenticates users through the ingress controller), attempting to access File Browser yields a 500 error.
Expected behaviour
What is happening instead?
auth.js:34 POST /files/api/login 500
(anonymous) @ auth.js:34
w @ runtime.js:62
(anonymous) @ runtime.js:288
e.(anonymous function) @ runtime.js:114
s @ asyncToGenerator.js:5
a @ asyncToGenerator.js:27
(anonymous) @ asyncToGenerator.js:34
t @ _export.js:36
(anonymous) @ asyncToGenerator.js:23
le @ auth.js:34
oe @ auth.js:34
(anonymous) @ main.js:12
w @ runtime.js:62
(anonymous) @ runtime.js:288
e.(anonymous function) @ runtime.js:114
s @ asyncToGenerator.js:5
a @ asyncToGenerator.js:27
(anonymous) @ asyncToGenerator.js:34
t @ _export.js:36
(anonymous) @ asyncToGenerator.js:23
ho @ main.js:12
po @ main.js:12
56d7 @ main.js:10
i @ bootstrap:78
0 @ bootstrap:151
i @ bootstrap:78
s @ bootstrap:45
(anonymous) @ bootstrap:149
(anonymous) @ bootstrap:149
auth.js:34 Uncaught (in promise) Error: 500 Internal Server Error
at auth.js:34
at w (runtime.js:62)
at Generator._invoke (runtime.js:288)
at Generator.e.(/files/anonymous function) [as next] (/files/static/js/chunk-vendors.8da789cf.js:36:47656)
at s (asyncToGenerator.js:5)
at a (asyncToGenerator.js:27)
2019/03/22 21:42:26 Using config file: /etc/filebrowser/.filebrowser.json
2019/03/22 21:42:26 Listening on [::]:8080
2019/03/22 21:42:29 /api/login: 500 172.17.0.1:40034 the resource does not exist
How to reproduce?
FROM alpine:3.6
COPY --from="filebrowser/filebrowser:v2.0.3" filebrowser /bin/filebrowser
RUN set -ex; \
mkdir /home/filebrowser; \
mkdir /var/lib/filebrowser
COPY initial.json /etc/filebrowser/.filebrowser.json
COPY runtime.json /etc/filebrowser/runtime.json
RUN set -ex; \
filebrowser config import /etc/filebrowser/runtime.json
EXPOSE 8080
ENTRYPOINT [ "/bin/filebrowser" ]
initial.json config like this:{
"port": 8080,
"baseURL": "",
"address": "",
"log": "stdout",
"database": "/var/lib/filebrowser/database.db",
"root": "/home/filebrowser"
}
runtime.json like this:{
"settings": {
"signup": false,
"defaults": {
"scope": ".",
"locale": "en",
"viewMode": "mosaic",
"sorting": {
"by": "",
"asc": false
},
"perm": {
"admin": false,
"execute": false,
"create": true,
"rename": true,
"modify": true,
"delete": true,
"share": false,
"download": true
},
"commands": []
},
"authMethod": "noauth",
"branding": {
"name": "",
"disableExternal": true,
"files": ""
},
"commands": {
"after_copy": [],
"after_delete": [],
"after_rename": [],
"after_save": [],
"after_upload": [],
"before_copy": [],
"before_delete": [],
"before_rename": [],
"before_save": [],
"before_upload": []
},
"shell": [],
"rules": []
},
"server": {
"root": "/home/filebrowser",
"baseURL": "",
"tlsKey": "",
"tlsCert": "",
"port": "8080",
"address": "",
"log": "stdout"
},
"auther": {}
}
Workaround
Ensure that the Dockerfile adds the first user account after importing the config.
For example, we changed our config import line to read:
RUN set -ex; \
filebrowser config import /etc/filebrowser/runtime.json; \
\
RANDOM_PASSWORD=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1); \
\
filebrowser users add \
"default-user" \
"${RANDOM_PASSWORD}"
Thanks for reporting this @GuyPaddock!
Probably I won't fix it as soon as I'd like to _but_ thanks a lot for the big report. It'll help other users!
If you'd like to contribute, I'd love a PR 馃槂
I'm closing this since this repository will be archived. Please read the information on the README for more information. Thanks for all your contributions!
This issue still exist. Requesting to reopen the issue
Most helpful comment
This issue still exist. Requesting to reopen the issue