Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

openwisp2_python: python3
ansible_python_interpreter: /usr/bin/python3
openwisp2_network_topology: false
Expand Down Expand Up @@ -72,6 +71,7 @@ openwisp2_redis_install: true
openwisp2_redis_host: localhost
openwisp2_redis_port: 6379
openwisp2_redis_cache_url: "redis://{{ openwisp2_redis_host }}:{{ openwisp2_redis_port }}/1"
openwisp2_redis_sessions_url: "redis://{{ openwisp2_redis_host }}:{{ openwisp2_redis_port }}/4"
openwisp2_influxdb_install: true
openwisp2_timeseries_database:
backend: "openwisp_monitoring.db.backends.influxdb"
Expand Down
1 change: 1 addition & 0 deletions docs/user/role-variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ take a look at `the default values of these variables
openwisp2_redis_host: localhost
openwisp2_redis_port: 6379
openwisp2_redis_cache_url: "redis://{{ openwisp2_redis_host }}:{{ openwisp2_redis_port }}/1"
openwisp2_redis_sessions_url: "redis://{{ openwisp2_redis_host }}:{{ openwisp2_redis_port }}/4"
# the following options are required to configure influxdb which is used in openwisp-monitoring
openwisp2_influxdb_install: true
openwisp2_timeseries_database:
Expand Down
13 changes: 10 additions & 3 deletions templates/openwisp2/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [("{{ openwisp2_redis_host }}", {{ openwisp2_redis_port }})],
"hosts": [f"redis://{{ openwisp2_redis_host }}:{{ openwisp2_redis_port }}/0"],
"group_expiry": {{ openwisp2_daphne_websocket_timeout }},
},
},
Expand Down Expand Up @@ -358,11 +358,18 @@
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
},
}
},
"sessions": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "{{ openwisp2_redis_sessions_url }}",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
},
},
}

SESSION_ENGINE = "django.contrib.sessions.backends.cache"
SESSION_CACHE_ALIAS = "default"
SESSION_CACHE_ALIAS = "sessions"
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True

Expand Down
Loading