diff --git a/docker-compose.yml b/docker-compose.yml index e3b44f77..589f9c9f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/docs/config/settings.md b/docs/config/settings.md index 4008a296..b31cf3d3 100644 --- a/docs/config/settings.md +++ b/docs/config/settings.md @@ -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. diff --git a/docs/deploy/docker.md b/docs/deploy/docker.md index 84ced49e..4bdbbb9b 100644 --- a/docs/deploy/docker.md +++ b/docs/deploy/docker.md @@ -85,7 +85,7 @@ services condition: service_healthy … environment: - - WEBSOCKET_ENABLED=1 + - REALTIME_ENABLED=1 - REDIS_URL=redis://redis:6379 … diff --git a/umap/settings/base.py b/umap/settings/base.py index f077ba18..5faf21c1 100644 --- a/umap/settings/base.py +++ b/umap/settings/base.py @@ -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") diff --git a/umap/tests/settings.py b/umap/tests/settings.py index 41de66d3..2af73f01 100644 --- a/umap/tests/settings.py +++ b/umap/tests/settings.py @@ -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" diff --git a/umap/utils.py b/umap/utils.py index 6bf8001a..b55d22c3 100644 --- a/umap/utils.py +++ b/umap/utils.py @@ -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) diff --git a/umap/views.py b/umap/views.py index aed882bf..bf8df787 100644 --- a/umap/views.py +++ b/umap/views.py @@ -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, }