Skip to content

Commit 4687308

Browse files
coliseeRobin Alexander
andauthored
Fix permissions issues when using bind mounts (#191)
* Create a link to /var/www/html only when /var/www/${APP_PATH} does not exist * Fix permissions when taking into account the usage of env APP_PATH * Adapt virtual server config file inside /etc/apache2/sites-available * Fix port substitution in /etc/apache2/sites-available/000-default.conf * Add instructions when using bind mounts --------- Co-authored-by: Robin Alexander <colisee@hotmail>
1 parent f96c573 commit 4687308

3 files changed

Lines changed: 27 additions & 17 deletions

File tree

RUN.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ For instance:
4141

4242
* favicon: `/var/www/html/Web/favicon.ico`
4343

44+
## Bind mounts
45+
46+
If you are using bind mounts for librebooking, then you need to grant
47+
the required permissions before running the librebooking container
48+
49+
```sh
50+
sudo mkdir --parents <bind_dir_path>
51+
sudo chown go+rwx <bind_dir_path>
52+
```
53+
4454
## Backround jobs
4555

4656
Several services in librebooking such as reminder emails require a job

bin/entrypoint.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,15 @@ fi
108108
if [ -n "${APP_PATH}" ]; then
109109
## Set server document root 1 directory up
110110
sed \
111-
-i /etc/apache2/sites-enabled/000-default.conf \
111+
-i /etc/apache2/sites-available/000-default.conf \
112112
-e "s:/var/www/html:/var/www:"
113113

114114
## Create a link to the html directory
115-
pushd /var/www
116-
ln -s html "${APP_PATH}"
117-
popd
115+
if ! [ -e "/var/www/${APP_PATH}" ]; then
116+
pushd /var/www
117+
ln -s html "${APP_PATH}"
118+
popd
119+
fi
118120

119121
## Adapt the .htaccess file
120122
sed \

setup.sh

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ sed \
4747
-e 's/Listen 443/Listen 8443/'
4848
sed \
4949
-i /etc/apache2/sites-available/000-default.conf \
50-
-e 's/<VirtualHost *:80>/<VirtualHost *:8080>/'
50+
-e 's/<VirtualHost \*:80>/<VirtualHost \*:8080>/'
5151

5252
if [ -f /var/www/html/composer.json ]; then
5353
sed \
@@ -65,17 +65,15 @@ if ! [ -d /var/www/html/tpl_c ]; then
6565
fi
6666
mkdir /var/www/html/Web/uploads/reservation
6767

68-
chown --recursive www-data:root \
69-
/var/www/html/config \
70-
/var/www/html/plugins \
71-
/var/www/html/tpl_c \
72-
/var/www/html/Web/uploads/images \
73-
/var/www/html/Web/uploads/reservation \
68+
chown www-data:root \
69+
/var/www \
7470
/usr/local/etc/php/conf.d/librebooking.ini
75-
chmod --recursive g+rwx \
76-
/var/www/html/config \
77-
/var/www/html/plugins \
78-
/var/www/html/tpl_c \
79-
/var/www/html/Web/uploads/images \
80-
/var/www/html/Web/uploads/reservation \
71+
chmod g+rwx \
72+
/var/www \
8173
/usr/local/etc/php/conf.d/librebooking.ini
74+
chown --recursive www-data:root \
75+
/etc/apache2/sites-available \
76+
/var/www/html/tpl_c
77+
chmod --recursive g+rwx \
78+
/etc/apache2/sites-available \
79+
/var/www/html/tpl_c

0 commit comments

Comments
 (0)