diff --git a/Dockerfile b/Dockerfile index 730e13e..1cebb61 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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/ \ diff --git a/README.md b/README.md index 785038e..0a5efb4 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/root/entrypoint.sh b/root/entrypoint.sh index 5aadb12..9bbfe99 100755 --- a/root/entrypoint.sh +++ b/root/entrypoint.sh @@ -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 diff --git a/root/etc/nginx/nginx.conf b/root/etc/nginx/nginx.conf index 4c896d0..2f499d3 100644 --- a/root/etc/nginx/nginx.conf +++ b/root/etc/nginx/nginx.conf @@ -36,6 +36,7 @@ http { server { listen 80; + listen [::0]:80; server_name _; root /var/www/wallabag/web; diff --git a/root/etc/wallabag/parameters.template.yml b/root/etc/wallabag/parameters.template.yml index 27dab79..42a8333 100644 --- a/root/etc/wallabag/parameters.template.yml +++ b/root/etc/wallabag/parameters.template.yml @@ -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 diff --git a/tests/test_login.py b/tests/test_login.py index 5a037de..adb6655 100644 --- a/tests/test_login.py +++ b/tests/test_login.py @@ -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