Skip to content

Commit 84a02ec

Browse files
authored
Merge pull request #45 from Xpirix/handle_ssl_cert
Handle SSL certificate renewal
2 parents 5e1ec26 + 954aed9 commit 84a02ec

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

deployment/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
# See accompanying Make commands for easy collectstatic etc.
99
volumes:
10-
postgres-data-hello:
10+
postgres-data:
1111
db-backups:
1212
static-data:
1313
media-data:
@@ -18,7 +18,7 @@ services:
1818
db:
1919
image: kartoza/postgis:16-3.4
2020
volumes:
21-
- postgres-data-hello:/var/lib/postgresql
21+
- postgres-data:/var/lib/postgresql
2222
- db-backups:/backups
2323
environment:
2424
- POSTGRES_USER=${DATABASE_USERNAME}

deployment/scripts/renew-ssl.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
4+
# Run daily on crontab e.g.
5+
# Your cron job will be run at: (5 times displayed)
6+
#
7+
# 2021-11-08 11:10:00 UTC
8+
# 2021-11-09 11:10:00 UTC
9+
# 2021-11-10 11:10:00 UTC
10+
# 2021-11-11 11:10:00 UTC
11+
# 2021-11-12 11:10:00 UTC
12+
# ...etc
13+
14+
#25 11 * * * /bin/bash /home/web/QGIS-Changelog-Website/deployment/scripts/renew_ssl.sh > /tmp/ssl-renewal-logs.txt
15+
16+
17+
docker compose -f /home/web/QGIS-Changelog-Website/deployment/docker-compose.yml -f /home/web/QGIS-Changelog-Website/deployment/docker-compose.override.yml run certbot renew

deployment/sites-enabled/prod-ssl.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ server {
2222
# the port your site will be served on
2323
listen 80;
2424
# the domain name it will serve for
25-
server_name plugins.qgis.org;
26-
27-
# Redirect all HTTP traffic to HTTPS
28-
return 301 https://$server_name$request_uri;
25+
server_name changelog.qgis.org;
2926

3027
charset utf-8;
3128

@@ -96,6 +93,9 @@ server {
9693
return 403;
9794
}
9895

96+
# Redirect all HTTP traffic to HTTPS
97+
return 301 https://$server_name$request_uri;
98+
9999
# Redirect members and certification to the new location
100100
include redirections.conf;
101101
}

0 commit comments

Comments
 (0)