Larry Fox пре 10 година
родитељ
комит
158503b6ca

+ 26
- 0
roles/git/tasks/cgit.yml Прегледај датотеку

@@ -0,0 +1,26 @@
1
+
2
+- name: Download cgit release
3
+  get_url: url=http://git.zx2c4.com/cgit/snapshot/cgit-{{ cgit_version }}.tar.xz
4
+           dest=/root/cgit-{{ cgit_version }}.tar.xz
5
+
6
+- name: Decompress cgit source
7
+  command: tar xvfJ /root/cgit-{{ cgit_version }}.tar.xz
8
+           chdir=/root
9
+           creates=/root/cgit-{{ cgit_version }}/configure
10
+
11
+- name: Build and install cgit
12
+  shell: make get-git ; make ; make install
13
+         executable=/bin/bash
14
+         chdir=/root/cgit-{{ cgit_version }}
15
+         creates=/var/www/htdocs/cgit/cgit.cgi
16
+
17
+- name: Copy cgit apache config
18
+  template: src=etc_apache2_sites-available_cgit.j2
19
+            dest=/etc/apache2/sites-available/cgit
20
+            group=www-data
21
+            owner=www-data
22
+  notify: restart apache
23
+
24
+- name: Enable the cgit server
25
+  command: a2ensite cgit creates=/etc/apache2/sites-enabled/cgit
26
+  notify: restart apache

+ 1
- 0
roles/git/tasks/main.yml Прегледај датотеку

@@ -0,0 +1 @@
1
+- include: cgit.yml tags=cgit

+ 36
- 0
roles/git/templates/etc_apache2_sites-available_cgit.j2 Прегледај датотеку

@@ -0,0 +1,36 @@
1
+<VirtualHost *:80>
2
+    ServerName {{ cgit_domain }}
3
+
4
+    Redirect permanent / https://{{ cgit_domain }}/
5
+</VirtualHost>
6
+
7
+<VirtualHost *:443>
8
+    ServerName {{ cgit_domain }}
9
+
10
+    SSLEngine on
11
+    SSLProtocol ALL -SSLv2
12
+    SSLHonorCipherOrder On
13
+    SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5:!DSS
14
+    SSLCertificateFile      /etc/ssl/certs/wildcard_public_cert.crt
15
+    SSLCertificateKeyFile   /etc/ssl/private/wildcard_private.key
16
+    SSLCACertificateFile    /etc/ssl/certs/wildcard_ca.pem
17
+    Header add Strict-Transport-Security "max-age=15768000; includeSubdomains"
18
+
19
+    DocumentRoot /var/www/htdocs/cgit/
20
+
21
+    <Directory "/var/www/htdocs/cgit/">
22
+        AllowOverride None
23
+        Options +ExecCGI
24
+        Order allow,deny
25
+        Allow from all
26
+    </Directory>
27
+
28
+    Alias       /cgit.png   /var/www/htdocs/cgit/cgit.png
29
+    Alias       /cgit.css   /var/www/htdocs/cgit/cgit.css
30
+    ScriptAlias /           /var/www/htdocs/cgit/cgit.cgi/
31
+    RewriteRule ^$          / [R]
32
+    RewriteRule ^/(.*)$     /cgit.cgi/$1 [PT]
33
+
34
+    CustomLog /var/log/apache2/cgit_access.log combined
35
+    ErrorLog /var/log/apache2/cgit_error.log
36
+</VirtualHost>

+ 1
- 0
site.yml Прегледај датотеку

@@ -21,3 +21,4 @@
21 21
     - vpn
22 22
     - tarsnap
23 23
     - news
24
+    - git

+ 4
- 0
vars/defaults.yml Прегледај датотеку

@@ -97,3 +97,7 @@ selfoss_domain: "news.{{ domain }}"
97 97
 selfoss_db_username: selfoss
98 98
 # selfoss_db_password: (required)
99 99
 selfoss_db_database: selfoss
100
+
101
+# git
102
+cgit_version: 0.10.1
103
+cgit_domain: "git.{{ domain }}"

Loading…
Откажи
Сачувај