From f8abc5d351b6fa2293593d394a80c83665d5729d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 28 Jun 2019 16:56:22 +0200 Subject: [pam-slx-plug] Move old pam_script_* hook dirs to pam dir They're all now in subdirectories of /opt/openslx/pam/hooks. Symlinks have been put in place where they used to reside. --- .../pam/hooks/session-open.d/00-chromium-policies | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 core/modules/kiosk-chromium/data/opt/openslx/pam/hooks/session-open.d/00-chromium-policies (limited to 'core/modules/kiosk-chromium/data/opt/openslx/pam/hooks/session-open.d/00-chromium-policies') diff --git a/core/modules/kiosk-chromium/data/opt/openslx/pam/hooks/session-open.d/00-chromium-policies b/core/modules/kiosk-chromium/data/opt/openslx/pam/hooks/session-open.d/00-chromium-policies new file mode 100644 index 00000000..743d53ed --- /dev/null +++ b/core/modules/kiosk-chromium/data/opt/openslx/pam/hooks/session-open.d/00-chromium-policies @@ -0,0 +1,37 @@ +#!/bin/bash +# ^SOURCED, actually running in ash + +. /opt/openslx/config + +chromium_policies() { + # create managed policy file, those settings cannot be changed by the user + # (if he even gets to the settings dialog in the first place) + local chromium_policy_file="/etc/chromium-browser/policies/managed/kiosk-mode.json" + [ -e "$chromium_policy_file" ] && rm -f "$chromium_policy_file" + + mkdir -p ${chromium_policy_file%/*} + + if [ -n "$SLX_BROWSER_BOOKMARKS" ]; then + bookmarkbar=true + else + bookmarkbar=false + fi + + cat <<- EOF > "$chromium_policy_file" + { + "AutoFillEnabled": false, + "BackgroundModeEnabled": false, + "BookmarkBarEnabled": $bookmarkbar, + "DefaultBrowserSettingEnabled": true, + "DownloadRestrictions": 3, + "PasswordManagerEnabled": false, + "ShowAppsShortcutInBookmarkBar": false, + "TranslateEnabled": false + } + EOF +} + +if [ "${PAM_SERVICE//autologin/}" != "$PAM_SERVICE" -a "$PAM_TTY" = ":0" ]; then + chromium_policies +fi +true -- cgit v1.2.3-55-g7522