Selaa lähdekoodia

Merge pull request #227 from jplock/jp-readlater

Merge pull request #227
Alex Payne 10 vuotta sitten
vanhempi
commit
b5d87cf495

+ 1
- 0
README.textile Näytä tiedosto

@@ -51,6 +51,7 @@ What do you get if you point this thing at a VPS? All kinds of good stuff!
51 51
 * Nightly backups to "Tarsnap":https://www.tarsnap.com/.
52 52
 * Git hosting via "cgit":http://git.zx2c4.com/cgit/about/ and "gitolite":https://github.com/sitaramc/gitolite.
53 53
 * "Newebe":http://newebe.org, a social network.
54
+* Read-it-later via "Wallabag":https://www.wallabag.org/
54 55
 * A bunch of nice-to-have tools like "mosh":http://mosh.mit.edu and "htop":http://htop.sourceforge.net that make life with a server a little easier.
55 56
 
56 57
 No setup is perfect, but the general idea is to provide a bunch of useful services while being reasonably secure and low-maintenance. Set it up, SSH in every couple weeks, but mostly forget about it.

+ 6
- 0
roles/readlater/handlers/main.yml Näytä tiedosto

@@ -0,0 +1,6 @@
1
+- name: import wallabag sql
2
+  shell: PGPASSWORD='{{ wallabag_db_password }}' psql -h localhost -d {{ wallabag_db_database }} -U {{ wallabag_db_username }} -f /var/www/wallabag/install/postgres.sql --set ON_ERROR_STOP=1
3
+  notify: remove install folder
4
+
5
+- name: remove install folder
6
+  file: path=/var/www/wallabag/install state=absent

+ 1
- 0
roles/readlater/tasks/main.yml Näytä tiedosto

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

+ 65
- 0
roles/readlater/tasks/wallabag.yml Näytä tiedosto

@@ -0,0 +1,65 @@
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
+  notify: import wallabag sql
31
+
32
+- name: Build Composer
33
+  shell: curl -sS https://getcomposer.org/installer | php
34
+         chdir=/root
35
+         creates=/root/composer.phar
36
+
37
+- name: Initialize composer
38
+  command: php /root/composer.phar install
39
+           chdir=/var/www/wallabag
40
+           creates=/var/www/wallabag/vendor/autoload.php
41
+
42
+- name: Set wallabag permissions
43
+  file: owner=www-data
44
+        group=www-data
45
+        path=/var/www/wallabag
46
+        recurse=yes
47
+        state=directory
48
+
49
+- name: Create the configuration file
50
+  template: src=var_www_wallabag_inc_poche_config.inc.php.j2
51
+            dest=/var/www/wallabag/inc/poche/config.inc.php
52
+            owner=www-data
53
+            group=www-data
54
+
55
+- name: Configure the Apache HTTP server for wallabag
56
+  template: src=etc_apache2_sites-available_wallabag.j2
57
+            dest=/etc/apache2/sites-available/wallabag
58
+            owner=www-data
59
+            group=www-data
60
+  notify: restart apache
61
+
62
+- name: Enable the wallabag site
63
+  command: a2ensite wallabag
64
+           creates=/etc/apache2/sites-enabled/wallabag
65
+  notify: restart apache

+ 31
- 0
roles/readlater/templates/etc_apache2_sites-available_wallabag.j2 Näytä tiedosto

@@ -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>

+ 58
- 0
roles/readlater/templates/var_www_wallabag_inc_poche_config.inc.php.j2 Näytä tiedosto

@@ -0,0 +1,58 @@
1
+<?php
2
+/**
3
+ * wallabag, self hostable application allowing you to not miss any content anymore
4
+ *
5
+ * @category   wallabag
6
+ * @author     Nicolas Lœuillet <nicolas@loeuillet.org>
7
+ * @copyright  2013
8
+ * @license    http://www.wtfpl.net/ see COPYING file
9
+ */
10
+
11
+define ('SALT', '{{ wallabag_salt }}'); # put a strong string here
12
+define ('LANG', 'en_EN.utf8');
13
+
14
+define ('STORAGE', 'postgres'); # postgres, mysql or sqlite
15
+
16
+define ('STORAGE_SQLITE', ROOT . '/db/poche.sqlite'); # if you are using sqlite, where the database file is located
17
+
18
+# only for postgres & mysql
19
+define ('STORAGE_SERVER', 'localhost');
20
+define ('STORAGE_DB', '{{ wallabag_db_database }}');
21
+define ('STORAGE_USER', '{{ wallabag_db_username }}');
22
+define ('STORAGE_PASSWORD', '{{ wallabag_db_password }}');
23
+
24
+#################################################################################
25
+# Do not trespass unless you know what you are doing
26
+#################################################################################
27
+
28
+// Change this if not using the standart port for SSL - i.e you server is behind sslh
29
+define ('SSL_PORT', 443);
30
+
31
+define ('MODE_DEMO', FALSE);
32
+define ('DEBUG_POCHE', FALSE);
33
+define ('DOWNLOAD_PICTURES', FALSE);
34
+define ('CONVERT_LINKS_FOOTNOTES', FALSE);
35
+define ('REVERT_FORCED_PARAGRAPH_ELEMENTS', FALSE);
36
+define ('SHARE_TWITTER', TRUE);
37
+define ('SHARE_MAIL', TRUE);
38
+define ('SHARE_SHAARLI', FALSE);
39
+define ('SHAARLI_URL', 'http://myshaarliurl.com');
40
+define ('FLATTR', TRUE);
41
+define ('FLATTR_API', 'https://api.flattr.com/rest/v2/things/lookup/?url=');
42
+define ('NOT_FLATTRABLE', '0');
43
+define ('FLATTRABLE', '1');
44
+define ('FLATTRED', '2');
45
+define ('ABS_PATH', 'assets/');
46
+
47
+define ('DEFAULT_THEME', 'baggy');
48
+
49
+define ('THEME', ROOT . '/themes');
50
+define ('LOCALE', ROOT . '/locale');
51
+define ('CACHE', ROOT . '/cache');
52
+
53
+define ('PAGINATION', '10');
54
+
55
+//limit for download of articles during import
56
+define ('IMPORT_LIMIT', 5);
57
+//delay between downloads (in sec)
58
+define ('IMPORT_DELAY', 5);

+ 1
- 0
site.yml Näytä tiedosto

@@ -23,3 +23,4 @@
23 23
     - news
24 24
     - git
25 25
     - newebe
26
+    - readlater

+ 9
- 1
vars/defaults.yml Näytä tiedosto

@@ -105,6 +105,14 @@ 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
- 
108
+
109 109
 # newebe
110 110
 newebe_domain: "newebe.{{ domain }}"
111
+
112
+# wallabag
113
+wallabag_version: 1.6.1b
114
+wallabag_domain: "read.{{ domain }}"
115
+# wallabag_salt: (required)
116
+wallabag_db_username: wallabag
117
+# wallabag_db_password: (required)
118
+wallabag_db_database: wallabag

+ 4
- 0
vars/testing.yml Näytä tiedosto

@@ -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

+ 4
- 0
vars/user.yml Näytä tiedosto

@@ -80,3 +80,7 @@ selfoss_db_password: "TODO"
80 80
 selfoss_username: "{{ main_user_name }}"
81 81
 # this is the sha512 hash of the desired password
82 82
 selfoss_password_hash: "TODO"
83
+
84
+# wallabag
85
+wallabag_salt: TODO
86
+wallabag_db_password: TODO

Loading…
Peruuta
Tallenna