add two more cloud servers to the rotation

This is not a great way to load-balance, but it works and doesn't require
high end hardware on the backend.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2023-12-27 13:54:50 -08:00
parent b3d2a8cdcb
commit 7792e227da
3 changed files with 10 additions and 2 deletions

View file

@ -103,7 +103,9 @@ bool CheckCloudConnection::nextServer()
};
static struct serverTried cloudServers[] = {
{ CLOUD_HOST_EU, false },
{ CLOUD_HOST_US, false }
{ CLOUD_HOST_US, false },
{ CLOUD_HOST_E2, false },
{ CLOUD_HOST_U2, false }
};
const char *server = nullptr;
for (serverTried &item: cloudServers) {

View file

@ -306,7 +306,11 @@ int certificate_check_cb(git_cert *cert, int valid, const char *host, void *payl
UNUSED(payload);
if (verbose)
SSRF_INFO("git storage: certificate callback for host %s with validity %d\n", host, valid);
if ((same_string(host, CLOUD_HOST_GENERIC) || same_string(host, CLOUD_HOST_US) || same_string(host, CLOUD_HOST_EU)) &&
if ((same_string(host, CLOUD_HOST_GENERIC) ||
same_string(host, CLOUD_HOST_US) ||
same_string(host, CLOUD_HOST_U2) ||
same_string(host, CLOUD_HOST_EU) ||
same_string(host, CLOUD_HOST_E2)) &&
cert->cert_type == GIT_CERT_X509) {
// for some reason the LetsEncrypt certificate makes libgit2 throw up on some
// platforms but not on others

View file

@ -14,7 +14,9 @@ extern "C" {
#endif
#define CLOUD_HOST_US "ssrf-cloud-us.subsurface-divelog.org"
#define CLOUD_HOST_U2 "ssrf-cloud-u2.subsurface-divelog.org"
#define CLOUD_HOST_EU "ssrf-cloud-eu.subsurface-divelog.org"
#define CLOUD_HOST_E2 "ssrf-cloud-e2.subsurface-divelog.org"
#define CLOUD_HOST_PATTERN "ssrf-cloud-..\\.subsurface-divelog\\.org"
#define CLOUD_HOST_GENERIC "cloud.subsurface-divelog.org"