From fe4529e31657b317c0d86e31e285ef09d2aa4874 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 22 Jan 2024 22:10:34 +0100 Subject: [PATCH] Avoid root as user https://github.com/alexbelgium/hassio-addons/issues/1197 --- mealie/rootfs/run.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mealie/rootfs/run.txt b/mealie/rootfs/run.txt index f08178b0d..2d7a34abb 100644 --- a/mealie/rootfs/run.txt +++ b/mealie/rootfs/run.txt @@ -31,6 +31,18 @@ for k in $(bashio::jq "/data/options.json" 'keys | .[]'); do export "$k"="$(bashio::config "$k")" done +############## +# Check PUID # +############## + +bashio::log.info "Checking user type" +if [ "$PUID" = 0 ] || [ "$PGID" = 0 ]; then + bashio::log.warning "Can't run as root, the user will be set to 1000:1000" + bashio::addon.option "PUID" "1000" + bashio::addon.option "PGID" "1000" + bashio::addon.restart +fi + ############### # CONFIG YAML # ###############