Fix DNS mirror forward redirects Issue: gmt-admin #297 Incorrect DNS settings for mirrors#9068
Open
ES-Solar wants to merge 5 commits into
Open
Fix DNS mirror forward redirects Issue: gmt-admin #297 Incorrect DNS settings for mirrors#9068ES-Solar wants to merge 5 commits into
ES-Solar wants to merge 5 commits into
Conversation
joa-quim
reviewed
Jun 23, 2026
| # body that GMT cannot parse as a netCDF grid, causing the test to fail. | ||
|
|
||
| # Remove any cached copy to force a real download from the server | ||
| rm -f "${HOME}/.gmt/server/earth/earth_relief/earth_relief_15m_g.grd" |
Member
There was a problem hiding this comment.
Use the earth_relief_01d_p.grd grid instead. Much smaller.
Member
|
Also, don't you have permission writes to master? Because PRs submitted to master are much easier for us to test. |
Collaborator
Author
|
I updated the test to use the smaller grid. was used to the updating my fork and thought that was the preferred workflow. I'll change that for the next PR I contribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Related to GenericMappingTools/gmt-admin#297
Alias server names such as
chinaandaustraliaexpand to Hover DNSURL-forwards (e.g.,
http://china.generic-mapping-tools.org) that redirectall requests to the mirror root — stripping the file path in the process.
This caused every file download to fail: GMT received an HTML directory
listing instead of the requested grid or cache file.
Fix
gmtremote_resolve_redirect()ingmt_remote.cfollows the redirect chainonce at session start to discover the real mirror base URL
(e.g.,
https://mirrors.ustc.edu.cn/gmtdata).gmt_dataserver_url()cachesthe result for the process lifetime and uses it for all subsequent file URL
construction. Direct
http://URLs and servers with no redirect areunaffected.
Test
Added
test/gmt_remote/dataserver_alias.shwhich forcesGMT_DATA_SERVER=oceania,clears the local cache, downloads
@earth_relief_15m_g.grd, and verifies thegrid region with
gmt grdinfo -I-.