Skip to content

Commit

Permalink
Initial work to support wallabag
Browse files Browse the repository at this point in the history
  • Loading branch information
jplock committed Apr 14, 2014
1 parent 4349e03 commit 79fd923
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/readlater/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- include: wallabag.yml tags=wallabag
58 changes: 58 additions & 0 deletions roles/readlater/tasks/wallabag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
- name: Clone wallabag
git: repo=https://github.com/wallabag/wallabag.git
dest=/var/www/wallabag
version={{ wallabag_version }}

- name: Install wallabag dependencies
apt: pkg={{ item }} state=present
with_items:
- php5
- php5-mcrypt
- php5-tidy
- php5-curl
- php5-pgsql

- name: Create database user for wallabag
postgresql_user: login_host=localhost
login_user={{ db_admin_username }}
login_password="{{ db_admin_password }}"
name={{ wallabag_db_username }}
password="{{ wallabag_db_password }}"
state=present

- name: Create database for wallabag
postgresql_db: login_host=localhost
login_user={{ db_admin_username }}
login_password="{{ db_admin_password }}"
name={{ wallabag_db_database }}
state=present
owner={{ wallabag_db_username }}

- name: Build Composer
shell: curl -sS https://getcomposer.org/installer | php
chdir=/root
creates=/root/composer.phar

- name: Initialize composer
command: php /root/composer.phar install
chdir=/var/www/wallabag
creates=/var/www/wallabag/vendor/autoload.php

- name: Set wallabag permissions
file: owner=www-data
group=www-data
path=/var/www/wallabag
recurse=yes
state=directory

- name: Configure the Apache HTTP server for wallabag
template: src=etc_apache2_sites-available_wallabag.j2
dest=/etc/apache2/sites-available/wallabag
group=www-data
owner=www-data
notify: restart apache

- name: Enable the wallabag site
command: a2ensite wallabag
creates=/etc/apache2/sites-enabled/wallabag
notify: restart apache
31 changes: 31 additions & 0 deletions roles/readlater/templates/etc_apache2_sites-available_wallabag.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<VirtualHost *:80>
ServerName {{ wallabag_domain }}

Redirect permanent / https://{{ wallabag_domain }}/
</VirtualHost>

<VirtualHost *:443>
ServerName {{ wallabag_domain }}

SSLEngine on
SSLProtocol ALL -SSLv2
SSLHonorCipherOrder On
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
SSLCertificateFile /etc/ssl/certs/wildcard_public_cert.crt
SSLCertificateKeyFile /etc/ssl/private/wildcard_private.key
SSLCACertificateFile /etc/ssl/certs/wildcard_ca.pem
Header add Strict-Transport-Security "max-age=15768000; includeSubdomains"

DocumentRoot /var/www/wallabag
Options -Indexes

ErrorLog /var/log/apache2/wallabag.info-error_log
CustomLog /var/log/apache2/wallabag.info-access_log common

<Directory /var/www/wallabag>
AllowOverride All
Order allow,deny
allow from all
DirectoryIndex index.php
</Directory>
</VirtualHost>
1 change: 1 addition & 0 deletions site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@
- tarsnap
- news
- git
- readlater
8 changes: 8 additions & 0 deletions vars/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,11 @@ selfoss_db_database: selfoss
cgit_version: 0.10.1
cgit_domain: "git.{{ domain }}"
gitolite_version: 3.5.3.1

# wallabag
wallabag_version: 1.6.1b
# wallabag_salt: (required)
wallabag_domain: "read.{{ domain }}"
wallabag_db_username: wallabag
# wallabag_db_password: (required)
wallabag_db_database: wallabag
4 changes: 4 additions & 0 deletions vars/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ selfoss_username: "{{ main_user_name }}"
# this is the sha512 hash of the desired password
selfoss_password_hash: "f7fbba6e0636f890e56fbbf3283e524c6fa3204ae298382d624741d0dc6638326e282c41be5e4254d8820772c5518a2c5a8c0c7f7eda19594a7eb539453e1ed7"
# foo

# wallabag
wallabag_salt: testing
wallabag_db_password: testPassword

0 comments on commit 79fd923

Please sign in to comment.