mirror of
https://github.com/linuxserver/docker-boinc.git
synced 2026-02-20 05:47:06 +08:00
changes for new gclient version, improve device perms
This commit is contained in:
parent
c85cba0d19
commit
5f720d6bf4
@ -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.
|
||||
|
||||
@ -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." }
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user