From 812f1717bb15428ae765abb8934d9b5ca7b2a336 Mon Sep 17 00:00:00 2001 From: Cristian Lucchesi Date: Mon, 26 Sep 2022 17:47:41 +0200 Subject: [PATCH] =?UTF-8?q?Aggiunta=20possibilit=C3=A0=20di=20utilizzare?= =?UTF-8?q?=20un=20subpath=20nella=20baseUrl.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Versione 2.6.0. --- CHANGELOG.md | 4 +++- VERSION | 2 +- app/views/main.html | 4 ++-- docker-compose.yml | 4 +++- docker_conf/init | 17 +++++++++++++++-- docker_conf/prod.conf | 1 + docs/sysadmin/startup.rst | 4 ++++ 7 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd84c8f70..f84627eb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [2.6.0] - UNRELEASED +## [2.6.0] - 2022-09-27 ### Added + - Aggiunta possibilità di servire l'applicazione non come root path (per esempio come + https://mioentediricerca.it/epas). - Completata la gestione delle comunicazioni ferie/riposi compensativi per i livelli I-III nel caso il parametro generale sia configurato per non permettere approvazioni per i livelli I-III diff --git a/VERSION b/VERSION index c14b79ed0..914ec9671 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.6.0-rc2 \ No newline at end of file +2.6.0 \ No newline at end of file diff --git a/app/views/main.html b/app/views/main.html index 1a85ffd3b..f1c8ac79e 100755 --- a/app/views/main.html +++ b/app/views/main.html @@ -176,8 +176,8 @@ #{if header.equals('banner') } #{/if} diff --git a/docker-compose.yml b/docker-compose.yml index 28dc005a4..0692796a7 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,7 +32,9 @@ services: environment: - VIRTUAL_HOST=${HOST_NAME} #- PROTOCOL=https # default: http -- (http,https) - ##- EPAS_SHIB_LOGIN= # default: false -- (true,false) + #- HTTP_PATH=${HTTP_PATH} # default: / -- da utilizzare per non servire l'applicazione come root path ( / ) + # se è specificata la variabile HTTP_PATH questa deve cominciare con uno slash ( / ), es.: HTTP_PATH=/epas + #- EPAS_SHIB_LOGIN= # default: false -- (true,false) - JOBS_ACTIVE=true # default: false -- (true,false) -- Se forzato a true abilita l'esecuzione di tutti i job #- APPLICATION_SECRET=${APPLICATION_SECRET} # Opzionale ma fortemente consigliato, utilizzato per le funzioni criptografiche. # E' una stringa random, per esempio y2RS8pYk7g8NFttsRbjmhpEUm00tAQILvOfI1LMQ2wIiVV20J2S0VfQOdTjys9yh diff --git a/docker_conf/init b/docker_conf/init index bdc82f56a..4a509c147 100755 --- a/docker_conf/init +++ b/docker_conf/init @@ -21,8 +21,6 @@ case "${PROTOCOL}" in ;; esac -EPAS_APPLICATION_BASEURL="${PROTOCOL}:\/\/${VIRTUAL_HOST}" - DB_HOST=${DB_HOST:-postgres} DB_PORT=${DB_PORT:-5432} DB_NAME=${DB_NAME:-epas} @@ -78,6 +76,21 @@ FLOWS_ACTIVE=${FLOWS_ACTIVE:-false} cp ${APP_HOME}/docker_conf/prod.conf ${APP_HOME}/conf/ +EPAS_APPLICATION_BASEURL="${PROTOCOL}:\/\/${VIRTUAL_HOST}" + +# default HTTP_PATH = / +# Use this if you don't host your Play application at the root of the domain +# you're serving it from. +if [ -z ${HTTP_PATH} ] +then + EPAS_APPLICATION_BASEURL="${PROTOCOL}:\/\/${VIRTUAL_HOST}" + sed -n '/HTTP_PATH/!p' -i ${APP_HOME}/conf/prod.conf +else + EPAS_APPLICATION_BASEURL="${PROTOCOL}:\/\/${VIRTUAL_HOST}${HTTP_PATH}" + sed 's#{{HTTP_PATH}}#'"${HTTP_PATH}"'#' -i ${APP_HOME}/conf/prod.conf + echo "HTTP_PATH presente: ${HTTP_PATH}" +fi + sed 's#{{EPAS_APPLICATION_BASEURL}}#'"${EPAS_APPLICATION_BASEURL}"'#' -i ${APP_HOME}/conf/prod.conf sed 's#{{DB_HOST}}#'"${DB_HOST}"'#' -i ${APP_HOME}/conf/prod.conf diff --git a/docker_conf/prod.conf b/docker_conf/prod.conf index 218778113..3c01d7895 100644 --- a/docker_conf/prod.conf +++ b/docker_conf/prod.conf @@ -24,6 +24,7 @@ %prod.jobs.active={{JOBS_ACTIVE}} %prod.application.baseUrl={{EPAS_APPLICATION_BASEURL}} +%prod.http.path={{HTTP_PATH}} %prod.shib.login ={{EPAS_SHIB_LOGIN}} %prod.skip.ip.check={{SKIP_IP_CHECK}} %prod.flows.active={{FLOWS_ACTIVE}} diff --git a/docs/sysadmin/startup.rst b/docs/sysadmin/startup.rst index 5488e8054..d47f39bac 100644 --- a/docs/sysadmin/startup.rst +++ b/docs/sysadmin/startup.rst @@ -37,6 +37,9 @@ d'ambiente presenti nel `docker-compose.yml