[debian-edu-commits] [Git][debian-edu/debian-edu-config][master] 2 commits: libexec/debian-edu-apache2-update-tjener-aliases: Stop modifying the...

Mike Gabriel (@sunweaver) gitlab at salsa.debian.org
Sat Nov 7 22:25:33 GMT 2026



Mike Gabriel pushed to branch master at Debian Edu / debian-edu-config


Commits:
ee263553 by Mike Gabriel at 2026-11-07T23:25:10+01:00
libexec/debian-edu-apache2-update-tjener-aliases: Stop modifying the apache2_tjener-aliases.map under /usr at runtime

Instead, create a copy on first install to /var/lib/debian-edu/ and
update it there in regular intervals.

Plus some typo/grammar fixes.

(Closes: #153381)

- - - - -
79cfefad by Mike Gabriel at 2026-11-07T23:25:26+01:00
etc/apache2/sites-available/debian-edu-default.conf: Don't redirect sitesummary-client requests to https

The sitesummary-client tool cannot handle 302-moved-permanently return codes
gracefully and aborts with failure.

(Closes: #1153379).

- - - - -


4 changed files:

- debian/debian-edu-config.postinst
- etc/apache2/sites-available/debian-edu-default.conf
- libexec/debian-edu-apache2-update-tjener-aliases
- share/debian-edu-config/apache2_tjener-aliases.map → share/debian-edu-config/apache2_tjener-aliases.map.template


Changes:

=====================================
debian/debian-edu-config.postinst
=====================================
@@ -217,6 +217,11 @@ if grep -q Main-Server /etc/debian-edu/config; then
 	fi
 fi
 
+# Take the /usr/share/debian-edu-config/apache2_tjener-aliases.map.template and create the runtime file from it.
+if [ ! -e /var/lib/debian-edu/apache2_tjener-aliases.map ]; then
+	cp /usr/share/debian-edu-config/apache2_tjener-aliases.map.template /var/lib/debian-edu/apache2_tjener-aliases.map
+fi
+
 # Register all changes done by this postinst script
 if command -v etckeeper > /dev/null ; then
     etckeeper commit "end of debian-edu-config postinst" || true


=====================================
etc/apache2/sites-available/debian-edu-default.conf
=====================================
@@ -8,24 +8,28 @@
 	UseCanonicalName On
 
 	RewriteEngine On
-	RewriteMap tjeneralias "txt:/usr/share/debian-edu-config/apache2_tjener-aliases.map"
+	RewriteMap tjeneralias "txt:/var/lib/debian-edu/apache2_tjener-aliases.map"
 
 	# 1. Exclusions: Skip the redirect rules entirely for wpad.dat and Debian-Edu_rootCA.crt
 	RewriteCond %{REQUEST_URI} \.(?:dat|crt)$ [NC]
 	RewriteRule ^ - [L]
 
-	# 2. Check if the requested HTTP Host matches Edu IP subnet e.g. 10.x.x.x/8 subnet..
+	# 2. Exclusions: sitesummary-client cannot handle 302 Moved permanently return codes
+	RewriteCond %{REQUEST_URI} ^/cgi-bin/sitesummary-collector\.cgi$ [NC]
+	RewriteRule ^ - [L]
+
+	# 3. Check if the requested HTTP Host matches Edu IP subnet e.g. 10.x.x.x/8 subnet..
 	#    NOTE: Single IPs should be part of the TJENER alias map.
 	#    NOTE: .999.999 is technically possible, but harmless.
 	RewriteCond %1 ^10\.\d{1,3}\.\d{1,3}\.\d{1,3}$ [OR]
 
-	# 3. Path A (The Happy Path): HTTP Host is a known TJENER alias
+	# 4. Path A (The Happy Path): HTTP Host is a known TJENER alias
 	#    We strip the port, check the map. If it matches, redirect preserving the requested name.
 	RewriteCond %{HTTP_HOST} ^([^:]+)
 	RewriteCond ${tjeneralias:%1|DENY} ^ALLOW$ [NC]
 	RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
 
-	# 4. Path B (The Fallback): HTTP Host is not a known TJENER alias
+	# 5. Path B (The Fallback): HTTP Host is not a known TJENER alias
 	#    If the request makes it past Rule 3 without triggering the [L] flag,
 	#    it means the name was not in the map. We safely redirect to the static ServerName.
 	RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R=301,L]


=====================================
libexec/debian-edu-apache2-update-tjener-aliases
=====================================
@@ -18,7 +18,7 @@ set -euo pipefail
 # Configuration
 # -----------------------------------------------------------------------------
 SCRIPT_PATH="/usr/libexec/debian-edu-config/debian-edu-apache2-update-tjener-aliases"
-MAP_FILE="/usr/share/debian-edu-config/apache2_tjener-aliases.map"
+MAP_FILE="/var/lib/debian-edu/apache2_tjener-aliases.map"
 BACKUP_DIR="/var/backups/apache2-tjener-aliases"
 LDAP_BASE="relativeDomainName=tjener,zoneName=intern,cn=tjener,ou=servers,ou=systems,dc=skole,dc=skolelinux,dc=no"
 LDAP_OPTS="-x"


=====================================
share/debian-edu-config/apache2_tjener-aliases.map → share/debian-edu-config/apache2_tjener-aliases.map.template
=====================================
@@ -26,7 +26,7 @@ localhost            ALLOW
 # ---------------------------
 # |   Debian Edu defaults   |
 # ---------------------------
-# NOTE: 10.x.x.x/8 network is allowed, so next line is redundand.
+# NOTE: 10.x.x.x/8 network is allowed, so next line is redundant.
 10.0.2.2             ALLOW
 www                  ALLOW
 www.intern           ALLOW
@@ -38,7 +38,7 @@ ldap.intern          ALLOW
 
 
 # ----- IMPORTANT HAND-EDIT ADDITIONS -----
-# If a user browses to the raw IP and it is not here, it will trigger a 302
+# If a user browses to the raw IP and it is not listed here, it will trigger a 302
 # response to a pre-defined server name.
 # Add any other IP addresses assigned to Tjeners interfaces:
 # 172.16.0.51          ALLOW



View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/compare/e84cd2d969d1934b168c7703e8d747d10e34e72b...79cfefadf191b986d9feae1265f9d6f0a5ac16a1

-- 
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/compare/e84cd2d969d1934b168c7703e8d747d10e34e72b...79cfefadf191b986d9feae1265f9d6f0a5ac16a1
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-commits/attachments/20261107/052decaa/attachment-0001.htm>


More information about the debian-edu-commits mailing list