From 3f102ce8a53ed7fecb0d81aa00702a35a212b924 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 2 Feb 2023 12:28:45 +0100 Subject: [kiosk-chromium] Adapt to different path name on Debian --- .../openslx/pam/hooks/session-open.d/00-chromium-policies | 12 +++++++++--- .../openslx/pam/hooks/session-open.d/10-chromium-urlfilter | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'core/modules/kiosk-chromium') 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 index c2329d7f..7137f8cf 100644 --- 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 @@ -6,12 +6,15 @@ # creates managed policy file, those settings cannot be changed by the user # (if he even gets to the settings dialog in the first place) create_chromium_policies() { + local bookmarkbar url if [ -n "$SLX_BROWSER_BOOKMARKS" ]; then bookmarkbar=true else bookmarkbar=false fi + url=$( printf "%s" "$SLX_BROWSER_URL" | jq -R . ) + mkdir -p "/etc/chromium-browser/policies/managed" "/etc/chromium/policies/managed" cat <<- EOF > "/etc/chromium-browser/policies/managed/kiosk-mode.json" { "AutoFillEnabled": false, @@ -20,15 +23,18 @@ create_chromium_policies() { "DefaultBrowserSettingEnabled": true, "DeviceAutoUpdateDisabled": true, "DownloadRestrictions": 3, - "HomepageLocation": "$SLX_BROWSER_URL", - "NewTabPageLocation": "$SLX_BROWSER_URL", + "HomepageLocation": $url, + "NewTabPageLocation": "about:blank", "PasswordManagerEnabled": false, "RestoreOnStartup": 4, - "RestoreOnStartupURLs": "$SLX_BROWSER_URL", + "RestoreOnStartupURLs": $url, "ShowAppsShortcutInBookmarkBar": false, "TranslateEnabled": false } EOF + # Ubuntu uses chromium-browser, Debian chromium (...) + ln -nfs "/etc/chromium-browser/policies/managed/kiosk-mode.json" \ + "/etc/chromium/policies/managed/kiosk-mode.json" } if [ "${PAM_SERVICE//autologin/}" != "$PAM_SERVICE" -a "$PAM_TTY" = ":0" ]; then diff --git a/core/modules/kiosk-chromium/data/opt/openslx/pam/hooks/session-open.d/10-chromium-urlfilter b/core/modules/kiosk-chromium/data/opt/openslx/pam/hooks/session-open.d/10-chromium-urlfilter index 0abb8832..f0555260 100644 --- a/core/modules/kiosk-chromium/data/opt/openslx/pam/hooks/session-open.d/10-chromium-urlfilter +++ b/core/modules/kiosk-chromium/data/opt/openslx/pam/hooks/session-open.d/10-chromium-urlfilter @@ -85,6 +85,9 @@ main() { | jq -Rs 'rtrimstr("\n") | split("\n")' fi >> "$url_policy_file" echo '}' >> "$url_policy_file" + # Debian uses chromium instead of chromium-browser -.- + mkdir -p "/etc/chromium/policies/managed" + ln -nfs "$url_policy_file" "/etc/chromium/policies/managed/url-filter.json" } if [ "${PAM_SERVICE//autologin/}" != "$PAM_SERVICE" ] && [ "$PAM_TTY" = ":0" ]; then -- cgit v1.2.3-55-g7522