From e4b56b50eb21f0e92507ba2e62703892a5ff32a2 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 14 Feb 2014 18:43:52 -0800 Subject: [PATCH] x.509/Makefile-link: Add a basic Makefile for linking wildcard certs --- x.509/Makefile-link | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 x.509/Makefile-link diff --git a/x.509/Makefile-link b/x.509/Makefile-link new file mode 100644 index 0000000..c73b4b7 --- /dev/null +++ b/x.509/Makefile-link @@ -0,0 +1,29 @@ +# Create links to a wildcard certificate on the fly +# +# This is useful for testing with the nginx-proxy container, but note +# that functional wildcard certificates are only one subdomain level +# deep (e.g. *.example.com matches www.example.com but not +# www.beta.example.com) [1]. +# +# [1]: http://en.wikipedia.org/wiki/Wildcard_certificate + +DOMAIN ?= example.com +HOSTS ?= www static media kibana es + +WILDCARD_KEY ?= /etc/ssl/$(DOMAIN)/wildcard.$(DOMAIN).key +WILDCARD_CERT_CHAIN ?= /etc/ssl/$(DOMAIN)/wildcard.$(DOMAIN)-chain.crt + +FQDNS = $(patsubst %, %.$(DOMAIN), $(HOSTS)) nginx +KEYS = $(patsubst %, %.key, $(FQDNS)) +CERTS = $(patsubst %, %.pem, $(FQDNS)) + +all: $(KEYS) $(CERTS) + +clean: + rm -f *.key *.pem + +$(KEYS): %.key: | $(WILDCARD_KEY) + ln -s "$(WILDCARD_KEY)" "$@" + +$(CERTS): %.pem: | $(WILDCARD_CERT_CHAIN) + ln -s "$(WILDCARD_CERT_CHAIN)" "$@" -- 2.26.2