mirror of
https://github.com/wallabag/docker
synced 2025-12-16 03:06:34 +00:00
Merge pull request #307 from ngosang/feature/ansible
Replace Ansible with Shell script
This commit is contained in:
28
Dockerfile
28
Dockerfile
@@ -1,17 +1,20 @@
|
|||||||
|
FROM golang:alpine3.16 as builder
|
||||||
|
|
||||||
|
# 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.16
|
FROM alpine:3.16
|
||||||
|
|
||||||
LABEL maintainer "Marvin Steadfast <marvin@xsteadfastx.org>"
|
COPY --from=builder /go/bin/envsubst /usr/bin/envsubst
|
||||||
|
|
||||||
ARG WALLABAG_VERSION=2.5.2
|
ARG WALLABAG_VERSION=2.5.2
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& apk update \
|
&& apk add --no-cache \
|
||||||
&& apk upgrade --available \
|
|
||||||
&& apk add \
|
|
||||||
ansible \
|
|
||||||
curl \
|
curl \
|
||||||
libwebp \
|
libwebp \
|
||||||
mariadb-client \
|
|
||||||
nginx \
|
nginx \
|
||||||
pcre \
|
pcre \
|
||||||
php8 \
|
php8 \
|
||||||
@@ -40,9 +43,8 @@ RUN set -ex \
|
|||||||
php8-xmlreader \
|
php8-xmlreader \
|
||||||
php8-tidy \
|
php8-tidy \
|
||||||
php8-intl \
|
php8-intl \
|
||||||
py3-mysqlclient \
|
mariadb-client \
|
||||||
py3-psycopg2 \
|
postgresql14-client \
|
||||||
py-simplejson \
|
|
||||||
rabbitmq-c \
|
rabbitmq-c \
|
||||||
s6 \
|
s6 \
|
||||||
tar \
|
tar \
|
||||||
@@ -54,18 +56,20 @@ RUN set -ex \
|
|||||||
&& ln -sf /dev/stderr /var/log/nginx/error.log \
|
&& ln -sf /dev/stderr /var/log/nginx/error.log \
|
||||||
&& curl -s https://getcomposer.org/installer | php \
|
&& curl -s https://getcomposer.org/installer | php \
|
||||||
&& mv composer.phar /usr/local/bin/composer \
|
&& mv composer.phar /usr/local/bin/composer \
|
||||||
&& composer selfupdate 2.2.18
|
&& composer selfupdate 2.2.18 \
|
||||||
|
&& rm -rf /root/.composer/*
|
||||||
|
|
||||||
COPY root /
|
COPY root /
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& mv /var/www/wallabag/app /tmp/app \
|
|
||||||
&& 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/archive/$WALLABAG_VERSION.tar.gz \
|
||||||
&& tar xvf /tmp/wallabag.tar.gz -C /tmp \
|
&& tar xvf /tmp/wallabag.tar.gz -C /tmp \
|
||||||
|
&& mkdir /var/www/wallabag \
|
||||||
&& mv /tmp/wallabag-*/* /var/www/wallabag/ \
|
&& mv /tmp/wallabag-*/* /var/www/wallabag/ \
|
||||||
&& rm -rf /tmp/wallabag* \
|
&& rm -rf /tmp/wallabag* \
|
||||||
&& mv /tmp/app/config/parameters.yml /var/www/wallabag/app/config/parameters.yml \
|
|
||||||
&& cd /var/www/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 \
|
&& 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/* \
|
&& 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
|
&& chown -R nobody:nobody /var/www/wallabag
|
||||||
|
|||||||
@@ -1,27 +1,105 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# Exit when any command fails
|
||||||
|
set -e
|
||||||
|
|
||||||
provisioner () {
|
COMMAND_ARG1="$1"
|
||||||
echo "Starting provisioner..."
|
COMMAND_ARG2="$2"
|
||||||
if ! out=`ansible-playbook -i /etc/ansible/hosts /etc/ansible/entrypoint.yml -c local "$@"`;then
|
|
||||||
echo $out;
|
cd /var/www/wallabag || exit
|
||||||
fi
|
|
||||||
echo "Provisioner finished."
|
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
|
||||||
|
if [ "$SYMFONY__ENV__DATABASE_DRIVER" = "pdo_sqlite" ] && [ ! -f "/var/www/wallabag/data/db/wallabag.sqlite" ] ; 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
|
provisioner
|
||||||
|
echo "Wallabag is ready!"
|
||||||
exec s6-svscan /etc/s6/
|
exec s6-svscan /etc/s6/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" = "import" ];then
|
if [ "$COMMAND_ARG1" = "import" ]; then
|
||||||
provisioner --skip-tags=firstrun
|
provisioner
|
||||||
cd /var/www/wallabag/
|
exec su -c "bin/console wallabag:import:redis-worker --env=prod $COMMAND_ARG2 -vv" -s /bin/sh nobody
|
||||||
exec su -c "bin/console wallabag:import:redis-worker --env=prod $2 -vv" -s /bin/sh nobody
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" = "migrate" ];then
|
if [ "$COMMAND_ARG1" = "migrate" ]; then
|
||||||
provisioner
|
provisioner
|
||||||
cd /var/www/wallabag/
|
|
||||||
exec su -c "bin/console doctrine:migrations:migrate --env=prod --no-interaction" -s /bin/sh nobody
|
exec su -c "bin/console doctrine:migrations:migrate --env=prod --no-interaction" -s /bin/sh nobody
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,171 +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) }}"
|
|
||||||
database_table_prefix: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_TABLE_PREFIX')|default('wallabag_', 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: {{ database_table_prefix }}
|
|
||||||
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 }}
|
|
||||||
63
root/etc/wallabag/parameters.template.yml
Normal file
63
root/etc/wallabag/parameters.template.yml
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
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.root_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-url-instance.com}
|
||||||
|
|
||||||
|
mailer_transport: ${SYMFONY__ENV__MAILER_TRANSPORT:-smtp}
|
||||||
|
mailer_user: ${SYMFONY__ENV__MAILER_USER:-~}
|
||||||
|
mailer_password: ${SYMFONY__ENV__MAILER_PASSWORD:-~}
|
||||||
|
mailer_host: ${SYMFONY__ENV__MAILER_HOST:-127.0.0.1}
|
||||||
|
mailer_port: ${SYMFONY__ENV__MAILER_PORT:-25}
|
||||||
|
mailer_encryption: ${SYMFONY__ENV__MAILER_ENCRYPTION:-~}
|
||||||
|
mailer_auth_mode: ${SYMFONY__ENV__MAILER_AUTH_MODE:-~}
|
||||||
|
|
||||||
|
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_auth: ${SYMFONY__ENV__TWOFACTOR_AUTH:-true}
|
||||||
|
twofactor_sender: ${SYMFONY__ENV__TWOFACTOR_SENDER:-no-reply@wallabag.org}
|
||||||
|
|
||||||
|
# fosuser stuff
|
||||||
|
fosuser_registration: ${SYMFONY__ENV__FOSUSER_REGISTRATION:-true}
|
||||||
|
fosuser_confirmation: ${SYMFONY__ENV__FOSUSER_CONFIRMATION:-true}
|
||||||
|
|
||||||
|
# how long the access token should live in seconds for the API
|
||||||
|
fos_oauth_server_access_token_lifetime: 3600
|
||||||
|
# how long the refresh token should life in seconds for the API
|
||||||
|
fos_oauth_server_refresh_token_lifetime: 1209600
|
||||||
|
|
||||||
|
from_email: ${SYMFONY__ENV__FROM_EMAIL:-no-reply@wallabag.org}
|
||||||
|
|
||||||
|
rss_limit: 50
|
||||||
|
|
||||||
|
# RabbitMQ processing
|
||||||
|
rabbitmq_host: localhost
|
||||||
|
rabbitmq_port: 5672
|
||||||
|
rabbitmq_user: guest
|
||||||
|
rabbitmq_password: guest
|
||||||
|
rabbitmq_prefetch_count: 10
|
||||||
|
|
||||||
|
# Redis processing
|
||||||
|
redis_scheme: ${SYMFONY__ENV__REDIS_SCHEME:-tcp}
|
||||||
|
redis_host: ${SYMFONY__ENV__REDIS_HOST:-redis}
|
||||||
|
redis_port: ${SYMFONY__ENV__REDIS_PORT:-6379}
|
||||||
|
redis_path: ${SYMFONY__ENV__REDIS_PATH:-~}
|
||||||
|
redis_password: ${SYMFONY__ENV__REDIS_PASSWORD:-~}
|
||||||
|
|
||||||
|
# Sentry
|
||||||
|
sentry_dsn: ${SYMFONY__ENV__SENTRY_DSN:-~}
|
||||||
|
|
||||||
|
# User-friendly name of your instance for 2FA issuer
|
||||||
|
server_name: ${SYMFONY__ENV__SERVER_NAME:-"Your wallabag instance"}
|
||||||
@@ -1,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
|
|
||||||
Reference in New Issue
Block a user