Skip to content

Commit

Permalink
Docker: Add apache config file
Browse files Browse the repository at this point in the history
  • Loading branch information
quartje committed Nov 17, 2023
1 parent 96349a0 commit b99d4de
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
1 change: 1 addition & 0 deletions manage-gui/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FROM ghcr.io/openconext/openconext-basecontainers/apache2-shibboleth:latest
COPY ./build/ /var/www/
COPY ./docker/conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
77 changes: 77 additions & 0 deletions manage-gui/docker/conf/000-default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
RewriteEngine on

RewriteCond %{REQUEST_URI} !\.html$
RewriteCond %{REQUEST_URI} !\.(js|css)(\.map)?$
RewriteCond %{REQUEST_URI} !\.svg$
RewriteCond %{REQUEST_URI} !\.png$
RewriteCond %{REQUEST_URI} !\.ico$
RewriteCond %{REQUEST_URI} !\.woff$
RewriteCond %{REQUEST_URI} !\.woff2$
RewriteCond %{REQUEST_URI} !\.ttf$
RewriteCond %{REQUEST_URI} !\.eot$
RewriteCond %{REQUEST_URI} !^/(asset-)?manifest.json$
RewriteCond %{REQUEST_URI} !^/manage
RewriteCond %{REQUEST_URI} !^/internal
RewriteCond %{REQUEST_URI} !^/fonts
RewriteRule (.*) /index.html [L]

ProxyPass /Shibboleth.sso !
ProxyPass /manage/api/health http://manage/internal/health
ProxyPass /manage/api/info http://manage/internal/info

ProxyPass /internal/health http://manage/internal/health
ProxyPass /internal/info http://manage/internal/info

ProxyPass /manage/api http://manage
ProxyPassReverse /manage/api http://manage

###########################################################################
# Backdoor instructions #
# ------------------------------------------------------------------------#
# Manage offers the ability to use basic authentication to login #
# In order to activate it, remove the <Location> </Location> block below #
# and restart httpd #
# The username and password can be found in the manage application.yml #
# #########################################################################

PassEnv OPENCONEXT_REMOTE_ENTITYID
PassEnv OPENCONEXT_OWN_ENTITYID
<Location />
AuthType shibboleth
ShibUseHeaders On
ShibRequestSetting entityID ${OPENCONEXT_REMOTE_ENTITYID}
ShibRequestSetting entityIDSelf ${OPENCONEXT_OWN_ENTITYID}
ShibRequireSession On
ShibRequestSetting REMOTE_ADDR X-Forwarded-For
Require valid-user
</Location>

DocumentRoot "/var/www"

<Directory "/var/www">
Require all granted
Options -Indexes
</Directory>

# Enable shibboleth for all other URLs, but the health check and info endpoint
<Location ~ "/manage/api/(health|info)">
Require all granted
</Location>

<Location ~ "/internal/(health|info)">
Require all granted
</Location>

# The internal API is secured with basic auth
<Location ~ "/manage/api/internal/">
Require all granted
</Location>

<Location ~ "(.*)(eot|svg|ttf|woff2|woff|html|js|js\.map|css|css\.map|png|jpg|ico)$">
Require all granted
</Location>

<Location ~ "/(asset-)?manifest.json$">
Require all granted
</Location>

0 comments on commit b99d4de

Please sign in to comment.