From 2234e9a63d3877d52ff69e42013828bd80108391 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 28 Oct 2022 09:36:15 +0200 Subject: [PATCH] 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. --- README.md | 2 ++ root/etc/ansible/entrypoint.yml | 1 + root/etc/ansible/templates/parameters.yml.j2 | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eb5fa05..c49effd 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ 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) @@ -123,6 +124,7 @@ services: - SYMFONY__ENV__DATABASE_USER=wallabag - SYMFONY__ENV__DATABASE_PASSWORD=wallapass - SYMFONY__ENV__DATABASE_CHARSET=utf8mb4 + - SYMFONY__ENV__DATABASE_TABLE_PREFIX="wallabag_" - SYMFONY__ENV__MAILER_HOST=127.0.0.1 - SYMFONY__ENV__MAILER_USER=~ - SYMFONY__ENV__MAILER_PASSWORD=~ diff --git a/root/etc/ansible/entrypoint.yml b/root/etc/ansible/entrypoint.yml index f176fd6..b31cb5c 100644 --- a/root/etc/ansible/entrypoint.yml +++ b/root/etc/ansible/entrypoint.yml @@ -14,6 +14,7 @@ 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) }}" diff --git a/root/etc/ansible/templates/parameters.yml.j2 b/root/etc/ansible/templates/parameters.yml.j2 index f01cc5c..5efa74c 100644 --- a/root/etc/ansible/templates/parameters.yml.j2 +++ b/root/etc/ansible/templates/parameters.yml.j2 @@ -6,7 +6,7 @@ parameters: database_user: {{ database_user }} database_password: {{ database_password }} database_path: "%kernel.root_dir%/../data/db/wallabag.sqlite" - database_table_prefix: wallabag_ + database_table_prefix: {{ database_table_prefix }} database_socket: null database_charset: {{ database_charset }}