Generate the certificate directory with a pretest script
fixes #1690 Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
parent
d4be7016ef
commit
db713e127b
23 changed files with 15 additions and 621 deletions
|
@ -2,14 +2,7 @@
|
|||
set -e
|
||||
|
||||
hostname="localregistry"
|
||||
authhostname="auth.$hostname"
|
||||
|
||||
set_etc_hosts() {
|
||||
hostentry=$1
|
||||
IP=$(ifconfig eth0|grep "inet addr:"| cut -d: -f2 | awk '{ print $1}')
|
||||
echo "$IP $hostentry" >> /etc/hosts
|
||||
# TODO: Check if record already exists in /etc/hosts
|
||||
}
|
||||
installdir="$1"
|
||||
|
||||
install_ca() {
|
||||
mkdir -p $1/$hostname:$2
|
||||
|
@ -32,18 +25,19 @@ install_test_certs() {
|
|||
install_ca $1 5448
|
||||
}
|
||||
|
||||
set_etc_hosts $hostname
|
||||
set_etc_hosts $authhostname
|
||||
install_ca_file() {
|
||||
mkdir -p $2
|
||||
cp $1 $2/ca.crt
|
||||
}
|
||||
|
||||
install_test_certs /etc/docker/certs.d
|
||||
install_test_certs /root/.docker/tls
|
||||
install_test_certs $installdir
|
||||
|
||||
# Malevolent server
|
||||
mkdir -p /etc/docker/certs.d/$hostname:6666
|
||||
cp ./malevolent-certs/ca.pem /etc/docker/certs.d/$hostname:6666/ca.crt
|
||||
install_ca_file ./malevolent-certs/ca.pem $installdir/$hostname:6666
|
||||
|
||||
# Token server
|
||||
install_file ./tokenserver/certs/ca.pem $1 5555
|
||||
install_file ./tokenserver/certs/ca.pem $1 5554
|
||||
install_file ./tokenserver/certs/ca.pem $1 5557
|
||||
install_file ./tokenserver/certs/ca.pem $1 5558
|
||||
install_ca_file ./tokenserver/certs/ca.pem $installdir/$hostname:5554
|
||||
install_ca_file ./tokenserver/certs/ca.pem $installdir/$hostname:5555
|
||||
install_ca_file ./tokenserver/certs/ca.pem $installdir/$hostname:5557
|
||||
install_ca_file ./tokenserver/certs/ca.pem $installdir/$hostname:5558
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue