Skip to content

Commit

Permalink
Make default recordings dir writable also for webserver
Browse files Browse the repository at this point in the history
Issue bluecherrydvr#620
arises because the dir exists, is owned by bluecherry:bluecherry, but is
by default writable only by owning user, but not the owning group.

Fix this here in docker image building code.

root@df79d5606903:~# sudo -u www-data php -r "echo is_writable('/var/lib/bluecherry/recordings') ? 'writable' : 'not writable';"; echo
not writable
root@df79d5606903:~# sudo -u www-data touch /var/lib/bluecherry/recordings/www-data.was.here
touch: cannot touch '/var/lib/bluecherry/recordings/www-data.was.here': Permission denied
root@df79d5606903:~# id
uid=0(root) gid=0(root) groups=0(root)
root@df79d5606903:~# id www-data
uid=33(www-data) gid=33(www-data) groups=33(www-data),4(adm),20(dialout),29(audio),44(video),999(bluecherry)
root@df79d5606903:~# ls -l /var/lib/bluecherry/recordings -d
drwxr-xr-x 2 bluecherry bluecherry 4096 Nov 24 00:36 /var/lib/bluecherry/recordings
root@df79d5606903:~# chmod g+w /var/lib/bluecherry/recordings
root@df79d5606903:~# ls -l /var/lib/bluecherry/recordings -d
drwxrwxr-x 2 bluecherry bluecherry 4096 Nov 24 00:36 /var/lib/bluecherry/recordings
root@df79d5606903:~# sudo -u www-data touch /var/lib/bluecherry/recordings/www-data.was.here
root@df79d5606903:~# sudo -u www-data php -r "echo is_writable('/var/lib/bluecherry/recordings') ? 'writable' : 'not writable';"; echo
writable
  • Loading branch information
andrey-utkin committed Nov 24, 2023
1 parent 23eb396 commit ec77668
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion actions/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ RUN /usr/sbin/groupadd -rf \
|| echo "bluecherry user already exists"

RUN mkdir /recordings \
&& chown bluecherry:bluecherry /recordings
&& chown bluecherry:bluecherry /recordings \
&& chmod ug=rwx,o=rx /recordings

EXPOSE 7001/tcp 7002/tcp

Expand Down

0 comments on commit ec77668

Please sign in to comment.