Skip to content

Commit 59111ad

Browse files
Wallabag: new service (#392)
* Wallabag: new service * Wallabag: align the README row and the Redis note * Wallabag: pad the root README row * Wallabag: drop Redis and set the owner of the images folder --------- Co-authored-by: Bart <57799908+crypt0rr@users.noreply.github.com>
1 parent c278b74 commit 59111ad

4 files changed

Lines changed: 179 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ Every stack starts from the same [standard setup](documentation/standard-setup.m
187187
| **SubTrackr** | Subscription tracker that shows monthly and yearly costs and when each one renews. | [Details](services/subtrackr) |
188188
| **Sure** | Fork of the archived Maybe finance app, for tracking accounts, investments, and net worth. | [Details](services/sure) |
189189
| **Vikunja** | To-do and project management app with lists, boards, Gantt charts, and reminders. | [Details](services/vikunja) |
190+
| **Wallabag** | Read-it-later app that saves web pages as articles. | [Details](services/wallabag) |
190191
| **Wallos** | Subscription and expense tracker with payment reminders and budget help. | [Details](services/wallos) |
191192
| **XWiki** | Wiki platform for documentation and knowledge management, with extensions. | [Details](services/xwiki) |
192193

‎services/wallabag/.env‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#URL=https://github.com/tailscale-dev/ScaleTail
2+
# To run a second copy, copy the folder under another name and change SERVICE.
3+
4+
# Service Configuration
5+
# Service name (e.g., adguard). Used as hostname in Tailscale and for container naming.
6+
SERVICE=wallabag
7+
# Docker image URL from container registry (e.g., adguard/adguardhome:latest).
8+
IMAGE_URL=wallabag/wallabag:2.6.14
9+
10+
# Network Configuration
11+
# Port to expose to local network. Uncomment the "ports:" section in compose.yaml to enable.
12+
SERVICEPORT=80
13+
# Preferred DNS server for Tailscale. Uncomment the "dns:" section in compose.yaml to enable.
14+
DNS_SERVER=9.9.9.9
15+
16+
# Tailscale Configuration
17+
# Auth key from https://console.tailscale.com/admin/settings/keys. See: https://tailscale.com/kb/1085/auth-keys#generate-an-auth-key for instructions.
18+
TS_AUTHKEY=
19+
20+
# Time Zone setting for containers. See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
21+
TZ=Europe/Amsterdam
22+
23+
# Any Container environment variables are declared below. See https://docs.docker.com/compose/how-tos/environment-variables/
24+
25+
# Required: your Tailnet name, the part between the service name and ".ts.net" in https://wallabag.<tailnet name>.ts.net, for example tail1234.
26+
TAILNET_NAME=
27+
# Required: signs the sessions and tokens. Generate it with: openssl rand -hex 32
28+
WALLABAG_SECRET=
29+
# Required: password of the wallabag database user. Generate it with: openssl rand -hex 32
30+
DATABASE_PASSWORD=
31+
# Required: password of the database root user. Generate it with: openssl rand -hex 32
32+
MYSQL_ROOT_PASSWORD=

‎services/wallabag/README.md‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Wallabag
2+
3+
[Wallabag](https://wallabag.org/) is a read-it-later app. It saves web pages as clean articles that you can tag, annotate, and read later, from the web interface, the mobile apps, or a browser extension.
4+
5+
This stack runs Wallabag with a Tailscale sidecar, as described in [the standard setup](../../documentation/standard-setup.md).
6+
7+
## At a glance
8+
9+
| Item | Value |
10+
| ------------- | ------------------------------------------- |
11+
| Web interface | `https://wallabag.<tailnet>.ts.net` |
12+
| Service port | `80` |
13+
| Images | `wallabag/wallabag` |
14+
| | `mariadb:11.8` |
15+
| Data | `./wallabag-data/db` (MariaDB database) |
16+
| | `./wallabag-data/images` (article pictures) |
17+
18+
## Before you start
19+
20+
Set these values in `.env`. Compose stops with an error if one of them is empty.
21+
22+
- **`TAILNET_NAME`.** Your Tailnet name, the part between the service name and `.ts.net`, for example `tail1234`. `compose.yaml` builds the address `https://<SERVICE>.<TAILNET_NAME>.ts.net` from it.
23+
- **`WALLABAG_SECRET`.** Signs sessions and tokens. Generate one with `openssl rand -hex 32`. Without it, the image falls back to a fixed secret that is public.
24+
- **`DATABASE_PASSWORD`.** The password of the `wallabag` database user. Generate one with `openssl rand -hex 32`. MariaDB applies it only when it first creates the database.
25+
- **`MYSQL_ROOT_PASSWORD`.** The password of the database root user. Generate one with `openssl rand -hex 32`. MariaDB applies it only when it first creates the database. Wallabag uses it on the first start to create its database and user.
26+
27+
Create the folder for article pictures before the first start, and give it to the user that runs Wallabag inside the container, `nobody` with the ID `65534`. Docker would otherwise create it as `root`, and Wallabag could not save pictures there when you turn on "Download images locally" in the Misc section of the internal settings:
28+
29+
```sh
30+
mkdir -p wallabag-data/images
31+
sudo chown 65534:65534 wallabag-data/images
32+
```
33+
34+
## Deviations from the standard setup
35+
36+
- **Extra container.** The stack runs a `db` container with MariaDB. Wallabag reaches it by its Compose service name over the Docker network, and it is not reachable from your Tailnet.
37+
- **No Redis.** The upstream Compose example adds Redis, which Wallabag uses only for asynchronous imports, and only with a separate import worker. Wallabag imports without it, so this stack leaves both out. Keep "Enable Redis to import data asynchronously" and "Enable RabbitMQ to import data asynchronously" off in the Import section of the internal settings.
38+
- **Base address.** `SYMFONY__ENV__DOMAIN_NAME` in `compose.yaml` is the Tailnet address of the service. Wallabag uses it for the links it generates. If you change `SERVICE` or `TAILNET_NAME`, the address changes with them.
39+
40+
## First run
41+
42+
Open the web interface and log in with the default account: user `wallabag`, password `wallabag`. Change the password right away on the Config page: until you do, anyone on your Tailnet can log in. After the first login, Wallabag shows a quickstart page.
43+
44+
To add an article, paste its address into the add field at the top of the page. The browser extensions and the mobile apps connect to `https://wallabag.<tailnet>.ts.net`, and the device must be connected to your Tailnet. The [Wallabag documentation](https://doc.wallabag.org/) explains how to create the API client they need.
45+
46+
## Troubleshooting
47+
48+
- **`WARN: MySQL database is already configured` in the logs.** The Wallabag container found its database on a later start. The message is harmless: the entrypoint creates the database only once.
49+
50+
## Links
51+
52+
- [Wallabag documentation](https://doc.wallabag.org/)
53+
- [Wallabag Docker image and Compose example](https://github.com/wallabag/docker)
54+
- [Wallabag source code](https://github.com/wallabag/wallabag)

‎services/wallabag/compose.yaml‎

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
configs:
2+
ts-serve:
3+
content: |
4+
{"TCP":{"443":{"HTTPS":true}},
5+
"Web":{"$${TS_CERT_DOMAIN}:443":
6+
{"Handlers":{"/":
7+
{"Proxy":"http://127.0.0.1:80"}}}},
8+
"AllowFunnel":{"$${TS_CERT_DOMAIN}:443":false}}
9+
10+
services:
11+
# Make sure you have updated/checked the .env file with the correct variables.
12+
# Every variable used in this file must be defined there, unless it has a default such as ${VAR:-value}.
13+
# Tailscale Sidecar Configuration
14+
tailscale:
15+
image: tailscale/tailscale:latest # Image to be used
16+
container_name: tailscale-${SERVICE} # Name for local container management
17+
hostname: ${SERVICE} # Name used within your Tailscale environment
18+
environment:
19+
- TS_AUTHKEY=${TS_AUTHKEY}
20+
- TS_STATE_DIR=/var/lib/tailscale
21+
- TS_SERVE_CONFIG=/config/serve.json # Tailscale Serve configuration to expose the web interface on your local Tailnet - remove this line if not required
22+
- TS_USERSPACE=false
23+
- TS_ENABLE_HEALTH_CHECK=true # Enable healthcheck endpoint: "/healthz"
24+
- TS_LOCAL_ADDR_PORT=127.0.0.1:41234 # The <addr>:<port> for the healthz endpoint
25+
#- TS_ACCEPT_DNS=true # Uncomment only if the service must resolve MagicDNS names - this replaces Docker DNS, so Compose service names no longer resolve
26+
- TS_AUTH_ONCE=true
27+
configs:
28+
- source: ts-serve
29+
target: /config/serve.json
30+
volumes:
31+
- ./config:/config # Config folder used to store Tailscale files - you may need to change the path
32+
- ./ts/state:/var/lib/tailscale # Tailscale requirement - you may need to change the path
33+
devices:
34+
- /dev/net/tun:/dev/net/tun # Network configuration for Tailscale to work
35+
cap_add:
36+
- net_admin # Tailscale requirement
37+
#ports:
38+
# - 0.0.0.0:${SERVICEPORT}:${SERVICEPORT} # Binding the service port to the local network - may be removed if only exposure to your Tailnet is required
39+
# If any DNS issues arise, use your preferred DNS provider by uncommenting the config below
40+
#dns:
41+
# - ${DNS_SERVER}
42+
healthcheck:
43+
test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:41234/healthz"] # Check Tailscale has a Tailnet IP and is operational
44+
interval: 1m # How often to perform the check
45+
timeout: 10s # Time to wait for the check to succeed
46+
retries: 3 # Number of retries before marking as unhealthy
47+
start_period: 10s # Time to wait before starting health checks
48+
restart: always
49+
50+
# Application
51+
application:
52+
image: ${IMAGE_URL} # Image to be used
53+
network_mode: service:tailscale # Sidecar configuration to route the service through Tailscale
54+
container_name: app-${SERVICE} # Name for local container management
55+
environment: # Variables are declared in .env file.
56+
- TZ=${TZ}
57+
- SYMFONY__ENV__DOMAIN_NAME=https://${SERVICE}.${TAILNET_NAME:?Set TAILNET_NAME in .env}.ts.net
58+
- SYMFONY__ENV__SECRET=${WALLABAG_SECRET:?Set WALLABAG_SECRET in .env}
59+
- SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
60+
- SYMFONY__ENV__DATABASE_HOST=db
61+
- SYMFONY__ENV__DATABASE_PORT=3306
62+
- SYMFONY__ENV__DATABASE_NAME=wallabag
63+
- SYMFONY__ENV__DATABASE_USER=wallabag
64+
- SYMFONY__ENV__DATABASE_PASSWORD=${DATABASE_PASSWORD:?Set DATABASE_PASSWORD in .env}
65+
- SYMFONY__ENV__DATABASE_CHARSET=utf8mb4
66+
# The entrypoint uses the root password to create the database and the user on the first start.
67+
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:?Set MYSQL_ROOT_PASSWORD in .env}
68+
volumes:
69+
- ./${SERVICE}-data/images:/var/www/wallabag/web/assets/images
70+
depends_on:
71+
tailscale:
72+
condition: service_healthy
73+
db:
74+
condition: service_healthy
75+
# Healthcheck: defined by the image (curl on http://localhost/api/info), so this file does not override it.
76+
restart: always
77+
78+
# Database
79+
db:
80+
image: mariadb:11.8
81+
container_name: app-${SERVICE}-db # Name for local container management
82+
environment:
83+
- MARIADB_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:?Set MYSQL_ROOT_PASSWORD in .env}
84+
volumes:
85+
- ./${SERVICE}-data/db:/var/lib/mysql
86+
healthcheck:
87+
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] # Check if MariaDB accepts connections and InnoDB is initialized
88+
interval: 10s # How often to perform the check
89+
timeout: 5s # Time to wait for the check to succeed
90+
retries: 5 # Number of retries before marking as unhealthy
91+
start_period: 30s # Time to wait before starting health checks
92+
restart: always

0 commit comments

Comments
 (0)