diff --git a/README.md b/README.md index 6e0a425..73f3802 100644 --- a/README.md +++ b/README.md @@ -250,6 +250,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **31.01.22:** - Improve device permissions setting verbosity. * **23.03.21:** - Rebase to rdesktop-web baseimage. Deprecate `GUAC_USER` and `GUAC_PASS` env vars. Existing users can set the new var `PASSWORD` for the user `abc`. * **01.04.20:** - Install boinc from ppa. * **17.03.20:** - Add armhf and aarch64 builds and switch to multi-arch image. diff --git a/readme-vars.yml b/readme-vars.yml index 15fadcb..f880607 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -75,6 +75,7 @@ app_setup_block: | # changelog changelogs: + - { date: "31.01.22:", desc: "Improve device permissions setting verbosity." } - { date: "23.03.21:", desc: "Rebase to rdesktop-web baseimage. Deprecate `GUAC_USER` and `GUAC_PASS` env vars. Existing users can set the new var `PASSWORD` for the user `abc`." } - { date: "01.04.20:", desc: "Install boinc from ppa." } - { date: "17.03.20:", desc: "Add armhf and aarch64 builds and switch to multi-arch image." } diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index ed61db7..bf4dfb8 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -8,32 +8,11 @@ mkdir -p \ # clean up old PIDs rm -rf "/config/BOINC Manager-abc" -# handle password access -sed -i 's|"password":"abc",|"password":"kjhbouygiuvhgvghv",|' /gclient/app.js -if ([ -n "$GUAC_USER" ] || [ -n "$GUAC_PASS" ]) && [ -z "$PASSWORD" ]; then - echo ' -******************************************************** -******************************************************** -**** **** -**** GUAC_USER and GUAC_PASS vars are deprecated **** -**** **** -**** Temporary credentials are being set: **** -**** **** -**** User: abc **** -**** Pass: abc **** -**** **** -**** **** -**** See the readme for new credential info **** -**** **** -**** **** -******************************************************** -********************************************************' -elif [ -n "$PASSWORD" ]; then - echo "abc:${PASSWORD}" | chpasswd - echo "Setting password from environment variable." -else - echo "abc:kjhbouygiuvhgvghv" | chpasswd - echo "No password is set for the interface." +if [ -n "$PASSWORD" ]; then + echo "abc:${PASSWORD}" | chpasswd + echo "**** Setting password from environment variable. ****" +else + echo "**** No auth enabled. To enable auth, you can set the PASSWORD var in docker arguments. ****" fi # permissions diff --git a/root/etc/cont-init.d/60-gid-video b/root/etc/cont-init.d/60-gid-video index cf063b2..20545d0 100644 --- a/root/etc/cont-init.d/60-gid-video +++ b/root/etc/cont-init.d/60-gid-video @@ -4,14 +4,17 @@ FILES=$(find /dev/dri -type c -print 2>/dev/null) for i in $FILES do - VIDEO_GID=$(stat -c '%g' "$i") - if ! id -G abc | grep -qw "$VIDEO_GID"; then - VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}') - if [ -z "${VIDEO_NAME}" ]; then - VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8)" - groupadd "$VIDEO_NAME" - groupmod -g "$VIDEO_GID" "$VIDEO_NAME" - fi - usermod -a -G "$VIDEO_NAME" abc - fi + VIDEO_GID=$(stat -c '%g' "$i") + if ! id -G abc | grep -qw "$VIDEO_GID"; then + VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}') + if [ -z "${VIDEO_NAME}" ]; then + VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8)" + groupadd "$VIDEO_NAME" + groupmod -g "$VIDEO_GID" "$VIDEO_NAME" + fi + usermod -a -G "$VIDEO_NAME" abc + if [ $(stat -c '%A' "${i}" | cut -b 5,6) != "rw" ]; then + echo -e "**** The device ${i} does not have group read/write permissions, which might prevent hardware transcode from functioning correctly. To fix it, you can run the following on your docker host: ****\nsudo chmod g+rw ${i}\n" + fi + fi done