Skip to content

Commit 4837c0b

Browse files
committed
(#39) xmpp2: preliminary certbot setup
1 parent 5c713b2 commit 4837c0b

File tree

7 files changed

+46
-12
lines changed

7 files changed

+46
-12
lines changed

Folder.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:Boolean x:Key="/Default/UserDictionary/Words/=certonly/@EntryIndexedValue">True</s:Boolean>
23
<s:Boolean x:Key="/Default/UserDictionary/Words/=codingteam/@EntryIndexedValue">True</s:Boolean>
34
<s:Boolean x:Key="/Default/UserDictionary/Words/=lineinfile/@EntryIndexedValue">True</s:Boolean>
45
<s:Boolean x:Key="/Default/UserDictionary/Words/=loglist/@EntryIndexedValue">True</s:Boolean>

xmpp2/certbot.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-FileCopyrightText: 2025 Friedrich von Never <friedrich@fornever.me>
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
---
6+
- name: Configure Certbot for certificate renewal
7+
hosts: xmpp2
8+
become: true
9+
10+
tasks:
11+
- name: Install certbot
12+
community.general.snap:
13+
name: certbot
14+
classic: true
15+
16+
# One-time setup should be performed manually, see the documentation:
17+
# https://certbot.eff.org/instructions?ws=nginx&os=snap&tab=standard
18+
#
19+
# sudo certbot certonly --nginx -d codingteam.org.ru -d loglist.xyz -d www.loglist.xyz
20+
#
21+
# Verify the changes to the web server configuration files performed by this command.
22+
#
23+
# Further updates are done by snap.certbot.renew.timer — see `systemctl list-timers` for details.

xmpp2/default.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
- import_playbook: docker.yml
88
- import_playbook: codingteam.org.ru.yml
99
- import_playbook: loglist.yml
10+
- import_playbook: certbot.yml

xmpp2/files/nginx/conf.d/codingteam.org.ru.conf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
# SPDX-License-Identifier: MIT
44

55
server {
6-
# TODO: enable back after we set up SSL
7-
# listen 443 ssl http2;
8-
listen 443;
6+
listen 443 ssl http2;
97
server_name codingteam.org.ru;
8+
include /etc/nginx/ssl.conf;
109

1110
location /old-logs/ {
1211
alias /opt/codingteam/old-logs/;

xmpp2/files/nginx/conf.d/loglist.conf

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
# SPDX-License-Identifier: MIT
44

55
server {
6-
# TODO: enable back after we set up SSL
7-
# listen 443 ssl http2;
6+
listen 443 ssl http2;
87
server_name loglist.xyz;
9-
# TODO: include /etc/nginx/ssl.conf;
8+
include /etc/nginx/ssl.conf;
109

1110
location / {
1211
proxy_set_header X-Forwarded-Host $host;
@@ -19,10 +18,9 @@ server {
1918
}
2019

2120
server {
22-
# TODO: enable back after we set up SSL
23-
# listen 443 ssl http2;
21+
listen 443 ssl http2;
2422
server_name *.loglist.xyz;
25-
# TODO: include /etc/nginx/ssl.conf;
23+
include /etc/nginx/ssl.conf;
2624

2725
location / {
2826
return 301 https://loglist.xyz$request_uri;

xmpp2/files/nginx/ssl.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-FileCopyrightText: 2017-2025 codingteam/devops contributors <https://github.com/codingteam/devops>
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
ssl_certificate /etc/letsencrypt/live/codingteam.org.ru-0001/fullchain.pem;
6+
ssl_certificate_key /etc/letsencrypt/live/codingteam.org.ru-0001/privkey.pem;
7+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
8+
ssl_ciphers "HIGH:!aNULL:!MD5:!kEDH";
9+
add_header Strict-Transport-Security 'max-age=15552000';

xmpp2/nginx.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
- name: Remove the *-enabled and *-available directories
2828
ansible.builtin.file:
29-
path: "/etc/nginx/{{ item }}"
29+
path: '/etc/nginx/{{ item }}'
3030
state: absent
3131
loop:
3232
- modules-available
@@ -36,7 +36,10 @@
3636

3737
- name: Set up the main nginx configuration file
3838
ansible.builtin.copy:
39-
src: nginx/nginx.conf
40-
dest: /etc/nginx/nginx.conf
39+
src: 'nginx/{{ item }}'
40+
dest: '/etc/nginx/{{ item }}'
4141
mode: "u=rx,go=rx"
42+
loop:
43+
- nginx.conf
44+
- ssl.conf
4245
notify: Reload nginx

0 commit comments

Comments
 (0)