No description
Find a file
Yohan Boniface c4bdb04795 Use X-Accel-Redirect for serving ajax-proxy request
uMap allows to use remote URL as data sources, but those URLs
are not always CORS open, so this is why there is this "ajax-proxy"
feature, where the URL is passed to the backend.

Additionally, there is a caching feature, which duration is configurable
through frontend settings. Valid values are: disabled, 5 min, 1 hour,
1 day.

Initially, I wanted this to be totally handled by Nginx, but I never
found a wayt to set the proxy_cache_valid value from a query string.

Since then, at least in OSM France servers, the ajax-proxy is still
handled by a Django view, which then opens the remote URL and transfert
the data. This is not optimal. And I suppose this is what is causing
hicups on the OSM France servers lately.

This PR provides a mix option, where python deals with validating the
URL and parsing the TTL parameter, and then it passes the hand to
nginx which will serve the remote content.

So, roughtly:

- the client calls /ajax-proxy/?url=xxx&ttl=300
- python will validate the URL (not internal calls…)
- if UMAP_SENDFILE_HEADER is set, then the python returns an empty
  response with the path /proxy/http://url plus it will set the
  cache ttl through the header X-Accel-Expires
- this /proxy/ location is then handled by nginx
2023-08-24 13:41:34 +02:00
.github More explicit link requirement in bug report template 2023-08-21 09:42:15 -04:00
.tx i18n 2023-02-22 10:23:03 +01:00
docker Use layers to build Docker image 2023-06-05 15:44:32 +02:00
docs Use X-Accel-Redirect for serving ajax-proxy request 2023-08-24 13:41:34 +02:00
scripts Use maintained fork of togeojson 2023-08-08 09:02:22 +02:00
umap Use X-Accel-Redirect for serving ajax-proxy request 2023-08-24 13:41:34 +02:00
.dockerignore Do not track Dockerfile, not to invalidate Docker cache at each change 2023-06-05 14:44:33 +02:00
.gitignore Simpler .gitignore, easier to read, understand, maintain 2020-03-09 17:54:43 +01:00
.pipignore Upgrade django-social-auth to python-social-auth 2014-03-06 23:22:37 +01:00
.prettierrc.yaml Apply PrettierJS to the whole codebase 2023-05-12 13:57:03 -04:00
.readthedocs.yaml Control which version of mkdocs is install on readthedocs 2023-04-30 11:35:23 +02:00
.travis.yml chore: use setup.cfg 2021-12-30 11:16:00 +01:00
docker-compose.yml Tweak Compose file so that it works out of the box 2023-06-05 17:42:08 +02:00
Dockerfile Add umap command in Docker PATH 2023-06-29 15:19:39 +02:00
LICENSE Fixed typo 2013-06-23 22:43:29 -05:00
Makefile Add make minor command 2023-08-15 16:49:04 +02:00
manage.py Allow to load setting from a non python path 2016-09-10 08:26:23 +02:00
MANIFEST.in Explicitly exclude local.py from being released 2018-07-07 23:46:10 +02:00
mkdocs.yml Use magiclink extension for changelog with links 2023-08-23 09:45:44 -04:00
osmic-white.yaml update osmic YAML files according to new configuration 2018-11-17 22:03:08 +01:00
osmic.yaml update osmic YAML files according to new configuration 2018-11-17 22:03:08 +01:00
package-lock.json Bump growl and mocha 2023-08-22 16:20:54 +00:00
package.json Bump growl and mocha 2023-08-22 16:20:54 +00:00
pyproject.toml Bump requests from 2.30.0 to 2.31.0 2023-08-22 13:48:45 +00:00
pytest.ini Use ipdb with pytest --pdb 2023-02-27 11:01:01 +01:00
README.md fix: correct changelog link 2023-08-23 08:31:15 +02:00
SECURITY.md Create SECURITY.md to report security issues 2023-05-05 15:13:53 -04:00

uMap project

Requirements Status Join the chat at https://gitter.im/umap-project/umap Documentation StatusBuild Status

About

uMap lets you create maps with OpenStreetMap layers in a minute and embed them in your site. Because we think that the more OSM will be used, the more OSM will be improved. Built on top of Django and Leaflet.

Installation and configuration

See developer documentation.