PHRAS-3318 - Fix phraseanet-saml-sp for kubernets use (#4146)

This commit is contained in:
moctardiouf
2022-10-05 17:39:01 +02:00
committed by GitHub
parent f9de6877d2
commit 9f349e063b
4 changed files with 12 additions and 6 deletions

5
.env
View File

@@ -106,7 +106,7 @@
# - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml # - COMPOSE_FILE=docker-compose.yml:docker-compose.datastores.yml:docker-compose.tools.yml
# - COMPOSE_PROFILES=app,setup,gateway-classic,db,elasticsearch,redis,redis-session,rabbitmq,pma,mailhog,assetsInjest,createRecord,deleteRecord,editRecord, # - COMPOSE_PROFILES=app,setup,gateway-classic,db,elasticsearch,redis,redis-session,rabbitmq,pma,mailhog,assetsInjest,createRecord,deleteRecord,editRecord,
# exportMail,exposeUpload,exportFtp,mainQueue,populateIndex,pullAssets,recordsActions,subdefCreation, # exportMail,exposeUpload,exportFtp,mainQueue,populateIndex,pullAssets,recordsActions,subdefCreation,
# subtitle,validationReminder,webhook,writeMetadatas,shareBasket,scheduler,elk,db-backup,phrasea-sp # subtitle,validationReminder,webhook,writeMetadatas,shareBasket,scheduler,elk,db-backup,phraseanet-saml-sp
# #
@@ -836,8 +836,9 @@ SSH_AUTH_SOCK=/dev/null
# SAML Service provider setting # SAML Service provider setting
# simplesamlphp as service provider for Phraseanet # simplesamlphp as service provider for Phraseanet
# must be associated to a plugin # must be associated to a plugin
# on docker-compose staxk add the profile phrasea-sp # on docker-compose staxk add the profile phraseanet-saml-sp
SAML_ALLOW_DEBUG=true
SAML_PHRASEANET_HOST=http://127.0.0.1:8082 SAML_PHRASEANET_HOST=http://127.0.0.1:8082
SAML_SP_CONFIG_DIR=./saml-config/ SAML_SP_CONFIG_DIR=./saml-config/
SAML_SP_AUTHSOURCES= SAML_SP_AUTHSOURCES=

View File

@@ -93,7 +93,7 @@ services:
- GZIP_LEVEL=${DB_BACKUP_GZIP_LEVEL} - GZIP_LEVEL=${DB_BACKUP_GZIP_LEVEL}
restart: unless-stopped restart: unless-stopped
phrasea-sp: phraseanet-saml-sp:
build: build:
context: . context: .
target: phraseanet-saml-sp target: phraseanet-saml-sp
@@ -101,7 +101,7 @@ services:
- SSH_PRIVATE_KEY=${PHRASEANET_SSH_PRIVATE_KEY} - SSH_PRIVATE_KEY=${PHRASEANET_SSH_PRIVATE_KEY}
- PHRASEANET_PLUGINS=${PHRASEANET_PLUGINS} - PHRASEANET_PLUGINS=${PHRASEANET_PLUGINS}
image: $PHRASEANET_DOCKER_REGISTRY/phraseanet-saml-sp:$PHRASEANET_DOCKER_TAG image: $PHRASEANET_DOCKER_REGISTRY/phraseanet-saml-sp:$PHRASEANET_DOCKER_TAG
profiles: ["phrasea-sp"] profiles: ["phraseanet-saml-sp"]
restart: on-failure restart: on-failure
volumes: volumes:
- ${SAML_IDP_METADATA_LOCAL_CONFIG_DIR}:/var/www/simplesamlphp-1.10.0/metadata:rw - ${SAML_IDP_METADATA_LOCAL_CONFIG_DIR}:/var/www/simplesamlphp-1.10.0/metadata:rw
@@ -120,6 +120,7 @@ services:
- SAML_SP_AUTHSOURCES - SAML_SP_AUTHSOURCES
- SAML_IDP_METADATA_CONFIG - SAML_IDP_METADATA_CONFIG
- SAML_IDP_METADATA_LOCAL_CONFIG_DIR - SAML_IDP_METADATA_LOCAL_CONFIG_DIR
- SAML_ALLOW_DEBUG
ports: ports:
- 8080:8080 - 8080:8080

View File

@@ -12,7 +12,7 @@ upstream backend {
} }
#upstream samlsp { #upstream samlsp {
# server phrasea-sp:8080; # server phraseanet-saml-sp:8080;
#} #}
server { server {
@@ -65,7 +65,7 @@ server {
proxy_redirect off; proxy_redirect off;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
set $target phrasea-sp:8080; set $target phraseanet-saml-sp:8080;
proxy_pass http://$target; proxy_pass http://$target;
} }

View File

@@ -4,9 +4,13 @@ set -e
echo `date +"%Y-%m-%d %H:%M:%S"` " - Starting simplesamlphp sp entrypoint." echo `date +"%Y-%m-%d %H:%M:%S"` " - Starting simplesamlphp sp entrypoint."
if [[ -n $SAML_ALLOW_DEBUG || $SAML_ALLOW_DEBUG == "true" ]]; then
echo "SAML DEBUG IS ENABLED - TO ADD DEFAULT CONFIG"
cp -Rf /var/www/simplesamlphp-1.10.0/config-templates/* /var/www/simplesamlphp-1.10.0/config/ cp -Rf /var/www/simplesamlphp-1.10.0/config-templates/* /var/www/simplesamlphp-1.10.0/config/
cp -Rf /bootstrap/conf.d/phrasea.* /var/www/simplesamlphp-1.10.0/cert/ cp -Rf /bootstrap/conf.d/phrasea.* /var/www/simplesamlphp-1.10.0/cert/
fi
envsubst < "/bootstrap/php.ini.sample" > /usr/local/etc/php/php.ini envsubst < "/bootstrap/php.ini.sample" > /usr/local/etc/php/php.ini
envsubst \$SAML_PHRASEANET_HOST < "/bootstrap/config/config.php" > /var/www/simplesamlphp-1.10.0/config/config.php envsubst \$SAML_PHRASEANET_HOST < "/bootstrap/config/config.php" > /var/www/simplesamlphp-1.10.0/config/config.php