links:
	# Enforce proxy on networked installs
	debian.!standalone::
                /etc/iceweasel/pref/debian-edu-networked.js ->
                /usr/share/debian-edu-config/iceweacel-networked-prefs.js nofile=force

# Configure squid, copy our setup to /etc/squid3/ (instead of
# including it in the package as a conffile), to ensure package
# upgrades do not trigger a conffile question from dpkg.
directories:
   debian.server::
    /etc/squid3 mode=755 owner=root group=root  
copy:
   debian.server::
    /usr/share/debian-edu-config/squid3.conf dest=/etc/squid3/squid-debian-edu.conf mode=0644
editfiles:
   debian.server::
    { /etc/default/squid3
      AutoCreate
      AppendIfNoSuchLine "CONFIG=/etc/squid3/squid-debian-edu.conf"
      AppendIfNoSuchLine "SQUID_ARGS=\"-YC -f /etc/squid3/squid-debian-edu.conf\""
    }


   # Disable the automatic proxy configuration on LTSP boot, as the
   # default setup is already correct and not calling
   # wpad-proxy-update shave 3 seconds from the boot.
   debian.ltspclient::
    { /etc/debian-edu/config
      AppendIfNoSuchLine "DHCP_WPAD_PROXY_UPDATE=false"
    }

shellcommands:

   debian.server::

    # Update Squid to use all the available space (aka 80% of the partition)
    "/usr/share/debian-edu-config/tools/squid-update-cachedir /etc/squid3/squid-debian-edu.conf"
    # Migrate to squid3 when ugrading to jessie.
    "/usr/share/debian-edu-config/tools/migrate-squid-to-squid3"

   debian.!server.!standalone.fifthpass::

    # Update /etc/environment and APT configurat using wpad.dat file
    # Do this on fifth pass, to make sure scripts like
    # debian-edu-pxeinstall (forthpass) do not get the wrong proxy
    # setting when installing a main-server and the webcache proxy
    # isn't up yet.
    "/usr/share/debian-edu-config/tools/update-proxy-from-wpad"

   debian.server.fifthpass::
    "/usr/share/debian-edu-config/tools/update-proxy-from-wpad file\:///etc/debian-edu/www/wpad.dat"
