Parcourir la source

Merge pull request #113 from brucespang/rss

Add an RSS Reader
Luke Cyca il y a 11 ans
Parent
révision
30ac25a6cf

+ 1
- 0
README.textile Voir le fichier

@@ -31,6 +31,7 @@ What do you get if you point this thing at a VPS? All kinds of good stuff!
31 31
 * "SMTP":https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol over SSL via Postfix, including a nice set of "DNSBLs":https://en.wikipedia.org/wiki/DNSBL to discard spam before it ever hits your filters.
32 32
 * Webmail via "Roundcube":http://www.roundcube.net/.
33 33
 * Jabber/"XMPP":http://xmpp.org/ instant messaging via "Prosody":http://prosody.im/.
34
+* An RSS Reader via "Selfoss":http://selfoss.aditu.de/.
34 35
 * Virtual domains for your email, backed by "MySQL":https://www.mysql.com/.
35 36
 * Secure on-disk storage for email and more via "EncFS":http://www.arg0.net/encfs.
36 37
 * Spam fighting via "DSPAM":http://dspam.sourceforge.net/ and "Postgrey":http://postgrey.schweikert.ch/.

+ 1
- 0
roles/news/tasks/main.yml Voir le fichier

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

+ 38
- 0
roles/news/tasks/selfoss.yml Voir le fichier

@@ -0,0 +1,38 @@
1
+- name: Clone Selfoss
2
+  git: repo=https://github.com/SSilence/selfoss.git
3
+       dest=/var/www/selfoss
4
+
5
+- name: Set selfoss permissions
6
+  action: file owner=www-data group=www-data path=/var/www/selfoss recurse=yes state=directory
7
+
8
+- name: Create database user for selfoss
9
+  mysql_user: user={{ selfoss_mysql_username }} password={{ selfoss_mysql_password }} state=present priv="selfoss.*:ALL"
10
+
11
+- name: Create database for selfoss
12
+  mysql_db: name={{ selfoss_mysql_database }} state=present
13
+
14
+- name: Install selfoss config.ini
15
+  template: src=var_www_selfoss_config.ini.j2 dest=/var/www/selfoss/config.ini group=www-data owner=www-data
16
+
17
+- name: Enable Apache rewrite module
18
+  command: a2enmod rewrite creates=/etc/apache2/mods-enabled/rewrite.load
19
+  notify: restart apache
20
+
21
+- name: Enable Apache headers module
22
+  command: a2enmod headers creates=/etc/apache2/mods-enabled/headers.load
23
+  notify: restart apache
24
+
25
+- name: Enable Apache expires module
26
+  command: a2enmod expires creates=/etc/apache2/mods-enabled/expires.load
27
+  notify: restart apache
28
+
29
+- name: Configure the Apache HTTP server for selfoss
30
+  template: src=etc_apache2_sites-available_selfoss.j2 dest=/etc/apache2/sites-available/selfoss group=www-data owner=www-data
31
+  notify: restart apache
32
+
33
+- name: Enable the selfoss site
34
+  command: a2ensite selfoss creates=/etc/apache2/sites-enabled/selfoss
35
+  notify: restart apache
36
+
37
+- name: Install selfoss cronjob
38
+  cron: name="ownCloud" user="www-data" minute="*/5" job="curl -k 'https://{{ selfoss_domain }}/update'"

+ 31
- 0
roles/news/templates/etc_apache2_sites-available_selfoss.j2 Voir le fichier

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

+ 28
- 0
roles/news/templates/var_www_selfoss_config.ini.j2 Voir le fichier

@@ -0,0 +1,28 @@
1
+; see https://github.com/SSilence/selfoss/wiki/Configuration for more information about the configuration parameters
2
+[globals]
3
+db_type=mysql
4
+db_database={{selfoss_mysql_database}}
5
+db_username={{selfoss_mysql_username}}
6
+db_password={{selfoss_mysql_password}}
7
+db_port=3306
8
+db_prefix=
9
+logger_level=DEBUG
10
+items_perpage=50
11
+items_lifetime=30
12
+base_url=
13
+username={{selfoss_username}}
14
+password={{selfoss_password_hash}}
15
+salt=
16
+public=0
17
+rss_title=selfoss feed
18
+rss_max_items=1000
19
+rss_mark_as_read=0
20
+homepage=unread
21
+language=0
22
+auto_mark_as_read=1
23
+anonymizer=
24
+use_system_font=1
25
+readability=
26
+share=gtfprde
27
+allow_public_update_access=0
28
+unread_order=

+ 1
- 1
site.yml Voir le fichier

@@ -20,4 +20,4 @@
20 20
     - owncloud
21 21
     - vpn
22 22
     - tarsnap
23
-
23
+    - news

+ 19
- 0
tests.py Voir le fichier

@@ -69,6 +69,25 @@ class WebTests(unittest.TestCase):
69 69
             r.content
70 70
         )
71 71
 
72
+    def test_selfoss_http(self):
73
+        """selfoss is redirecting to https and displaying login page"""
74
+        r = requests.get('http://news.' + TEST_SERVER)
75
+
76
+        # We should be redirected to https
77
+        self.assertEquals(r.history[0].status_code, 301)
78
+        self.assertEquals(r.url, 'https://news.' + TEST_SERVER + '/')
79
+
80
+        # 200 - We should be at the login page
81
+        self.assertEquals(r.status_code, 200)
82
+        self.assertIn(
83
+            'selfoss',
84
+            r.content
85
+        )
86
+        self.assertIn(
87
+            'login',
88
+            r.content
89
+        )
90
+
72 91
     def test_znc_http(self):
73 92
         """ZNC web interface is displaying login page"""
74 93
         # FIXME: requests won't verify sovereign.local with *.sovereign.local cert

+ 6
- 0
vars/defaults.yml Voir le fichier

@@ -63,3 +63,9 @@ webmail_domain: "mail.{{ domain }}"
63 63
 prosody_admin: "{{ admin_email }}"
64 64
 prosody_virtual_domain: "{{ domain }}"
65 65
 # prosody_accounts: (required)
66
+
67
+# news
68
+selfoss_domain: "news.{{ domain }}"
69
+selfoss_mysql_username: selfoss
70
+# selfoss_mysql_password: (required)
71
+selfoss_mysql_database: selfoss

+ 7
- 0
vars/testing.yml Voir le fichier

@@ -57,3 +57,10 @@ openvpn_clients:
57 57
 prosody_accounts:
58 58
   - name: "{{ main_user_name }}"
59 59
     password: foo
60
+
61
+# selfoss
62
+selfoss_mysql_password: testPassword
63
+selfoss_username: "{{ main_user_name }}"
64
+# this is the sha512 hash of the desired password
65
+selfoss_password_hash: "f7fbba6e0636f890e56fbbf3283e524c6fa3204ae298382d624741d0dc6638326e282c41be5e4254d8820772c5518a2c5a8c0c7f7eda19594a7eb539453e1ed7"
66
+# foo

+ 6
- 0
vars/user.yml Voir le fichier

@@ -63,3 +63,9 @@ prosody_virtual_domain: "{{ domain }}"
63 63
 prosody_accounts:
64 64
   - name: "{{ main_user_name }}"
65 65
     password: TODO
66
+
67
+# selfoss
68
+selfoss_mysql_password: "TODO"
69
+selfoss_username: "{{ main_user_name }}"
70
+# this is the sha512 hash of the desired password
71
+selfoss_password_hash: "TODO"

Chargement…
Annuler
Enregistrer