# Wallabag

Environement : Archlinux + Caddy

## Dépendances

1. Installation des dépendances
   ```
   pacman -Sy php php-fpm php-gd php-tidy php-sodium composer
   ```
2. Configuration de php (`/etc/php/php.ini`)
   ```ini
   [PHP]
   ; Extensions
   extension=bcmath
   extension=curl
   extension=gd
   extension=gettext
   extension=iconv
   extension=intl
   extension=pdo_mysql
   extension=sockets
   extension=sodium
   extension=tidy
   extension=zip
   ```
## Configuration base de données

1. Se connecter à la base de données
   ```
   mariadb -u root
   ```
2. Créer le compte et la base de données
   ```sql
   CREATE USER 'wallabag'@'localhost' IDENTIFIED BY '***';
   create database wallabag;
   GRANT ALL PRIVILEGES ON wallabag.* TO 'wallabag'@'localhost';
   FLUSH PRIVILEGES;
   ```

## Installation

1. Passer en tant que l'user `http`
   ```
   sudo -su http
   ```
2. Récupéré les sources
   ```
   cd /srv/http
   git clone https://github.com/wallabag/wallabag.git bag.bksp.space
   ```
3. Démarrer l'installation
   ```
   cd bag.bksp.space
   make install
   ```

## Configuration du reverse proxy

```caddy
bag.bksp.space {
    root * /srv/http/bag.bksp.space/web
    file_server
    encode gzip
 
    php_fastcgi unix//run/php-fpm/php-fpm.sock {
        index app.php
    }

    try_files {path} {path}/ /app.php?{query}

    log {
        output file /var/log/caddy/bag.bksp.space.log
    }
}
```