Skip to content

Commit f86d945

Browse files
authored
Merge pull request #107 from greenrd/feature/db-driver-class
Support Postgres 10
2 parents eeead4f + a37317f commit f86d945

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Default login is `wallabag:wallabag`.
1818
- `-e POSTGRES_PASSWORD=...` (needed for the posgres container to initialise and for the entrypoint in the wallabag container to create a database and user if not there)
1919
- `-e POSTGRES_USER=...` (needed for the posgres container to initialise and for the entrypoint in the wallabag container to create a database and user if not there)
2020
- `-e SYMFONY__ENV__DATABASE_DRIVER=...` (defaults to "pdo_sqlite", this sets the database driver to use)
21+
- `-e SYMFONY__ENV__DATABASE_DRIVER_CLASS=...` (sets the database driver class to use)
2122
- `-e SYMFONY__ENV__DATABASE_HOST=...` (defaults to "127.0.0.1", if use mysql this should be the name of the mariadb container)
2223
- `-e SYMFONY__ENV__DATABASE_PORT=...` (port of the database host)
2324
- `-e SYMFONY__ENV__DATABASE_NAME=...`(defaults to "symfony", this is the name of the database to use)
@@ -62,7 +63,7 @@ For using PostgreSQL you have to define some environment variables with the cont
6263

6364
```
6465
$ docker run --name wallabag-db -e "POSTGRES_PASSWORD=my-secret-pw" -e "POSTGRES_USER=my-super-user" -d postgres:9.6
65-
$ docker run --name wallabag --link wallabag-db:wallabag-db -e "POSTGRES_PASSWORD=my-secret-pw" -e "POSTGRES_USER=my-super-user" -e "SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql" -e "SYMFONY__ENV__DATABASE_HOST=wallabag-db" -e "SYMFONY__ENV__DATABASE_PORT=5432" -e "SYMFONY__ENV__DATABASE_NAME=wallabag" -e "SYMFONY__ENV__DATABASE_USER=wallabag" -e "SYMFONY__ENV__DATABASE_PASSWORD=wallapass" -p 80:80 wallabag/wallabag
66+
$ docker run --name wallabag --link wallabag-db:wallabag-db -e "POSTGRES_PASSWORD=my-secret-pw" -e "POSTGRES_USER=my-super-user" -e "SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql" -e 'SYMFONY__ENV__DATABASE_DRIVER_CLASS=Wallabag\CoreBundle\Doctrine\DBAL\Driver\CustomPostgreSQLDriver' -e "SYMFONY__ENV__DATABASE_HOST=wallabag-db" -e "SYMFONY__ENV__DATABASE_PORT=5432" -e "SYMFONY__ENV__DATABASE_NAME=wallabag" -e "SYMFONY__ENV__DATABASE_USER=wallabag" -e "SYMFONY__ENV__DATABASE_PASSWORD=wallapass" -p 80:80 wallabag/wallabag
6667
```
6768

6869
## Redis

root/etc/ansible/entrypoint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
vars:
66

77
database_driver: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_DRIVER')|default('pdo_sqlite', true) }}"
8+
database_driver_class: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_DRIVER_CLASS')|default('~', true) }}"
89
database_host: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_HOST')|default('127.0.0.1', true) }}"
910
database_name: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_NAME')|default('symfony', true) }}"
1011
database_password: "{{ lookup('env', 'SYMFONY__ENV__DATABASE_PASSWORD')|default('~', true) }}"
@@ -116,6 +117,7 @@
116117
postgresql_user:
117118
name="{{ database_user }}"
118119
password="{{ database_password }}"
120+
encrypted=true
119121
db={{ database_name }}
120122
priv=ALL
121123
login_host="{{ database_host }}"

root/etc/ansible/templates/parameters.yml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
parameters:
22
database_driver: {{ database_driver }}
3+
database_driver_class: {{ database_driver_class }}
34
database_host: {{ database_host }}
45
database_port: {{ database_port }}
56
database_name: {{ database_name }}
@@ -9,7 +10,6 @@ parameters:
910
database_table_prefix: wallabag_
1011
database_socket: null
1112
database_charset: {{ database_charset }}
12-
database_driver_class: null
1313

1414
domain_name: {{ domain_name }}
1515

tests/docker-compose.postgresql.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
- POSTGRES_USER=my-super-user
1111
- SYMFONY__ENV__SECRET=F00B4R
1212
- SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql
13+
- SYMFONY__ENV__DATABASE_DRIVER_CLASS=Wallabag\CoreBundle\Doctrine\DBAL\Driver\CustomPostgreSQLDriver
1314
- SYMFONY__ENV__DATABASE_HOST=db
1415
- SYMFONY__ENV__DATABASE_PORT=5432
1516
- SYMFONY__ENV__DATABASE_NAME=wallabag
@@ -18,7 +19,7 @@ services:
1819
ports:
1920
- "127.0.0.1:80:80"
2021
db:
21-
image: postgres:9.6
22+
image: postgres:10.3
2223
environment:
2324
- POSTGRES_PASSWORD=my-secret-pw
2425
- POSTGRES_USER=my-super-user

0 commit comments

Comments
 (0)