Compare commits
78
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d743f3f08 | ||
|
|
6653823fa5 | ||
|
|
83bcaeeebf | ||
|
|
7f217a03f1 | ||
|
|
2df1fd1523 | ||
|
|
bf73c033be | ||
|
|
c28bb5e784 | ||
|
|
26cba7455c | ||
|
|
b439d91d0e | ||
|
|
82de650b79 | ||
|
|
45aedd9b18 | ||
|
|
f247d44230 | ||
|
|
fda4e23f56 | ||
|
|
006d03d73b | ||
|
|
d978697dad | ||
|
|
62684f48ab | ||
|
|
acf8946506 | ||
|
|
56d184abd6 | ||
|
|
35ea64604f | ||
|
|
1c99af96d5 | ||
|
|
0e2d47097f | ||
|
|
0461e0c08c | ||
|
|
5a10741a91 | ||
|
|
948d189305 | ||
|
|
4ea3335b19 | ||
|
|
2af6a89315 | ||
|
|
0bdaa05577 | ||
|
|
e46bce5f85 | ||
|
|
817961dcf4 | ||
|
|
c9252e9813 | ||
|
|
721dc5e924 | ||
|
|
b45e5e2df7 | ||
|
|
92a6cdea42 | ||
|
|
cdf38224d1 | ||
|
|
a0e17b5834 | ||
|
|
861d1fca09 | ||
|
|
770054a038 | ||
|
|
180943f4c5 | ||
|
|
fd01d5f787 | ||
|
|
74b52adfdf | ||
|
|
6a0aedd1e5 | ||
|
|
d80b0fba88 | ||
|
|
cf7d0ebd33 | ||
|
|
a7cf9cc25b | ||
|
|
81c7ff173a | ||
|
|
f3013f0ef8 | ||
|
|
a6a6ae6a5e | ||
|
|
6e554926dc | ||
|
|
b619989563 | ||
|
|
f506d48223 | ||
|
|
f869f5dbe3 | ||
|
|
0d93de311e | ||
|
|
ce26163993 | ||
|
|
6c253f3d53 | ||
|
|
dd7dc76c26 | ||
|
|
f38959bd46 | ||
|
|
183975e3cd | ||
|
|
859e081eb8 | ||
|
|
87d2a0e1ef | ||
|
|
d1f4146564 | ||
|
|
6359bbd88d | ||
|
|
b2840b342f | ||
|
|
883a045614 | ||
|
|
08e064c1eb | ||
|
|
ca33b0271c | ||
|
|
d1b8342ca8 | ||
|
|
ce94faa458 | ||
|
|
c7b8e0659d | ||
|
|
74d775d7d6 | ||
|
|
c18442e45c | ||
|
|
ed8436505a | ||
|
|
af3c127a81 | ||
|
|
14f79d54de | ||
|
|
2d615e67c7 | ||
|
|
32584a96da | ||
|
|
46643abc4f | ||
|
|
2e0aa3d6dd | ||
|
|
098ee388d2 |
+6
-3
@@ -1,3 +1,6 @@
|
||||
data/secrets/
|
||||
data/certbot/
|
||||
data/traefik/
|
||||
data/openvpn
|
||||
data/secrets
|
||||
data/certbot
|
||||
data/traefik
|
||||
data/caddy
|
||||
data.tar.gz
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
export:
|
||||
tar cvzf data.tgz data
|
||||
gpg --encrypt --recipient 'marc.partensky@gmail.com' data.tgz
|
||||
rm data.tgz
|
||||
clean:
|
||||
rm data.tgz.gpg
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
## Domains
|
||||
- https://marcpartensky.com
|
||||
- https://www.marcpartensky.com
|
||||
- https://pandoc.marcpartensky.com
|
||||
- https://ialab.marcpartensky.com
|
||||
- https://notebook.marcpartensky.com
|
||||
@@ -10,12 +9,26 @@
|
||||
- https://cloud.marcpartensky.com
|
||||
- https://wordpress.marcpartensky.com
|
||||
- https://git.marcpartensky.com
|
||||
- https://business.marcpartensky.com
|
||||
- https://todolist.marcpartensky.com
|
||||
- https://api.todolist.marcpartensky.com
|
||||
- https://marc.wp.marcpartensky.com
|
||||
- https://alex.wp.marcpartensky.com
|
||||
- https://uml.marcpartensky.com
|
||||
- https://grafana.marcpartensky.com
|
||||
- https://prometheus.marcpartensky.com
|
||||
- https://dns.marcpartensky.com
|
||||
<!-- - https://dev.marcpartensky.com -->
|
||||
<!-- - https://box.marcpartensky.com -->
|
||||
<!-- - https://business.marcpartensky.com -->
|
||||
<!-- - https://glou.marcpartensky.com -->
|
||||
<!-- - https://minecraft.marcpartensky.com -->
|
||||
|
||||
## Reverse proxy
|
||||
The `docker-compose.yml` configuration is compatible with the following reverse-proxies:
|
||||
- traefik
|
||||
- caddy
|
||||
- nginx
|
||||
|
||||
## Commands
|
||||
```sh
|
||||
certbot certonly -d newdomain.com -n --standalone
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
mail._domainkey.marcpartensky.com marcpartensky.com:mail:/etc/opendkim/keys/marcpartensky.com/mail.private
|
||||
@@ -0,0 +1 @@
|
||||
*@marcpartensky.com mail._domainkey.marcpartensky.com
|
||||
@@ -0,0 +1,2 @@
|
||||
127.0.0.1
|
||||
localhost
|
||||
@@ -0,0 +1,51 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIJKAIBAAKCAgEAouPk5YPodxb41YBVY4xdeJGRCzUXSrVYUZc2ukE2HqIqWsiv
|
||||
U7vPgBFlclBzMMJVdrt/NAt3NnulzWyQg6V+A8wSYkCNpevGlsp2TvkL8Mcuf1LV
|
||||
GfNScjycJ8nC8LhRgHZZJ876yM97mEK+J4X4k8X1/IWzwUSmOOAB3EpfuQLMVQL8
|
||||
KQh5gyAdvokbnmq+r9VqOyiFbZ03JzyW+RPMTQxMu2kid+KH336/j5Tvza8ITN3v
|
||||
qZRVfZJjJzCJHvx4iKpWy2iOFxNThlUTbnZ93xFEA+36s+pU2hT22RGN8qzSQFBt
|
||||
IXKEqyNJ4KoJ/X53ukYc4ZSmpRAz/PhxX9eIgurUwKXrSwX5127+eCIanRT4aMYS
|
||||
obuue7IGlHixNI4dmZW4H0kMs5MwDItYzNQfmsv7HDjkfsRhBlFpV5LMES1g4L4r
|
||||
WQ85kKcQYfl60FyReCKrrBGiFi9H8iEK5gDIgOFJ37qNa3yLolll31YdkhONsFyr
|
||||
OyGrEAcCzRHOa9jq9KEa5p8QyRekG75aGEfGlRMntkM1KAhdyjuyixle3I7SYywq
|
||||
tqJfjAButWJdvhuPf1jWmqzs97AoJZb2mYzgP/ur9sqHR8EBJ8HN9thRgf4Qsyxp
|
||||
PTO9tOU+4GtT9YSVSGjXHQ0Sn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XrSwX5127+eCIanRT4aMYSobuue7IGlHixNI4dmZW4H0kMs5MwDItYzNQfmsv7HDjkfsRhBlFpV5LMES1g4L4rWQ85kKcQYfl60FyReCKrrBGi"
|
||||
"Fi9H8iEK5gDIgOFJ37qNa3yLolll31YdkhONsFyrOyGrEAcCzRHOa9jq9KEa5p8QyRekG75aGEfGlRMntkM1KAhdyjuyixle3I7SYywqtqJfjAButWJdvhuPf1jWmqzs97AoJZb2mYzgP/ur9sqHR8EBJ8HN9thRgf4QsyxpPTO9tOU+4GtT9YSVSGjXHQ0SnPDAj8YxjOql5RDalmiP91NmAeGUfCbLwUkCAwEAAQ==" ) ; ----- DKIM key mail for marcpartensky.com
|
||||
@@ -0,0 +1 @@
|
||||
marc@marcpartensky.com|{SHA512-CRYPT}$6$G1SLI/9La3kXrkrt$9MdkaLuUEoa2n8mVVZoCwmy0g6MrvlHDL0i2FVrUakAXi3pgPfo/HNz/mLWRFS6nG1oOeP8IMbTGM.JptPR../
|
||||
@@ -0,0 +1,5 @@
|
||||
# Please restart ClamAV after changing signatures
|
||||
Example-Signature.Ignore-1
|
||||
PUA.Win.Trojan.EmbeddedPDF-1
|
||||
PUA.Pdf.Trojan.EmbeddedJavaScript-1
|
||||
PUA.Pdf.Trojan.OpenActionObjectwithJavascript-1
|
||||
@@ -0,0 +1,16 @@
|
||||
server {
|
||||
listen 25565;
|
||||
server_name mc.marcpartensky.com;
|
||||
|
||||
access_log /var/log/nginx/reverse-access.log;
|
||||
error_log /var/log/nginx/reverse-error.log;
|
||||
|
||||
location / {
|
||||
proxy_pass http://marcpartensky.com:7065;
|
||||
# proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name ialab.marcpartensky.com;
|
||||
|
||||
# ssl keys + letsencrypt
|
||||
ssl_certificate /etc/letsencrypt/live/ialab.marcpartensky.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/ialab.marcpartensky.com/privkey.pem;
|
||||
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
# logs
|
||||
access_log /var/log/nginx/reverse-access.log;
|
||||
error_log /var/log/nginx/reverse-error.log;
|
||||
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
allow all;
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://ialab;
|
||||
# proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name poiret.marcpartensky.com;
|
||||
|
||||
# ssl keys + letsencrypt
|
||||
ssl_certificate /etc/letsencrypt/live/poiret.marcpartensky.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/poiret.marcpartensky.com/privkey.pem;
|
||||
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
# logs
|
||||
access_log /var/log/nginx/reverse-access.log;
|
||||
error_log /var/log/nginx/reverse-error.log;
|
||||
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
allow all;
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://poiret:8000;
|
||||
# proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name vnc.marcpartensky.com;
|
||||
|
||||
# ssl keys + letsencrypt
|
||||
ssl_certificate /etc/letsencrypt/live/vnc.marcpartensky.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/vnc.marcpartensky.com/privkey.pem;
|
||||
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
# logs
|
||||
access_log /var/log/nginx/reverse-access.log;
|
||||
error_log /var/log/nginx/reverse-error.log;
|
||||
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
allow all;
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://vnc:6901;
|
||||
# proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name alex.wp.marcpartensky.com;
|
||||
|
||||
# ssl keys + letsencrypt
|
||||
ssl_certificate /etc/letsencrypt/live/alex.wp.marcpartensky.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/alex.wp.marcpartensky.com/privkey.pem;
|
||||
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
# logs
|
||||
access_log /var/log/nginx/reverse-access.log;
|
||||
error_log /var/log/nginx/reverse-error.log;
|
||||
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
allow all;
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://wordpress_alex;
|
||||
# proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
server_name marc.wp.marcpartensky.com;
|
||||
|
||||
# ssl keys + letsencrypt
|
||||
ssl_certificate /etc/letsencrypt/live/marc.wp.marcpartensky.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/marc.wp.marcpartensky.com/privkey.pem;
|
||||
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
|
||||
# logs
|
||||
access_log /var/log/nginx/reverse-access.log;
|
||||
error_log /var/log/nginx/reverse-error.log;
|
||||
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
allow all;
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://wordpress_marc;
|
||||
# proxy_redirect off;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
}
|
||||
}
|
||||
+873
-84
File diff suppressed because it is too large
Load Diff
@@ -1,80 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! [ -x "$(command -v docker-compose)" ]; then
|
||||
echo 'Error: docker-compose is not installed.' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
domains=(marcpartensky.com www.marcpartensky.com)
|
||||
rsa_key_size=4096
|
||||
data_path="./data/certbot"
|
||||
email="" # Adding a valid address is strongly recommended
|
||||
staging=0 # Set to 1 if you're testing your setup to avoid hitting request limits
|
||||
|
||||
if [ -d "$data_path" ]; then
|
||||
read -p "Existing data found for $domains. Continue and replace existing certificate? (y/N) " decision
|
||||
if [ "$decision" != "Y" ] && [ "$decision" != "y" ]; then
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -e "$data_path/conf/options-ssl-nginx.conf" ] || [ ! -e "$data_path/conf/ssl-dhparams.pem" ]; then
|
||||
echo "### Downloading recommended TLS parameters ..."
|
||||
mkdir -p "$data_path/conf"
|
||||
curl -s https://raw.githubusercontent.com/certbot/certbot/master/certbot-nginx/certbot_nginx/_internal/tls_configs/options-ssl-nginx.conf > "$data_path/conf/options-ssl-nginx.conf"
|
||||
curl -s https://raw.githubusercontent.com/certbot/certbot/master/certbot/certbot/ssl-dhparams.pem > "$data_path/conf/ssl-dhparams.pem"
|
||||
echo
|
||||
fi
|
||||
|
||||
echo "### Creating dummy certificate for $domains ..."
|
||||
path="/etc/letsencrypt/live/$domains"
|
||||
mkdir -p "$data_path/conf/live/$domains"
|
||||
docker-compose run --rm --entrypoint "\
|
||||
openssl req -x509 -nodes -newkey rsa:$rsa_key_size -days 1\
|
||||
-keyout '$path/privkey.pem' \
|
||||
-out '$path/fullchain.pem' \
|
||||
-subj '/CN=localhost'" certbot
|
||||
echo
|
||||
|
||||
|
||||
echo "### Starting nginx ..."
|
||||
docker-compose up --force-recreate -d nginx
|
||||
echo
|
||||
|
||||
echo "### Deleting dummy certificate for $domains ..."
|
||||
docker-compose run --rm --entrypoint "\
|
||||
rm -Rf /etc/letsencrypt/live/$domains && \
|
||||
rm -Rf /etc/letsencrypt/archive/$domains && \
|
||||
rm -Rf /etc/letsencrypt/renewal/$domains.conf" certbot
|
||||
echo
|
||||
|
||||
|
||||
echo "### Requesting Let's Encrypt certificate for $domains ..."
|
||||
#Join $domains to -d args
|
||||
domain_args=""
|
||||
for domain in "${domains[@]}"; do
|
||||
domain_args="$domain_args -d $domain"
|
||||
done
|
||||
|
||||
# Select appropriate email arg
|
||||
case "$email" in
|
||||
"") email_arg="--register-unsafely-without-email" ;;
|
||||
*) email_arg="--email $email" ;;
|
||||
esac
|
||||
|
||||
# Enable staging mode if needed
|
||||
if [ $staging != "0" ]; then staging_arg="--staging"; fi
|
||||
|
||||
docker-compose run --rm --entrypoint "\
|
||||
certbot certonly --webroot -w /var/www/certbot \
|
||||
$staging_arg \
|
||||
$email_arg \
|
||||
$domain_args \
|
||||
--rsa-key-size $rsa_key_size \
|
||||
--agree-tos \
|
||||
--force-renewal" certbot
|
||||
echo
|
||||
|
||||
echo "### Reloading nginx ..."
|
||||
docker-compose exec nginx nginx -s reload
|
||||
Reference in New Issue
Block a user