mirror of
https://github.com/wallabag/docker
synced 2025-12-13 17:56:31 +00:00
Compare commits
261 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b4eb85eb1 | ||
|
|
7ac0c31dc1 | ||
|
|
854d1027b8 | ||
|
|
f4517471db | ||
|
|
abb6a98924 | ||
|
|
624616cd9e | ||
|
|
d6ce0cea67 | ||
|
|
673dea7800 | ||
|
|
d21d9c6260 | ||
|
|
886535f767 | ||
|
|
1ad213de86 | ||
|
|
3538a3c8d7 | ||
|
|
92fcba3557 | ||
|
|
98ed4730b3 | ||
|
|
c0c280b606 | ||
|
|
5790e0d029 | ||
|
|
e61cbdb025 | ||
|
|
c12a84557a | ||
|
|
835e9ad84b | ||
|
|
d5aac3e6ed | ||
|
|
e38f9adb8b | ||
|
|
b6db602ece | ||
|
|
659a8f4d3f | ||
|
|
62d1948e15 | ||
|
|
a025d243d1 | ||
|
|
fb13655def | ||
|
|
de07417e8f | ||
|
|
b34d71355d | ||
|
|
8bc63c22ec | ||
|
|
676572b8fe | ||
|
|
d51cc9fe33 | ||
|
|
5c52eee713 | ||
|
|
e2717ea9a9 | ||
|
|
185b063ca2 | ||
|
|
a298ff95f7 | ||
|
|
68c2e88e88 | ||
|
|
2b75993504 | ||
|
|
88d24aee30 | ||
|
|
b10121989c | ||
|
|
74bfdfa5c7 | ||
|
|
229cb3d017 | ||
|
|
30c372025e | ||
|
|
4c4aa852c1 | ||
|
|
2603775b01 | ||
|
|
3f4a4c7625 | ||
|
|
ae9214ea87 | ||
|
|
f92efc56d6 | ||
|
|
695212dacb | ||
|
|
bf0102ece6 | ||
|
|
054677bb02 | ||
|
|
43a26d7406 | ||
|
|
ecb1ed2793 | ||
|
|
104373da6d | ||
|
|
080b97130b | ||
|
|
115c83794a | ||
|
|
e6a8421274 | ||
|
|
2e947c0b86 | ||
|
|
2234e9a63d | ||
|
|
3214a229b6 | ||
|
|
66231efd36 | ||
|
|
3f801bf1a5 | ||
|
|
5620cd4e7d | ||
|
|
140721c49c | ||
|
|
61899108bc | ||
|
|
3d63b3b6fd | ||
|
|
7ffaafb436 | ||
|
|
b1aeffca4e | ||
|
|
b49d7faf71 | ||
|
|
bce0488aed | ||
|
|
1d42727517 | ||
|
|
939b644424 | ||
|
|
3f62284368 | ||
|
|
7a99f1ef73 | ||
|
|
537b502424 | ||
|
|
bfd3fe3d55 | ||
|
|
ed49d39db4 | ||
|
|
983bfe094b | ||
|
|
37216dfd69 | ||
|
|
13862eca8f | ||
|
|
55b4290605 | ||
|
|
7873719099 | ||
|
|
05d9d45a54 | ||
|
|
13818bd90e | ||
|
|
1b5fe1a934 | ||
|
|
9d44149e4d | ||
|
|
2b99017b25 | ||
|
|
a85e592e6e | ||
|
|
f4a8e5eadc | ||
|
|
f460f40b8c | ||
|
|
58c3977a3c | ||
|
|
aede9b9c98 | ||
|
|
749587fb4f | ||
|
|
6839862b04 | ||
|
|
f4f8bac984 | ||
|
|
a04e494755 | ||
|
|
bd6e2b174e | ||
|
|
e7ebbc69da | ||
|
|
c5df063ccb | ||
|
|
d619c63e43 | ||
|
|
7e43f2acfa | ||
|
|
f02adb2504 | ||
|
|
0e7fa2bca7 | ||
|
|
1f1dd12cc3 | ||
|
|
b291bf697e | ||
|
|
511a2595bc | ||
|
|
6962f33ed7 | ||
|
|
836f9871ef | ||
|
|
d02c1a404a | ||
|
|
b8ab40b6b4 | ||
|
|
2cd061f08d | ||
|
|
1693adc27c | ||
|
|
a444f0db9d | ||
|
|
b98d38cbed | ||
|
|
6c548be161 | ||
|
|
174fa565eb | ||
|
|
45989b38de | ||
|
|
af075af5d8 | ||
|
|
51a60408e1 | ||
|
|
bea6b2fcc6 | ||
|
|
e189338065 | ||
|
|
8595085d6b | ||
|
|
503114fcba | ||
|
|
88bf8bb86d | ||
|
|
58a4d10cc5 | ||
|
|
501c4a08c6 | ||
|
|
710cc43af4 | ||
|
|
b2afa8eff4 | ||
|
|
a01e124295 | ||
|
|
4abeb0db73 | ||
|
|
ca1dd1d464 | ||
|
|
c58b7b4af2 | ||
|
|
4dcaf994ab | ||
|
|
8737b7115e | ||
|
|
dd280bd5cf | ||
|
|
e292a1c0c2 | ||
|
|
7cce137040 | ||
|
|
ad326dcfe3 | ||
|
|
71dd17939c | ||
|
|
66c3967ef5 | ||
|
|
6d7fdd92c8 | ||
|
|
f9f5b5c68c | ||
|
|
386924f2cc | ||
|
|
3d3f11fb85 | ||
|
|
25bf47149f | ||
|
|
0cee0470de | ||
|
|
b626873351 | ||
|
|
e741136827 | ||
|
|
b92f4c2740 | ||
|
|
040655c3c4 | ||
|
|
5f78ae9a21 | ||
|
|
e510f9db1b | ||
|
|
926e8c7445 | ||
|
|
7d7b1a846f | ||
|
|
8fd1421d36 | ||
|
|
f86d945624 | ||
|
|
a37317f55f | ||
|
|
47dc65b84e | ||
|
|
64fc68eb56 | ||
|
|
213d23691c | ||
|
|
eeead4ff44 | ||
|
|
16a1a1236a | ||
|
|
2460f55662 | ||
|
|
0fe76aa896 | ||
|
|
0f52136d3d | ||
|
|
de684f5a44 | ||
|
|
bf0316bac6 | ||
|
|
ae7aefe8e4 | ||
|
|
ef910d313c | ||
|
|
51e3b625c0 | ||
|
|
dcaa684897 | ||
|
|
6edcd745c4 | ||
|
|
7a476cdab0 | ||
|
|
6a7bbbb8d0 | ||
|
|
e5456115c1 | ||
|
|
7b68684720 | ||
|
|
b67e80a9f8 | ||
|
|
434b17cd8f | ||
|
|
5123e9de38 | ||
|
|
5682aefa74 | ||
|
|
bf82658342 | ||
|
|
abb0647cbd | ||
|
|
6f22d1ef68 | ||
|
|
d1c050662b | ||
|
|
038a5ea6c7 | ||
|
|
c42058bf0f | ||
|
|
3e4cd35253 | ||
|
|
8c15693e12 | ||
|
|
f6e4816eb5 | ||
|
|
bff2dd3d8b | ||
|
|
90265c1653 | ||
|
|
fb020c3be6 | ||
|
|
80a3379a76 | ||
|
|
5203ab63b1 | ||
|
|
65b2e2c7a9 | ||
|
|
4de27027b9 | ||
|
|
924d663c86 | ||
|
|
ec8f599298 | ||
|
|
125aad2c1c | ||
|
|
606b7d681c | ||
|
|
fdaaf37381 | ||
|
|
2b13ed0703 | ||
|
|
e41a237604 | ||
|
|
724d6492bc | ||
|
|
267618a519 | ||
|
|
0fe227a0cc | ||
|
|
d42d34cdac | ||
|
|
58cc845c75 | ||
|
|
c553787564 | ||
|
|
73187d7ce1 | ||
|
|
f7bd58c73a | ||
|
|
ba8f6ec5d3 | ||
|
|
68db53e09c | ||
|
|
530e59329a | ||
|
|
2ae7dee8af | ||
|
|
c2052c2681 | ||
|
|
310d55bdea | ||
|
|
76f5ecb61e | ||
|
|
92f5db7ba9 | ||
|
|
ee4a7e4a46 | ||
|
|
e0bc4e895d | ||
|
|
ed6b4437b8 | ||
|
|
af2fb30389 | ||
|
|
af6c68a312 | ||
|
|
1f4d9af316 | ||
|
|
6a5ab7c126 | ||
|
|
f66d2aeab0 | ||
|
|
0d2bf2999a | ||
|
|
8bd298316a | ||
|
|
d9f9efcf13 | ||
|
|
cccc5fb91e | ||
|
|
79ae48bfac | ||
|
|
d0691598b6 | ||
|
|
28b4b03b21 | ||
|
|
c65be008ec | ||
|
|
63ee463365 | ||
|
|
efbcf75701 | ||
|
|
b4b1469215 | ||
|
|
4a81bc45db | ||
|
|
107beb115c | ||
|
|
67030c1c36 | ||
|
|
255fe53dfc | ||
|
|
4094d3c9ff | ||
|
|
93651c95f5 | ||
|
|
97783ac312 | ||
|
|
b165d3c14f | ||
|
|
8ce69e0d48 | ||
|
|
3c96d9d6d9 | ||
|
|
fdffa0f9ec | ||
|
|
6a67881572 | ||
|
|
038bef09cd | ||
|
|
26b75eee75 | ||
|
|
025c51422e | ||
|
|
5f6a948f98 | ||
|
|
06af340123 | ||
|
|
4cd689a11c | ||
|
|
6e006e4730 | ||
|
|
d42538d365 | ||
|
|
5ef93a5396 | ||
|
|
7b46fdd314 | ||
|
|
052f98f7ba | ||
|
|
21c4819511 |
14
.github/dependabot.yml
vendored
Normal file
14
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: docker
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: daily
|
||||||
|
time: "04:00"
|
||||||
|
timezone: Europe/Paris
|
||||||
|
open-pull-requests-limit: 10
|
||||||
|
ignore:
|
||||||
|
- dependency-name: alpine
|
||||||
|
versions:
|
||||||
|
- ">= 3.11.a"
|
||||||
|
- "< 3.12"
|
||||||
57
.github/workflows/publish.yml
vendored
Normal file
57
.github/workflows/publish.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
name: Publish Docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
push_to_registries:
|
||||||
|
name: Push Docker image to multiple registries
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: Check out the repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Log in to the Container registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
# Documentation: https://github.com/docker/setup-qemu-action
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
# Documentation: https://github.com/docker/setup-buildx-action
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
wallabag/wallabag
|
||||||
|
ghcr.io/${{ github.repository }}
|
||||||
|
|
||||||
|
- name: Build and push Docker images
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
# Support for different platforms, see here:
|
||||||
|
# https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#-set-the-target-platforms-for-the-build---platform
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
51
.github/workflows/test.yml
vendored
Normal file
51
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
name: "CI"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- "master"
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "master"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: "Testing with database: ${{ matrix.database }}"
|
||||||
|
runs-on: "ubuntu-latest"
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
database:
|
||||||
|
- "default"
|
||||||
|
- "sqlite"
|
||||||
|
- "mariadb"
|
||||||
|
- "postgresql"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: 3.11
|
||||||
|
|
||||||
|
- name: "Build image"
|
||||||
|
run: docker-compose -f tests/docker-compose.${{ matrix.database }}.yml build
|
||||||
|
|
||||||
|
- name: "Install dependencies"
|
||||||
|
run: pip install pytest pytest-docker requests
|
||||||
|
|
||||||
|
- name: "Run tests"
|
||||||
|
run: py.test --database=${{ matrix.database }} tests/
|
||||||
|
|
||||||
|
- name: "Get docker logs"
|
||||||
|
if: ${{ always() }}
|
||||||
|
run: docker-compose -p "wallabag_${{ matrix.database }}" -f tests/docker-compose.${{ matrix.database }}.yml logs wallabag
|
||||||
|
|
||||||
|
- name: "Cleanup environment"
|
||||||
|
if: ${{ always() }}
|
||||||
|
run: docker-compose -p "wallabag_${{ matrix.database }}" -f tests/docker-compose.${{ matrix.database }}.yml down -v
|
||||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.cache
|
||||||
|
__pycache__/*
|
||||||
|
*.pyc
|
||||||
115
Dockerfile
115
Dockerfile
@@ -1,63 +1,86 @@
|
|||||||
FROM alpine:edge
|
ARG COMPOSER_VERSION=2.5.8
|
||||||
MAINTAINER Marvin Steadfast <marvin@xsteadfastx.org>
|
|
||||||
|
|
||||||
ENV WALLABAG_VERSION=2.0.1 \
|
FROM composer:$COMPOSER_VERSION as composer
|
||||||
SYMFONY__ENV__DATABASE_DRIVER=pdo_sqlite \
|
|
||||||
SYMFONY__ENV__DATABASE_HOST=127.0.0.1 \
|
|
||||||
SYMFONY__ENV__DATABASE_PORT=~ \
|
|
||||||
SYMFONY__ENV__DATABASE_NAME=symfony \
|
|
||||||
SYMFONY__ENV__DATABASE_USER=root \
|
|
||||||
SYMFONY__ENV__DATABASE_PASSWORD=~ \
|
|
||||||
SYMFONY__ENV__SECRET=ovmpmAWXRCabNlMgzlzFXDYmCFfzGv
|
|
||||||
|
|
||||||
RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
FROM golang:alpine as builder
|
||||||
&& apk add --update \
|
|
||||||
ansible \
|
# envsubst from gettext can not replace env vars with default values
|
||||||
|
# this package is not available for ARM32 and we have to build it from source code
|
||||||
|
# flag -ldflags "-s -w" produces a smaller executable
|
||||||
|
RUN go install -ldflags "-s -w" -v github.com/a8m/envsubst/cmd/envsubst@v1.3.0
|
||||||
|
|
||||||
|
FROM alpine:3.18
|
||||||
|
|
||||||
|
COPY --from=builder /go/bin/envsubst /usr/bin/envsubst
|
||||||
|
|
||||||
|
ARG WALLABAG_VERSION=2.6.3
|
||||||
|
|
||||||
|
RUN set -ex \
|
||||||
|
&& apk add --no-cache \
|
||||||
curl \
|
curl \
|
||||||
git \
|
libwebp \
|
||||||
libwebp@testing \
|
|
||||||
mariadb-client \
|
|
||||||
nginx \
|
nginx \
|
||||||
pcre \
|
pcre \
|
||||||
php7 \
|
php81 \
|
||||||
php7-ctype@testing \
|
php81-bcmath \
|
||||||
php7-curl@testing \
|
php81-ctype \
|
||||||
php7-dom@testing \
|
php81-curl \
|
||||||
php7-fpm@testing \
|
php81-dom \
|
||||||
php7-gd@testing \
|
php81-fpm \
|
||||||
php7-gettext@testing \
|
php81-gd \
|
||||||
php7-iconv@testing \
|
php81-gettext \
|
||||||
php7-json@testing \
|
php81-iconv \
|
||||||
php7-mbstring@testing \
|
php81-json \
|
||||||
php7-openssl@testing \
|
php81-mbstring \
|
||||||
php7-pdo_mysql@testing \
|
php81-openssl \
|
||||||
php7-pdo_sqlite@testing \
|
php81-pecl-amqp \
|
||||||
php7-phar@testing \
|
php81-pdo_mysql \
|
||||||
php7-session@testing \
|
php81-pdo_pgsql \
|
||||||
php7-xml@testing \
|
php81-pdo_sqlite \
|
||||||
php7@testing\
|
php81-phar \
|
||||||
py-mysqldb \
|
php81-session \
|
||||||
py-simplejson \
|
php81-simplexml \
|
||||||
|
php81-tokenizer \
|
||||||
|
php81-xml \
|
||||||
|
php81-zlib \
|
||||||
|
php81-sockets \
|
||||||
|
php81-xmlreader \
|
||||||
|
php81-tidy \
|
||||||
|
php81-intl \
|
||||||
|
php81-sodium \
|
||||||
|
mariadb-client \
|
||||||
|
postgresql14-client \
|
||||||
|
rabbitmq-c \
|
||||||
s6 \
|
s6 \
|
||||||
&& rm -rf /var/cache/apk/*
|
tar \
|
||||||
|
tzdata \
|
||||||
RUN ln -s /usr/bin/php7 /usr/bin/php \
|
&& ln -sf /usr/bin/php81 /usr/bin/php \
|
||||||
|
&& ln -sf /usr/sbin/php-fpm81 /usr/sbin/php-fpm \
|
||||||
|
&& rm -rf /var/cache/apk/* \
|
||||||
&& ln -sf /dev/stdout /var/log/nginx/access.log \
|
&& ln -sf /dev/stdout /var/log/nginx/access.log \
|
||||||
&& ln -sf /dev/stderr /var/log/nginx/error.log
|
&& ln -sf /dev/stderr /var/log/nginx/error.log
|
||||||
|
|
||||||
RUN curl -s http://getcomposer.org/installer | php \
|
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
|
||||||
&& mv composer.phar /usr/local/bin/composer
|
|
||||||
|
|
||||||
RUN git clone --branch $WALLABAG_VERSION --depth 1 https://github.com/wallabag/wallabag.git /var/www/wallabag
|
|
||||||
|
|
||||||
COPY root /
|
COPY root /
|
||||||
|
|
||||||
RUN cd /var/www/wallabag \
|
RUN set -ex \
|
||||||
&& SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
&& curl -L -o /tmp/wallabag.tar.gz https://github.com/wallabag/wallabag/archive/$WALLABAG_VERSION.tar.gz \
|
||||||
|
&& tar xvf /tmp/wallabag.tar.gz -C /tmp \
|
||||||
|
&& mkdir /var/www/wallabag \
|
||||||
|
&& mv /tmp/wallabag-*/* /var/www/wallabag/ \
|
||||||
|
&& rm -rf /tmp/wallabag* \
|
||||||
|
&& cd /var/www/wallabag \
|
||||||
|
&& mkdir data/assets \
|
||||||
|
&& envsubst < /etc/wallabag/parameters.template.yml > app/config/parameters.yml \
|
||||||
|
&& SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist --no-progress \
|
||||||
|
&& rm -rf /root/.composer/* /var/www/wallabag/var/cache/* /var/www/wallabag/var/logs/* /var/www/wallabag/var/sessions/* \
|
||||||
|
&& chown -R nobody:nobody /var/www/wallabag
|
||||||
|
|
||||||
RUN chown -R nobody:nobody /var/www/wallabag
|
ENV PATH="${PATH}:/var/www/wallabag/bin"
|
||||||
|
|
||||||
RUN chmod +x /entrypoint.sh
|
# Set console entry path
|
||||||
|
WORKDIR /var/www/wallabag
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|||||||
123
README.md
123
README.md
@@ -1,5 +1,9 @@
|
|||||||
# What is wallabag?
|
# What is wallabag?
|
||||||
|
|
||||||
|

|
||||||
|
[](https://hub.docker.com/r/wallabag/wallabag/)
|
||||||
|
[](https://hub.docker.com/r/wallabag/wallabag/)
|
||||||
|
|
||||||
[wallabag](https://www.wallabag.org/) is a self hostable application for saving web pages. Unlike other services, wallabag is free (as in freedom) and open source.
|
[wallabag](https://www.wallabag.org/) is a self hostable application for saving web pages. Unlike other services, wallabag is free (as in freedom) and open source.
|
||||||
|
|
||||||
With this application you will not miss content anymore. Click, save, read it when you want. It saves the content you select so that you can read it when you have time.
|
With this application you will not miss content anymore. Click, save, read it when you want. It saves the content you select so that you can read it when you have time.
|
||||||
@@ -11,47 +15,103 @@ Default login is `wallabag:wallabag`.
|
|||||||
## Environment variables
|
## Environment variables
|
||||||
|
|
||||||
- `-e MYSQL_ROOT_PASSWORD=...` (needed for the mariadb container to initialise and for the entrypoint in the wallabag container to create a database and user if its not there)
|
- `-e MYSQL_ROOT_PASSWORD=...` (needed for the mariadb container to initialise and for the entrypoint in the wallabag container to create a database and user if its not there)
|
||||||
|
- `-e POSTGRES_PASSWORD=...` (needed for the postgres container to initialise and for the entrypoint in the wallabag container to create a database and user if not there)
|
||||||
|
- `-e POSTGRES_USER=...` (needed for the posgres container to initialise and for the entrypoint in the wallabag container to create a database and user if not there)
|
||||||
- `-e SYMFONY__ENV__DATABASE_DRIVER=...` (defaults to "pdo_sqlite", this sets the database driver to use)
|
- `-e SYMFONY__ENV__DATABASE_DRIVER=...` (defaults to "pdo_sqlite", this sets the database driver to use)
|
||||||
- `-e SYMFONY__ENV__DATABASE_HOST=...` (defaults to "127.0.0.1", if use mysql this should be the name of the mariadb container)
|
- `-e SYMFONY__ENV__DATABASE_HOST=...` (defaults to "127.0.0.1", if use mysql this should be the name of the mariadb container)
|
||||||
- `-e SYMFONY__ENV__DATABASE_PORT=...` (port of the database host)
|
- `-e SYMFONY__ENV__DATABASE_PORT=...` (port of the database host)
|
||||||
- `-e SYMFONY__ENV__DATABASE_NAME=...`(defaults to "symfony", this is the name of the database to use)
|
- `-e SYMFONY__ENV__DATABASE_NAME=...`(defaults to "symfony", this is the name of the database to use)
|
||||||
- `-e SYMFONY__ENV__DATABASE_USER=...` (defaults to "root", this is the name of the database user to use)
|
- `-e SYMFONY__ENV__DATABASE_USER=...` (defaults to "root", this is the name of the database user to use)
|
||||||
- `-e SYMFONY__ENV__DATABASE_PASSWORD=...` (defaults to "~", this is the password of the database user to use)
|
- `-e SYMFONY__ENV__DATABASE_PASSWORD=...` (defaults to "~", this is the password of the database user to use)
|
||||||
|
- `-e SYMFONY__ENV__DATABASE_CHARSET=...` (defaults to utf8, this is the database charset to use)
|
||||||
|
- `-e SYMFONY__ENV__DATABASE_TABLE_PREFIX=...` (defaults to "wallabag_". Specifies the prefix for each database table)
|
||||||
- `-e SYMFONY__ENV__SECRET=...` (defaults to "ovmpmAWXRCabNlMgzlzFXDYmCFfzGv")
|
- `-e SYMFONY__ENV__SECRET=...` (defaults to "ovmpmAWXRCabNlMgzlzFXDYmCFfzGv")
|
||||||
|
- `-e SYMFONY__ENV__LOCALE=...` (default to en)
|
||||||
|
- `-e SYMFONY__ENV__MAILER_DSN=...` (defaults to "smtp://127.0.0.1")
|
||||||
|
- `-e SYMFONY__ENV__FROM_EMAIL=...`(defaults to "`wallabag@example.com`", the address wallabag uses for outgoing emails)
|
||||||
|
- `-e SYMFONY__ENV__TWOFACTOR_SENDER=...` (defaults to "`no-reply@wallabag.org`", the address wallabag uses for two-factor emails)
|
||||||
|
- `-e SYMFONY__ENV__FOSUSER_REGISTRATION=...`(defaults to "true", enable or disable public user registration)
|
||||||
|
- `-e SYMFONY__ENV__FOSUSER_CONFIRMATION=...`(defaults to "true", enable or disable registration confirmation)
|
||||||
|
- `-e SYMFONY__ENV__DOMAIN_NAME=...` defaults to "`https://your-wallabag-instance.wallabag.org`", the URL of your wallabag instance)
|
||||||
|
- `-e SYMFONY__ENV__REDIS_SCHEME=...` (defaults to "tcp", protocol to use to communicate with the target server (tcp, unix, or http))
|
||||||
|
- `-e SYMFONY__ENV__REDIS_HOST=...` (defaults to "redis", IP or hostname of the target server)
|
||||||
|
- `-e SYMFONY__ENV__REDIS_PORT=...` (defaults to "6379", port of the target host)
|
||||||
|
- `-e SYMFONY__ENV__REDIS_PATH=...`(defaults to "~", path of the unix socket file)
|
||||||
|
- `-e SYMFONY__ENV__REDIS_PASSWORD=...` (defaults to "~", this is the password defined in the Redis server configuration)
|
||||||
|
- `-e SYMFONY__ENV__SENTRY_DSN=...` (defaults to "~", this is the data source name for sentry)
|
||||||
|
- `-e POPULATE_DATABASE=...`(defaults to "True". Does the DB has to be populated or is it an existing one)
|
||||||
|
- `-e SYMFONY__ENV__SERVER_NAME=...` (defaults to "Your wallabag instance". Specifies a user-friendly name for the 2FA issuer)
|
||||||
|
|
||||||
## sqlite
|
## SQLite
|
||||||
|
|
||||||
The easiest way to start wallabag is to use the sqlite backend. You can spin that up with
|
The easiest way to start wallabag is to use the SQLite backend. You can spin that up with
|
||||||
|
|
||||||
```
|
```
|
||||||
$ docker run -p 80:80 xsteadfastx/wallabag
|
$ docker run -p 80:80 -e "SYMFONY__ENV__DOMAIN_NAME=http://localhost" wallabag/wallabag
|
||||||
```
|
```
|
||||||
|
|
||||||
and point your browser to `http://localhost:80`. For persistent storage you should start the container with the a volume:
|
and point your browser to `http://localhost`. For persistent storage you should start the container with a volume:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ docker run -v /opt/wallabag:/var/www/wallabag/data -p 80:80 xsteadfastx/wallabag
|
$ docker run -v /opt/wallabag/data:/var/www/wallabag/data -v /opt/wallabag/images:/var/www/wallabag/web/assets/images -p 80:80 -e "SYMFONY__ENV__DOMAIN_NAME=http://localhost" wallabag/wallabag
|
||||||
```
|
```
|
||||||
|
|
||||||
## mariadb / mysql
|
## MariaDB / MySQL
|
||||||
|
|
||||||
For using mariadb or mysql you have to define some environment variables with the container. Example:
|
For using MariaDB or MySQL you have to define some environment variables with the container. Example:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ docker run docker run --name wallabag-db -e "MYSQL_ROOT_PASSWORD=my-secret-pw" -d mariadb
|
$ docker run --name wallabag-db -e "MYSQL_ROOT_PASSWORD=my-secret-pw" -d mariadb
|
||||||
$ docker run --name wallabag --link wallabag-db:wallabag-db -e "MYSQL_ROOT_PASSWORD=my-secret-pw" -e "SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql" -e "SYMFONY__ENV__DATABASE_HOST=wallabag-db" -e "SYMFONY__ENV__DATABASE_PORT=3306" -e "SYMFONY__ENV__DATABASE_NAME=wallabag" -e "SYMFONY__ENV__DATABASE_USER=wallabag" -e "SYMFONY__ENV__DATABASE_PASSWORD=wallapass" -p 80:80 xsteadfastx/wallabag
|
$ docker run --name wallabag --link wallabag-db:wallabag-db -e "MYSQL_ROOT_PASSWORD=my-secret-pw" -e "SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql" -e "SYMFONY__ENV__DATABASE_HOST=wallabag-db" -e "SYMFONY__ENV__DATABASE_PORT=3306" -e "SYMFONY__ENV__DATABASE_NAME=wallabag" -e "SYMFONY__ENV__DATABASE_USER=wallabag" -e "SYMFONY__ENV__DATABASE_PASSWORD=wallapass" -e "SYMFONY__ENV__DATABASE_CHARSET=utf8mb4" -e "SYMFONY__ENV__DOMAIN_NAME=http://localhost" -p 80:80 wallabag/wallabag
|
||||||
|
```
|
||||||
|
|
||||||
|
## PostgreSQL
|
||||||
|
|
||||||
|
For using PostgreSQL you have to define some environment variables with the container. Example:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker run --name wallabag-db -e "POSTGRES_PASSWORD=my-secret-pw" -e "POSTGRES_USER=my-super-user" -d postgres:9.6
|
||||||
|
$ docker run --name wallabag --link wallabag-db:wallabag-db -e "POSTGRES_PASSWORD=my-secret-pw" -e "POSTGRES_USER=my-super-user" -e "SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql" -e "SYMFONY__ENV__DATABASE_HOST=wallabag-db" -e "SYMFONY__ENV__DATABASE_PORT=5432" -e "SYMFONY__ENV__DATABASE_NAME=wallabag" -e "SYMFONY__ENV__DATABASE_USER=wallabag" -e "SYMFONY__ENV__DATABASE_PASSWORD=wallapass" -e "SYMFONY__ENV__DOMAIN_NAME=http://localhost" -p 80:80 wallabag/wallabag
|
||||||
|
```
|
||||||
|
|
||||||
|
## Redis
|
||||||
|
|
||||||
|
To use redis with a Docker link, a redis container with the name `redis` is needed and none of the `REDIS` environmental variables are needed:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker run -p 6379:6379 --name redis redis:alpine
|
||||||
|
$ docker run -p 80:80 -e "SYMFONY__ENV__DOMAIN_NAME=http://localhost" --link redis:redis wallabag/wallabag
|
||||||
|
```
|
||||||
|
|
||||||
|
To use redis with an external redis host, set the appropriate environmental variables. Example:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker run -p 80:80 -e "SYMFONY__ENV__REDIS_HOST=my.server.hostname" -e "SYMFONY__ENV__REDIS_PASSWORD=my-secret-pw" -e "SYMFONY__ENV__DOMAIN_NAME=http://localhost" wallabag/wallabag
|
||||||
|
```
|
||||||
|
|
||||||
|
## Upgrading
|
||||||
|
|
||||||
|
If there is a version upgrade that needs a database migration. The most easy way to do is running the `migrate` command:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker run --link wallabag-db:wallabag-db -e <... your config variables here ...> wallabag/wallabag migrate
|
||||||
|
```
|
||||||
|
|
||||||
|
Or you can start the container with the new image and run the migration command manually:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker exec -t NAME_OR_ID_OF_YOUR_WALLABAG_CONTAINER /var/www/wallabag/bin/console doctrine:migrations:migrate --env=prod --no-interaction
|
||||||
```
|
```
|
||||||
|
|
||||||
## docker-compose
|
## docker-compose
|
||||||
|
|
||||||
Its a good way to use [docker-compose](https://docs.docker.com/compose/). Example:
|
An example [docker-compose](https://docs.docker.com/compose/) file can be seen below:
|
||||||
|
|
||||||
```
|
```
|
||||||
version: '2'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
wallabag:
|
wallabag:
|
||||||
build:
|
image: wallabag/wallabag
|
||||||
context: wallabag/
|
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=wallaroot
|
- MYSQL_ROOT_PASSWORD=wallaroot
|
||||||
- SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
|
- SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
|
||||||
@@ -60,16 +120,43 @@ services:
|
|||||||
- SYMFONY__ENV__DATABASE_NAME=wallabag
|
- SYMFONY__ENV__DATABASE_NAME=wallabag
|
||||||
- SYMFONY__ENV__DATABASE_USER=wallabag
|
- SYMFONY__ENV__DATABASE_USER=wallabag
|
||||||
- SYMFONY__ENV__DATABASE_PASSWORD=wallapass
|
- SYMFONY__ENV__DATABASE_PASSWORD=wallapass
|
||||||
|
- SYMFONY__ENV__DATABASE_CHARSET=utf8mb4
|
||||||
|
- SYMFONY__ENV__DATABASE_TABLE_PREFIX="wallabag_"
|
||||||
|
- SYMFONY__ENV__MAILER_DSN=smtp://127.0.0.1
|
||||||
|
- SYMFONY__ENV__FROM_EMAIL=wallabag@example.com
|
||||||
|
- SYMFONY__ENV__DOMAIN_NAME=https://your-wallabag-instance.wallabag.org
|
||||||
|
- SYMFONY__ENV__SERVER_NAME="Your wallabag instance"
|
||||||
ports:
|
ports:
|
||||||
- "80"
|
- "80"
|
||||||
|
volumes:
|
||||||
|
- /opt/wallabag/images:/var/www/wallabag/web/assets/images
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost"]
|
||||||
|
interval: 1m
|
||||||
|
timeout: 3s
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
- redis
|
||||||
db:
|
db:
|
||||||
image: mariadb
|
image: mariadb
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=wallaroot
|
- MYSQL_ROOT_PASSWORD=wallaroot
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/wallabag:/var/lib/mysql
|
- /opt/wallabag/data:/var/lib/mysql
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
|
||||||
|
interval: 20s
|
||||||
|
timeout: 3s
|
||||||
|
redis:
|
||||||
|
image: redis:alpine
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 20s
|
||||||
|
timeout: 3s
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note that you must fill out the mail related variables according to your mail config.
|
||||||
|
|
||||||
## nginx
|
## nginx
|
||||||
|
|
||||||
I use nginx to make wallabag public available. This is a example how to use it:
|
I use nginx to make wallabag public available. This is a example how to use it:
|
||||||
@@ -92,3 +179,11 @@ server {
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Import worker
|
||||||
|
|
||||||
|
To run the [async redis import worker](https://doc.wallabag.org/en/admin/asynchronous.html#install-redis-for-asynchronous-tasks) use the following command:
|
||||||
|
```
|
||||||
|
$ docker run --name wallabag --link wallabag-db:wallabag-db --link redis:redis -e <... your config variables here ...> wallabag/wallabag import <type>
|
||||||
|
```
|
||||||
|
Where `<type>` is one of pocket, readability, instapaper, wallabag_v1, wallabag_v2, firefox or chrome.
|
||||||
|
|||||||
4
conftest.py
Normal file
4
conftest.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import pytest
|
||||||
|
|
||||||
|
def pytest_addoption(parser):
|
||||||
|
parser.addoption("--database", action="store", default="default")
|
||||||
103
root/entrypoint.sh
Normal file → Executable file
103
root/entrypoint.sh
Normal file → Executable file
@@ -1,8 +1,107 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# Exit when any command fails
|
||||||
|
set -e
|
||||||
|
|
||||||
if [ "$1" = "wallabag" ];then
|
COMMAND_ARG1="$1"
|
||||||
ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local
|
COMMAND_ARG2="$2"
|
||||||
|
|
||||||
|
cd /var/www/wallabag || exit
|
||||||
|
|
||||||
|
wait_for_database() {
|
||||||
|
timeout 60s /bin/sh -c "$(cat << EOF
|
||||||
|
until echo 'Waiting for database ...' \
|
||||||
|
&& nc -z ${SYMFONY__ENV__DATABASE_HOST} ${SYMFONY__ENV__DATABASE_PORT} < /dev/null > /dev/null 2>&1 ; \
|
||||||
|
do sleep 1 ; done
|
||||||
|
EOF
|
||||||
|
)"
|
||||||
|
}
|
||||||
|
|
||||||
|
install_wallabag() {
|
||||||
|
su -c "php bin/console wallabag:install --env=prod -n" -s /bin/sh nobody
|
||||||
|
}
|
||||||
|
|
||||||
|
provisioner() {
|
||||||
|
SYMFONY__ENV__DATABASE_DRIVER=${SYMFONY__ENV__DATABASE_DRIVER:-pdo_sqlite}
|
||||||
|
POPULATE_DATABASE=${POPULATE_DATABASE:-True}
|
||||||
|
|
||||||
|
# Replace environment variables
|
||||||
|
envsubst < /etc/wallabag/parameters.template.yml > app/config/parameters.yml
|
||||||
|
|
||||||
|
# Wait for external database
|
||||||
|
if [ "$SYMFONY__ENV__DATABASE_DRIVER" = "pdo_mysql" ] || [ "$SYMFONY__ENV__DATABASE_DRIVER" = "pdo_pgsql" ] ; then
|
||||||
|
wait_for_database
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Configure SQLite database
|
||||||
|
SQLITE_FILE_SIZE=$(wc -c "/var/www/wallabag/data/db/wallabag.sqlite" | awk '{print $1}')
|
||||||
|
if [ "$SYMFONY__ENV__DATABASE_DRIVER" = "pdo_sqlite" ] && ([ ! -f "/var/www/wallabag/data/db/wallabag.sqlite" ] || [ "$SQLITE_FILE_SIZE" = 0 ]) ; then
|
||||||
|
echo "Configuring the SQLite database ..."
|
||||||
|
install_wallabag
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Configure MySQL / MariaDB database
|
||||||
|
if [ "$SYMFONY__ENV__DATABASE_DRIVER" = "pdo_mysql" ] && [ "$POPULATE_DATABASE" = "True" ] && [ "$MYSQL_ROOT_PASSWORD" != "" ] ; then
|
||||||
|
DATABASE_EXISTS="$(mysql -h "${SYMFONY__ENV__DATABASE_HOST}" --port "${SYMFONY__ENV__DATABASE_PORT}" -uroot -p"${MYSQL_ROOT_PASSWORD}" \
|
||||||
|
-sse "SELECT EXISTS(SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '$SYMFONY__ENV__DATABASE_NAME')")"
|
||||||
|
if [ "$DATABASE_EXISTS" != "1" ]; then
|
||||||
|
echo "Configuring the MySQL database ..."
|
||||||
|
mysql -h "${SYMFONY__ENV__DATABASE_HOST}" --port "${SYMFONY__ENV__DATABASE_PORT}" -uroot -p"${MYSQL_ROOT_PASSWORD}" \
|
||||||
|
-e "CREATE DATABASE IF NOT EXISTS ${SYMFONY__ENV__DATABASE_NAME} CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
|
||||||
|
USER_EXISTS="$(mysql -h "${SYMFONY__ENV__DATABASE_HOST}" --port "${SYMFONY__ENV__DATABASE_PORT}" -uroot -p"${MYSQL_ROOT_PASSWORD}" \
|
||||||
|
-sse "SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user = '$SYMFONY__ENV__DATABASE_USER')")"
|
||||||
|
if [ "$USER_EXISTS" != "1" ]; then
|
||||||
|
mysql -h "${SYMFONY__ENV__DATABASE_HOST}" --port "${SYMFONY__ENV__DATABASE_PORT}" -uroot -p"${MYSQL_ROOT_PASSWORD}" \
|
||||||
|
-e "CREATE USER IF NOT EXISTS '${SYMFONY__ENV__DATABASE_USER}'@'%' IDENTIFIED BY '${SYMFONY__ENV__DATABASE_PASSWORD}';"
|
||||||
|
mysql -h "${SYMFONY__ENV__DATABASE_HOST}" --port "${SYMFONY__ENV__DATABASE_PORT}" -uroot -p"${MYSQL_ROOT_PASSWORD}" \
|
||||||
|
-e "GRANT ALL PRIVILEGES ON ${SYMFONY__ENV__DATABASE_NAME}.* TO '${SYMFONY__ENV__DATABASE_USER}'@'%';"
|
||||||
|
fi
|
||||||
|
install_wallabag
|
||||||
|
else
|
||||||
|
echo "WARN: MySQL database is already configured. Remove the environment variable with root password."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Configure Postgres database
|
||||||
|
if [ "$SYMFONY__ENV__DATABASE_DRIVER" = "pdo_pgsql" ] && [ "$POPULATE_DATABASE" = "True" ] && [ "$POSTGRES_PASSWORD" != "" ] ; then
|
||||||
|
export PGPASSWORD="${POSTGRES_PASSWORD}"
|
||||||
|
DATABASE_EXISTS="$(psql -qAt -h "${SYMFONY__ENV__DATABASE_HOST}" -p "${SYMFONY__ENV__DATABASE_PORT}" -U "${POSTGRES_USER}" \
|
||||||
|
-c "SELECT 1 FROM pg_catalog.pg_database WHERE datname = '${SYMFONY__ENV__DATABASE_NAME}';")"
|
||||||
|
if [ "$DATABASE_EXISTS" != "1" ]; then
|
||||||
|
echo "Configuring the Postgres database ..."
|
||||||
|
psql -q -h "${SYMFONY__ENV__DATABASE_HOST}" -p "${SYMFONY__ENV__DATABASE_PORT}" -U "${POSTGRES_USER}" \
|
||||||
|
-c "CREATE DATABASE ${SYMFONY__ENV__DATABASE_NAME};"
|
||||||
|
USER_EXISTS="$(psql -qAt -h "${SYMFONY__ENV__DATABASE_HOST}" -p "${SYMFONY__ENV__DATABASE_PORT}" -U "${POSTGRES_USER}" \
|
||||||
|
-c "SELECT 1 FROM pg_roles WHERE rolname = '${SYMFONY__ENV__DATABASE_USER}';")"
|
||||||
|
if [ "$USER_EXISTS" != "1" ]; then
|
||||||
|
psql -q -h "${SYMFONY__ENV__DATABASE_HOST}" -p "${SYMFONY__ENV__DATABASE_PORT}" -U "${POSTGRES_USER}" \
|
||||||
|
-c "CREATE ROLE ${SYMFONY__ENV__DATABASE_USER} with PASSWORD '${SYMFONY__ENV__DATABASE_PASSWORD}' LOGIN;"
|
||||||
|
fi
|
||||||
|
install_wallabag
|
||||||
|
else
|
||||||
|
echo "WARN: Postgres database is already configured. Remove the environment variable with root password."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove cache and install Wallabag
|
||||||
|
rm -f -r /var/www/wallabag/var/cache
|
||||||
|
su -c "SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist" -s /bin/sh nobody
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$COMMAND_ARG1" = "wallabag" ]; then
|
||||||
|
echo "Starting wallabag ..."
|
||||||
|
provisioner
|
||||||
|
echo "wallabag is ready!"
|
||||||
exec s6-svscan /etc/s6/
|
exec s6-svscan /etc/s6/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$COMMAND_ARG1" = "import" ]; then
|
||||||
|
provisioner
|
||||||
|
exec su -c "bin/console wallabag:import:redis-worker --env=prod $COMMAND_ARG2 -vv" -s /bin/sh nobody
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$COMMAND_ARG1" = "migrate" ]; then
|
||||||
|
provisioner
|
||||||
|
exec su -c "bin/console doctrine:migrations:migrate --env=prod --no-interaction" -s /bin/sh nobody
|
||||||
|
fi
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
@@ -1,92 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
|
||||||
remote_user: root
|
|
||||||
|
|
||||||
vars:
|
|
||||||
|
|
||||||
database_driver: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_DRIVER') }}"
|
|
||||||
database_host: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_HOST') }}"
|
|
||||||
database_name: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_NAME') }}"
|
|
||||||
database_password: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PASSWORD') }}"
|
|
||||||
database_port: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PORT') }}"
|
|
||||||
database_root_password: "{{ lookup('env', 'MYSQL_ROOT_PASSWORD') }}"
|
|
||||||
database_user: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_USER') }}"
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
|
|
||||||
- name: needed dirs
|
|
||||||
file:
|
|
||||||
path={{ item }}
|
|
||||||
state=directory
|
|
||||||
with_items:
|
|
||||||
- /var/www/wallabag/data/db
|
|
||||||
- /var/www/wallabag/data/assets
|
|
||||||
notify: chown dir
|
|
||||||
|
|
||||||
- stat:
|
|
||||||
path=/var/www/wallabag/data/db/wallabag.sqlite
|
|
||||||
register: wallabag_sqlite_db
|
|
||||||
when: database_driver == 'pdo_sqlite'
|
|
||||||
|
|
||||||
- name: notify install for sqlite
|
|
||||||
debug:
|
|
||||||
msg='notify installation script if sqlite db does not exist'
|
|
||||||
notify: run install
|
|
||||||
when: (database_driver == 'pdo_sqlite') and
|
|
||||||
(wallabag_sqlite_db.stat.exists == False)
|
|
||||||
|
|
||||||
- name: wait for db container
|
|
||||||
wait_for:
|
|
||||||
host="{{ database_host }}"
|
|
||||||
port=3306
|
|
||||||
when: database_driver == 'pdo_mysql'
|
|
||||||
|
|
||||||
- name: mariadb db
|
|
||||||
mysql_db:
|
|
||||||
name="{{ database_name }}"
|
|
||||||
state=present
|
|
||||||
login_host="{{ database_host }}"
|
|
||||||
login_user=root
|
|
||||||
login_password="{{ database_root_password }}"
|
|
||||||
notify: run install
|
|
||||||
when: database_driver == 'pdo_mysql'
|
|
||||||
|
|
||||||
- name: add mariadb user
|
|
||||||
mysql_user:
|
|
||||||
name="{{ database_user }}"
|
|
||||||
host=%
|
|
||||||
password="{{ database_password }}"
|
|
||||||
priv={{ database_name }}.*:ALL
|
|
||||||
login_host="{{ database_host }}"
|
|
||||||
login_port="{{ database_port }}"
|
|
||||||
login_user=root
|
|
||||||
login_password="{{ database_root_password }}"
|
|
||||||
state=present
|
|
||||||
when: (database_driver == 'pdo_mysql') and
|
|
||||||
(database_user != 'root')
|
|
||||||
|
|
||||||
- name: remove cache
|
|
||||||
file:
|
|
||||||
path=/var/www/wallabag/var/cache
|
|
||||||
state=absent
|
|
||||||
|
|
||||||
- name: run composer
|
|
||||||
shell: SYMFONY_ENV=prod composer install --no-dev -o --prefer-dist
|
|
||||||
args:
|
|
||||||
chdir: /var/www/wallabag
|
|
||||||
notify: chown dir
|
|
||||||
|
|
||||||
handlers:
|
|
||||||
|
|
||||||
- name: run install
|
|
||||||
shell: php bin/console wallabag:install --env=prod -n
|
|
||||||
args:
|
|
||||||
chdir: /var/www/wallabag
|
|
||||||
notify: chown dir
|
|
||||||
|
|
||||||
- name: chown dir
|
|
||||||
file:
|
|
||||||
path=/var/www/wallabag
|
|
||||||
recurse=yes
|
|
||||||
owner=nobody
|
|
||||||
group=nobody
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
[localhost]
|
|
||||||
localhost
|
|
||||||
@@ -10,7 +10,7 @@ fastcgi_param DOCUMENT_URI $document_uri;
|
|||||||
fastcgi_param DOCUMENT_ROOT $document_root;
|
fastcgi_param DOCUMENT_ROOT $document_root;
|
||||||
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
||||||
fastcgi_param REQUEST_SCHEME $scheme;
|
fastcgi_param REQUEST_SCHEME $scheme;
|
||||||
fastcgi_param HTTPS $https if_not_empty;
|
fastcgi_param HTTPS $fe_https;
|
||||||
|
|
||||||
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
|
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
|
||||||
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
|
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
|
||||||
|
|||||||
@@ -23,13 +23,19 @@ http {
|
|||||||
gzip on;
|
gzip on;
|
||||||
gzip_disable "msie6";
|
gzip_disable "msie6";
|
||||||
open_file_cache max=100;
|
open_file_cache max=100;
|
||||||
|
client_max_body_size 100M;
|
||||||
|
|
||||||
|
map $http_x_forwarded_proto $fe_https {
|
||||||
|
default $https;
|
||||||
|
https on;
|
||||||
|
}
|
||||||
|
|
||||||
upstream php-upstream {
|
upstream php-upstream {
|
||||||
server 127.0.0.1:9000;
|
server 127.0.0.1:9000;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
listen 80;
|
||||||
server_name _;
|
server_name _;
|
||||||
root /var/www/wallabag/web;
|
root /var/www/wallabag/web;
|
||||||
|
|
||||||
@@ -57,8 +63,8 @@ http {
|
|||||||
internal;
|
internal;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_log /var/log/nginx/access.log;
|
access_log /var/log/nginx/access.log;
|
||||||
access_log /var/log/nginx/error.log;
|
error_log /var/log/nginx/error.log;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ output_buffering = 4096
|
|||||||
; Note: You need to use zlib.output_handler instead of the standard
|
; Note: You need to use zlib.output_handler instead of the standard
|
||||||
; output_handler, or otherwise the output will be corrupted.
|
; output_handler, or otherwise the output will be corrupted.
|
||||||
; http://php.net/zlib.output-compression
|
; http://php.net/zlib.output-compression
|
||||||
zlib.output_compression = Off
|
zlib.output_compression = On
|
||||||
|
|
||||||
; http://php.net/zlib.output-compression-level
|
; http://php.net/zlib.output-compression-level
|
||||||
;zlib.output_compression_level = -1
|
;zlib.output_compression_level = -1
|
||||||
@@ -373,7 +373,7 @@ zend.enable_gc = On
|
|||||||
; threat in any way, but it makes it possible to determine whether you use PHP
|
; threat in any way, but it makes it possible to determine whether you use PHP
|
||||||
; on your server or not.
|
; on your server or not.
|
||||||
; http://php.net/expose-php
|
; http://php.net/expose-php
|
||||||
expose_php = On
|
expose_php = Off
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;
|
||||||
; Resource Limits ;
|
; Resource Limits ;
|
||||||
@@ -670,7 +670,7 @@ auto_globals_jit = On
|
|||||||
; Its value may be 0 to disable the limit. It is ignored if POST data reading
|
; Its value may be 0 to disable the limit. It is ignored if POST data reading
|
||||||
; is disabled through enable_post_data_reading.
|
; is disabled through enable_post_data_reading.
|
||||||
; http://php.net/post-max-size
|
; http://php.net/post-max-size
|
||||||
post_max_size = 20G
|
post_max_size = 100M
|
||||||
|
|
||||||
; Automatically add files before PHP document.
|
; Automatically add files before PHP document.
|
||||||
; http://php.net/auto-prepend-file
|
; http://php.net/auto-prepend-file
|
||||||
@@ -802,7 +802,7 @@ upload_tmp_dir = /tmp/
|
|||||||
|
|
||||||
; Maximum allowed size for uploaded files.
|
; Maximum allowed size for uploaded files.
|
||||||
; http://php.net/upload-max-filesize
|
; http://php.net/upload-max-filesize
|
||||||
upload_max_filesize = 20G
|
upload_max_filesize = 100M
|
||||||
|
|
||||||
; Maximum number of files that can be uploaded via a single request
|
; Maximum number of files that can be uploaded via a single request
|
||||||
max_file_uploads = 20
|
max_file_uploads = 20
|
||||||
2
root/etc/s6/.s6-svscan/finish
Executable file
2
root/etc/s6/.s6-svscan/finish
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
exec /bin/true
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
exec php-fpm7 -F
|
exec php-fpm -F
|
||||||
|
|||||||
56
root/etc/wallabag/parameters.template.yml
Normal file
56
root/etc/wallabag/parameters.template.yml
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
parameters:
|
||||||
|
database_driver: ${SYMFONY__ENV__DATABASE_DRIVER:-pdo_sqlite}
|
||||||
|
database_host: ${SYMFONY__ENV__DATABASE_HOST:-127.0.0.1}
|
||||||
|
database_port: ${SYMFONY__ENV__DATABASE_PORT:-~}
|
||||||
|
database_name: ${SYMFONY__ENV__DATABASE_NAME:-symfony}
|
||||||
|
database_user: ${SYMFONY__ENV__DATABASE_USER:-root}
|
||||||
|
database_password: ${SYMFONY__ENV__DATABASE_PASSWORD:-~}
|
||||||
|
database_path: "%kernel.project_dir%/data/db/wallabag.sqlite"
|
||||||
|
database_table_prefix: ${SYMFONY__ENV__DATABASE_TABLE_PREFIX:-wallabag_}
|
||||||
|
database_socket: null
|
||||||
|
database_charset: ${SYMFONY__ENV__DATABASE_CHARSET:-utf8}
|
||||||
|
|
||||||
|
domain_name: ${SYMFONY__ENV__DOMAIN_NAME:-https://your-wallabag-instance.wallabag.org}
|
||||||
|
|
||||||
|
mailer_dsn: ${SYMFONY__ENV__MAILER_DSN:-smtp://127.0.0.1}
|
||||||
|
|
||||||
|
locale: ${SYMFONY__ENV__LOCALE:-en}
|
||||||
|
|
||||||
|
# A secret key that's used to generate certain security-related tokens
|
||||||
|
secret: ${SYMFONY__ENV__SECRET:-ovmpmAWXRCabNlMgzlzFXDYmCFfzGv}
|
||||||
|
|
||||||
|
# two factor stuff
|
||||||
|
twofactor_sender: ${SYMFONY__ENV__TWOFACTOR_SENDER:-no-reply@wallabag.org}
|
||||||
|
|
||||||
|
# fosuser stuff
|
||||||
|
fosuser_registration: ${SYMFONY__ENV__FOSUSER_REGISTRATION:-true}
|
||||||
|
fosuser_confirmation: ${SYMFONY__ENV__FOSUSER_CONFIRMATION:-true}
|
||||||
|
|
||||||
|
# how long the access token should live in seconds for the API
|
||||||
|
fos_oauth_server_access_token_lifetime: 3600
|
||||||
|
# how long the refresh token should life in seconds for the API
|
||||||
|
fos_oauth_server_refresh_token_lifetime: 1209600
|
||||||
|
|
||||||
|
from_email: ${SYMFONY__ENV__FROM_EMAIL:-no-reply@wallabag.org}
|
||||||
|
|
||||||
|
rss_limit: 50
|
||||||
|
|
||||||
|
# RabbitMQ processing
|
||||||
|
rabbitmq_host: localhost
|
||||||
|
rabbitmq_port: 5672
|
||||||
|
rabbitmq_user: guest
|
||||||
|
rabbitmq_password: guest
|
||||||
|
rabbitmq_prefetch_count: 10
|
||||||
|
|
||||||
|
# Redis processing
|
||||||
|
redis_scheme: ${SYMFONY__ENV__REDIS_SCHEME:-tcp}
|
||||||
|
redis_host: ${SYMFONY__ENV__REDIS_HOST:-redis}
|
||||||
|
redis_port: ${SYMFONY__ENV__REDIS_PORT:-6379}
|
||||||
|
redis_path: ${SYMFONY__ENV__REDIS_PATH:-~}
|
||||||
|
redis_password: ${SYMFONY__ENV__REDIS_PASSWORD:-~}
|
||||||
|
|
||||||
|
# Sentry
|
||||||
|
sentry_dsn: ${SYMFONY__ENV__SENTRY_DSN:-~}
|
||||||
|
|
||||||
|
# User-friendly name of your instance for 2FA issuer
|
||||||
|
server_name: ${SYMFONY__ENV__SERVER_NAME:-"Your wallabag instance"}
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
parameters:
|
|
||||||
database_driver: %env.database_driver%
|
|
||||||
database_host: %env.database_host%
|
|
||||||
database_port: %env.database_port%
|
|
||||||
database_name: %env.database_name%
|
|
||||||
database_user: %env.database_user%
|
|
||||||
database_password: %env.database_password%
|
|
||||||
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
|
|
||||||
database_table_prefix: wallabag_
|
|
||||||
|
|
||||||
test_database_driver: pdo_sqlite
|
|
||||||
test_database_host: 127.0.0.1
|
|
||||||
test_database_port: ~
|
|
||||||
test_database_name: ~
|
|
||||||
test_database_user: ~
|
|
||||||
test_database_password: ~
|
|
||||||
test_database_path: "%kernel.root_dir%/../data/db/wallabag_test.sqlite"
|
|
||||||
|
|
||||||
mailer_transport: smtp
|
|
||||||
mailer_host: 127.0.0.1
|
|
||||||
mailer_user: ~
|
|
||||||
mailer_password: ~
|
|
||||||
|
|
||||||
locale: en
|
|
||||||
|
|
||||||
# A secret key that's used to generate certain security-related tokens
|
|
||||||
secret: %env.secret%
|
|
||||||
|
|
||||||
# two factor stuff
|
|
||||||
twofactor_auth: true
|
|
||||||
twofactor_sender: no-reply@wallabag.org
|
|
||||||
|
|
||||||
# fosuser stuff
|
|
||||||
fosuser_confirmation: true
|
|
||||||
|
|
||||||
from_email: no-reply@wallabag.org
|
|
||||||
9
tests/docker-compose.default.yml
Normal file
9
tests/docker-compose.default.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
wallabag:
|
||||||
|
build:
|
||||||
|
context: ../
|
||||||
|
image: wallabag:default
|
||||||
|
container_name: wallabag
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:80"
|
||||||
23
tests/docker-compose.mariadb.yml
Normal file
23
tests/docker-compose.mariadb.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
wallabag:
|
||||||
|
build:
|
||||||
|
context: ../
|
||||||
|
image: wallabag:mariadb
|
||||||
|
container_name: wallabag
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=wallaroot
|
||||||
|
- SYMFONY__ENV__SECRET=F00B4R
|
||||||
|
- SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
|
||||||
|
- SYMFONY__ENV__DATABASE_HOST=db
|
||||||
|
- SYMFONY__ENV__DATABASE_PORT=3306
|
||||||
|
- SYMFONY__ENV__DATABASE_NAME=wallabag
|
||||||
|
- SYMFONY__ENV__DATABASE_USER=wallabag
|
||||||
|
- SYMFONY__ENV__DATABASE_PASSWORD=wallapass
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:80"
|
||||||
|
db:
|
||||||
|
image: mariadb
|
||||||
|
command: mariadbd --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=wallaroot
|
||||||
24
tests/docker-compose.postgresql.yml
Normal file
24
tests/docker-compose.postgresql.yml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
wallabag:
|
||||||
|
build:
|
||||||
|
context: ../
|
||||||
|
image: wallabag:postgresql
|
||||||
|
container_name: wallabag
|
||||||
|
environment:
|
||||||
|
- POSTGRES_PASSWORD=my-secret-pw
|
||||||
|
- POSTGRES_USER=my-super-user
|
||||||
|
- SYMFONY__ENV__SECRET=F00B4R
|
||||||
|
- SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql
|
||||||
|
- SYMFONY__ENV__DATABASE_HOST=db
|
||||||
|
- SYMFONY__ENV__DATABASE_PORT=5432
|
||||||
|
- SYMFONY__ENV__DATABASE_NAME=wallabag
|
||||||
|
- SYMFONY__ENV__DATABASE_USER=wallabag
|
||||||
|
- SYMFONY__ENV__DATABASE_PASSWORD=wallapass
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:80"
|
||||||
|
db:
|
||||||
|
image: postgres:10.3
|
||||||
|
environment:
|
||||||
|
- POSTGRES_PASSWORD=my-secret-pw
|
||||||
|
- POSTGRES_USER=my-super-user
|
||||||
17
tests/docker-compose.sqlite.yml
Normal file
17
tests/docker-compose.sqlite.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
wallabag:
|
||||||
|
build:
|
||||||
|
context: ../
|
||||||
|
image: wallabag:sqlite
|
||||||
|
container_name: wallabag
|
||||||
|
environment:
|
||||||
|
- SYMFONY__ENV__DATABASE_DRIVER=pdo_sqlite
|
||||||
|
- SYMFONY__ENV__DATABASE_HOST=127.0.0.1
|
||||||
|
- SYMFONY__ENV__DATABASE_PORT=~
|
||||||
|
- SYMFONY__ENV__DATABASE_NAME=symfony
|
||||||
|
- SYMFONY__ENV__DATABASE_USER=root
|
||||||
|
- SYMFONY__ENV__DATABASE_PASSWORD=~
|
||||||
|
- SYMFONY__ENV__SECRET=F00B4R
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:80:80"
|
||||||
87
tests/test_login.py
Normal file
87
tests/test_login.py
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
import pytest
|
||||||
|
import re
|
||||||
|
import requests
|
||||||
|
import os
|
||||||
|
|
||||||
|
from requests.exceptions import ConnectionError
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session")
|
||||||
|
def database(pytestconfig):
|
||||||
|
return pytestconfig.getoption("database")
|
||||||
|
|
||||||
|
def is_responsive(url):
|
||||||
|
try:
|
||||||
|
response = requests.get(url)
|
||||||
|
if response.status_code == 200:
|
||||||
|
return True
|
||||||
|
except ConnectionError:
|
||||||
|
return False
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session")
|
||||||
|
def docker_compose_project_name(database):
|
||||||
|
return "wallabag_{}".format(database)
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session")
|
||||||
|
def docker_cleanup():
|
||||||
|
"""Disable docker cleanup at the end of tests to get logs outside of pytest"""
|
||||||
|
return False
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session")
|
||||||
|
def docker_compose_command() -> str:
|
||||||
|
return "docker-compose"
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session")
|
||||||
|
def docker_compose_file(pytestconfig, database):
|
||||||
|
return os.path.join(str(pytestconfig.rootdir), "tests/", "docker-compose.{}.yml".format(database))
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session")
|
||||||
|
def wallabag_service(docker_ip, docker_services):
|
||||||
|
"""Ensure that wallabag service is up and responsive"""
|
||||||
|
|
||||||
|
# `port_for` takes a container port and returns the corresponding host port
|
||||||
|
port = docker_services.port_for("wallabag", 80)
|
||||||
|
url = "http://{}:{}".format(docker_ip, port)
|
||||||
|
docker_services.wait_until_responsive(
|
||||||
|
timeout=60.0, pause=0.5, check=lambda: is_responsive(url)
|
||||||
|
)
|
||||||
|
return url
|
||||||
|
|
||||||
|
def test_accessing_login_page(wallabag_service):
|
||||||
|
r = requests.get(wallabag_service, allow_redirects=True)
|
||||||
|
|
||||||
|
assert r.status_code == 200
|
||||||
|
assert 'Log in' in r.text
|
||||||
|
assert 'Password' in r.text
|
||||||
|
assert 'Register' in r.text
|
||||||
|
assert 'Username' in r.text
|
||||||
|
|
||||||
|
|
||||||
|
def test_logging_in(wallabag_service):
|
||||||
|
client = requests.session()
|
||||||
|
r = client.get(wallabag_service, allow_redirects=True)
|
||||||
|
jar = r.cookies
|
||||||
|
|
||||||
|
# get csrf token
|
||||||
|
csrf_match = re.search(
|
||||||
|
'<input type="hidden" name="_csrf_token" value="(.*)" />',
|
||||||
|
r.text
|
||||||
|
)
|
||||||
|
|
||||||
|
if csrf_match:
|
||||||
|
csrf = csrf_match.group(1)
|
||||||
|
else:
|
||||||
|
# if there is no csrf token the test will fail
|
||||||
|
pytest.fail('csrf not matched')
|
||||||
|
|
||||||
|
data = {
|
||||||
|
'_username': 'wallabag',
|
||||||
|
'_password': 'wallabag',
|
||||||
|
'_csrf_token': csrf
|
||||||
|
}
|
||||||
|
|
||||||
|
r = client.post(wallabag_service + '/login_check', cookies=jar, data=data)
|
||||||
|
assert r.status_code == 200
|
||||||
|
assert '/unread/list' in r.text
|
||||||
|
assert '/starred/list' in r.text
|
||||||
|
assert '/archive/list' in r.text
|
||||||
|
assert '/all/list' in r.text
|
||||||
Reference in New Issue
Block a user