This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcertbot-piratas.bash
More file actions
executable file
·128 lines (120 loc) · 2.04 KB
/
certbot-piratas.bash
File metadata and controls
executable file
·128 lines (120 loc) · 2.04 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
## Comentar linhas a serem ignoradas com uma # simples
## Linhas com ## dupla são comentários
## Selecionar domínios
DOMINIOS=( \
#"movimentopirata.xyz" \
"partidopirata.org" \
#"partidopirata.xyz" \
#"piratas.xyz" \
#"pirata.xyz" \
)
## Selecionar subdomínios
SUBDOMINIOS=( \
"entwickler" \
"42" \
"404" \
"502" \
"503" \
"775" \
"781" \
"ad" \
"adhocracy" \
"anapirata" \
"apoiar" \
"apoiar-dev" \
"apoio" \
"apoio-dev" \
"assembleia" \
"assembleia2014" \
"assembleia2016" \
"assembleia2018" \
"assembleia2020" \
"assembleia2022" \
"biblioteca" \
"blog" \
"btorrent" \
"coinhive" \
"crowdfunding" \
"dev" \
"embarque" \
"etherpad" \
"faq" \
"ftp" \
"financiamento" \
"git" \
"github" \
"gtc" \
"gti" \
"hub" \
#"imap" \
"iniciativa" \
"irc" \
"iuf" \
"ipfs" \
"lf" \
"liquidfeedback" \
"listas" \
"loomio" \
#"mail" \
"membros" \
"midia" \
"mg" \
"mumble" \
"mx" \
"nao" \
"nao-dev" \
"naofode" \
"noosfero" \
"ns" \
"ns1" \
"ns2" \
"ns3" \
"pad" \
"radio" \
"rede" \
"rs" \
"rio" \
"rj" \
"sac" \
"saopaulo" \
"sim" \
"site" \
#"smtp" \
"status" \
"social" \
"sul" \
"taiga" \
"teste" \
"tesouraria" \
"torrent" \
"transparencia" \
"trello" \
"wiki" \
"www" \
"zeronet" \
)
## TODO: Usar webroot, pra não precisar parar o servidor web
CERTBOT_MODO="certonly"
## Selecionar porta para tls-sni-01 (aparentemente só funciona 443 e 80, daí a necessidade de parar o servidor web)
CERTBOT_PORTA="443"
## Conta para gerar certificados
CERTBOT_CONTA="admin@partidopirata.org"
## Parâmetros
CERTBOT_OPCOES=(
"--standalone" \
"--standalone-supported-challenges tls-sni-01" \
"--tls-sni-01-port ${CERTBOT_PORTA}" \
#"--agree-tos" \
#"--keep-until-expiring" \
"--allow-subset-of-names"
#"--no-self-upgrade" \
"--email ${CERTBOT_CONTA}" \
)
## Não deveria ser necessário alterar daqui pra frente
sudo systemctl -l stop nginx.service
for DOMINIO in ${DOMINIOS[@]}
do
sudo certbot "${CERTBOT_MODO}" "${CERTBOT_OPCOES[@]}" -d "${DOMINIO}" $(for SUBDOMINIO in ${SUBDOMINIOS[@]}; do echo -n " -d ${SUBDOMINIO}.${DOMINIO}"; done)
done
sudo systemctl -l start nginx.service