Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make default recordings dir writable also for webserver #37

Merged

Conversation

andrey-utkin
Copy link
Contributor

Issue bluecherrydvr/bluecherry-apps#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 setup code.
bluecherry-apps code will be amended to handle this, too.

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

Issue bluecherrydvr/bluecherry-apps#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 setup code.
bluecherry-apps code will be amended to handle this, too.

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
@andrey-utkin andrey-utkin force-pushed the recordings-dir-not-writable branch from 4bd1962 to e116788 Compare November 24, 2023 01:01
@andrey-utkin andrey-utkin changed the title Make default recordings dir writable also for webserver (on top of PR#36) Make default recordings dir writable also for webserver Nov 24, 2023
@andrey-utkin andrey-utkin marked this pull request as draft November 24, 2023 01:19
@curtishall curtishall marked this pull request as ready for review November 28, 2023 01:14
@curtishall curtishall merged commit f38b5cf into bluecherrydvr:master Nov 28, 2023
1 of 2 checks passed
@andrey-utkin
Copy link
Contributor Author

@curtishall
I apologise for the confusion - this change didn't work in my test, it should not have been merged.

This should work, although I still haven't tested it to the end bluecherrydvr/bluecherry-apps#627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants