Skip to content

Commit

Permalink
config: disable session activity tracking
Browse files Browse the repository at this point in the history
* Add config option ACCOUNTS_SESSION_ACTIVITY_ENABLED = False.
* Rename SESSION_REDIS as ACCOUNTS_SESSION_REDIS_URL for Docker Compose.
* Remove unused "APP_SESSION_TYPE=redis" from docker-compose.yml.
  • Loading branch information
GraemeWatt committed Aug 8, 2024
1 parent 770c25e commit 758ed96
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ services:
- "APP_CELERY_RESULT_BACKEND=redis://cache:6379/2"
- "APP_OPENSEARCH_HOST=os:9200"
- "APP_SECRET_KEY=CHANGE_ME"
- "APP_SESSION_TYPE=redis"
- "APP_SESSION_REDIS_URL=redis://cache:6379/1"
- "APP_ACCOUNTS_SESSION_REDIS_URL=redis://cache:6379/1"
- "APP_SQLALCHEMY_DATABASE_URI=postgresql://hepdata:hepdata@db/hepdata"
- "SAUCE_USERNAME=${SAUCE_USERNAME}"
- "SAUCE_ACCESS_KEY=${SAUCE_ACCESS_KEY}"
Expand All @@ -38,8 +37,7 @@ services:
- "APP_CELERY_RESULT_BACKEND=redis://cache:6379/2"
- "APP_OPENSEARCH_HOST=os:9200"
- "APP_SECRET_KEY=CHANGE_ME"
- "APP_SESSION_TYPE=redis"
- "APP_SESSION_REDIS_URL=redis://cache:6379/1"
- "APP_ACCOUNTS_SESSION_REDIS_URL=redis://cache:6379/1"
- "APP_SQLALCHEMY_DATABASE_URI=postgresql://hepdata:hepdata@db/hepdata"
read_only: false
volumes:
Expand Down
3 changes: 2 additions & 1 deletion hepdata/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def _(x):
CACHE_TYPE = "redis"

# Session
SESSION_REDIS = "redis://localhost:6379/0"
ACCOUNTS_SESSION_REDIS_URL = CACHE_REDIS_URL
PERMANENT_SESSION_LIFETIME = timedelta(hours=12)

# OpenSearch
Expand Down Expand Up @@ -205,6 +205,7 @@ def _(x):
MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD', '')

ACCOUNTS_USE_CELERY = False
ACCOUNTS_SESSION_ACTIVITY_ENABLED = False

RECORDS_REST_ENDPOINTS = dict(
recid=dict(
Expand Down
2 changes: 1 addition & 1 deletion hepdata/config_local.docker_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
CELERY_BROKER_URL = "redis://cache:6379/0"
CELERY_RESULT_BACKEND = "redis://cache:6379/1"
CACHE_REDIS_URL = "redis://cache:6379/0"
SESSION_REDIS = "redis://cache:6379/0"
ACCOUNTS_SESSION_REDIS_URL = CACHE_REDIS_URL
TEST_DB_HOST = "db"
OPENSEARCH_HOST = "os"
SEARCH_HOSTS = [
Expand Down
2 changes: 1 addition & 1 deletion hepdata/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
and parsed by ``setup.py``.
"""

__version__ = "0.9.4dev20240805"
__version__ = "0.9.4dev20240808"

0 comments on commit 758ed96

Please sign in to comment.