1ea512b92ecb6ae35dae658eac7eb1dc5a03550e
max
  Thu Sep 10 05:58:37 2026 -0700
hgHubConnect: let mirrors show the API key section without hubSpace, refs #38323

The API key section was gated on storeUserFiles && showHubApiKey, so a
mirror could only offer key generation by also turning on the whole
hubSpace upload stack (tusd endpoint, tusdDataDir, hubSpaceUrl). But keys
are also used to bypass the download CAPTCHA and live in each machine's
own hgcentral, so botDelay tells a genome-euro user that keys are
server-specific and sends them to euro's hgHubConnect, where the section
was not being printed. Gate on showHubApiKey alone, as before e9a3e487007.
Mirrors still need showHubApiKey=on in hg.conf.

diff --git src/hg/hgHubConnect/hgHubConnect.c src/hg/hgHubConnect/hgHubConnect.c
index 16b15f03ab9..1cb6a776c8c 100644
--- src/hg/hgHubConnect/hgHubConnect.c
+++ src/hg/hgHubConnect/hgHubConnect.c
@@ -565,31 +565,33 @@
     }
 
 printf("<b style='font-size:90%%'>Show load times: %s</b> &nbsp;", timeStatus);
 printf("<button type='submit' name='measureTiming' value='%s'>Change to: %s</button>", timeVal, timeLabel);
 
 printf("<div class='help'>Current setting: %s</div>\n", timeDesc);
 
 puts("</FORM>");
 puts("</div>"); // margin-left
 puts("</div>"); // tabSection
 
 jsOnEventById("click", "hubValidateButton", "makeIframe(event)");
 
 // API Key section 
 
-if (cfgOptionBooleanDefault("storeUserFiles", FALSE) && cfgOptionBooleanDefault("showHubApiKey", FALSE)) // This should probably not be shown on mirrors, so default to FALSE
+// Not tied to storeUserFiles: an apiKey is also used to bypass the download CAPTCHA, and
+// keys are per-central, so a mirror needs to hand out its own keys without running hubSpace.
+if (cfgOptionBooleanDefault("showHubApiKey", FALSE))
     printApiKeySection();
 puts("</div>"); // hub developement tab
 
 }
 
 void printSearchAndFilterBoxes(int searchEnabled, char *hubSearchTerms, char *dbFilter)
 /* Create the text boxes for search and database filtering along with the required
  * javscript */
 {
 printf("<FORM ACTION=\"%s\" NAME=\"searchHubForm\">\n",  "../cgi-bin/hgHubConnect");
 if (searchEnabled)
     {
     cgiMakeHiddenVar(hgHubDoSearch, "on");
     cgiMakeHiddenVar(hgHubDbFilter, "");
     cartSaveSession(cart);