diff --git a/debian/control b/debian/control index 41f1bc431..24d4909f8 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Standards-Version: 3.9.6 Package: passbook Architecture: all -Recommends: mysql-server, rabbitmq-server +Recommends: mysql-server, rabbitmq-server, redis-server Pre-Depends: adduser, libldap2-dev, libsasl2-dev Depends: python3 (>= 3.5) | python3.6 | python3.7, python3-pip, dbconfig-pgsql | dbconfig-no-thanks, ${misc:Depends} Description: Authentication Provider/Proxy supporting protocols like SAML, OAuth, LDAP and more. diff --git a/helm/passbook/charts/redis-5.1.0.tgz b/helm/passbook/charts/redis-5.1.0.tgz new file mode 100644 index 000000000..71237425a Binary files /dev/null and b/helm/passbook/charts/redis-5.1.0.tgz differ diff --git a/helm/passbook/requirements.lock b/helm/passbook/requirements.lock index e0d0da107..15be0d3d0 100644 --- a/helm/passbook/requirements.lock +++ b/helm/passbook/requirements.lock @@ -5,5 +5,8 @@ dependencies: - name: postgresql repository: https://kubernetes-charts.storage.googleapis.com/ version: 3.10.1 -digest: sha256:c36e054785f7d706d7d3f525eb1b167dbc89b42f84da7fc167a18bbb6542c999 -generated: 2019-03-11T20:36:35.125079+01:00 +- name: redis + repository: https://kubernetes-charts.storage.googleapis.com/ + version: 5.1.0 +digest: sha256:8bf68bc928a2e3c0f05139635be05fa0840554c7bde4cecd624fac78fb5fa5a3 +generated: 2019-03-21T11:06:51.553379+01:00 diff --git a/helm/passbook/requirements.yaml b/helm/passbook/requirements.yaml index 9ae71eac5..0f2e1f356 100644 --- a/helm/passbook/requirements.yaml +++ b/helm/passbook/requirements.yaml @@ -5,3 +5,6 @@ dependencies: - name: postgresql version: 3.10.1 repository: https://kubernetes-charts.storage.googleapis.com/ +- name: redis + version: 5.1.0 + repository: https://kubernetes-charts.storage.googleapis.com/ diff --git a/helm/passbook/templates/passbook-configmap.yaml b/helm/passbook/templates/passbook-configmap.yaml index 8283e8d20..6fcf669a3 100644 --- a/helm/passbook/templates/passbook-configmap.yaml +++ b/helm/passbook/templates/passbook-configmap.yaml @@ -37,6 +37,7 @@ data: secure_proxy_header: HTTP_X_FORWARDED_PROTO: https rabbitmq: "user:{{ .Values.rabbitmq.rabbitmq.password }}@{{ .Release.Name }}-rabbitmq" + redis: ":{{ .Values.redis.password }}@{{ .Release.Name }}-redis-master" # Error reporting, sends stacktrace to sentry.services.beryju.org error_report_enabled: {{ .Values.config.error_reporting }} diff --git a/passbook/core/requirements.txt b/passbook/core/requirements.txt index dea78258c..e6bf90dbe 100644 --- a/passbook/core/requirements.txt +++ b/passbook/core/requirements.txt @@ -1,12 +1,13 @@ -django>=2.0 -django-model-utils +celery +cherrypy +colorlog django-ipware +django-model-utils +django-redis +django>=2.0 djangorestframework +idna<2.8,>=2.5 +markdown +psycopg2 PyYAML raven -markdown -colorlog -celery -psycopg2 -idna<2.8,>=2.5 -cherrypy diff --git a/passbook/core/settings.py b/passbook/core/settings.py index b5b42ef78..f30af2c77 100644 --- a/passbook/core/settings.py +++ b/passbook/core/settings.py @@ -45,6 +45,8 @@ AUTH_USER_MODEL = 'passbook_core.User' CSRF_COOKIE_NAME = 'passbook_csrf' SESSION_COOKIE_NAME = 'passbook_session' +SESSION_ENGINE = "django.contrib.sessions.backends.cache" +SESSION_CACHE_ALIAS = "default" LANGUAGE_COOKIE_NAME = 'passbook_language' AUTHENTICATION_BACKENDS = [ @@ -99,6 +101,16 @@ REST_FRAMEWORK = { ] } +CACHES = { + "default": { + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": "redis://%s" % CONFIG.get('redis'), + "OPTIONS": { + "CLIENT_CLASS": "django_redis.client.DefaultClient", + } + } +} + MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', diff --git a/passbook/lib/default.yml b/passbook/lib/default.yml index ab1015d9e..450581a93 100644 --- a/passbook/lib/default.yml +++ b/passbook/lib/default.yml @@ -30,6 +30,7 @@ debug: false secure_proxy_header: HTTP_X_FORWARDED_PROTO: https rabbitmq: guest:guest@localhost/passbook +redis: localhost # Error reporting, sends stacktrace to sentry.services.beryju.org error_report_enabled: true secret_key: 9$@r!d^1^jrn#fk#1#@ks#9&i$^s#1)_13%$rwjrhd=e8jfi_s