Fix DNS mirror forward redirects Issue: gmt-admin #297 Incorrect DNS settings for mirrors#9068
Conversation
| # 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" |
There was a problem hiding this comment.
Use the earth_relief_01d_p.grd grid instead. Much smaller.
|
Also, don't you have permission writes to master? Because PRs submitted to master are much easier for us to test. |
|
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. |
|
Should i be concerned about the 4 pull_request failures? Also, there is a note that 'Merging is blocked You're not authorized to push to this branch.' Does my github account need additional privilege to merge the PR? |
|
I see only failures in MacOS and are not related to this. Linux is a mess download failures and Windows build is broken. I'll
Yes, and probably means that you must to be added to a group that has that privilege. |
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-.