Skip to content

Commit

Permalink
Merge pull request #134 from kmlucy/master
Browse files Browse the repository at this point in the history
Add redis environmental variables
  • Loading branch information
j0k3r authored Dec 15, 2018
2 parents 6d7fdd9 + 386924f commit 66c3967
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ Default login is `wallabag:wallabag`.
- `-e SYMFONY__ENV__FOSUSER_REGISTRATION=...`(defaults to "true", 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-url-instance.com", 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))
- `-e SYMFONY__ENV__REDIS_HOST=...` (defaults to "redis", IP or hostname of the target server)
- `-e SYMFONY__ENV__REDIS_PORT=...` (defaults to "6379", port of the target host)
- `-e SYMFONY__ENV__REDIS_PATH=...`(defaults to "~", path of the unix socket file)
- `-e SYMFONY__ENV__REDIS_PASSWORD=...` (defaults to "~", this is the password defined in the Redis server configuration)
- `-e POPULATE_DATABASE=...`(defaults to "True". Does the DB has to be populated or is it an existing one)

## SQLite
Expand Down Expand Up @@ -69,13 +74,19 @@ $ docker run --name wallabag --link wallabag-db:wallabag-db -e "POSTGRES_PASSWOR

## Redis

To use redis support a linked redis container with the name `redis` is needed.
To use redis with a Docker link, a redis container with the name `redis` is needed and none of the `REDIS` environmental variables are needed:

```
$ docker run -p 6379:6379 --name redis redis:alpine
$ docker run -p 80:80 --link redis:redis wallabag/wallabag
```

To use redis with an external redis host, set the appropriate environmental variables. Example:

```
$ docker run -p 80:80 -e "SYMFONY__ENV__REDIS_HOST=my.server.hostname" -e "SYMFONY__ENV__REDIS_PASSWORD=my-secret-pw" wallabag/wallabag
```

## Upgrading

If there is a version upgrade that needs a database migration. The most easy way to do is running the `migrate` command:
Expand Down
5 changes: 5 additions & 0 deletions root/etc/ansible/entrypoint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
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) }}"

tasks:

Expand Down
10 changes: 5 additions & 5 deletions root/etc/ansible/templates/parameters.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ parameters:
rabbitmq_prefetch_count: 10

# Redis processing
redis_scheme: tcp
redis_host: redis
redis_port: 6379
redis_path: null
redis_password: null
redis_scheme: {{ redis_scheme }}
redis_host: {{ redis_host }}
redis_port: {{ redis_port }}
redis_path: {{ redis_path }}
redis_password: {{ redis_password }}

0 comments on commit 66c3967

Please sign in to comment.