mirror of
https://github.com/wallabag/docker
synced 2025-12-13 17:56:31 +00:00
Compare commits
141 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e28e25500 | ||
|
|
bfb9e7dc40 | ||
|
|
b133e9559d | ||
|
|
b0b760a765 | ||
|
|
480d3833bc | ||
|
|
42981284a6 | ||
|
|
91a399d3bb | ||
|
|
ccb4b25562 | ||
|
|
c8b95ac15b | ||
|
|
25a2e3de71 | ||
|
|
b522c24645 | ||
|
|
2ed6cbca1c | ||
|
|
9dd6c5b52b | ||
|
|
0e11114336 | ||
|
|
6379d9b90f | ||
|
|
e1fafcc31f | ||
|
|
7d2f4919c6 | ||
|
|
096ea7f79c | ||
|
|
2c1ec84dc7 | ||
|
|
488814d187 | ||
|
|
3808b524fc | ||
|
|
dd237ec16e | ||
|
|
84756ac1fd | ||
|
|
60ce6d2e4f | ||
|
|
b228deb919 | ||
|
|
52afa94c77 | ||
|
|
55976e23e5 | ||
|
|
3975a28546 | ||
|
|
0e58189b97 | ||
|
|
2d96e30450 | ||
|
|
424642d3b9 | ||
|
|
364b1b3d84 | ||
|
|
923dffae55 | ||
|
|
d1c4800a3e | ||
|
|
4c3ff8a8ac | ||
|
|
c9104abfeb | ||
|
|
78d6d36e0c | ||
|
|
2a78ed65fe | ||
|
|
cb78d1c98c | ||
|
|
19b6080f31 | ||
|
|
85c82d22c4 | ||
|
|
2ab5b95caf | ||
|
|
2c4fc77b58 | ||
|
|
bffc1412bf | ||
|
|
588c21b192 | ||
|
|
6f2ec8654e | ||
|
|
4143013553 | ||
|
|
eaf63d2098 | ||
|
|
9c6aca3b76 | ||
|
|
e16d9e4113 | ||
|
|
03d1e3a920 | ||
|
|
7c9d8a37e0 | ||
|
|
bdbf7b909a | ||
|
|
bf62096c0e | ||
|
|
f59fb4b67a | ||
|
|
c68fc98e51 | ||
|
|
919f82516c | ||
|
|
2515407009 | ||
|
|
96dd9bc3e3 | ||
|
|
5bde344da3 | ||
|
|
36d4bf58db | ||
|
|
e7b0f9c7f6 | ||
|
|
5a426ce3fa | ||
|
|
75d1b96cc8 | ||
|
|
9241c7d799 | ||
|
|
18d9f742fb | ||
|
|
b5d9ba681c | ||
|
|
b340aaee0a | ||
|
|
746c6e682b | ||
|
|
d7e49fbda9 | ||
|
|
8a68a267ed | ||
|
|
4b00b7f383 | ||
|
|
f1e3a0e2ae | ||
|
|
c2b7c3bbd7 | ||
|
|
7810ca6255 | ||
|
|
4f406f1f1f | ||
|
|
7edde03f39 | ||
|
|
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 |
7
.github/dependabot.yml
vendored
7
.github/dependabot.yml
vendored
@@ -12,3 +12,10 @@ updates:
|
||||
versions:
|
||||
- ">= 3.11.a"
|
||||
- "< 3.12"
|
||||
- package-ecosystem: github-actions
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
time: "04:00"
|
||||
timezone: Europe/Paris
|
||||
open-pull-requests-limit: 10
|
||||
|
||||
14
.github/workflows/publish.yml
vendored
14
.github/workflows/publish.yml
vendored
@@ -13,16 +13,16 @@ jobs:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
@@ -30,23 +30,23 @@ jobs:
|
||||
|
||||
# Documentation: https://github.com/docker/setup-qemu-action
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
# Documentation: https://github.com/docker/setup-buildx-action
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
wallabag/wallabag
|
||||
ghcr.io/${{ github.repository }}
|
||||
|
||||
- name: Build and push Docker images
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
|
||||
31
.github/workflows/test.yml
vendored
31
.github/workflows/test.yml
vendored
@@ -24,31 +24,28 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: "actions/checkout@v2"
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v6
|
||||
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
|
||||
run: docker compose -f tests/docker-compose.${{ matrix.database }}.yml build
|
||||
|
||||
- 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
|
||||
|
||||
112
Dockerfile
112
Dockerfile
@@ -1,73 +1,91 @@
|
||||
FROM alpine:3.15
|
||||
ARG COMPOSER_VERSION=2.2
|
||||
|
||||
LABEL maintainer "Marvin Steadfast <marvin@xsteadfastx.org>"
|
||||
FROM composer:$COMPOSER_VERSION AS composer
|
||||
|
||||
ARG WALLABAG_VERSION=2.5.2
|
||||
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.4.3
|
||||
|
||||
FROM alpine:3.22
|
||||
|
||||
COPY --from=builder /go/bin/envsubst /usr/bin/envsubst
|
||||
|
||||
ARG WALLABAG_VERSION=2.6.14
|
||||
|
||||
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 \
|
||||
php84 \
|
||||
php84-bcmath \
|
||||
php84-ctype \
|
||||
php84-curl \
|
||||
php84-dom \
|
||||
php84-fpm \
|
||||
php84-gd \
|
||||
php84-gettext \
|
||||
php84-iconv \
|
||||
php84-json \
|
||||
php84-mbstring \
|
||||
php84-opcache \
|
||||
php84-openssl \
|
||||
php84-pecl-amqp \
|
||||
php84-pecl-imagick \
|
||||
php84-pdo_mysql \
|
||||
php84-pdo_pgsql \
|
||||
php84-pdo_sqlite \
|
||||
php84-phar \
|
||||
php84-session \
|
||||
php84-simplexml \
|
||||
php84-tokenizer \
|
||||
php84-xml \
|
||||
php84-zlib \
|
||||
php84-sockets \
|
||||
php84-xmlreader \
|
||||
php84-tidy \
|
||||
php84-intl \
|
||||
php84-sodium \
|
||||
mariadb-client \
|
||||
postgresql17-client \
|
||||
rabbitmq-c \
|
||||
s6 \
|
||||
tar \
|
||||
tzdata \
|
||||
make \
|
||||
bash \
|
||||
&& ln -sf /usr/bin/php84 /usr/bin/php \
|
||||
&& ln -sf /usr/sbin/php-fpm84 /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 2.2.12 \
|
||||
&& 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/releases/download/$WALLABAG_VERSION/wallabag-$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
|
||||
|
||||
HEALTHCHECK CMD curl --fail --silent --show-error --user-agent healthcheck http://localhost/api/info || exit 1
|
||||
|
||||
EXPOSE 80
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["wallabag"]
|
||||
|
||||
28
README.md
28
README.md
@@ -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_REGISTRATION=...`(defaults to "false", 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)
|
||||
@@ -43,6 +41,7 @@ Default login is `wallabag:wallabag`.
|
||||
- `-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)
|
||||
- `-e PHP_MEMORY_LIMIT=...` (allows you to change the PHP `memory_limit` value. defaults to 128M, and should be a number and unit, eg. 512K, 128M, 2G, or a number of bytes)
|
||||
|
||||
## SQLite
|
||||
|
||||
@@ -110,10 +109,10 @@ $ docker exec -t NAME_OR_ID_OF_YOUR_WALLABAG_CONTAINER /var/www/wallabag/bin/con
|
||||
An example [docker-compose](https://docs.docker.com/compose/) file can be seen below:
|
||||
|
||||
```
|
||||
version: '3'
|
||||
services:
|
||||
wallabag:
|
||||
image: wallabag/wallabag
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=wallaroot
|
||||
- SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
|
||||
@@ -123,35 +122,32 @@ 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
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=wallaroot
|
||||
volumes:
|
||||
- /opt/wallabag/data:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
|
||||
test: ["CMD", "/usr/local/bin/healthcheck.sh", "--innodb_initialized"]
|
||||
interval: 20s
|
||||
timeout: 3s
|
||||
redis:
|
||||
image: redis:alpine
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 20s
|
||||
|
||||
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")
|
||||
@@ -1,27 +1,116 @@
|
||||
#!/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}
|
||||
SQLITE_DB_DIR="/var/www/wallabag/data/db"
|
||||
SQLITE_DB_FILEPATH="$SQLITE_DB_DIR/wallabag.sqlite"
|
||||
|
||||
# Replace environment variables
|
||||
envsubst < /etc/wallabag/parameters.template.yml > app/config/parameters.yml
|
||||
envsubst < /etc/wallabag/php-wallabag.template.ini > /etc/php84/conf.d/50_wallabag.ini
|
||||
|
||||
# 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
|
||||
if [ "$SYMFONY__ENV__DATABASE_DRIVER" = "pdo_sqlite" ]; then
|
||||
# mkdir and chown are mandatory for local folder binding
|
||||
if [ ! -f "$SQLITE_DB_FILEPATH" ]; then
|
||||
mkdir -p "$SQLITE_DB_DIR"
|
||||
chown nobody: "$SQLITE_DB_DIR"
|
||||
fi
|
||||
|
||||
if [ ! -s "$SQLITE_DB_FILEPATH" ]; then
|
||||
echo "Configuring the SQLite database ..."
|
||||
install_wallabag
|
||||
fi
|
||||
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 --env=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
|
||||
|
||||
|
||||
@@ -1,170 +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) }}"
|
||||
server_name: "{{ lookup('env', 'SYMFONY__ENV__SERVER_NAME')|default('Your wallabag instance', 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
|
||||
@@ -1,2 +0,0 @@
|
||||
[localhost]
|
||||
localhost
|
||||
@@ -1,63 +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 }}
|
||||
|
||||
# User-friendly name of your instance for 2FA issuer
|
||||
server_name: {{ server_name }}
|
||||
@@ -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;
|
||||
|
||||
@@ -25,13 +25,17 @@ 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;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80 ipv6only=off;
|
||||
server_name _;
|
||||
root /var/www/wallabag/web;
|
||||
|
||||
@@ -53,6 +57,7 @@ http {
|
||||
# for more information).
|
||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||
fastcgi_param DOCUMENT_ROOT $realpath_root;
|
||||
fastcgi_read_timeout 300s;
|
||||
# Prevents URIs that include the front controller. This will 404:
|
||||
# http://domain.tld/app.php/some-path
|
||||
# Remove the internal directive to allow URIs like this
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,3 @@
|
||||
#!/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:-false}
|
||||
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: ${SYMFONY__ENV__RABBITMQ_HOST:-localhost}
|
||||
rabbitmq_port: ${SYMFONY__ENV__RABBITMQ_PORT:-5672}
|
||||
rabbitmq_user: ${SYMFONY__ENV__RABBITMQ_USER:-guest}
|
||||
rabbitmq_password: ${SYMFONY__ENV__RABBITMQ_PASSWORD:-guest}
|
||||
rabbitmq_prefetch_count: ${SYMFONY__ENV__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
root/etc/wallabag/php-wallabag.template.ini
Normal file
1
root/etc/wallabag/php-wallabag.template.ini
Normal file
@@ -0,0 +1 @@
|
||||
memory_limit = ${PHP_MEMORY_LIMIT:-128M}
|
||||
@@ -1,63 +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: ~
|
||||
|
||||
# User-friendly name of your instance for 2FA issuer
|
||||
server_name: Your wallabag instance
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,24 +1,63 @@
|
||||
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
|
||||
assert 'Password' in r.text
|
||||
assert 'Register' in r.text
|
||||
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 +78,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
|
||||
|
||||
Reference in New Issue
Block a user