...

Text file src/github.com/docker/distribution/contrib/docker-integration/install_certs.sh

Documentation: github.com/docker/distribution/contrib/docker-integration

     1#!/bin/sh
     2set -e
     3
     4hostname="localregistry"
     5installdir="$1"
     6
     7install_ca() {
     8	mkdir -p $1/$hostname:$2
     9	cp ./nginx/ssl/registry-ca+ca.pem $1/$hostname:$2/ca.crt
    10	if [ "$3" != "" ]; then
    11		cp ./nginx/ssl/registry-$3+client-cert.pem $1/$hostname:$2/client.cert
    12		cp ./nginx/ssl/registry-$3+client-key.pem $1/$hostname:$2/client.key
    13	fi
    14}
    15
    16install_test_certs() {
    17	install_ca $1 5440
    18	install_ca $1 5441
    19	install_ca $1 5442 ca
    20	install_ca $1 5443 noca
    21	install_ca $1 5444 ca
    22	install_ca $1 5447 ca
    23	# For test remove CA
    24	rm $1/${hostname}:5447/ca.crt
    25	install_ca $1 5448
    26	install_ca $1 5600
    27}
    28
    29install_ca_file() {
    30	mkdir -p $2
    31	cp $1 $2/ca.crt
    32}
    33
    34append_ca_file() {
    35	mkdir -p $2
    36	cat $1 >> $2/ca.crt
    37}
    38
    39install_test_certs $installdir
    40
    41# Malevolent server
    42install_ca_file ./malevolent-certs/ca.pem $installdir/$hostname:6666
    43
    44# Token server
    45install_ca_file ./tokenserver/certs/ca.pem $installdir/$hostname:5554
    46install_ca_file ./tokenserver/certs/ca.pem $installdir/$hostname:5555
    47install_ca_file ./tokenserver/certs/ca.pem $installdir/$hostname:5557
    48install_ca_file ./tokenserver/certs/ca.pem $installdir/$hostname:5558
    49append_ca_file ./tokenserver/certs/ca.pem $installdir/$hostname:5600
    50

View as plain text