Skip to content

Commit

Permalink
removed nginx support
Browse files Browse the repository at this point in the history
  • Loading branch information
Cielquan committed Nov 24, 2019
1 parent 1f35088 commit e635674
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 189 deletions.
30 changes: 0 additions & 30 deletions docker-compose.nginx.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions nginx-docker/configs/conf.d/stapling.conf

This file was deleted.

12 changes: 0 additions & 12 deletions nginx-docker/configs/nginx.conf

This file was deleted.

Empty file.
8 changes: 0 additions & 8 deletions nginx-docker/configs/sites-enabled/http_redirect.conf

This file was deleted.

8 changes: 0 additions & 8 deletions nginx-docker/configs/sites-enabled/upstream.conf

This file was deleted.

2 changes: 0 additions & 2 deletions nginx-docker/configs/snippets/cert.conf

This file was deleted.

9 changes: 0 additions & 9 deletions nginx-docker/configs/snippets/proxy_forward.conf

This file was deleted.

14 changes: 0 additions & 14 deletions nginx-docker/configs/snippets/ssl-params.conf

This file was deleted.

14 changes: 0 additions & 14 deletions nginx-docker/configs/streams/dns-over-tls.conf

This file was deleted.

3 changes: 0 additions & 3 deletions nginx-docker/configs/streams/upstream.conf

This file was deleted.

26 changes: 0 additions & 26 deletions nginx-docker/templates/443.conf.template

This file was deleted.

74 changes: 15 additions & 59 deletions start_doth_dns.bash
Expand Up @@ -60,8 +60,7 @@ exit_dc_err() {
# Func for showing usage string
usage_string() {
printf "\nUsage: %s [-f] [-a <arm|x86>] [-c] [-I <INTERFACE>] [-i <IP ADDRESS>] `
`[-n <HOSTNAME>] [-t <TIMEZONE>] [-d <DOMAIN>] [-N] [-R] [-U] `
`[-p <traefik|nginx>] [-P] [-h]\n" "$0" 1>&2;
`[-n <HOSTNAME>] [-t <TIMEZONE>] [-d <DOMAIN>] [-N] [-R] [-U] [-P] [-h]\n" "$0" 1>&2;
}

# Func for showing usage
Expand All @@ -80,7 +79,7 @@ help() {

# ##########################################################################################
# Catching flags
while getopts ":fa:cI:i:n:t:d:RUp:PNh" flag; do
while getopts ":fa:cI:i:n:t:d:RUPNh" flag; do
case ${flag} in
f) # Set for overwriting existing configs with new ones.
_FLAG_FRESH='y'
Expand Down Expand Up @@ -116,14 +115,7 @@ while getopts ":fa:cI:i:n:t:d:RUp:PNh" flag; do
U) # Update all containers with newer images if available and recreate them.
_FLAG_UPDATE_ALL='y'
;;
p) # Set reverse proxy to use. 'ngnix' or 'traefik' (case insensitive). Default: traefik
if ! [[ "${OPTARG,,}" == 'nginx' ]] && ! [[ "${OPTARG,,}" == 'traefik' ]]; then
printf "No valid argument for '-p'.\n"
exit_arg_err
fi
_FLAG_PROXY=${OPTARG,,}
;;
P) # Start without a reverse proxy. Overwrites '-p'.
P) # Start without reverse proxy (`traefik`).
_FLAG_NO_PROXY='y'
;;
N) # Deactivate traefik dashboard authorization
Expand Down Expand Up @@ -452,24 +444,20 @@ if [[ "${_FLAG_NO_PROXY}" == 'y' ]]; then
docker-compose up -d || exit_dc_err
fi
else
# If no proxy is set fall back to 'traefik'
if [[ -z "${_FLAG_PROXY}" ]]; then
_FLAG_PROXY="traefik"
fi
if [[ "${_FLAG_UPDATE_ALL}" == 'y' ]]; then
printf "%bINFO: %b Updating DoTH-DNS with %b%s%b reverse proxy.\n" \
"${CYAN}" "${BLANK}" "${CYAN}" "${_FLAG_PROXY}" "${BLANK}"
docker-compose -f docker-compose.yaml -f docker-compose."${_FLAG_PROXY}".yaml down || exit_dc_err
docker-compose -f docker-compose.yaml -f docker-compose."${_FLAG_PROXY}".yaml pull || exit_dc_err
docker-compose -f docker-compose.yaml -f docker-compose."${_FLAG_PROXY}".yaml up -d --force-recreate || exit_dc_err
printf "%bINFO: %b Updating DoTH-DNS with %btraefik%b reverse proxy.\n" \
"${CYAN}" "${BLANK}" "${CYAN}" "${BLANK}"
docker-compose -f docker-compose.yaml -f docker-compose.traefik.yaml down || exit_dc_err
docker-compose -f docker-compose.yaml -f docker-compose.traefik.yaml pull || exit_dc_err
docker-compose -f docker-compose.yaml -f docker-compose.traefik.yaml up -d --force-recreate || exit_dc_err
elif [[ "${_FLAG_RECREATE_ALL}" == 'y' ]]; then
printf "%bINFO: %b Recreating DoTH-DNS with %b%s%b reverse proxy.\n" \
"${CYAN}" "${BLANK}" "${CYAN}" "${_FLAG_PROXY}" "${BLANK}"
docker-compose -f docker-compose.yaml -f docker-compose."${_FLAG_PROXY}".yaml up -d --force-recreate || exit_dc_err
printf "%bINFO: %b Recreating DoTH-DNS with %btraefik%b reverse proxy.\n" \
"${CYAN}" "${BLANK}" "${CYAN}" "${BLANK}"
docker-compose -f docker-compose.yaml -f docker-compose.traefik.yaml up -d --force-recreate || exit_dc_err
else
printf "%bINFO: %b Creating DoTH-DNS with %b%s%b reverse proxy.\n" \
"${CYAN}" "${BLANK}" "${CYAN}" "${_FLAG_PROXY}" "${BLANK}"
docker-compose -f docker-compose.yaml -f docker-compose."${_FLAG_PROXY}".yaml up -d || exit_dc_err
printf "%bINFO: %b Creating DoTH-DNS with %btraefik%b reverse proxy.\n" \
"${CYAN}" "${BLANK}" "${CYAN}" "${BLANK}"
docker-compose -f docker-compose.yaml -f docker-compose.traefik.yaml up -d || exit_dc_err
fi
fi

Expand Down Expand Up @@ -599,40 +587,9 @@ printf "%bINFO: %b Container health status of 'doh_server': `
`%b$(docker inspect -f "{{.State.Status}}" doh_server)%b\n" "${CYAN}" "${BLANK}" "${CYAN}" "${BLANK}"


# ##########################################################################################
### Testing nginx-docker
if [[ "${_FLAG_PROXY}" == 'nginx' ]]; then
# Check if container started and is running; timeout after 1 min
printf "\n%bINFO: %b Starting up nginx container " "${CYAN}" "${BLANK}"
for i in $(seq 1 20); do
if [ "$(docker inspect -f "{{.State.Status}}" nginx)" == "running" ]; then
sleep 5
if [ "$(docker inspect -f "{{.State.Status}}" nginx)" == "running" ]; then
printf " %bOK%b\n" "${GREEN}" "${BLANK}"
break
fi
else
sleep 3
printf "."
fi

if [ "$i" -eq 20 ]; then
printf " %bFAILED%b\n" "${RED}" "${BLANK}"
printf "%bERROR: %b Timed out waiting for nginx to start, check your container logs for more info `
`(\`docker logs nginx\`).\n" "${RED}" "${BLANK}"
printf "%bINFO: %b Container health status of 'nginx': `
`%b$(docker inspect -f "{{.State.Status}}" nginx)%b\n" "${CYAN}" "${BLANK}" "${CYAN}" "${BLANK}"
exit_err
fi
done;
printf "%bINFO: %b Container health status of 'nginx': `
`%b$(docker inspect -f "{{.State.Status}}" nginx)%b\n" "${CYAN}" "${BLANK}" "${CYAN}" "${BLANK}"
fi


# ##########################################################################################
### Testing traefik-docker
if [[ "${_FLAG_PROXY}" == 'traefik' ]]; then
if ! [[ "${_FLAG_NO_PROXY}" == 'y' ]]; then
# Check if container started and is running; timeout after 1 min
printf "\n%bINFO: %b Starting up traefik container " "${CYAN}" "${BLANK}"
for i in $(seq 1 20); do
Expand Down Expand Up @@ -660,7 +617,6 @@ if [[ "${_FLAG_PROXY}" == 'traefik' ]]; then
`%b$(docker inspect -f "{{.State.Status}}" traefik)%b\n" "${CYAN}" "${BLANK}" "${CYAN}" "${BLANK}"
fi


# ##########################################################################################
# Finishing line
printf "\n\n%bSUCCESS:%b DoTH-DNS is up and running.\n" "${GREEN}" "${BLANK}"
Expand Down

0 comments on commit e635674

Please sign in to comment.