1
0
mirror of https://github.com/wallabag/docker synced 2025-12-12 17:26:25 +00:00

Merge branch 'master' into 2.6.x

This commit is contained in:
Kevin Decherf
2024-03-10 22:03:33 +01:00
6 changed files with 22 additions and 9 deletions

View File

@@ -34,6 +34,7 @@ RUN set -ex \
php81-mbstring \
php81-openssl \
php81-pecl-amqp \
php81-pecl-imagick \
php81-pdo_mysql \
php81-pdo_pgsql \
php81-pdo_sqlite \
@@ -65,7 +66,7 @@ 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 \
&& 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/ \

View File

@@ -30,7 +30,7 @@ Default login is `wallabag:wallabag`.
- `-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_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-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))
@@ -112,6 +112,7 @@ version: '3'
services:
wallabag:
image: wallabag/wallabag
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=wallaroot
- SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql
@@ -131,7 +132,7 @@ services:
volumes:
- /opt/wallabag/images:/var/www/wallabag/web/assets/images
healthcheck:
test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost"]
test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost/api/info"]
interval: 1m
timeout: 3s
depends_on:
@@ -139,6 +140,7 @@ services:
- redis
db:
image: mariadb
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=wallaroot
volumes:
@@ -149,6 +151,7 @@ services:
timeout: 3s
redis:
image: redis:alpine
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 20s

View File

@@ -23,6 +23,8 @@ install_wallabag() {
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
@@ -33,10 +35,17 @@ provisioner() {
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
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

View File

@@ -36,6 +36,7 @@ http {
server {
listen 80;
listen [::0]:80;
server_name _;
root /var/www/wallabag/web;

View File

@@ -23,7 +23,7 @@ parameters:
twofactor_sender: ${SYMFONY__ENV__TWOFACTOR_SENDER:-no-reply@wallabag.org}
# fosuser stuff
fosuser_registration: ${SYMFONY__ENV__FOSUSER_REGISTRATION:-true}
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

View File

@@ -52,7 +52,6 @@ def test_accessing_login_page(wallabag_service):
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