Wrong apiBaseUrl logic.
Describe the bug If I specify apiBaseUrl, I will not be able to fetch status.json.
The root cause is L14.
Github raw user content is used to fetch summary.json and generated latency graphs. While github api is used to fetch issue texts. They are not the same!
User should be able to specify proxy url for api.github.com and raw.githubusercontent.com seperately.
Please let me know if I'm wrong. If I'm right, I can fix this with a PR.
https://github.com/upptime/status-page/pull/444 Related
In current definition, the user can replace apiBaseurl with a proxy like this:
location /XtTechGroup/Uptime/master {
proxy_pass https://raw.githubusercontent.com;
proxy_set_header Host raw.githubusercontent.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
location /repos/XtTechGroup/Uptime/issues {
proxy_pass https://api.github.com;
proxy_set_header Host api.github.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Host $http_host;
}
Then what's the point of having an extra option to specify the proxy to raw.githubusercontent.com again?
You're right, it makes sense to specify two URLs in the configuration, one for the GitHub API and one for the raw content URL. Happy to accept a PR!
Good to hear. The github api interface is severely rate limited. It's better to split them into two urls so the developer can decide which to use.
Thanks for the PR! Can you also please make a PR in upptime/upptime.js.org so we can add info about this new configuration property in the documentation?