aboutsummaryrefslogtreecommitdiff
path: root/roles/cosmos
diff options
context:
space:
mode:
Diffstat (limited to 'roles/cosmos')
-rw-r--r--roles/cosmos/tasks/main.yml12
-rw-r--r--roles/cosmos/templates/nginx.conf.j245
2 files changed, 57 insertions, 0 deletions
diff --git a/roles/cosmos/tasks/main.yml b/roles/cosmos/tasks/main.yml
index c44505e..a50205c 100644
--- a/roles/cosmos/tasks/main.yml
+++ b/roles/cosmos/tasks/main.yml
@@ -18,5 +18,17 @@
18 validate: nginx-validate %s /etc/nginx/http.d/cosmos.conf 18 validate: nginx-validate %s /etc/nginx/http.d/cosmos.conf
19 notify: Reload nginx 19 notify: Reload nginx
20 20
21 - name: Provision cosmos CGit instance
22 ansible.builtin.include_role:
23 name: cgit
24 tags:
25 cgit
26 vars:
27 instance: "cosmos"
28 domain: "git.cosmos.party"
29 root_title: "Cosmos Party"
30 root_desc: "Here you can find all our git repositories"
31 scan_path: "/var/lib/git/repositories/"
32
21 tags: 33 tags:
22 - cosmos 34 - cosmos
diff --git a/roles/cosmos/templates/nginx.conf.j2 b/roles/cosmos/templates/nginx.conf.j2
index b9b6c67..98879ac 100644
--- a/roles/cosmos/templates/nginx.conf.j2
+++ b/roles/cosmos/templates/nginx.conf.j2
@@ -48,6 +48,51 @@ server {
48} 48}
49 49
50server { 50server {
51 server_name git.cosmos.party;
52
53 listen unix:/var/run/nginx/http.sock;
54 listen 443 ssl;
55 listen [::]:443 ssl;
56 listen 443 quic;
57 listen [::]:443 quic;
58
59 http2 on;
60 http3 on;
61
62 add_header Alt-Svc 'h3=":443"; ma=86400';
63
64 ssl_certificate /etc/ssl/cosmos.party.fullchain.pem;
65 ssl_certificate_key /etc/ssl/private/cosmos.party.key;
66 ssl_protocols TLSv1.2 TLSv1.3;
67
68 location ~ /.+/(info/refs|git-upload-pack) {
69 include /etc/nginx/fastcgi_params;
70 fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend;
71 fastcgi_param PATH_INFO $uri;
72 fastcgi_param GIT_PROJECT_ROOT /var/lib/git/repositories/;
73 fastcgi_pass unix:/var/run/cgit.sock-1;
74 }
75
76 root /srv/http/git.cosmos.party/;
77 try_files $uri @cgit-static;
78
79 location @cgit-static {
80 root /usr/share/webapps/cgit/;
81 try_files $uri @cgit;
82 }
83
84 location @cgit {
85 include /etc/nginx/fastcgi_params;
86 fastcgi_param SCRIPT_FILENAME /usr/share/webapps/cgit/cgit.cgi;
87 fastcgi_param CGIT_CONFIG /etc/cgitrc-cosmos;
88 fastcgi_param PATH_INFO $uri;
89 fastcgi_param QUERY_STRING $args;
90 fastcgi_param HTTP_HOST $server_name;
91 fastcgi_pass unix:/var/run/cgit.sock-1;
92 }
93}
94
95server {
51 server_name andr.cosmos.party; 96 server_name andr.cosmos.party;
52 97
53 98