ProfessionalWiki / ProfessionalWiki/Maps
Allow external kml and geojson files from an allowlist of hosts
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 78
- Forks
- 65
- Avg merge
- 9h 17m
- Merged PRs (30d)
- 6
Description
Since 15.0.0 the kml and geojson parameters load only files that are on the wiki, unless $egMapsAllowExternalDataFiles is set to true, which allows any URL again. Wikis that depend on one or two trusted sources, such as an open-data portal or their own file server, have no middle ground: they either lose those maps or accept every host.
Proposal
A setting that lists the hosts external data files may come from, for example:
$egMapsAllowedDataFileHosts = [ 'data.example.org', '*.geo.example.net' ];
- A URL in
kmlorgeojsonloads if$egMapsAllowExternalDataFilesistrue, as now, or if its host matches the list. The default is an empty list, so nothing changes for existing wikis. - Entries are host names, and a leading
*.covers subdomains. - The list applies to both paths: KML fetched by the viewer's browser and GeoJSON fetched by the server. The existing server-side safeguards, blocked private address ranges and pinned DNS, stay in force for listed hosts, and a redirect to a host outside the list is not followed.
NetworkLinkelements inside a KML document follow the same list.MediaWiki:Mapsgets a counterpart,general.allowedDataFileHosts, like the other settings.
MediaWiki core has the same pattern in $wgCopyUploadsDomains for upload by URL, whose matching rules could be reused.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace how kml and geojson URLs are handled in both the viewer's browser path and the server-side GeoJSON path, then compare host matching with MediaWiki's $wgCopyUploadsDomains rules. Verify the empty-list default, wildcard subdomains, redirects, KML NetworkLink handling, and existing private-address and pinned-DNS safeguards for both configuration settings.
Written by the indexing model from the issue text.
Assessment
- Domain
- full-stack
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100