diff --git a/templates/vine/desktop/Dockerfile.ubuntu b/templates/vine/desktop/Dockerfile.ubuntu index 42c5c4b8..88b1e702 100644 --- a/templates/vine/desktop/Dockerfile.ubuntu +++ b/templates/vine/desktop/Dockerfile.ubuntu @@ -167,6 +167,8 @@ RUN apt-get update && apt-get install -y \ "${USER_SHELL}" \ wget \ zip \ + # Core (BMC) + ipmitool \ # Core (CLI) jq \ yq \ @@ -488,6 +490,10 @@ RUN apt-get update && apt-get install -y \ # Link default system-wide font config && ln -sf "/home/${USER_NAME}/.config/fontconfig/conf.d/99-openark.conf" /etc/fonts/conf.d/99-openark.conf \ && rm -f /etc/fonts/conf.d/65-nonlatin.conf \ + # Printer Configuration + && echo 'a4' >/etc/papersize \ + && mkdir -p /etc/cups /etc/cupshelpers /var/log/cups /usr/lib/cups /var/cache/cups /run/cups /var/spool/cups \ + && chown -R user:lpadmin /etc/cups /etc/cupshelpers /var/log/cups /usr/lib/cups /var/cache/cups /run/cups /var/spool/cups \ # Remove conflicted repositories && rm -f /etc/apt/sources.list.d/vscode.list \ # X11 Configuration @@ -747,13 +753,15 @@ RUN mkdir -p /opt/public/ \ # Add scripts ADD ./config/weston.ini /etc/xdg/weston/weston.ini +ADD ./polkit/rules.d/* /etc/polkit-1/rules.d/ ADD ./scripts /opt/scripts/ -RUN chmod 0555 /opt/scripts/* +RUN chmod 0400 /etc/polkit-1/rules.d/* \ + && chmod 0555 /opt/scripts/* # Add a user RUN /sbin/ldconfig.real \ && groupadd -g "${USER_GID}" -o "${USER_NAME}" \ - && useradd -u "${USER_UID}" -g "${USER_GID}" -G "audio,cdrom,input,render,video" \ + && useradd -u "${USER_UID}" -g "${USER_GID}" -G "audio,cdrom,input,lpadmin,render,video" \ -s "/bin/${USER_SHELL}" -m -o "${USER_NAME}" \ && printf "${USER_UID}:2001:65535" > /etc/subuid \ && printf "${USER_GID}:2001:65535" > /etc/subgid \ diff --git a/templates/vine/desktop/polkit/rules.d/49-allow-passwordless-printer-admin.rules b/templates/vine/desktop/polkit/rules.d/49-allow-passwordless-printer-admin.rules new file mode 100644 index 00000000..38172efe --- /dev/null +++ b/templates/vine/desktop/polkit/rules.d/49-allow-passwordless-printer-admin.rules @@ -0,0 +1,6 @@ +polkit.addRule(function(action, subject) { + if (action.id == "org.opensuse.cupspkhelper.mechanism.all-edit" && + subject.isInGroup("wheel")){ + return polkit.Result.YES; + } +}); diff --git a/templates/vine/desktop/scripts/init-desktop-session.sh b/templates/vine/desktop/scripts/init-desktop-session.sh index 2f8504b3..f57f5232 100755 --- a/templates/vine/desktop/scripts/init-desktop-session.sh +++ b/templates/vine/desktop/scripts/init-desktop-session.sh @@ -8,6 +8,9 @@ set -e -o pipefail # Verbose set -x +# Run Printer (CUPS) daemon +cupsd || true + # Remove Google Chrome singletons rm -rf \ "${HOME}/.config/google-chrome/SingletonCookie" \