diff --git a/RUN.md b/RUN.md index 51fb124..e0c8430 100644 --- a/RUN.md +++ b/RUN.md @@ -41,6 +41,16 @@ For instance: * favicon: `/var/www/html/Web/favicon.ico` +## Bind mounts + +If you are using bind mounts for librebooking, then you need to grant +the required permissions before running the librebooking container + +```sh +sudo mkdir --parents +sudo chown go+rwx +``` + ## Backround jobs Several services in librebooking such as reminder emails require a job diff --git a/bin/entrypoint.sh b/bin/entrypoint.sh index e63f2e9..3bdb4d7 100644 --- a/bin/entrypoint.sh +++ b/bin/entrypoint.sh @@ -108,13 +108,15 @@ fi if [ -n "${APP_PATH}" ]; then ## Set server document root 1 directory up sed \ - -i /etc/apache2/sites-enabled/000-default.conf \ + -i /etc/apache2/sites-available/000-default.conf \ -e "s:/var/www/html:/var/www:" ## Create a link to the html directory - pushd /var/www - ln -s html "${APP_PATH}" - popd + if ! [ -e "/var/www/${APP_PATH}" ]; then + pushd /var/www + ln -s html "${APP_PATH}" + popd + fi ## Adapt the .htaccess file sed \ diff --git a/setup.sh b/setup.sh index 8462b8b..b55b16f 100644 --- a/setup.sh +++ b/setup.sh @@ -47,7 +47,7 @@ sed \ -e 's/Listen 443/Listen 8443/' sed \ -i /etc/apache2/sites-available/000-default.conf \ - -e 's///' + -e 's///' if [ -f /var/www/html/composer.json ]; then sed \ @@ -65,17 +65,15 @@ if ! [ -d /var/www/html/tpl_c ]; then fi mkdir /var/www/html/Web/uploads/reservation -chown --recursive www-data:root \ - /var/www/html/config \ - /var/www/html/plugins \ - /var/www/html/tpl_c \ - /var/www/html/Web/uploads/images \ - /var/www/html/Web/uploads/reservation \ +chown www-data:root \ + /var/www \ /usr/local/etc/php/conf.d/librebooking.ini -chmod --recursive g+rwx \ - /var/www/html/config \ - /var/www/html/plugins \ - /var/www/html/tpl_c \ - /var/www/html/Web/uploads/images \ - /var/www/html/Web/uploads/reservation \ +chmod g+rwx \ + /var/www \ /usr/local/etc/php/conf.d/librebooking.ini +chown --recursive www-data:root \ + /etc/apache2/sites-available \ + /var/www/html/tpl_c +chmod --recursive g+rwx \ + /etc/apache2/sites-available \ + /var/www/html/tpl_c