Skip to content
Snippets Groups Projects
Commit d43dd7bf authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Znema SP entity ID

parent f0a2ef9d
No related branches found
No related tags found
No related merge requests found
Pipeline #96 passed
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# Entrypoint for Docker Container # Entrypoint for Docker Container
HOST=${HOST:-'dotazniky.pirati.cz'} HOST=${HOST:-'dotazniky.pirati.cz'}
SP_ID=${SP_ID:-'dotazniky'}
IDP_METADATA=${IDP_METADATA:-'https://auth.pirati.cz/auth/realms/pirati/protocol/saml/descriptor'} IDP_METADATA=${IDP_METADATA:-'https://auth.pirati.cz/auth/realms/pirati/protocol/saml/descriptor'}
DB_TYPE=${DB_TYPE:-'pgsql'} DB_TYPE=${DB_TYPE:-'pgsql'}
...@@ -31,14 +30,14 @@ if [ ! -f /etc/apache2/saml2/idp.xml ]; then ...@@ -31,14 +30,14 @@ if [ ! -f /etc/apache2/saml2/idp.xml ]; then
fi fi
# Create mod_auth_mellon service provider config # Create mod_auth_mellon service provider config
if [ ! -f /etc/apache2/saml2/${SP_ID}.xml ]; then if [ ! -f /etc/apache2/saml2/${HOST}.xml ]; then
pushd /etc/apache2/saml2 pushd /etc/apache2/saml2
echo -e "Generating new service provider certificate.\n\n" echo -e "Generating new service provider certificate.\n\n"
/usr/sbin/mellon_create_metadata ${SP_ID} https://${HOST}/mellon /usr/sbin/mellon_create_metadata https://${HOST}/mellon/metadata https://${HOST}/mellon
popd popd
fi fi
sed -i "s/{{SP_ID}}/${SP_ID}/g" /etc/apache2/conf-enabled/mod_auth_mellon.conf sed -i "s/{{SP_ID}}/${HOST}/g" /etc/apache2/conf-enabled/mod_auth_mellon.conf
# Check if database is available # Check if database is available
if [ -z "$DB_SOCK" ]; then if [ -z "$DB_SOCK" ]; then
......
<Location /admin > <Location / >
AuthType Mellon MellonEnable info
MellonEnable auth
MellonEndpointPath /mellon MellonEndpointPath /mellon
MellonSPPrivateKeyFile /etc/apache2/saml2/{{SP_ID}}.key MellonSPPrivateKeyFile /etc/apache2/saml2/{{SP_ID}}.key
MellonSPCertFile /etc/apache2/saml2/{{SP_ID}}.cert MellonSPCertFile /etc/apache2/saml2/{{SP_ID}}.cert
MellonSPMetadataFile /etc/apache2/saml2/{{SP_ID}}.xml MellonSPMetadataFile /etc/apache2/saml2/{{SP_ID}}.xml
MellonIdPMetadataFile /etc/apache2/saml2/idp.xml MellonIdPMetadataFile /etc/apache2/saml2/idp.xml
</Location>
<Location /admin >
AuthType Mellon
MellonEnable auth
Require valid-user Require valid-user
</Location> </Location>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment