#
# Set up Iceweasel to accept the default ssl certificate created through cf.apache2.
#
# Should create cert_override.txt in /etc/iceweasel/profile/ that will be included
# in new Iceweasel profiles created on local host.
# On main server use /etc/skel/ to create a default profile for new
# users in case they start Iceweasel the first time on non configured
# hosts.
#
directories:
	# Check file system is prepared for the local Iceweasel default profile.
	debian.installation.!standalone::
		/etc/iceweasel/profile mode=755 owner=root group=root

	# Check file system is prepared for inclusion in new users home directories.
	debian.installation.server::
		/etc/skel/.mozilla/firefox/debian-edu.default mode=755 owner=root group=root

shellcommands:
	# Enable the default profile.
	debian.installation.server::
		"/usr/bin/update-ini-file /etc/skel/.mozilla/firefox/profiles.ini General StartWithLastProfile 1"
		"/usr/bin/update-ini-file /etc/skel/.mozilla/firefox/profiles.ini Profile0 Name default"
		"/usr/bin/update-ini-file /etc/skel/.mozilla/firefox/profiles.ini Profile0 IsRelative 1"
		"/usr/bin/update-ini-file /etc/skel/.mozilla/firefox/profiles.ini Profile0 Path debian-edu.default"

	# On main server try to assure this is envoked after apache is
	# configured and the new certificate is created by mkslapdcert
	# (firstpass).
	debian.installation.(!standalone.!server.!ltspclient|server.secondpass)::
		# Under certain conditions if ssl server doesn't reply
		# it may wait forever, so limit the time it allowed to
		# run.
		'/usr/sbin/snakeoil-on-ice' timeout=5

	# Change default start page.  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-iceweasel-homepage http\://www.skolelinux.org/"
	debian.installation.!standalone::
		"/usr/share/debian-edu-config/tools/update-iceweasel-homepage ldap\:homepage"

files:
	# Ensure file file is readable by everyone
	debian.installation.server.secondpass::
		/etc/skel/.mozilla/firefox/profiles.ini mode=a+r act=fixall
