summaryrefslogtreecommitdiffstats
path: root/core/modules/kiosk-chromium/data/opt/openslx/pam/hooks/session-open.d/00-chromium-policies
diff options
context:
space:
mode:
authorSimon Rettberg2019-06-28 16:56:22 +0200
committerroot2019-06-28 17:12:49 +0200
commitf8abc5d351b6fa2293593d394a80c83665d5729d (patch)
treee24a9ee760e50f66cf6698eaf0a73ee104b2b93b /core/modules/kiosk-chromium/data/opt/openslx/pam/hooks/session-open.d/00-chromium-policies
parent[pam-slx-plug] Move slx-plug specific hook directory (diff)
downloadmltk-f8abc5d351b6fa2293593d394a80c83665d5729d.tar.gz
mltk-f8abc5d351b6fa2293593d394a80c83665d5729d.tar.xz
mltk-f8abc5d351b6fa2293593d394a80c83665d5729d.zip
[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.
Diffstat (limited to 'core/modules/kiosk-chromium/data/opt/openslx/pam/hooks/session-open.d/00-chromium-policies')
-rw-r--r--core/modules/kiosk-chromium/data/opt/openslx/pam/hooks/session-open.d/00-chromium-policies37
1 files changed, 37 insertions, 0 deletions
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