From 7fad00b00902a22b392c84e6b056b93428f942e9 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 27 Jun 2021 11:05:14 +0200 Subject: [PATCH] Noauth --- filebrowser/run.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/filebrowser/run.sh b/filebrowser/run.sh index a4f0a8ef5..208b1e3a4 100644 --- a/filebrowser/run.sh +++ b/filebrowser/run.sh @@ -152,16 +152,27 @@ PGID=0 # LAUNCH FILEBROWSER # ###################### +NOAUTH="" + if bashio::config.true 'NoAuth'; then - /./filebrowser config init || true - /./filebrowser config set --auth.method=noauth + if ! bashio::fs.file_exists "/data/noauth"; then + rm /data/auth || true + touch /data/noauth + rm /config/filebrowser/filebrowser.dB || true + NOAUTH="--no-auth" + bashio::log.warning "Auth method change, database reset" + fi bashio::log.info "NoAuth option selected" else - /./filebrowser config init || true - /./filebrowser config set --auth.method=json + if ! bashio::fs.file_exists "/data/auth"; then + rm /data/noauth || true + touch /data/auth + rm /config/filebrowser/filebrowser.dB || true + bashio::log.warning "Auth method change, database reset" + fi bashio::log.info "Default username/password : admin/admin" fi bashio::log.info "Please wait 1 or 2 minutes to allow the server to load" -/./filebrowser $CERTFILE $KEYFILE --root=/ --address=0.0.0.0 --database=/config/filebrowser/filebrowser.dB +/./filebrowser $CERTFILE $KEYFILE --root=/ --address=0.0.0.0 --database=/config/filebrowser/filebrowser.dB $NOAUTH