1
0
mirror of https://github.com/wallabag/docker synced 2025-12-13 09:46:27 +00:00

99 Commits
2.4.0 ... 2.6.6

Author SHA1 Message Date
Jérémy Benoist
9241c7d799 Merge pull request #375 from wallabag/release/2.6.6
Prepare 2.6.6
2023-09-07 09:29:54 +02:00
Jérémy Benoist
18d9f742fb Prepare 2.6.6 2023-09-07 09:29:14 +02:00
Jérémy Benoist
b5d9ba681c Merge pull request #372 from wallabag/release/2.6.5
2.6.5
2023-08-28 10:38:22 +02:00
Jérémy Benoist
746c6e682b 2.6.5 2023-08-28 10:36:30 +02:00
Nicolas Lœuillet
4f406f1f1f Merge pull request #365 from wallabag/nicosomb-patch-1
Update Dockerfile for 2.6.4
2023-08-22 15:50:15 +02:00
Nicolas Lœuillet
7edde03f39 Update Dockerfile for 2.6.4 2023-08-22 15:45:19 +02:00
Nicolas Lœuillet
4b4eb85eb1 Merge pull request #363 from wallabag/nicosomb-patch-1
Update Dockerfile for wallabag 2.6.3
2023-08-21 12:18:25 +02:00
Jérémy Benoist
7ac0c31dc1 Merge pull request #360 from yguedidi/get-composer-from-official-image
Get composer from official image
2023-08-21 12:12:17 +02:00
Nicolas Lœuillet
854d1027b8 Update Dockerfile for wallabag 2.6.3 2023-08-21 12:07:33 +02:00
Yassine Guedidi
f4517471db Get composer from official image 2023-08-15 18:21:29 +02:00
Nicolas Lœuillet
abb6a98924 Merge pull request #361 from yguedidi/rename-root_dir-to-project_dir
Rename root_dir to project_dir
2023-08-14 07:52:51 +02:00
Yassine Guedidi
624616cd9e Rename root_dir to project_dir 2023-08-13 11:48:06 +02:00
Jérémy Benoist
d6ce0cea67 Merge pull request #344 from STaRDoGG/patch-1
Change default workdir
2023-07-24 15:31:15 +02:00
J. Scott Elblein
673dea7800 Merge branch 'master' into patch-1 2023-07-24 07:56:12 -05:00
Kevin Decherf
d21d9c6260 Merge pull request #355 from wallabag/update-readme
Update README
2023-07-24 13:42:23 +02:00
Nicolas Lœuillet
886535f767 Update Dockerfile for wallabag 2.6.2 2023-07-24 13:15:37 +02:00
Nicolas Lœuillet
1ad213de86 Update README 2023-07-24 13:11:12 +02:00
Jérémy Benoist
3538a3c8d7 Merge pull request #345 from STaRDoGG/patch-2
Add wallabag/bin to PATH
2023-07-24 10:32:36 +02:00
Jérémy Benoist
92fcba3557 Merge pull request #354 from wallabag/alpine318
Update base alpine to 3.18
2023-07-24 10:31:52 +02:00
Kevin Decherf
98ed4730b3 drop: run tests on master
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2023-07-22 18:34:12 +02:00
Kevin Decherf
c0c280b606 Update base alpine to 3.18
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2023-07-22 18:32:38 +02:00
Kevin Decherf
5790e0d029 Merge pull request #353 from wallabag/fix/logs
tests: always run ci steps for logs and cleanup
2023-07-22 18:31:10 +02:00
Nicolas Lœuillet
e61cbdb025 Merge pull request #352 from wallabag/nicosomb-patch-1
Remove 2fa parameter
2023-07-22 17:55:29 +02:00
Kevin Decherf
c12a84557a tests: always run ci steps for logs and cleanup
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2023-07-22 17:46:33 +02:00
Nicolas Lœuillet
835e9ad84b Remove 2fa parameter 2023-07-22 17:34:17 +02:00
Kevin Decherf
d5aac3e6ed Merge pull request #351 from wallabag/impr/pytest
tests: move docker service start in pytest
2023-07-22 17:33:32 +02:00
Kevin Decherf
e38f9adb8b tests: move docker service start in pytest
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2023-07-22 17:17:11 +02:00
J. Scott Elblein
b6db602ece Update Dockerfile
Add Wallabag bin path to environment path so it's commands (i.e console cache:clear --env=prod) can be run from anywhere.
2023-06-28 20:09:05 -05:00
J. Scott Elblein
659a8f4d3f Update Dockerfile
Sets the workdir to navigate to the wallabag folder when entering.

Makes it much easier to not have to always drill all the way down each time you first shell in.
2023-06-28 12:27:54 -05:00
Jérémy Benoist
62d1948e15 Merge pull request #336 from wallabag/nicosomb-patch-1
2.6.1
2023-06-21 13:45:25 +02:00
Jeremy Benoist
a025d243d1 Fix mariadb launch 2023-06-21 13:39:51 +02:00
Jeremy Benoist
fb13655def Handle mailer_dsn 2023-06-21 10:45:24 +02:00
Jeremy Benoist
de07417e8f Update domain name 2023-06-21 09:56:30 +02:00
Jérémy Benoist
b34d71355d Relax composer
We don't need a fixed version of Composer now (as we updated most packages on wallabag)
2023-06-21 09:26:11 +02:00
Nicolas Lœuillet
8bc63c22ec Update Dockerfile 2023-06-21 07:27:14 +02:00
Nicolas Lœuillet
676572b8fe Update dependencies 2023-06-20 18:16:17 +02:00
Nicolas Lœuillet
d51cc9fe33 Update Dockerfile to 2.6.0 2023-06-20 18:07:13 +02:00
Jérémy Benoist
5c52eee713 Merge pull request #319 from wallabag/release/2.5.4
2.5.4
2023-02-07 22:28:01 +01:00
Jérémy Benoist
e2717ea9a9 2.5.4
See https://github.com/wallabag/wallabag/releases/tag/2.5.4
2023-02-07 22:25:16 +01:00
Jérémy Benoist
185b063ca2 Merge pull request #315 from wallabag/release/2.5.3
2.5.3
2023-02-01 10:22:30 +01:00
Jérémy Benoist
a298ff95f7 2.5.3 2023-02-01 10:19:37 +01:00
Jérémy Benoist
68c2e88e88 Merge pull request #313 from ngosang/feature/config 2023-01-02 06:49:45 +01:00
ngosang
2b75993504 Fix PHP 8.1 configuration 2022-12-30 20:27:52 +01:00
Jérémy Benoist
88d24aee30 Merge pull request #310 from ngosang/feature/alpine
Update Alpine 3.17 and PHP 8.1
2022-11-30 14:00:38 -08:00
ngosang
b10121989c Update Alpine 3.17 and PHP 8.1 2022-11-30 00:24:03 +01:00
Kevin Decherf
74bfdfa5c7 Merge pull request #307 from ngosang/feature/ansible
Replace Ansible with Shell script
2022-11-13 15:17:33 +01:00
ngosang
229cb3d017 Replace Ansible with Shell script
* Remove Ansible and all Python packages
* Reduce image size by 456 MB (689 MB => 233 MB uncompressed)
* Fixes some open issues, for example, root password is not required if the database already exists.
* Show install and startup traces (traces and errors were hidden by Ansible)
2022-11-13 14:41:04 +01:00
Jérémy Benoist
30c372025e Merge pull request #308 from ngosang/feature/actions
Update Python version in GitHub Actions
2022-11-02 09:56:41 +01:00
Jérémy Benoist
4c4aa852c1 Merge pull request #309 from ngosang/feature/composer
Update Composer 2.2.18
2022-11-02 09:56:11 +01:00
ngosang
2603775b01 Update Composer 2.2.18 2022-10-29 13:39:37 +02:00
ngosang
3f4a4c7625 Update Python version in GitHub Actions 2022-10-29 02:51:41 +02:00
Jérémy Benoist
ae9214ea87 Merge pull request #306 from ngosang/feature/iconv 2022-10-28 19:05:17 +02:00
ngosang
f92efc56d6 Remove fix for gnu-libiconv (already fixed in Alpine 3.16) 2022-10-28 16:18:26 +02:00
Jérémy Benoist
695212dacb Merge pull request #265 from hwiorn/fix-nginx-conf-for-reverse-proxy-with-https
Fix nginx.conf for reverse-proxy with HTTPS
2022-10-28 14:05:11 +02:00
hwiorn
bf0102ece6 Fix default value of fe_https for non-reverse-proxy compatibility 2022-10-28 14:01:09 +02:00
hwiorn
054677bb02 Fix nginx.conf for reverse-proxy with HTTPS 2022-10-28 14:01:09 +02:00
Jérémy Benoist
43a26d7406 Merge pull request #302 from ngosang/feature/alpine
Update Alpine 3.16
2022-10-28 14:00:04 +02:00
Jérémy Benoist
ecb1ed2793 Merge pull request #301 from ngosang/feature/bash
Remove Bash and Make packages
2022-10-28 13:59:02 +02:00
ngosang
104373da6d Update Alpine 3.16 2022-10-28 12:51:17 +02:00
Diego Heras
080b97130b Merge branch 'master' into feature/bash 2022-10-28 12:44:35 +02:00
Jérémy Benoist
115c83794a Merge pull request #299 from ngosang/feature/php8
Update PHP 8.0
2022-10-28 09:45:12 +02:00
Jérémy Benoist
e6a8421274 Merge pull request #305 from wallabag/fix/database_table_prefix
Add ability to define `database_table_prefix`
2022-10-28 09:44:29 +02:00
Jérémy Benoist
2e947c0b86 Merge pull request #300 from ngosang/feature/git
Install from TAR file and reduce image size
2022-10-28 09:44:15 +02:00
Jeremy Benoist
2234e9a63d Add ability to define database_table_prefix
For people in need to migrate to the docker version from a previous installed wallabag instance defined with a database prefix.
2022-10-28 09:36:15 +02:00
ngosang
3214a229b6 Remove Bash and Make packages 2022-10-25 23:34:07 +02:00
ngosang
66231efd36 Install from TAR file and reduce image size
* Git package not required
* Reduced Docker image size in 129 MB (808 MB -> 679 MB)
* Docker build time reduced in +1 min (no git pull)
2022-10-25 23:12:35 +02:00
ngosang
3f801bf1a5 Update PHP 8.0 2022-10-25 22:37:22 +02:00
Jérémy Benoist
5620cd4e7d Merge pull request #298 from wallabag/fix/update-actions
Update actions to latest version
2022-10-21 14:13:55 +02:00
Jérémy Benoist
140721c49c Update test actions to latest version 2022-10-21 14:10:21 +02:00
Jérémy Benoist
61899108bc Update publish action to latest version
It removed all warning during the build.
2022-10-21 14:09:20 +02:00
Jérémy Benoist
3d63b3b6fd Merge pull request #297 from wallabag/release/2.5.2
2.5.2
2022-10-21 14:00:18 +02:00
Jérémy Benoist
7ffaafb436 2.5.2 2022-10-21 13:55:32 +02:00
Jérémy Benoist
b1aeffca4e Merge pull request #292 from wallabag/release/2.5.1
2.5.1
2022-06-09 09:44:29 +02:00
Jérémy Benoist
b49d7faf71 Stay on 3.15 2022-06-09 09:36:59 +02:00
Jérémy Benoist
bce0488aed 2.5.1
Also update alpine to 3.16
2022-06-09 09:35:02 +02:00
Jérémy Benoist
1d42727517 Merge pull request #287 from wallabag/release/2.5.0
2.5.0
2022-05-21 21:36:55 +02:00
Jeremy Benoist
939b644424 Update alpine image to 3.15
Also use latest Composer 2.2
2022-05-21 21:27:30 +02:00
Jérémy Benoist
3f62284368 2.5.0 2022-05-21 21:11:57 +02:00
Jérémy Benoist
7a99f1ef73 Merge pull request #284 from pgrunm/master 2022-05-20 21:08:56 +02:00
Pascal Gru
537b502424 Update build.yml to build ARM docker images.
This commit allows Github actions to automatically create and publish Docker images for armv7 and arm64 architecture (e. g. Raspberry Pi).
2022-04-29 13:58:21 +02:00
Jérémy Benoist
bfd3fe3d55 Merge pull request #282 from wallabag/fix/composer-2.3 2022-04-04 07:15:20 +02:00
Jérémy Benoist
ed49d39db4 wallabag isn't compatible with Composer 2.3
Install the latest known 2.2 version instead.
2022-04-01 16:20:35 +02:00
Jeremy Benoist
983bfe094b Remove forced composer v1 2022-02-15 09:29:16 +01:00
Jeremy Benoist
37216dfd69 Publish Docker images 2022-02-14 19:52:08 +01:00
Jérémy Benoist
13862eca8f Merge pull request #280 from wallabag/2.4.3
2.4.3
2022-02-14 17:04:37 +01:00
Jérémy Benoist
55b4290605 2.4.3 2022-02-14 17:00:55 +01:00
Kevin Decherf
7873719099 Merge pull request #254 from sethsimmons/patch-1
Add healthcheck and dependencies to docker-compose example
2021-07-02 17:30:24 +02:00
Seth Simmons
05d9d45a54 Add healthcheck and dependencies to docker-compose example
This PR adds in a health check that can used for reporting, monitoring, or autohealing, as well as a `depends_on` statement that ensures wallabag comes up only once the DB and Redis are up.

Update timeout/retries to be more sane
2021-07-02 11:14:24 -04:00
Jeremy Benoist
13818bd90e 2.4.2 2021-03-16 12:17:19 +01:00
Jeremy Benoist
1b5fe1a934 Add missing parameter server_name for 2.4.1 2021-01-05 15:09:39 +01:00
Jérémy Benoist
9d44149e4d 2.4.1 2021-01-05 15:00:15 +01:00
Jérémy Benoist
2b99017b25 Merge pull request #239 from wallabag/otp-issuer 2021-01-04 06:47:50 +01:00
Jérémy Benoist
a85e592e6e Merge pull request #240 from wallabag/update-readme 2021-01-04 06:47:18 +01:00
Kevin Decherf
f4a8e5eadc Update README to include SYMFONY__ENV__DOMAIN_NAME in the quickstart
The default value of this variable leads to a lot of issues with assets
when new comers try wallabag. This change should reduce the occurrence of
this kind of issue.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2020-12-31 18:53:26 +01:00
Kevin Decherf
f460f40b8c Add new parameter server_name for 2FA issuer
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2020-12-31 18:44:50 +01:00
Jérémy Benoist
58c3977a3c Merge pull request #238 from hoh/patch-1 2020-12-29 06:15:45 +01:00
Hugo Herter
aede9b9c98 Fix upgrading to 2.4 requires make and bash
Running `make update` requires make and bash to be installed.

Closes #237
2020-12-29 00:20:52 +01:00
Jérémy Benoist
749587fb4f Merge pull request #228 from wallabag/fix/env-prod-cli-parameter
Fix `-e=prod` parameter
2020-12-10 20:11:20 +01:00
Jeremy Benoist
6839862b04 Fix -e=prod parameter 2020-12-10 17:31:31 +01:00
19 changed files with 368 additions and 392 deletions

57
.github/workflows/publish.yml vendored Normal file
View 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

View File

@@ -24,31 +24,28 @@ jobs:
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.5
python-version: 3.11
- name: "Build image"
run: docker-compose -f tests/docker-compose.${{ matrix.database }}.yml build
- name: "Run image"
run: docker-compose -f tests/docker-compose.${{ matrix.database }}.yml up -d
- name: "Install dependencies"
run: |
pip install pytest
pip install requests
- name: "Check running instance"
run: docker ps
- name: "Wait 60s"
run: sleep 60
run: pip install pytest pytest-docker requests
- name: "Run tests"
run: py.test 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

View File

@@ -1,71 +1,87 @@
FROM alpine:3.12
ARG COMPOSER_VERSION=2.5.8
LABEL maintainer "Marvin Steadfast <marvin@xsteadfastx.org>"
FROM composer:$COMPOSER_VERSION as composer
ARG WALLABAG_VERSION=2.4.0
FROM golang:alpine as builder
RUN apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
# 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.6
RUN set -ex \
&& apk update \
&& apk upgrade --available \
&& apk add \
ansible \
&& apk add --no-cache \
curl \
git \
libwebp \
mariadb-client \
nginx \
pcre \
php7 \
php7-amqp \
php7-bcmath \
php7-ctype \
php7-curl \
php7-dom \
php7-fpm \
php7-gd \
php7-gettext \
php7-iconv \
php7-json \
php7-mbstring \
php7-openssl \
php7-pdo_mysql \
php7-pdo_pgsql \
php7-pdo_sqlite \
php7-phar \
php7-session \
php7-simplexml \
php7-tokenizer \
php7-xml \
php7-zlib \
php7-sockets \
php7-xmlreader \
php7-tidy \
php7-intl \
py3-mysqlclient \
py3-psycopg2 \
py-simplejson \
php81 \
php81-bcmath \
php81-ctype \
php81-curl \
php81-dom \
php81-fpm \
php81-gd \
php81-gettext \
php81-iconv \
php81-json \
php81-mbstring \
php81-openssl \
php81-pecl-amqp \
php81-pdo_mysql \
php81-pdo_pgsql \
php81-pdo_sqlite \
php81-phar \
php81-session \
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 \
tar \
tzdata \
&& 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/stderr /var/log/nginx/error.log \
&& curl -s https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer \
&& composer selfupdate --1 \
&& git clone --branch $WALLABAG_VERSION --depth 1 https://github.com/wallabag/wallabag.git /var/www/wallabag
&& ln -sf /dev/stderr /var/log/nginx/error.log
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
COPY root /
RUN set -ex \
&& 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
ENV PATH="${PATH}:/var/www/wallabag/bin"
# Set console entry path
WORKDIR /var/www/wallabag
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
CMD ["wallabag"]

View File

@@ -24,17 +24,15 @@ Default login is `wallabag:wallabag`.
- `-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_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__LOCALE=...` (default to en)
- `-e SYMFONY__ENV__MAILER_HOST=...` (defaults to "127.0.0.1", the SMTP host)
- `-e SYMFONY__ENV__MAILER_USER=...` (defaults to "~", the SMTP user)
- `-e SYMFONY__ENV__MAILER_PASSWORD=...`(defaults to "~", the SMTP password)
- `-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_AUTH=...` (defaults to "true", enable or disable two-factor authentication)
- `-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-url-instance.com`", the URL of your wallabag instance)
- `-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)
@@ -42,19 +40,20 @@ Default login is `wallabag:wallabag`.
- `-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
The easiest way to start wallabag is to use the SQLite backend. You can spin that up with
```
$ docker run -p 80:80 wallabag/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 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/data:/var/www/wallabag/data -v /opt/wallabag/images:/var/www/wallabag/web/assets/images -p 80:80 wallabag/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
@@ -63,7 +62,7 @@ For using MariaDB or MySQL you have to define some environment variables with th
```
$ 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" -e "SYMFONY__ENV__DATABASE_CHARSET=utf8mb4" -p 80:80 wallabag/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
@@ -72,7 +71,7 @@ For using PostgreSQL you have to define some environment variables with the cont
```
$ 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" -p 80:80 wallabag/wallabag
$ 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
@@ -81,13 +80,13 @@ To use redis with a Docker link, a redis container with the name `redis` is need
```
$ docker run -p 6379:6379 --name redis redis:alpine
$ docker run -p 80:80 --link redis:redis wallabag/wallabag
$ 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" wallabag/wallabag
$ 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
@@ -106,7 +105,7 @@ $ docker exec -t NAME_OR_ID_OF_YOUR_WALLABAG_CONTAINER /var/www/wallabag/bin/con
## docker-compose
It's 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: '3'
@@ -122,23 +121,38 @@ services:
- SYMFONY__ENV__DATABASE_USER=wallabag
- SYMFONY__ENV__DATABASE_PASSWORD=wallapass
- SYMFONY__ENV__DATABASE_CHARSET=utf8mb4
- SYMFONY__ENV__MAILER_HOST=127.0.0.1
- SYMFONY__ENV__MAILER_USER=~
- SYMFONY__ENV__MAILER_PASSWORD=~
- 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-url-instance.com
- SYMFONY__ENV__DOMAIN_NAME=https://your-wallabag-instance.wallabag.org
- SYMFONY__ENV__SERVER_NAME="Your wallabag instance"
ports:
- "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:
image: mariadb
environment:
- MYSQL_ROOT_PASSWORD=wallaroot
volumes:
- /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.

4
conftest.py Normal file
View File

@@ -0,0 +1,4 @@
import pytest
def pytest_addoption(parser):
parser.addoption("--database", action="store", default="default")

View File

@@ -1,27 +1,106 @@
#!/bin/sh
# Exit when any command fails
set -e
provisioner () {
echo "Starting provisioner..."
if ! out=`ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local "$@"`;then
echo $out;
fi
echo "Provisioner finished."
COMMAND_ARG1="$1"
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
)"
}
if [ "$1" = "wallabag" ];then
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/
fi
if [ "$1" = "import" ];then
provisioner --skip-tags=firstrun
cd /var/www/wallabag/
exec su -c "bin/console wallabag:import:redis-worker -e=prod $2 -vv" -s /bin/sh nobody
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 [ "$1" = "migrate" ];then
if [ "$COMMAND_ARG1" = "migrate" ]; then
provisioner
cd /var/www/wallabag/
exec su -c "bin/console doctrine:migrations:migrate --env=prod --no-interaction" -s /bin/sh nobody
fi

View File

@@ -1,169 +0,0 @@
---
- hosts: localhost
remote_user: root
vars:
database_driver: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_DRIVER')|default('pdo_sqlite', true) }}"
database_host: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_HOST')|default('127.0.0.1', true) }}"
database_name: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_NAME')|default('symfony', true) }}"
database_password: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PASSWORD')|default('~', true) }}"
database_port: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PORT')|default('~', true) }}"
database_root_password_mariadb: "{{ lookup('env', 'MYSQL_ROOT_PASSWORD') }}"
database_root_user_postgres: "{{ lookup('env', 'POSTGRES_USER') }}"
database_root_password_postgres: "{{ lookup('env', 'POSTGRES_PASSWORD') }}"
database_user: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_USER')|default('root', true) }}"
database_charset: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_CHARSET')|default('utf8', true) }}"
populate_database: "{{ lookup('env', 'POPULATE_DATABASE')|default(True, true) }}"
locale: "{{ lookup('env', 'SYMFONY__ENV__LOCALE')|default('en', true) }}"
secret: "{{ lookup('env', 'SYMFONY__ENV__SECRET')|default('ovmpmAWXRCabNlMgzlzFXDYmCFfzGv', true) }}"
mailer_transport: "{{ lookup('env', 'SYMFONY__ENV__MAILER_TRANSPORT')|default('smtp', true) }}"
mailer_host: "{{ lookup('env', 'SYMFONY__ENV__MAILER_HOST')|default('127.0.0.1', true) }}"
mailer_user: "{{ lookup('env', 'SYMFONY__ENV__MAILER_USER')|default('~', true) }}"
mailer_password: "{{ lookup('env', 'SYMFONY__ENV__MAILER_PASSWORD')|default('~', true) }}"
mailer_port: "{{ lookup('env', 'SYMFONY__ENV__MAILER_PORT')|default('25', true) }}"
mailer_encryption: "{{ lookup('env', 'SYMFONY__ENV__MAILER_ENCRYPTION')|default('~', true) }}"
mailer_auth_mode: "{{ lookup('env', 'SYMFONY__ENV__MAILER_AUTH_MODE')|default('~', true) }}"
from_email: "{{ lookup('env', 'SYMFONY__ENV__FROM_EMAIL')|default('wallabag@example.com', true) }}"
twofactor_auth: "{{ lookup('env', 'SYMFONY__ENV__TWOFACTOR_AUTH')|default('true', true) }}"
twofactor_sender: "{{ lookup('env', 'SYMFONY__ENV__TWOFACTOR_SENDER')|default('no-reply@wallabag.org', true) }}"
registration: "{{ lookup('env', 'SYMFONY__ENV__FOSUSER_REGISTRATION')|default('true', true) }}"
registration_mail_confirmation: "{{ lookup('env', 'SYMFONY__ENV__FOSUSER_CONFIRMATION')|default('true', true) }}"
domain_name: "{{ lookup('env', 'SYMFONY__ENV__DOMAIN_NAME')|default('https://your-wallabag-url-instance.com', true) }}"
redis_scheme: "{{ lookup('env', 'SYMFONY__ENV__REDIS_SCHEME')|default('tcp', true) }}"
redis_host: "{{ lookup('env', 'SYMFONY__ENV__REDIS_HOST')|default('redis', true) }}"
redis_port: "{{ lookup('env', 'SYMFONY__ENV__REDIS_PORT')|default('6379', true) }}"
redis_path: "{{ lookup('env', 'SYMFONY__ENV__REDIS_PATH')|default('~', true) }}"
redis_password: "{{ lookup('env', 'SYMFONY__ENV__REDIS_PASSWORD')|default('~', true) }}"
sentry_dsn: "{{ lookup('env', 'SYMFONY__ENV__SENTRY_DSN')|default('~', true) }}"
tasks:
- name: needed dirs
file:
path={{ item }}
state=directory
with_items:
- /var/www/wallabag/app
- /var/www/wallabag/app/config
- /var/www/wallabag/data
- /var/www/wallabag/data/assets
- /var/www/wallabag/data/db
notify: chown dir
tags:
- firstrun
- name: write parameters.yml
template:
src=templates/parameters.yml.j2
dest=/var/www/wallabag/app/config/parameters.yml
- 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'
changed_when: true
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="{{ database_port }}"
when: (database_driver == 'pdo_mysql') or
(database_driver == 'pdo_pgsql')
- name: add mariadb db
mysql_db:
name="{{ database_name }}"
state=present
login_host="{{ database_host }}"
login_port={{ database_port }}
login_user=root
login_password="{{ database_root_password_mariadb }}"
encoding="utf8mb4"
notify: run install
when: (database_driver == 'pdo_mysql') and
(populate_database == True)
tags:
- firstrun
- 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_mariadb }}"
state=present
when: (database_driver == 'pdo_mysql') and
(database_user != 'root') and
(populate_database == True)
tags:
- firstrun
- name: postgresql db
postgresql_db:
name="{{ database_name }}"
state=present
login_host="{{ database_host }}"
port={{ database_port }}
login_user="{{ database_root_user_postgres }}"
login_password="{{ database_root_password_postgres }}"
notify: run install
when: (database_driver == 'pdo_pgsql') and
(populate_database == True)
tags:
- firstrun
- name: add postgresql user
postgresql_user:
name="{{ database_user }}"
password="{{ database_password }}"
encrypted=true
db={{ database_name }}
priv=ALL
login_host="{{ database_host }}"
port={{ database_port }}
login_user="{{ database_root_user_postgres }}"
login_password="{{ database_root_password_postgres }}"
state=present
when: (database_driver == 'pdo_pgsql') and
(database_user != 'postgres') and
(populate_database == True)
tags:
- firstrun
- 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

View File

@@ -1,2 +0,0 @@
[localhost]
localhost

View File

@@ -1,60 +0,0 @@
parameters:
database_driver: {{ database_driver }}
database_host: {{ database_host }}
database_port: {{ database_port }}
database_name: {{ database_name }}
database_user: {{ database_user }}
database_password: {{ database_password }}
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
database_socket: null
database_charset: {{ database_charset }}
domain_name: {{ domain_name }}
mailer_transport: {{ mailer_transport }}
mailer_user: {{ mailer_user }}
mailer_password: {{ mailer_password }}
mailer_host: {{ mailer_host }}
mailer_port: {{ mailer_port }}
mailer_encryption: {{ mailer_encryption }}
mailer_auth_mode: {{ mailer_auth_mode }}
locale: {{ locale }}
# A secret key that's used to generate certain security-related tokens
secret: {{ secret }}
# two factor stuff
twofactor_auth: {{ twofactor_auth }}
twofactor_sender: {{ twofactor_sender }}
# fosuser stuff
fosuser_registration: {{ registration }}
fosuser_confirmation: {{ registration_mail_confirmation }}
# 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: {{ from_email }}
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: {{ redis_scheme }}
redis_host: {{ redis_host }}
redis_port: {{ redis_port }}
redis_path: {{ redis_path }}
redis_password: {{ redis_password }}
# sentry logging
sentry_dsn: {{ sentry_dsn }}

View File

@@ -10,7 +10,7 @@ fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
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 SERVER_SOFTWARE nginx/$nginx_version;

View File

@@ -25,6 +25,10 @@ http {
open_file_cache max=100;
client_max_body_size 100M;
map $http_x_forwarded_proto $fe_https {
default $https;
https on;
}
upstream php-upstream {
server 127.0.0.1:9000;

View File

@@ -1,3 +1,3 @@
#!/bin/sh
exec php-fpm7 -F
exec php-fpm -F

View 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"}

View File

@@ -1,60 +0,0 @@
parameters:
database_driver: pdo_sqlite
database_host: 127.0.0.1
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite"
database_table_prefix: wallabag_
database_socket: null
database_charset: utf8
domain_name: https://your-wallabag-url-instance.com
mailer_transport: smtp
mailer_user: ~
mailer_password: ~
mailer_host: 127.0.0.1
mailer_port: false
mailer_encryption: ~
mailer_auth_mode: ~
locale: en
# A secret key that's used to generate certain security-related tokens
secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv
# two factor stuff
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# fosuser stuff
fosuser_registration: true
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: 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: tcp
redis_host: localhost
redis_port: 6379
redis_path: null
redis_password: null
# sentry logging
sentry_dsn: ~

View File

@@ -18,6 +18,6 @@ services:
- "127.0.0.1:80:80"
db:
image: mariadb
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE
command: mariadbd --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE
environment:
- MYSQL_ROOT_PASSWORD=wallaroot

View File

@@ -11,7 +11,7 @@ services:
- SYMFONY__ENV__DATABASE_PORT=~
- SYMFONY__ENV__DATABASE_NAME=symfony
- SYMFONY__ENV__DATABASE_USER=root
- SYMFONY__ENV_DATABASE_PASSWORD=~
- SYMFONY__ENV__DATABASE_PASSWORD=~
- SYMFONY__ENV__SECRET=F00B4R
ports:
- "127.0.0.1:80:80"

View File

@@ -1,13 +1,53 @@
import pytest
import re
import requests
import os
from requests.exceptions import ConnectionError
URL = 'http://127.0.0.1:80'
@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
def test_accessing_login_page():
r = requests.get(URL, allow_redirects=True)
@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
@@ -16,9 +56,9 @@ def test_accessing_login_page():
assert 'Username' in r.text
def test_logging_in():
def test_logging_in(wallabag_service):
client = requests.session()
r = client.get(URL, allow_redirects=True)
r = client.get(wallabag_service, allow_redirects=True)
jar = r.cookies
# get csrf token
@@ -39,7 +79,7 @@ def test_logging_in():
'_csrf_token': csrf
}
r = client.post(URL + '/login_check', cookies=jar, data=data)
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