<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>MemberManual/WebApplications/Wallabag</title><revhistory><revision><revnumber>5</revnumber><date>2020-07-19 00:26:45</date><authorinitials>ClintonEbadi</authorinitials><revremark>workaround php not being able to write sessions in afs, guide is adequate now</revremark></revision><revision><revnumber>4</revnumber><date>2020-07-18 23:40:03</date><authorinitials>ClintonEbadi</authorinitials><revremark>fixed setEnvIf issue -- it wants an array of no_spaces, and no_spaces accepts &quot;$&quot; just fine. It's not like I implemented the action or anything and should know better...</revremark></revision><revision><revnumber>3</revnumber><date>2020-07-16 04:58:30</date><authorinitials>ClintonEbadi</authorinitials><revremark>api is also broken without fixing domtool</revremark></revision><revision><revnumber>2</revnumber><date>2020-07-16 04:39:46</date><authorinitials>ClintonEbadi</authorinitials></revision><revision><revnumber>1</revnumber><date>2020-07-16 04:38:55</date><authorinitials>ClintonEbadi</authorinitials><revremark>basic install, still needs some tweaks</revremark></revision></revhistory></articleinfo><para>Guide for installing and maintaining a <ulink url="https://wallabag.org/">Wallabag</ulink> instance. Wallabag is a self-hosted alternative to pocket that integrates well with <ulink url="https://koreader.rocks/">KOReader</ulink>. </para><section><title>Installation</title><section><title>Create the database</title><para>You can use either MySQL or PostgreSQL. You'll need to create a database for wallabag. The name is arbitrary but in this guide we'll be using a mysql database named <code>wallabag</code> (PostgreSQL support appeared to be less robust as of July 2020): </para><screen><![CDATA[dbtool mysql createdb wallabag]]></screen></section><section><title>Install and Run Setup Script</title><para>Wallabag runs from its source directory. Check the code out to wherever you want to store the webapps (except for <code>~/public_html</code>). In this guide we'll be using <code>~/webapps/wallabag</code>.  </para><para>First, checkout the source code and build the application. </para><screen><![CDATA[git clone https://github.com/wallabag/wallabag.git ~/webapps/wallabag
cd ~/webapps/wallabag
make]]></screen><para>The Makefile will ask you several questions, the important values to set are (substitute <code>YOU</code> for your username, and <code>YOUR-WALLABAG-DOMAIN</code> for the domain you are installing wallabag on): </para><screen><![CDATA[database_driver: mysql
database_host: mysql.hcoop.net
database_name: YOU_wallabag
database_user: YOU
database_password: YOUR MYSQL PASSWORD
domain_name: https://YOUR-WALLABAG-DOMAIN
twofactor_sender: no-reply@YOUR-WALLABAG-DOMAIN
fosuser_registration: false
from_email: no-reply@YOUR-WALLABAG-DOMAIN]]></screen><para>Use <code>http</code> for your domain if you will not be <ulink url="https://wiki.hcoop.net/MemberManual/WebApplications/Wallabag/MemberManual/ServingWebsites/SslCert#">using TLS</ulink>. </para><para>When the Makefile gets to the database creation step, it may ask you if you want to reset the database. Answer <code>no</code> and it will create the schema (answering yes just causes it to attempt to drop the database, which fails). If you need to reset the database entirely, you'll need to drop and re-create it using <code>dbtool</code> </para><para>It will then ask if you would like to setup an admin user, you generally should. Choose an appropriate username and password, and <emphasis role="strong">do not use the insecure defaults</emphasis>.  </para></section><section><title>Set Permissions</title><para>The application will need to read the source tree, and write to <code>~/webapps/wallbag/var</code> as your daemon user. Additionally, it will attempt to store session in `~/webapps/wallabag/var/sessions/prod, but PHP cannot write session files into AFS, so we symlink that to the shared sessions directory on the webserver's local filesystem. Set the appropriate openafs acls and symlinks: </para><screen><![CDATA[fsr sa ~/webapps/wallabag/ $USER.daemon read
fsr sa ~/webapps/wallabag/var/ $USER.daemon write
mkdir -p ~/webapps/wallabag/var/sessions ; rm -rf ~/webapps/wallabag/var/sessions/prod ; ln -s  /var/lib/php/sessions/ ~/webapps/wallabag/var/sessions/prod]]></screen></section><section><title>Domtool Configuration</title><para>This example assumes you'll be installing it as a subdomain named <code>wallabag</code> of another domain. Inside of the <code>dom</code> container for your domain: </para><screen><![CDATA[  web "wallabag" where
    DocumentRoot = home "webapps/wallabag/web";
    SSL = YOUR SSL CERT;
  with
    location "/" with
      setEnvIf "Authorization" "(.*)" ["HTTP_AUTHORIZATION=$1"];
   
      rewriteCond "%{REQUEST_FILENAME}" "!-f" [];
      rewriteRule "." "app.php" [qsappend,last];
    end;
  end;]]></screen></section></section><section><title>Upgrading</title><para>(NB: untested) </para><screen><![CDATA[make update]]></screen></section><section><title>Additional Material</title><itemizedlist><listitem><para><ulink url="https://github.com/wallabag/wallabag">Upstream source code</ulink> </para></listitem><listitem><para><ulink url="https://doc.wallabag.org/">Wallabag documentation</ulink> </para></listitem><listitem><para><ulink url="https://doc.wallabag.org/en/admin/installation/installation.html">Upstream installation manual</ulink> </para></listitem><listitem><para><ulink url="https://doc.wallabag.org/en/admin/upgrade.html">Upstream upgrade guide</ulink> </para></listitem></itemizedlist><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="https://wiki.hcoop.net/MemberManual/WebApplications/Wallabag/CategoryMemberManual#">CategoryMemberManual</ulink> </para></section></article>