chore: rename WEBSOCKET_ENABLED in REALTIME_ENABLED

Co-authored-by: David Larlet <david@larlet.fr>
This commit is contained in:
Yohan Boniface 2025-04-07 18:55:18 +02:00
parent 3670c47af9
commit c0c55075b7
7 changed files with 21 additions and 24 deletions

View file

@ -35,7 +35,7 @@ services:
- SITE_URL=https://umap.local/
- UMAP_ALLOW_ANONYMOUS=True
- DEBUG=1
- WEBSOCKET_ENABLED=1
- REALTIME_ENABLED=1
- REDIS_URL=redis://redis:6379
volumes:
- data:/srv/umap/uploads

View file

@ -88,6 +88,13 @@ Nginx configuration.
See [Django documentation for MEDIA_ROOT](https://docs.djangoproject.com/en/4.2/ref/settings/#media-root)
#### REALTIME_ENABLED
Setting `REALTIME_ENABLED` to `True` will allow users to enable real-time collaboration.
A switch will be available for them in the "advanced properties" of the map.
See [the documentation about ASGI deployment](../deploy/asgi.md) for more information.
#### SECRET_KEY
Must be defined to something unique and secret.
@ -121,6 +128,13 @@ The final URL of you instance, including the protocol:
`SITE_URL=http://umap.org`
#### SOCIAL_AUTH_OPENSTREETMAP_OAUTH2_KEY, SOCIAL_AUTH_OPENSTREETMAP_OAUTH2_SECRET
If you use OpenStreetMap as OAuth 2 provider, you can use those settings.
Otherwise, use any valid [python-social-auth configuration](https://python-social-auth.readthedocs.io/en/latest/configuration/django.html).
#### STATIC_ROOT
Where uMap should store static files (CSS, JS…), must be consistent with your
@ -348,16 +362,3 @@ Should uMap gzip datalayers geojson.
Can be set to `X-Accel-Redirect` to enable the [NGINX X-Accel](https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile/) feature.
See the NGINX documentation in addition.
#### SOCIAL_AUTH_OPENSTREETMAP_OAUTH2_KEY, SOCIAL_AUTH_OPENSTREETMAP_OAUTH2_SECRET
If you use OpenStreetMap as OAuth 2 provider, you can use those settings.
Otherwise, use any valid [python-social-auth configuration](https://python-social-auth.readthedocs.io/en/latest/configuration/django.html).
#### WEBSOCKET_ENABLED
Setting `WEBSOCKET_ENABLED` to `True` will allow users to enable real-time collaboration.
A switch will be available for them in the "advanced properties" of the map.
See [the documentation about ASGI deployment](../deploy/asgi.md) for more information.

View file

@ -85,7 +85,7 @@ services
condition: service_healthy
environment:
- WEBSOCKET_ENABLED=1
- REALTIME_ENABLED=1
- REDIS_URL=redis://redis:6379

View file

@ -360,10 +360,8 @@ LOGGING = {
},
}
# WebSocket configuration
# Real-time editing configuration
WEBSOCKET_ENABLED = env.bool("WEBSOCKET_ENABLED", default=False)
WEBSOCKET_BACK_HOST = env("WEBSOCKET_BACK_HOST", default="localhost")
WEBSOCKET_BACK_PORT = env.int("WEBSOCKET_BACK_PORT", default=8001)
REALTIME_ENABLED = env.bool("REALTIME_ENABLED", default=False)
REDIS_URL = env("REDIS_URL", default="redis://localhost:6379")

View file

@ -26,8 +26,6 @@ PASSWORD_HASHERS = [
]
WEBSOCKET_ENABLED = True
WEBSOCKET_BACK_PORT = "8010"
WEBSOCKET_FRONT_URI = "ws://localhost:8010"
REALTIME_ENABLED = True
REDIS_URL = "redis://localhost:6379/15"

View file

@ -28,7 +28,7 @@ def _urls_for_js():
"""
urls = {}
modules = ["umap.urls"]
if settings.WEBSOCKET_ENABLED:
if settings.REALTIME_ENABLED:
modules.append("umap.sync.app")
for module in modules:
names = _get_url_names(module)

View file

@ -616,7 +616,7 @@ class MapDetailMixin(SessionMixin):
"licences": dict((l.name, l.json) for l in Licence.objects.all()),
"umap_version": VERSION,
"featuresHaveOwner": settings.UMAP_DEFAULT_FEATURES_HAVE_OWNERS,
"websocketEnabled": settings.WEBSOCKET_ENABLED,
"websocketEnabled": settings.REALTIME_ENABLED,
"importers": settings.UMAP_IMPORTERS,
"defaultLabelKeys": settings.UMAP_LABEL_KEYS,
}