X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=entrypoint.sh;h=dd55cdbb5ed05827ed389ca5a266bfd48bf651a9;hb=4bfcc5bc955257d66b792a00f1ca44fa42616255;hp=7623322067fdf874375a9bee0cb77d7eb229a44f;hpb=b24251110179b86e12d6823618777ef133738861;p=github%2Fbastienwirtz%2Fhomer.git diff --git a/entrypoint.sh b/entrypoint.sh index 7623322..dd55cdb 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,15 @@ #!/bin/sh -yes n | cp -i /www/config.yml.dist /www/config.yml -while true; do echo n; done | cp -Ri /app/dist/www/assets /www/assets 2>/dev/null +# Ensure default assets are present. +while true; do echo n; done | cp -Ri /www/default-assets/* /www/assets/ &> /dev/null -darkhttpd /www/ --no-listing --port $PORT +# Ensure compatibility with previous version (config.yml was in the root directory) +if [ -f "/www/config.yml" ]; then + yes n | cp -i /www/config.yml /www/assets/ &> /dev/null +fi + +# Install default config if no one is available. +yes n | cp -i /www/default-assets/config.yml.dist /www/assets/config.yml &> /dev/null + +chown -R $UID:$GID /www/assets/* +exec su-exec $USER:$GROUP darkhttpd /www/ --no-listing --port "$PORT"