[X2Go-Commits] [live-build-x2go] 27/60: similar to firefox, chromium supports locked preferences as well, so let's set the homepage(s) that way, and add some sane defaults as well

git-admin at x2go.org git-admin at x2go.org
Mon Nov 28 19:43:49 CET 2022


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch feature/mate-minidesktop-buster
in repository live-build-x2go.

commit b7be315dae62dc577d9bffa8870cb8c03ecb3524
Author: Stefan Baur (BAUR-ITCS) <kontakt at baur-itcs.de>
Date:   Mon Jun 22 20:43:47 2020 +0200

    similar to firefox, chromium supports locked preferences as well, so
    let's set the homepage(s) that way, and add some sane defaults as well
---
 .../lib/live/config/2900-chromium-config           | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/config/includes.chroot/lib/live/config/2900-chromium-config b/config/includes.chroot/lib/live/config/2900-chromium-config
new file mode 100755
index 0000000..3edc84d
--- /dev/null
+++ b/config/includes.chroot/lib/live/config/2900-chromium-config
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+function urldecode() {
+	        : "${*//+/ }"; echo -e "${_//%/\\x}";
+	}
+
+ChromiumConfig ()
+{
+	# Output startup message
+	#
+	echo -n " chromiumconfig"
+
+	HOMEPAGEURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' -e 's/ \([^ "'"'"']\)/\n\1/g' /proc/cmdline | \
+		      awk -F'=' ' /^homepageurl=/ { print $2 } ')
+	if [ -z "$HOMEPAGEURL" ] ; then 
+		HOMEPAGEURL='http://www.x2go.org/'
+	else
+		HOMEPAGEURL=$(echo -e "$(urldecode "$HOMEPAGEURL")")
+	fi
+	cat >/etc/chromium/policies/managed/chromium.json <<CHROMIUMCONFIG
+
+// Policy template for Linux.
+// Documentation for this file can be found at
+// https://www.chromium.org/administrators/policy-list-3
+// and/or
+// https://cloud.google.com/docs/chrome-enterprise/policies/
+
+{
+ "AllowFileSelectionDialogs": false,
+ "DownloadDirectory": "/home/\${user_name}/Downloads",
+ "EditBookmarksEnabled": false,
+ "HomepageIsNewTabPage": false,
+ "HomepageLocation": "$HOMEPAGEURL",
+ "ImportBookmarks": false,
+ "ImportHistory": false,
+ "ImportHomepage": false,
+ "ImportSavedPasswords": false,
+ "ImportSearchEngine": false,
+ //"ProxyBypassList": "http://www.example1.com,http://www.example2.com,http://internalsite/",
+ //"ProxyMode": "direct",
+ //"ProxyPacUrl": "http://internal.site/example.pac",
+ //"ProxyServer": "123.123.123.123:8080",
+ "RestoreOnStartup": 4,
+ //   5 = Open New Tab Page
+ //   1 = Restore the last session
+ //   4 = Open a list of URLs
+ "RestoreOnStartupURLs": ["$HOMEPAGEURL"],
+ "ShowHomeButton": true,
+ "SyncDisabled": true,
+ "TranslateEnabled": false,
+}
+CHROMIUMCONFIG
+}
+
+( which chromium >/dev/null || which chromium-browser >/dev/null || which chrome >/dev/null || which chrome-broser >/dev/null ) && ChromiumConfig

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git


More information about the x2go-commits mailing list