From f39e478e44ddb4b0c4ad7a5cb4d1925f7f25a1ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andrej=20Rama=C5=A1euski?= <andrej@sedlistka.cz>
Date: Wed, 11 Dec 2019 20:55:43 +0100
Subject: [PATCH] Prejmenovani metadat

---
 entrypoint.sh        | 5 +++--
 mod_auth_mellon.conf | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/entrypoint.sh b/entrypoint.sh
index fbabcab..bf47e8d 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -34,11 +34,12 @@ if [ ! -f /etc/apache2/saml2/${HOST}.xml ]; then
     pushd /etc/apache2/saml2
      echo -e "Generating new service provider certificate.\n\n" 
      /usr/sbin/mellon_create_metadata https://${HOST}/mellon/metadata https://${HOST}/mellon
+    mv http*.xml sp.xml
+    mv http*.key sp.key
+    mv http*.cert sp.cert
     popd
 fi
 
-sed -i "s/{{SP_ID}}/${HOST}/g" /etc/apache2/conf-enabled/mod_auth_mellon.conf
-
 # Check if database is available
 if [ -z "$DB_SOCK" ]; then
     until nc -z -v -w30 $DB_HOST $DB_PORT
diff --git a/mod_auth_mellon.conf b/mod_auth_mellon.conf
index 1bf0425..7b9b0ac 100644
--- a/mod_auth_mellon.conf
+++ b/mod_auth_mellon.conf
@@ -1,9 +1,9 @@
 <Location / >
  MellonEnable info
  MellonEndpointPath /mellon
- MellonSPPrivateKeyFile /etc/apache2/saml2/{{SP_ID}}.key
- MellonSPCertFile       /etc/apache2/saml2/{{SP_ID}}.cert
- MellonSPMetadataFile   /etc/apache2/saml2/{{SP_ID}}.xml
+ MellonSPPrivateKeyFile /etc/apache2/saml2/sp.key
+ MellonSPCertFile       /etc/apache2/saml2/sp.cert
+ MellonSPMetadataFile   /etc/apache2/saml2/sp.xml
  MellonIdPMetadataFile  /etc/apache2/saml2/idp.xml
 </Location>
 
-- 
GitLab