Skip to content

Commit

Permalink
Merge pull request #45 from infonova/develop
Browse files Browse the repository at this point in the history
update v4.0.6
  • Loading branch information
rwese authored Nov 28, 2019
2 parents 92c5789 + f211917 commit 853e72e
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 66 deletions.
9 changes: 7 additions & 2 deletions application/services/Ci/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,13 @@ public function createCi($values, $userId, $sessionID)
$ciProjectDaoImpl = new Dao_CiProject();
$ciProjectDaoImpl->insertCiProject($ciId, $projectId);

$ciServiceGet = new Service_Ci_Get($this->translator, $this->logger, parent::getThemeId());

$ci_info = [];
$ci_info['new'] = $ciServiceGet->getContextInfoForCi($ciId);

// handle customization
$triggerUtil->createCi($ciId, $userId);
$triggerUtil->createCi($ciId, $userId, $ci_info);


//update query persistent
Expand Down Expand Up @@ -684,4 +689,4 @@ public function checkSelectionSession() {
*/

}
}
3 changes: 1 addition & 2 deletions application/services/Ci/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public function deleteCi($userDto, $ciId)
try {
$ci_info = [];
$ci_info['old'] = $ciServiceGet->getContextInfoForCi($ciId);
$ci_info['new'] = [];

// customization handling
$triggerUtil = new Util_Trigger($this->logger);
Expand Down Expand Up @@ -78,4 +77,4 @@ public function deleteSingleCiRelation($ciRelationId)
}


}
}
6 changes: 3 additions & 3 deletions application/utils/Trigger.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public function __construct($loggers)
}

// CI handling
public function createCi($ciId, $userId)
public function createCi($ciId, $userId, $ciInfo = null)
{
$this->handleCi($ciId, $userId, 'create');
$this->handleCi($ciId, $userId, 'create', $ciInfo);
}

public function updateCi($ciId, $userId, $ciInfo = null)
Expand Down Expand Up @@ -301,4 +301,4 @@ public function fileimportTrigger($importedFileName, $method, $fileimport_histor

}
}
}
}
17 changes: 13 additions & 4 deletions docker/nginx/custom-conf/conf.d/ssl_sample.domain.at.conf.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
server {
listen 80;
listen [::]:80;

server_name #CERT_HOSTNAME#;

return 301 https://$server_name$request_uri;
}

server {

listen 443 ssl http2;
listen [::]:443 ssl http2;

server_name #CERT_HOSTNAME#;
ssl_certificate #CERT_CRT_FILE#;
server_name #CERT_HOSTNAME#;
ssl_certificate #CERT_CRT_FILE#;
ssl_certificate_key #CERT_KEY_FILE#;

ssl_dhparam /etc/nginx/conf.d/ssl/dhparam.pem;
#DHPARAM#
ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0

root /app/public;
Expand Down Expand Up @@ -60,4 +69,4 @@ server {
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
}
}
6 changes: 3 additions & 3 deletions docker/nginx/default-conf/conf.d/default.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ server {
listen 80;
listen [::]:80;

server_name ${DOCKER_WEB_HOSTNAME} ${DOCKER_WEB_HOSTALIAS} ${DOCKER_INTERNAL_HOSTALIAS};
server_name #DOCKER_WEB_HOSTNAME# #DOCKER_WEB_HOSTALIAS# #DOCKER_INTERNAL_HOSTALIAS#;
root /app/public;
index index.php index.html index.htm;

Expand Down Expand Up @@ -35,10 +35,10 @@ server {
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param APPLICATION_ENV ${APPLICATION_ENV};
fastcgi_param APPLICATION_ENV #APPLICATION_ENV#;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
${PHP_DISABLE_FUNCTIONS}
#PHP_DISABLE_FUNCTIONS#
}

location / {
Expand Down
44 changes: 29 additions & 15 deletions docker/nginx/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,26 @@ if [[ "${DOCKER_WEB_HOSTALIAS}" != "web" ]]; then
export DOCKER_INTERNAL_HOSTALIAS="web"
fi

echo "Add default vhost for ${DOCKER_WEB_HOSTNAME}[Alias: ${DOCKER_WEB_HOSTALIAS} ${DOCKER_INTERNAL_HOSTALIAS}]: ${CONFIG_DIR}/conf.d/default.conf"
envsubst '
${DOCKER_WEB_HOSTNAME}
${DOCKER_WEB_HOSTALIAS}
${APPLICATION_ENV}
${PHP_DISABLE_FUNCTIONS}
${DOCKER_INTERNAL_HOSTALIAS}
'< ${CONFIG_DIR}/conf.d/default.conf.dist > ${CONFIG_DIR}/conf.d/default.conf

CONFD_PATH=/etc/nginx/conf.d/
DOCKER_WEB_HOSTNAME_CLEAN="${DOCKER_WEB_HOSTNAME//\./_}"
CERT_CONF_FULL_PATH=${CONFD_PATH}ssl_${DOCKER_WEB_HOSTNAME_CLEAN}.conf

if [[ ! -e ${CERT_CONF_FULL_PATH} ]]; then
echo "Add default vhost for ${DOCKER_WEB_HOSTNAME}[Alias: ${DOCKER_WEB_HOSTALIAS} ${DOCKER_INTERNAL_HOSTALIAS}]: ${CONFIG_DIR}/conf.d/default.conf"
cp ${CONFIG_DIR}/conf.d/default.conf.dist ${CONFIG_DIR}/conf.d/default.conf
sed -i -e "s|#DOCKER_WEB_HOSTNAME#|${DOCKER_WEB_HOSTNAME}|" "${CONFIG_DIR}/conf.d/default.conf"
sed -i -e "s|#DOCKER_WEB_HOSTALIAS#|${DOCKER_WEB_HOSTALIAS}|" "${CONFIG_DIR}/conf.d/default.conf"
sed -i -e "s|#APPLICATION_ENV#|${APPLICATION_ENV}|" "${CONFIG_DIR}/conf.d/default.conf"
sed -i -e "s|#PHP_DISABLE_FUNCTIONS#|${PHP_DISABLE_FUNCTIONS}|" "${CONFIG_DIR}/conf.d/default.conf"
sed -i -e "s|#DOCKER_INTERNAL_HOSTALIAS#|${DOCKER_INTERNAL_HOSTALIAS}|" "${CONFIG_DIR}/conf.d/default.conf"
else
echo "[NOTICE] Found SSL Configuration, skipping vhost-default configuration. [Config: ${CERT_CONF_FULL_PATH}]"

# get rid of the file inside the docker instance if it exists
rm -f "${CONFIG_DIR}/conf.d/default.conf"
fi

echo

if [[ -e /bootstrap/custom-conf ]]; then
Expand All @@ -51,14 +63,16 @@ fi
if [ "${APPLICATION_ENV}" = "testing" ] || [ "${APPLICATION_ENV}" = "development" ] ; then
echo "Add vhost config for cmdb.test.local"
DOCKER_WEB_HOSTALIAS=""
DOCKER_INTERNAL_HOSTALIAS=""
DOCKER_WEB_HOSTNAME="cmdb.test.local"
APPLICATION_ENV="testing"
envsubst '
${DOCKER_WEB_HOSTNAME}
${DOCKER_WEB_HOSTALIAS}
${APPLICATION_ENV}
${PHP_DISABLE_FUNCTIONS}
'< ${CONFIG_DIR}/conf.d/default.conf.dist > ${CONFIG_DIR}conf.d/testing.conf

cp ${CONFIG_DIR}/conf.d/default.conf.dist ${CONFIG_DIR}conf.d/testing.conf
sed -i -e "s|#DOCKER_INTERNAL_HOSTALIAS#|${DOCKER_INTERNAL_HOSTALIAS}|" "${CONFIG_DIR}conf.d/testing.conf"
sed -i -e "s|#DOCKER_WEB_HOSTNAME#|${DOCKER_WEB_HOSTNAME}|" "${CONFIG_DIR}conf.d/testing.conf"
sed -i -e "s|#DOCKER_WEB_HOSTALIAS#|${DOCKER_WEB_HOSTALIAS}|" "${CONFIG_DIR}conf.d/testing.conf"
sed -i -e "s|#APPLICATION_ENV#|${APPLICATION_ENV}|" "${CONFIG_DIR}conf.d/testing.conf"
sed -i -e "s|#PHP_DISABLE_FUNCTIONS#|${PHP_DISABLE_FUNCTIONS}|" "${CONFIG_DIR}conf.d/testing.conf"
echo
fi

Expand All @@ -74,4 +88,4 @@ chmod -R 700 ${CONFIG_DIR}conf.d/ssl/
chown -R root:root ${CONFIG_DIR}

echo "Execute next entrypoint script: $*"
exec "$@"
exec "$@"
5 changes: 0 additions & 5 deletions docker/openssl/Dockerfile

This file was deleted.

Loading

0 comments on commit 853e72e

Please sign in to comment.