Просмотр исходного кода

Initial work to support wallabag

Justin Plock 10 лет назад
Родитель
Сommit
79fd923668
Аккаунт пользователя с таким Email не найден

+ 1
- 0
roles/readlater/tasks/main.yml Просмотреть файл

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

+ 58
- 0
roles/readlater/tasks/wallabag.yml Просмотреть файл

@@ -0,0 +1,58 @@
1
+- name: Clone wallabag
2
+  git: repo=https://github.com/wallabag/wallabag.git
3
+       dest=/var/www/wallabag
4
+       version={{ wallabag_version }}
5
+
6
+- name: Install wallabag dependencies
7
+  apt: pkg={{ item }} state=present
8
+  with_items:
9
+    - php5
10
+    - php5-mcrypt
11
+    - php5-tidy
12
+    - php5-curl
13
+    - php5-pgsql
14
+    
15
+- name: Create database user for wallabag
16
+  postgresql_user: login_host=localhost
17
+                   login_user={{ db_admin_username }}
18
+                   login_password="{{ db_admin_password }}"
19
+                   name={{ wallabag_db_username }}
20
+                   password="{{ wallabag_db_password }}"
21
+                   state=present
22
+
23
+- name: Create database for wallabag
24
+  postgresql_db: login_host=localhost
25
+                 login_user={{ db_admin_username }}
26
+                 login_password="{{ db_admin_password }}"
27
+                 name={{ wallabag_db_database }}
28
+                 state=present
29
+                 owner={{ wallabag_db_username }}
30
+
31
+- name: Build Composer
32
+  shell: curl -sS https://getcomposer.org/installer | php
33
+         chdir=/root
34
+         creates=/root/composer.phar
35
+
36
+- name: Initialize composer
37
+  command: php /root/composer.phar install
38
+           chdir=/var/www/wallabag
39
+           creates=/var/www/wallabag/vendor/autoload.php
40
+
41
+- name: Set wallabag permissions
42
+  file: owner=www-data
43
+        group=www-data
44
+        path=/var/www/wallabag
45
+        recurse=yes
46
+        state=directory
47
+
48
+- name: Configure the Apache HTTP server for wallabag
49
+  template: src=etc_apache2_sites-available_wallabag.j2
50
+            dest=/etc/apache2/sites-available/wallabag
51
+            group=www-data
52
+            owner=www-data
53
+  notify: restart apache
54
+
55
+- name: Enable the wallabag site
56
+  command: a2ensite wallabag
57
+           creates=/etc/apache2/sites-enabled/wallabag
58
+  notify: restart apache

+ 31
- 0
roles/readlater/templates/etc_apache2_sites-available_wallabag.j2 Просмотреть файл

@@ -0,0 +1,31 @@
1
+<VirtualHost *:80>
2
+    ServerName {{ wallabag_domain }}
3
+
4
+    Redirect permanent / https://{{ wallabag_domain }}/
5
+</VirtualHost>
6
+
7
+<VirtualHost *:443>
8
+    ServerName {{ wallabag_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/wallabag
20
+    Options                 -Indexes
21
+
22
+    ErrorLog                /var/log/apache2/wallabag.info-error_log
23
+    CustomLog               /var/log/apache2/wallabag.info-access_log common
24
+
25
+    <Directory /var/www/wallabag>
26
+        AllowOverride All
27
+        Order allow,deny
28
+        allow from all
29
+        DirectoryIndex index.php
30
+    </Directory>
31
+</VirtualHost>

+ 1
- 0
site.yml Просмотреть файл

@@ -22,3 +22,4 @@
22 22
     - tarsnap
23 23
     - news
24 24
     - git
25
+    - readlater

+ 8
- 0
vars/defaults.yml Просмотреть файл

@@ -105,3 +105,11 @@ selfoss_db_database: selfoss
105 105
 cgit_version: 0.10.1
106 106
 cgit_domain: "git.{{ domain }}"
107 107
 gitolite_version: 3.5.3.1
108
+
109
+# wallabag
110
+wallabag_version: 1.6.1b
111
+# wallabag_salt: (required)
112
+wallabag_domain: "read.{{ domain }}"
113
+wallabag_db_username: wallabag
114
+# wallabag_db_password: (required)
115
+wallabag_db_database: wallabag

+ 4
- 0
vars/testing.yml Просмотреть файл

@@ -74,3 +74,7 @@ selfoss_username: "{{ main_user_name }}"
74 74
 # this is the sha512 hash of the desired password
75 75
 selfoss_password_hash: "f7fbba6e0636f890e56fbbf3283e524c6fa3204ae298382d624741d0dc6638326e282c41be5e4254d8820772c5518a2c5a8c0c7f7eda19594a7eb539453e1ed7"
76 76
 # foo
77
+
78
+# wallabag
79
+wallabag_salt: testing
80
+wallabag_db_password: testPassword

Загрузка…
Отмена
Сохранить