Add CDN_WEB_LOCATION to confjson5

This commit is contained in:
zkldi
2021-11-02 22:36:42 +00:00
parent f4ebae8161
commit fedaa4abd3
3 changed files with 4 additions and 1 deletions
+1
View File
@@ -23,6 +23,7 @@
TYPE: "omni",
ENABLE_SERVER_HTTPS: false,
RUN_OWN_CDN: true,
CDN_WEB_LOCATION: "/cdn",
OUR_URL: "https://example.com",
EMAIL_CONFIG: {
FROM: "test <zkldi@example.com>",
+1 -1
View File
@@ -42,7 +42,7 @@ export function CDNRedirect(res: Response, fileLoc: string) {
throw new Error(`Invalid fileLoc - did not start with /.`);
}
return res.redirect(`/cdn${fileLoc}`);
return res.redirect(`${ServerConfig.CDN_WEB_LOCATION}${fileLoc}`);
}
/**
+2
View File
@@ -78,6 +78,7 @@ export interface TachiConfig {
LOGGER_DISCORD_WEBHOOK?: string;
DISCORD_WHO_TO_TAG?: string[];
ENABLE_PUBLIC_SIGNUP?: boolean;
CDN_WEB_LOCATION: string;
}
const isValidOauth2 = p.optional({
@@ -118,6 +119,7 @@ const err = p(config, {
LOGGER_DISCORD_WEBHOOK: "*string",
DISCORD_WHO_TO_TAG: p.optional(["string"]),
ENABLE_PUBLIC_SIGNUP: "*boolean",
CDN_WEB_LOCATION: "string",
});
if (err) {