b50eb72560c220a7d4bb6856cedfe1e23fd1d2bf chmalee Tue Jan 14 16:08:32 2025 -0800 oops I deleted the web accessible file uploads location not the tusd endpoint location, refs Hiram email diff --git src/hg/lib/userdata.c src/hg/lib/userdata.c index 5a16df8..5cfe613 100644 --- src/hg/lib/userdata.c +++ src/hg/lib/userdata.c @@ -67,41 +67,49 @@ int prefixSize = strlen(dataDir); if (startsWith(dataDir, fname)) { char *ret = fname + prefixSize; return ret; } return NULL; } char *getHubDataDir(char *userName, char *hub) { char *dataDir = getDataDir(userName); return catTwoStrings(dataDir, hub); } +char *hubSpaceUrl = NULL; +static char *getHubSpaceUrl() +{ +if (!hubSpaceUrl) + hubSpaceUrl = cfgOption("hubSpaceUrl"); +return hubSpaceUrl; +} + char *webDataDir(char *userName) /* Return a web accesible path to the userDataDir, this is different from the full path tusd uses */ { char *retUrl = NULL; if (userName) { char *encUserName = cgiEncode(userName); char *userPrefix = md5HexForString(encUserName); userPrefix[2] = '\0'; struct dyString *userDirDy = dyStringNew(0); - dyStringPrintf(userDirDy, "%s/%s/%s/", HUB_SPACE_URL, userPrefix, encUserName); + dyStringPrintf(userDirDy, "%s/%s/%s/", getHubSpaceUrl(), userPrefix, encUserName); retUrl = dyStringCannibalize(&userDirDy); } return retUrl; } char *prefixUserFile(char *userName, char *fname, char *parentDir) /* Allocate a new string that contains the full per-user path to fname, NULL otherwise. * parentDir is optional and will go in between the per-user dir and the fname */ { char *pathPrefix = getDataDir(userName); char *path = NULL; if (pathPrefix) { if (parentDir) {