Commit graph

145 commits

Author SHA1 Message Date
David Larlet
d159fdc2cb
feat: add a setting to prevent users from editing their profile
In some situations, the profile comes from the OAuth provider and shouldn’t be modified by users.
2024-09-12 14:23:50 -04:00
Yohan Boniface
9bde88a513 fix: register fa-ir in LANG_INFO
fix #2086
2024-09-04 11:31:56 +02:00
Yohan Boniface
a72691e390 feat: display contact infos in the footer
This adds a new settings: UMAP_HOST_INFOS

Also, renames UMAP_FEEDBACK_LINK in UMAP_HELP_URL.

cf #2004
2024-08-29 11:41:11 +02:00
Yohan Boniface
3bdd5bedf1 fix: catch login_required from map page and add a way to login 2024-07-30 14:41:10 +02:00
Yohan Boniface
ca18c5b7df chore: move alert.html inside templates and update translations
When alert.html was in static, Django was creating a new translation
file, while we want it to just add those strings in the backend
po file.
2024-06-14 20:41:53 +02:00
Yohan Boniface
d928195a5b wip: rename and document UMAP_IMPORTERS 2024-06-14 18:40:05 +02:00
Yohan Boniface
a70307ea29 wip: rename presets to datasets 2024-06-14 18:40:05 +02:00
Yohan Boniface
f5eea1fe3f wip(naming): replace "plugin" by "importer"
We are not ready yet to talk about plugins
2024-06-14 18:38:30 +02:00
Yohan Boniface
93a189497b wip: control plugins from settings 2024-06-14 18:38:29 +02:00
David Larlet
5c2528900e
chore: Use web components to display alerts + a11y roles 2024-06-12 18:03:04 -04:00
940ae77602 settings: Make the websocket settings clearer.
It is now using `WEBSOCKET_BACK_HOST`, `WEBSOCKET_BACK_PORT` and
`WEBSOCKET_FRONT_URI`.

We need to take in consideration that the "front" WebSocket address
(that clients will connect to) might be different than the "back" ip and
port which are bound in the host.

This happens for instance for reverse proxies, or when running inside
a container.

We considered using a `WEBSOCKET_TLS` setting, to try guessing the
"front" address based on `WEBSOCKET_HOST`, `WEBSOCKET_PORT` and
`WEBSOCKET_TLS`, but as the back and front address can differ, this
would need to introduce a `WEBSOCKET_URI` in any case, so we went with
just using it, and not adding an extra `WEBSOCKET_TLS`.
2024-06-07 18:21:30 +02:00
def915c561 feat(settings): allow reading socket-related settings from ENV variables 2024-06-07 18:21:30 +02:00
32a4f3feda feat(sync): Add WebSocket specific settings
`WEBSOCKET_ENABLED`, `WEBSOCKET_HOST`, `WEBSOCKET_PORT` and
`WEBSOCKET_URI` have been added.

They are being transmitted to the client via the `map.options`.
When `WEBSOCKET_ENABLED` is set to `False`, the client doesn't have
the ability to be synced.
2024-06-07 18:21:30 +02:00
f255c3c8a5 feat(websockets): Authenticate with signed tokens.
Authentication is now done using a signed token provided by the Django
server, sent by the JS client and checked by the WebSocket server.

The token contains a `permissions` key that's checked to ensure the user
has access to the map "room", where events will be shared by the peers.
2024-06-07 18:21:30 +02:00
2daeaf12e0 WIP 2024-06-07 18:21:30 +02:00
Yohan Boniface
87e2467a4c feat: add link in contextmenu to edit map in OSM
fix #1651
2024-04-17 09:34:39 +02:00
Yohan Boniface
bfcdfdcfc1 chore: bump ruff 2024-03-05 17:23:49 +01:00
Yohan Boniface
217aec5556
Merge pull request #1615 from umap-project/default-from-email
chore: replace settings.FROM_EMAIL by settings.DEFAULT_FROM_EMAIL
2024-02-16 16:40:16 +01:00
Yohan Boniface
1a67d01c61 chore: replace deprecated FORM_RENDERER setting 2024-02-16 12:40:37 +01:00
Yohan Boniface
1db2455d51 chore: replace settings.FROM_EMAIL by settings.DEFAULT_FROM_EMAIL
DEFAULT_FROM_EMAIL is a Django standard setting
2024-02-16 11:49:38 +01:00
Yohan Boniface
a99ee90e15 chore: migrate to OAuth 2 for OpenStreetMap backend
fix #1279
2024-02-14 11:30:16 +01:00
Yohan Boniface
caeb9d5b44
Merge pull request #1531 from umap-project/home-highlighted
Introduce UMAP_HOME_FEED to control which maps are shown on the home page
2024-01-29 12:48:24 +01:00
Yohan Boniface
23af4c60cd chore: move UmapManifestStaticFilesStorage to a dedicated file 2024-01-19 17:16:35 +01:00
David Larlet
656e29c72b
Use custom storage instead of django-compressor 2024-01-17 09:09:00 -05:00
Yohan Boniface
9f377da1b2 Introduce UMAP_HOME_FEED to control which maps are shown on the home page
For now we have only three modes:
- latest, which is the default and shows the last updated maps
- highlighted, which shows only the map that have been starred by a least
  one staff member
- None, which does not show any map
2024-01-16 12:31:50 +01:00
aff0181636 [style] Format the code 2023-11-24 23:31:18 +01:00
David Larlet
af3518ad08
Apply Black to settings files 2023-09-26 09:40:41 -04:00
David Larlet
27e8fd0cac
Merge pull request #1324 from openbrian/add-username-to-features
Add username to features
2023-09-25 11:08:32 -04:00
Brian DeRocher
6720f76d85 Set the map option. No need for setting boolean from query string.
Only add the owner property if the feature flag (map.options.featuresHaveOwner) is enabled.

Default to features do NOT have owners.
2023-09-20 13:16:52 -04:00
Brian DeRocher
e25fb5d04f Add FeaturesHaveOwners map option.
WIP
2023-09-20 12:48:32 -04:00
Brian DeRocher
204db34282 Replace bash based waiting with python based django-probes. 2023-09-20 09:45:26 -04:00
Brice Maron
cd29486b84 fix: correct changelog link 2023-08-23 08:31:15 +02:00
Yohan Boniface
15e9cf0b5f Protect back username field from being modified by social auth login 2023-08-21 17:05:01 +02:00
Yohan Boniface
2b471be171 Very lite "My Profile" page to allow changing username 2023-08-21 15:09:30 +02:00
Yohan Boniface
0c3dc02fc1 Allow to configure default share and edit status
fix #1244
2023-08-07 08:16:49 +02:00
Yohan Boniface
6abc088121 i18n 2023-07-17 16:16:08 +02:00
Yohan Boniface
c1f8684a29 Replace si_LK by si 2023-07-17 16:00:55 +02:00
David Larlet
a87309cee6
Add a setting for the number of maps per search
Useful for https://github.com/umap-project/umap-dsfr
2023-06-27 18:41:00 -04:00
Yohan Boniface
81fcc080d9 Allow to customize user display name and URL slug 2023-06-16 14:59:59 +02:00
Yohan Boniface
453a7b5616 Remove unused settings from social auth
I cannot find any reference of those settings while looking
at social-core code.
2023-06-16 14:52:12 +02:00
David Larlet
bb8d233411
Remove DIRS from settings.TEMPLATES
It’s more convenient to let the sub-themes declare their own templates (especially with `'APP_DIRS': True`).
2023-06-14 21:15:37 -04:00
Yohan Boniface
4b502e9857 Merge branch 'docker' 2023-06-05 17:00:46 +02:00
Yohan Boniface
faebeebbdf INTERNAL_IPS should default to a list 2023-06-05 15:08:19 +02:00
Yohan Boniface
00f34c45ba Handle OpenStreetMap OAuth by default 2023-06-05 14:48:55 +02:00
Yohan Boniface
5e201b44fb Use django-environ to make part of the settings available throught env vars 2023-06-05 11:48:21 +02:00
Yohan Boniface
e0760ca403 Only ask to send edit link if email has been set up 2023-05-31 17:20:22 +02:00
Yohan Boniface
8f52d34bb2 WIP: final bit to make sending edit link working 2023-05-31 17:05:57 +02:00
Yohan Boniface
a462a58ae0 Remove SOCIAL_AUTH_PIPELINE from settings/base.py
We are using the default, so not need to define them on our
side.
2023-05-30 08:42:23 +02:00
Yohan Boniface
9ca5ba974b Auth: mark id as protected, otherwise social-core try to create
new account at each login:

```
  File "/srv/umap/venv/lib/python3.10/site-packages/social_core/backends/base.py", line 83, in pipeline
    out = self.run_pipeline(pipeline, pipeline_index, *args, **kwargs)
  File "/srv/umap/venv/lib/python3.10/site-packages/social_core/backends/base.py", line 113, in run_pipeline
    result = func(*args, **out) or {}
  File "/srv/umap/venv/lib/python3.10/site-packages/social_core/pipeline/user.py", line 122, in user_details
    strategy.storage.user.changed(user)
  File "/srv/umap/venv/lib/python3.10/site-packages/social_django/storage.py", line 16, in changed
    user.save()
django.db.utils.IntegrityError: duplicate key value violates unique constraint "auth_user_username_key"
DETAIL:  Key (username)=(xxxxx) already exists.
```
2023-05-30 08:42:23 +02:00
Yohan Boniface
1038836a72 Use Django full text instead of custom SQL 2023-05-11 11:33:08 +02:00