-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (34 loc) · 1.48 KB
/
Makefile
File metadata and controls
43 lines (34 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
DOMAIN=tools.jmap.io
DHPARAMDIR=/etc/ssl/dhparam/
DHPARAM=$(DOMAIN).dhparam
PRIVATEKEY=$(DOMAIN).privatekey
PUBLICCERT=$(DOMAIN).publiccert
PACKAGES= \
build-essential \
fcgiwrap \
nginx \
PERLPACKAGES= \
Net::CalDAVTalk \
all: $(DHPARAM) $(PUBLICCERT)
$(DHPARAM):
openssl dhparam -outform pem -out $(DHPARAM) 2048
$(PUBLICCERT) : $(PRIVATEKEY)
openssl req -key $(PRIVATEKEY) -new -nodes -out $@ -days 365 -x509 -subj '/C=AU/ST=Victoria/L=Melbourne/O=$(DOMAIN)/OU=testing/CN=*.$(DOMAIN)'
$(PRIVATEKEY):
openssl genrsa -out $@ 2048;
install: all
apt-get install -y $(PACKAGES)
$(foreach PERLPACKAGE, $(PERLPACKAGES), yes | cpan $(PERLPACKAGE) &&) true
install -o root -g root -m 755 -d $(DHPARAMDIR)
install -o root -g root -m 644 $(DHPARAM) $(DHPARAMDIR)/$(DHPARAM)
install -o root -g root -m 644 $(PUBLICCERT) /etc/ssl/certs/$(PUBLICCERT)
install -o root -g root -m 644 $(PRIVATEKEY) /etc/ssl/private/$(PRIVATEKEY)
install -o root -g root -m 644 nginx.conf /etc/nginx/sites-available/$(DOMAIN).conf
ln -fs /etc/nginx/sites-available/$(DOMAIN).conf /etc/nginx/sites-enabled/$(DOMAIN).conf
/etc/init.d/nginx restart
diff: all
diff -Nu /etc/nginx/sites-enabled/$(DOMAIN).conf nginx.conf || true
diff -Nu /etc/ssl/certs/$(PUBLICCERT) $(PUBLICCERT) || true
diff -Nu /etc/ssl/private/$(PRIVATEKEY) $(PRIVATEKEY) || true
clean:
rm -f $(DHPARAM) $(PUBLICCERT) $(PRIVATEKEY)