mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-30 02:24:14 +02:00
Merge pull request #2533 from alexbelgium/copilot/fix-connection-refused-error
Fix wger PermissionError on /data/media during fresh install
This commit is contained in:
@@ -67,6 +67,10 @@ ENV PACKAGES="sudo nginx"
|
||||
ADD "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_autoapps.sh" "/ha_autoapps.sh"
|
||||
RUN chmod 744 /ha_autoapps.sh && /ha_autoapps.sh "$PACKAGES" || true && rm /ha_autoapps.sh
|
||||
|
||||
# Ensure sudoers entry exists after sudo package installation
|
||||
# (installing sudo may overwrite /etc/sudoers with its default conffile)
|
||||
RUN echo "wger ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
|
||||
|
||||
################
|
||||
# 4 Entrypoint #
|
||||
################
|
||||
|
||||
@@ -11,22 +11,22 @@ sed -i "s|/home/wger/db/database.sqlite|/data/database.sqlite|g" /home/wger/src/
|
||||
#####################
|
||||
echo "... create directories"
|
||||
mkdir -p /data/static
|
||||
if [ -d /home/wger/static ]; then
|
||||
if [ -d /home/wger/static ] && [ ! -L /home/wger/static ]; then
|
||||
if [ -n "$(ls -A /home/wger/static 2> /dev/null)" ]; then
|
||||
cp -rnf /home/wger/static/* /data/static/
|
||||
fi
|
||||
rm -r /home/wger/static
|
||||
fi
|
||||
ln -s /data/static /home/wger
|
||||
ln -sf /data/static /home/wger
|
||||
|
||||
mkdir -p /data/media
|
||||
if [ -d /home/wger/media ]; then
|
||||
if [ -d /home/wger/media ] && [ ! -L /home/wger/media ]; then
|
||||
if [ -n "$(ls -A /home/wger/media 2> /dev/null)" ]; then
|
||||
cp -rnf /home/wger/media/* /data/media/
|
||||
fi
|
||||
rm -r /home/wger/media
|
||||
fi
|
||||
ln -s /data/media /home/wger
|
||||
ln -sf /data/media /home/wger
|
||||
|
||||
#####################
|
||||
# Align permissions #
|
||||
|
||||
Reference in New Issue
Block a user