Skip to content
Commits on Source (3)
......@@ -42,6 +42,7 @@ CFFILES = \
cf.adduser \
cf.apache2 \
cf.apt \
cf.chromium \
cf.cfengine \
cf.cups \
cf.dhcpserver \
......@@ -388,6 +389,7 @@ install: install-testsuite
share/debian-edu-config/tools/squid-update-cachedir \
share/debian-edu-config/tools/subnet-change \
share/debian-edu-config/tools/update-firefox-homepage \
share/debian-edu-config/tools/update-chromium-homepage \
share/debian-edu-config/tools/update-proxy-from-wpad \
share/debian-edu-config/tools/wpad-extract \
share/debian-edu-config/tools/debian-edu-dovecot-create-cert \
......
shellcommands:
# Change default Chromium homepage. Standalone machines get our project page,
# while school machines get the school start page from LDAP.
# The clients using LDAP also update the pages at boot.
debian.installation.standalone::
"/usr/share/debian-edu-config/tools/update-chromium-homepage http\://www.skolelinux.org/"
debian.installation.!standalone::
"/usr/share/debian-edu-config/tools/update-chromium-homepage ldap\:homepage"
debian-edu-config (1.929+deb9u2) UNRELEASED; urgency=medium
[ Wolfgang Schweer ]
* Fix configuration of personal web pages. (Closes: #866228).
- Set right order of linking in cf/cf.apache2.
- Add conditional code to d/d-e-c.postinst to fix the wrong configuration
......@@ -13,6 +14,18 @@ debian-edu-config (1.929+deb9u2) UNRELEASED; urgency=medium
otherwise installation fails because the Release file is expired.
- 032-edu-pkgs: Move all diskless workstation installation parts to
the finalization stage of LTSP chroot installation.
* Enable Chromium homepage setting at installation time and via LDAP.
- Add cf/cf.chromium (cfengine).
- Add debian/debian-edu-config.chromium-ldapconf (init script).
- Add share/debian-edu-config/tools/update-chromium-homepage (used by
both cfengine and the init script).
- Adjust Makefile and debian/rules. (Closes: #891262).
[ Mike Gabriel ]
* update-chromium-homepage:
- Don't complain about non-existing config file when attempting its removal.
- Don't statically set http://www as homepage, use detected homepage
instead. (Closes: #911790)
-- Wolfgang Schweer <wschweer@arcor.de> Mon, 29 Oct 2018 19:07:55 +0100
......
#!/bin/sh
### BEGIN INIT INFO
# Provides: chromium-ldapconf
# Required-Start: $remote_fs slapd
# Required-Stop: $remote_fs
# Should-Start: $network $syslog $named slapd fetch-ldap-cert
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Update chromium configuration from LDAP
# Description:
# Update default chromium default setup (currently only homepage)
# from LDAP. Check LDAP every boot to see if the default homepage
# should be changed or not.
### END INIT INFO
#
# Author: Petter Reinholdtsen <pere@hungry.com>
# Date: 2011-12-31
set -e
. /lib/lsb/init-functions
if [ -e /etc/debian-edu/config ] ; then
. /etc/debian-edu/config
fi
do_start() {
# Skip this on LTSP chroots
if [ -e /etc/ltsp_chroot ] ; then
return
fi
# Only networked profiles use LDAP
if echo "$PROFILE" | egrep -q 'Main-Server|Workstation|Roaming-Workstation|LTSP-Server|Thin-Client-Server|Minimal' ; then
/usr/share/debian-edu-config/tools/update-chromium-homepage ldap:homepage
fi
if echo "$PROFILE" | grep -q LTSP-Server && [ -d /opt/ltsp ] ; then
for ltsp_chroot in `find /opt/ltsp/ -mindepth 1 -maxdepth 1 -type d`; do
chroot $ltsp_chroot /usr/share/debian-edu-config/tools/update-chromium-homepage ldap:homepage
done
fi
}
case "$1" in
start)
do_start
;;
stop)
;;
restart|force-reload)
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload}"
exit 2
esac
exit 0
......@@ -2,6 +2,7 @@ etc
etc/apache2
etc/apache2/sites-available
etc/apache2/mods-available
etc/chromium/policies/managed
etc/cfengine/debian-edu
etc/courier
etc/cron.d
......
......@@ -13,6 +13,7 @@ override_dh_installinit:
dh_installinit --init-script fetch-ldap-cert -r --no-start -u"start 95 2 3 4 5 ."
# Start it after 15bind9, 19slapd and 95fetch-ldap-cert, and add some to be sure
dh_installinit --init-script firefox-ldapconf -r --no-start -u"start 96 2 3 4 5 ."
dh_installinit --init-script chromium-ldapconf -r --no-start -u"start 97 2 3 4 5 ."
dh_installinit --init-script enable-nat --no-start
override_dh_gconf:
......
#!/bin/sh
#
# Set default Chromium homepage based on URL fetched from
# command line or LDAP.
set -e
etcfile=/etc/chromium/policies/managed/debian-edu-homepage-ldap.json
if [ ldap:homepage = "$1" ] ; then
# Allow lookup script to be replaced using /etc/debian-edu/config
GETDEFAULTHOMEPAGE=/usr/share/debian-edu-config/tools/get-default-homepage
if [ -e /etc/debian-edu/config ] ; then
. /etc/debian-edu/config
fi
url="$($GETDEFAULTHOMEPAGE || true)"
if [ -z "$url" ] ; then # No LDAP available On main-server during installation
url="https://www/"
fi
else
url="$1"
fi
if [ -z "$url" ] || [ "about:blank" = "$url" ]; then
rm $etcfile
else
cat > $etcfile.new <<EOF
{
"HomepageLocation" : "$url",
"HomepageIsNewTabPage" : false
}
EOF
chmod 644 $etcfile.new
if cmp -s $etcfile $etcfile.new ; then
rm $etcfile.new
else
mv $etcfile.new $etcfile
logger -t update-chromium-homepage "Updated Chromium default homepage to $url."
fi
fi