Skip to content

Commit

Permalink
Use forward-proxy hostname when running local and in docker
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcialRosales committed Dec 4, 2024
1 parent 2eacab6 commit f87f42d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
5 changes: 4 additions & 1 deletion selenium/bin/components/forward-proxy
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ init_forward-proxy() {
print "> PROXY_HOSTNAME: ${PROXY_HOSTNAME}"
print "> PROXY_PORT: ${PROXY_PORT}"

generate-ca-server-client-kpi forward-proxy $HTTPD_CONFIG_DIR
}

start_forward-proxy() {
begin "Starting forward-proxy ..."

Expand All @@ -30,6 +32,7 @@ start_forward-proxy() {
mkdir -p $MOUNT_HTTPD_CONFIG_DIR
${BIN_DIR}/gen-httpd-conf ${HTTPD_CONFIG_DIR} $ENV_FILE $MOUNT_HTTPD_CONFIG_DIR/httpd.conf
print "> EFFECTIVE HTTPD_CONFIG_FILE: $MOUNT_HTTPD_CONFIG_DIR/httpd.conf"
cp ${HTTPD_CONFIG_DIR}/*.pem $MOUNT_HTTPD_CONFIG_DIR

docker run \
--detach \
Expand All @@ -39,6 +42,6 @@ start_forward-proxy() {
--mount "type=bind,source=${MOUNT_HTTPD_CONFIG_DIR},target=/usr/local/apache2/conf" \
${HTTPD_DOCKER_IMAGE}

wait_for_url $OAUTH_PROVIDER_URL ${PROXY_HOSTNAME}:${PROXY_PORT}
wait_for_url $OAUTH_PROVIDER_URL ${FORWARD_PROXY_URL}
end "forward-proxy is ready"
}
10 changes: 2 additions & 8 deletions selenium/bin/suite_template
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ elif [[ "$COMMAND" == "stop-rabbitmq" ]]
stop_local_rabbitmq
elif [[ "$COMMAND" == "start-others" ]]
then
trap "teardown_components" EXIT
start_local_others
elif [[ "$COMMAND" == "ensure-others" ]]
then
Expand Down Expand Up @@ -565,15 +566,9 @@ run_on_docker_with() {
build_mocha_image
start_selenium

trap teardown_components EXIT
trap "teardown_components" EXIT

start_components
TEST_RESULT=$?
if [ $TEST_RESULT -ne 0 ]; then
teardown_components
exit $TEST_RESULT
fi

test
TEST_RESULT=$?
save_logs
Expand Down Expand Up @@ -652,7 +647,6 @@ start_components() {
$start
done
}

teardown_components() {
skip_rabbitmq=${1:-false}

Expand Down
5 changes: 3 additions & 2 deletions selenium/test/oauth/env.docker.forward-proxy
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export FORWARD_PROXY_CERTS=/config/oauth/forward-proxy
export FORWARD_PROXY_CERTS=/usr/local/apache2/conf
export FORWARD_PROXY_CA_CERT=${FORWARD_PROXY_CERTS}/ca_forward-proxy_certificate.pem
export FORWARD_PROXY_URL=https://forward-proxy:9092/realms/test
export FORWARD_PROXY_URL=https://forward-proxy:9092
export OAUTH_PROVIDER_URL=${KEYCLOAK_URL}
5 changes: 3 additions & 2 deletions selenium/test/oauth/env.local.forward-proxy
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export FORWARD_PROXY_CERTS=/config/oauth/forward-proxy
export FORWARD_PROXY_CERTS=/usr/local/apache2/conf
export FORWARD_PROXY_CA_CERT=${FORWARD_PROXY_CERTS}/ca_forward-proxy_certificate.pem
export FORWARD_PROXY_URL=https://localhost:9092/realms/test
export FORWARD_PROXY_URL=https://forward-proxy:9092
export OAUTH_PROVIDER_URL=${KEYCLOAK_URL}
2 changes: 1 addition & 1 deletion selenium/test/oauth/env.local.keycloak
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export KEYCLOAK_URL=https://localhost:8443/realms/test
export KEYCLOAK_URL=https://keycloak:8443/realms/test
export KEYCLOAK_CA_CERT=selenium/test/oauth/keycloak/ca_keycloak_certificate.pem
2 changes: 1 addition & 1 deletion selenium/test/oauth/forward-proxy/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ LoadModule proxy_hcheck_module modules/mod_proxy_hcheck.so
#LoadModule session_dbd_module modules/mod_session_dbd.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
#LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
#LoadModule ssl_module modules/mod_ssl.so
LoadModule ssl_module modules/mod_ssl.so
#LoadModule optional_hook_export_module modules/mod_optional_hook_export.so
#LoadModule optional_hook_import_module modules/mod_optional_hook_import.so
#LoadModule optional_fn_import_module modules/mod_optional_fn_import.so
Expand Down

0 comments on commit f87f42d

Please sign in to comment.