Skip to content

Commit 886b456

Browse files
committed
Test improvements and add Alpine Linux
1 parent 410a3c9 commit 886b456

11 files changed

Lines changed: 86 additions & 65 deletions

docker-compose.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ services:
77
environment:
88
# with Go 1.13.x which defaults TLS 1.3 to on
99
GODEBUG: "tls13=1"
10-
# Don't re-use authorisations (breaks force renew test scripts)
11-
# PEBBLE_AUTHZREUSE: "0"
1210
ports:
1311
- 14000:14000 # HTTPS ACME API
1412
- 15000:15000 # HTTPS Management API
@@ -77,6 +75,33 @@ services:
7775
- i.centos6.getssl.test
7876
- j.centos6.getssl.test
7977
- k.centos6.getssl.test
78+
getssl-alpine:
79+
build:
80+
context: .
81+
dockerfile: test/Dockerfile-alpine
82+
container_name: getssl-alpine
83+
volumes:
84+
- .:/getssl
85+
environment:
86+
GETSSL_HOST: alpine.getssl.test
87+
GETSSL_IP: 10.30.50.6
88+
NGINX_CONFIG: /etc/nginx/conf.d/default.conf
89+
networks:
90+
acmenet:
91+
ipv4_address: 10.30.50.6
92+
aliases:
93+
- alpine.getssl.test
94+
- a.alpine.getssl.test
95+
- b.alpine.getssl.test
96+
- c.alpine.getssl.test
97+
- d.alpine.getssl.test
98+
- e.alpine.getssl.test
99+
- f.alpine.getssl.test
100+
- g.alpine.getssl.test
101+
- h.alpine.getssl.test
102+
- i.alpine.getssl.test
103+
- j.alpine.getssl.test
104+
- k.alpine.getssl.test
80105
getssl-ubuntu18-no-gawk:
81106
build:
82107
context: .
@@ -86,12 +111,12 @@ services:
86111
- .:/getssl
87112
environment:
88113
GETSSL_HOST: ubuntu18-no-gawk.getssl.test
89-
GETSSL_IP: 10.30.50.6
114+
GETSSL_IP: 10.30.50.7
90115
NGINX_CONFIG: /etc/nginx/sites-enabled/default
91116
TEST_AWK: "yes"
92117
networks:
93118
acmenet:
94-
ipv4_address: 10.30.50.6
119+
ipv4_address: 10.30.50.7
95120
aliases:
96121
- ubuntu18-no-gawk.getssl.test
97122

test/Dockerfile-alpine

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM alpine:latest
2+
3+
RUN apk --no-cache add supervisor openssl git curl bind-tools wget gawk nginx bash
4+
# RUN apk --no-cache add vim dos2unix # for debugging
5+
6+
WORKDIR /root
7+
RUN mkdir /run/nginx
8+
RUN mkdir /etc/nginx/pki
9+
RUN mkdir /etc/nginx/pki/private
10+
COPY ./test/test-config/nginx-ubuntu-no-ssl /etc/nginx/sites-enabled/default
11+
COPY ./test/alpine-supervisord.conf /etc/supervisord.conf
12+
13+
# BATS (Bash Automated Testings)
14+
RUN git clone https://github.com/bats-core/bats-core.git /bats-core
15+
RUN git clone https://github.com/jasonkarns/bats-support /bats-support
16+
RUN git clone https://github.com/jasonkarns/bats-assert-1 /bats-assert
17+
RUN /bats-core/install.sh /usr/local
18+
19+
# Use supervisord to run nginx in the background
20+
ENTRYPOINT /usr/bin/supervisord -c /etc/supervisord.conf

test/Dockerfile-centos6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ RUN /bats-core/install.sh /usr/local
1919
EXPOSE 80 443
2020

2121
# Run eternal loop - for testing
22-
CMD ["/bin/bash", "-c", "while :; do sleep 10; done"]
22+
CMD tail -f /dev/null

test/Dockerfile-ubuntu18

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ RUN /bats-core/install.sh /usr/local
2525
EXPOSE 80 443
2626

2727
# Run eternal loop - for testing
28-
CMD ["/bin/bash", "-c", "while :; do sleep 10; done"]
28+
CMD tail -f /dev/null

test/Dockerfile-ubuntu18-no-gawk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ RUN git clone https://github.com/jasonkarns/bats-assert-1 /bats-assert
1414
RUN /bats-core/install.sh /usr/local
1515

1616
# Run eternal loop - for testing
17-
CMD ["/bin/bash", "-c", "while :; do sleep 10; done"]
17+
CMD tail -f /dev/null

test/alpine-supervisord.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[supervisord]
2+
nodaemon=true
3+
logfile=/tmp/supervisord.log
4+
childlogdir=/tmp
5+
pidfile = /tmp/supervisord.pid
6+
7+
[program:nginx]
8+
command=nginx -g 'daemon off;'
9+
stdout_logfile=/dev/stdout
10+
stdout_logfile_maxbytes=0
11+
stderr_logfile=/dev/stderr
12+
stderr_logfile_maxbytes=0
13+
autorestart=false
14+
startretries=0

test/restart-nginx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
if [ "$GETSSL_HOST" = "alpine.getssl.test" ]; then
4+
killall -HUP nginx >&3-
5+
sleep 5
6+
else
7+
service nginx restart >&3-
8+
fi

test/test-config/getssl-dns01.cfg

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,17 @@
22
# see https://github.com/srvrco/getssl/wiki/Config-variables for details
33
# see https://github.com/srvrco/getssl/wiki/Example-config-files for example configs
44
#
5-
# The staging server is best for testing
6-
#CA="https://acme-staging.api.letsencrypt.org"
7-
# This server issues full certificates, however has rate limits
8-
#CA="https://acme-v01.api.letsencrypt.org"
95
CA="https://pebble:14000/dir"
106

117
VALIDATE_VIA_DNS=true
128
DNS_ADD_COMMAND="/getssl/dns_scripts/dns_add_challtestsrv"
139
DNS_DEL_COMMAND="/getssl/dns_scripts/dns_del_challtestsrv"
14-
# AUTH_DNS_SERVER=10.30.50.3
15-
16-
#PRIVATE_KEY_ALG="rsa"
1710

1811
# Additional domains - this could be multiple domains / subdomains in a comma separated list
19-
# Note: this is Additional domains - so should not include the primary domain.
2012
SANS=""
2113

2214
# Acme Challenge Location. The first line for the domain, the following ones for each additional domain.
23-
# If these start with ssh: then the next variable is assumed to be the hostname and the rest the location.
24-
# An ssh key will be needed to provide you with access to the remote server.
25-
# Optionally, you can specify a different userid for ssh/scp to use on the remote server before the @ sign.
26-
# If left blank, the username on the local server will be used to authenticate against the remote server.
27-
# If these start with ftp: then the next variables are ftpuserid:ftppassword:servername:ACL_location
28-
# These should be of the form "/path/to/your/website/folder/.well-known/acme-challenge"
29-
# where "/path/to/your/website/folder/" is the path, on your web server, to the web root for your domain.
3015
ACL=('/var/www/html/.well-known/acme-challenge')
31-
# 'ssh:server5:/var/www/getssltest.hopto.org/web/.well-known/acme-challenge'
32-
# 'ssh:sshuserid@server5:/var/www/getssltest.hopto.org/web/.well-known/acme-challenge'
33-
# 'ftp:ftpuserid:ftppassword:getssltest.hopto.org:/web/.well-known/acme-challenge')
3416

3517
#Set USE_SINGLE_ACL="true" to use a single ACL for all checks
3618
USE_SINGLE_ACL="false"
@@ -44,11 +26,8 @@ DOMAIN_CHAIN_LOCATION="" # this is the domain cert and CA cert
4426
DOMAIN_PEM_LOCATION="" # this is the domain_key, domain cert and CA cert
4527

4628
# The command needed to reload apache / nginx or whatever you use
47-
RELOAD_CMD="cp /getssl/test/test-config/nginx-ubuntu-ssl ${NGINX_CONFIG} && service nginx restart >&3-"
29+
RELOAD_CMD="cp /getssl/test/test-config/nginx-ubuntu-ssl ${NGINX_CONFIG} && /getssl/test/restart-nginx"
4830

49-
# Define the server type. This can be https, ftp, ftpi, imap, imaps, pop3, pop3s, smtp,
50-
# smtps_deprecated, smtps, smtp_submission, xmpp, xmpps, ldaps or a port number which
51-
# will be checked for certificate expiry and also will be checked after
52-
# an update to confirm correct certificate is running (if CHECK_REMOTE) is set to true
53-
#SERVER_TYPE="https"
54-
#CHECK_REMOTE="true"
31+
# Define the server type and confirm correct certificate is installed
32+
SERVER_TYPE="https"
33+
CHECK_REMOTE="true"

test/test-config/getssl-http01-10-hosts.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
CA="https://pebble:14000/dir"
66

77
# Additional domains - this could be multiple domains / subdomains in a comma separated list
8-
# Note: this is Additional domains - so should not include the primary domain.
98
SANS="a.${GETSSL_HOST},b.${GETSSL_HOST},c.${GETSSL_HOST},d.${GETSSL_HOST},e.${GETSSL_HOST},f.${GETSSL_HOST},g.${GETSSL_HOST},h.${GETSSL_HOST},i.${GETSSL_HOST},j.${GETSSL_HOST},k.${GETSSL_HOST}"
109

1110
# Acme Challenge Location.
@@ -22,7 +21,8 @@ DOMAIN_CHAIN_LOCATION="" # this is the domain cert and CA cert
2221
DOMAIN_PEM_LOCATION="" # this is the domain_key, domain cert and CA cert
2322

2423
# The command needed to reload apache / nginx or whatever you use
25-
RELOAD_CMD="cp /getssl/test/test-config/nginx-ubuntu-ssl ${NGINX_CONFIG} && service nginx restart >&3-"
24+
RELOAD_CMD="cp /getssl/test/test-config/nginx-ubuntu-ssl ${NGINX_CONFIG} && /getssl/test/restart-nginx"
2625

27-
#SERVER_TYPE="https"
28-
#CHECK_REMOTE="true"
26+
# Define the server type and confirm correct certificate is installed
27+
SERVER_TYPE="https"
28+
CHECK_REMOTE="true"

test/test-config/getssl-http01.cfg

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,13 @@
22
# see https://github.com/srvrco/getssl/wiki/Config-variables for details
33
# see https://github.com/srvrco/getssl/wiki/Example-config-files for example configs
44
#
5-
# The staging server is best for testing
6-
#CA="https://acme-staging.api.letsencrypt.org"
7-
# This server issues full certificates, however has rate limits
8-
#CA="https://acme-v01.api.letsencrypt.org"
95
CA="https://pebble:14000/dir"
106

11-
#VALIDATE_VIA_DNS=true
12-
#DNS_ADD_COMMAND="/getssl/dns_scripts/dns_add_challtestsrv"
13-
#DNS_DEL_COMMAND="/getssl/dns_scripts/dns_del_challtestsrv"
14-
15-
#PRIVATE_KEY_ALG="rsa"
16-
177
# Additional domains - this could be multiple domains / subdomains in a comma separated list
18-
# Note: this is Additional domains - so should not include the primary domain.
198
SANS=""
209

21-
# Acme Challenge Location. The first line for the domain, the following ones for each additional domain.
22-
# If these start with ssh: then the next variable is assumed to be the hostname and the rest the location.
23-
# An ssh key will be needed to provide you with access to the remote server.
24-
# Optionally, you can specify a different userid for ssh/scp to use on the remote server before the @ sign.
25-
# If left blank, the username on the local server will be used to authenticate against the remote server.
26-
# If these start with ftp: then the next variables are ftpuserid:ftppassword:servername:ACL_location
27-
# These should be of the form "/path/to/your/website/folder/.well-known/acme-challenge"
28-
# where "/path/to/your/website/folder/" is the path, on your web server, to the web root for your domain.
10+
# Acme Challenge Location.
2911
ACL=('/var/www/html/.well-known/acme-challenge')
30-
# 'ssh:server5:/var/www/getssltest.hopto.org/web/.well-known/acme-challenge'
31-
# 'ssh:sshuserid@server5:/var/www/getssltest.hopto.org/web/.well-known/acme-challenge'
32-
# 'ftp:ftpuserid:ftppassword:getssltest.hopto.org:/web/.well-known/acme-challenge')
3312

3413
#Set USE_SINGLE_ACL="true" to use a single ACL for all checks
3514
USE_SINGLE_ACL="false"
@@ -43,11 +22,8 @@ DOMAIN_CHAIN_LOCATION="" # this is the domain cert and CA cert
4322
DOMAIN_PEM_LOCATION="" # this is the domain_key, domain cert and CA cert
4423

4524
# The command needed to reload apache / nginx or whatever you use
46-
RELOAD_CMD="cp /getssl/test/test-config/nginx-ubuntu-ssl ${NGINX_CONFIG} && service nginx restart >&3-"
25+
RELOAD_CMD="cp /getssl/test/test-config/nginx-ubuntu-ssl ${NGINX_CONFIG} && /getssl/test/restart-nginx"
4726

48-
# Define the server type. This can be https, ftp, ftpi, imap, imaps, pop3, pop3s, smtp,
49-
# smtps_deprecated, smtps, smtp_submission, xmpp, xmpps, ldaps or a port number which
50-
# will be checked for certificate expiry and also will be checked after
51-
# an update to confirm correct certificate is running (if CHECK_REMOTE) is set to true
27+
# Define the server type and confirm correct certificate is installed
5228
SERVER_TYPE="https"
5329
CHECK_REMOTE="true"

0 commit comments

Comments
 (0)