Skip to content

Commit 520d974

Browse files
committed
FIX simplesamlphp sp can't bind to port 80 in kube
Only happened when I tried to deploy on kubernetes. Might be because we're running as www-data and not root, so it doesn't have permission. This wasn't an issue with docker compose because local docker apparently treats all ports as unprivileged. Changed the sp port to 8080, this is mainly apache configuration and adjusting traefik.
1 parent 6c0bb1b commit 520d974

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

LocalSettings.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ function loadenv($envName, $default = "") {
640640
'realNameAttribute' => 'urn:oid:2.16.840.1.113730.3.1.241',
641641
# mail attribute, email address
642642
'emailAttribute' => 'urn:oid:0.9.2342.19200300.100.1.3',
643+
# UBCAuth required attributes:
643644
# eduPersonAffiliation, an array of (staff, student, faculty, etc)
644645
'eduPersonAffiliationAttribute' => 'urn:oid:1.3.6.1.4.1.5923.1.1.1.1',
645646
# non-standard attributes, uncertain OIDs

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ services:
5454
- "traefik.enable=true"
5555
- "traefik.http.routers.sp.rule=PathPrefix(`/_saml2`)"
5656
- "traefik.http.routers.sp.entrypoints=wiki"
57-
- "traefik.http.services.sp.loadBalancer.server.port=80"
57+
- "traefik.http.services.sp.loadBalancer.server.port=8080"
5858
web: &app
5959
#image: ubcctlt/mediawiki
6060
build: .

docker/simplesamlphp/sp/Dockerfile.sp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,13 @@ RUN composer install && \
3333
COPY config/ config/
3434

3535
COPY apache.conf /etc/apache2/sites-available/000-default.conf
36+
COPY ports.conf /etc/apache2/ports.conf
3637

3738
# copy our custom entrypoint
3839
COPY custom-entrypoint /usr/local/bin/
3940

41+
EXPOSE 8080
42+
4043
# The wiki extension expects the simplesamlphp SP to be installed on the same
4144
# server and will import modules from the running SP. But we want the SP to run
4245
# in its own container. The only way the wiki container will be able to access

docker/simplesamlphp/sp/apache.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<VirtualHost *:80>
1+
<VirtualHost *:8080>
22
# The ServerName directive sets the request scheme, hostname and port that
33
# the server uses to identify itself. This is used when creating
44
# redirection URLs. In the context of virtual hosts, the ServerName

docker/simplesamlphp/sp/ports.conf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# If you just change the port or add more ports here, you will likely also
2+
# have to change the VirtualHost statement in
3+
# /etc/apache2/sites-enabled/000-default.conf
4+
5+
Listen 8080
6+
7+
<IfModule ssl_module>
8+
Listen 443
9+
</IfModule>
10+
11+
<IfModule mod_gnutls.c>
12+
Listen 443
13+
</IfModule>
14+
15+
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

0 commit comments

Comments
 (0)