update the host files to point to accessible docker container names for backends
added testing for this, including mock backend server.
This commit is contained in:
@@ -28,24 +28,25 @@ build() {
|
||||
build_test() {
|
||||
echo -e "\e[33mtesting the image\e[39m"
|
||||
|
||||
dc up -d
|
||||
dc up -d --force-recreate
|
||||
docker ps | grep sslproxy
|
||||
|
||||
sleep 2
|
||||
assertBadGateway https abcapi.xai-corp.net
|
||||
assertBadGateway https dkui.xai-corp.net
|
||||
assertBadGateway https git.xai-corp.net
|
||||
assertBadGateway https jenkins.xai-corp.net
|
||||
assertBadGateway https xaibox.xai-corp.net
|
||||
assertBadGateway https metrics.xai-corp.net
|
||||
sleep 5
|
||||
assertTeapot https abcapi.xai-corp.net
|
||||
assertTeapot https dkui.xai-corp.net
|
||||
assertTeapot https git.xai-corp.net
|
||||
assertTeapot https jenkins.xai-corp.net
|
||||
assertTeapot https xaibox.xai-corp.net
|
||||
assertMisdirectedRequest https not.xai-corp.net
|
||||
assertBadGateway http xai-corp.net
|
||||
assertBadGateway http abcapi.xai-corp.net
|
||||
assertBadGateway http dkui.xai-corp.net
|
||||
assertBadGateway http git.xai-corp.net
|
||||
assertBadGateway http jenkins.xai-corp.net
|
||||
assertBadGateway http xaibox.xai-corp.net
|
||||
assertBadGateway http metrics.xai-corp.net
|
||||
|
||||
#cert renewal
|
||||
assertTeapot http xai-corp.net
|
||||
assertTeapot http abcapi.xai-corp.net
|
||||
assertTeapot http dkui.xai-corp.net
|
||||
assertTeapot http git.xai-corp.net
|
||||
assertTeapot http jenkins.xai-corp.net
|
||||
assertTeapot http xaibox.xai-corp.net
|
||||
assertTeapot http metrics.xai-corp.net
|
||||
}
|
||||
|
||||
function assertMisdirectedRequest() {
|
||||
@@ -53,7 +54,7 @@ function assertMisdirectedRequest() {
|
||||
domain=$2
|
||||
set -e
|
||||
echo -e "\033[94m${proto}://${domain}\033[39m testing for mistrected request"
|
||||
curl --no-progress-meter -skH "Host: ${domain}" "${proto}://localhost" | tee "$LOG" | grep "421 Misdirected Request"
|
||||
curl --no-progress-meter -IskH "Host: ${domain}" "${proto}://localhost" | tee "$LOG" | grep "421 Misdirected Request"
|
||||
}
|
||||
|
||||
function assertBadGateway() {
|
||||
@@ -61,7 +62,16 @@ function assertBadGateway() {
|
||||
domain=$2
|
||||
set -e
|
||||
echo -e "\033[94m${proto}://${domain}\033[39m"
|
||||
curl --no-progress-meter -skH "Host: ${domain}" "${proto}://localhost" | tee "$LOG" | grep "502 Bad Gateway"
|
||||
curl --no-progress-meter -IskH "Host: ${domain}" "${proto}://localhost" | tee "$LOG" | grep "502 Bad Gateway"
|
||||
}
|
||||
|
||||
|
||||
function assertTeapot() {
|
||||
proto=$1
|
||||
domain=$2
|
||||
set -e
|
||||
echo -e "\033[94m${proto}://${domain}\033[39m"
|
||||
curl --no-progress-meter -IskH "Host: ${domain}" "${proto}://localhost" | tee "$LOG" | grep "418"
|
||||
}
|
||||
|
||||
build_save() {
|
||||
|
||||
@@ -3,7 +3,7 @@ set -e
|
||||
|
||||
echo -e "\033[36mCreate\033[39m: self-signed certificates"
|
||||
|
||||
CERTS_DIR=letsencrypt/live/xai-corp.net
|
||||
CERTS_DIR=certs/live/xai-corp.net
|
||||
|
||||
function make_cert() {
|
||||
mkdir -p $CERTS_DIR
|
||||
@@ -11,7 +11,7 @@ mkdir -p $CERTS_DIR
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -batch \
|
||||
-keyout $CERTS_DIR/privkey.pem \
|
||||
-out $CERTS_DIR/fullchain.pem \
|
||||
-config certs/localhost.conf
|
||||
-config certs/xai-corp.net.conf
|
||||
|
||||
#tell chrome to trust the cert
|
||||
certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n "www.xai-corp.net" -i $CERTS_DIR/fullchain.pem
|
||||
|
||||
7
dockerfiles/services/sslproxy/cli/exec
Executable file
7
dockerfiles/services/sslproxy/cli/exec
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
export DOCKER_HOST=${DOCKER_HOST:-'dkhost:2376'}
|
||||
|
||||
docker exec $@
|
||||
#docker network inspect ingress
|
||||
3
dockerfiles/services/sslproxy/cli/exec.help
Normal file
3
dockerfiles/services/sslproxy/cli/exec.help
Normal file
@@ -0,0 +1,3 @@
|
||||
ARGS - The arguments you wish to provide to this command
|
||||
|
||||
TODO: Fill out the help information for this command.
|
||||
1
dockerfiles/services/sslproxy/cli/exec.usage
Normal file
1
dockerfiles/services/sslproxy/cli/exec.usage
Normal file
@@ -0,0 +1 @@
|
||||
ARGS...
|
||||
19
dockerfiles/services/sslproxy/cli/up
Executable file
19
dockerfiles/services/sslproxy/cli/up
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
#set -x
|
||||
|
||||
LOCAL_IMAGE=sslproxy
|
||||
TAG=2.2.${BUILD_NUMBER:-dev}
|
||||
REMOTE_IMAGE=dkregistry.xai-corp.net:5000/${LOCAL_IMAGE}:${TAG}
|
||||
|
||||
LOG=$(mktemp)
|
||||
|
||||
export LOCAL_IMAGE
|
||||
export REMOTE_IMAGE
|
||||
export TAG
|
||||
|
||||
# shellcheck disable=SC2068
|
||||
docker-compose \
|
||||
-f docker-compose.yml \
|
||||
-f docker-compose.build.yml \
|
||||
up $@
|
||||
3
dockerfiles/services/sslproxy/cli/up.help
Normal file
3
dockerfiles/services/sslproxy/cli/up.help
Normal file
@@ -0,0 +1,3 @@
|
||||
ARGS - The arguments you wish to provide to this command
|
||||
|
||||
TODO: Fill out the help information for this command.
|
||||
1
dockerfiles/services/sslproxy/cli/up.usage
Normal file
1
dockerfiles/services/sslproxy/cli/up.usage
Normal file
@@ -0,0 +1 @@
|
||||
ARGS...
|
||||
Reference in New Issue
Block a user