chore: Centralize env parsing, validation, defaults, and deprecation notices (#3487)
* chore: Centralize env parsing, defaults, deprecation * wip * test * test * tsc * docs, more validation * fix: Allow empty REDIS_URL (defaults to localhost) * test * fix: SLACK_MESSAGE_ACTIONS not bool * fix: Add SMTP port validation
This commit is contained in:
@@ -117,7 +117,7 @@ class Team extends ParanoidModel {
|
||||
*/
|
||||
get emailSigninEnabled(): boolean {
|
||||
return (
|
||||
this.guestSignin && (!!env.SMTP_HOST || env.NODE_ENV === "development")
|
||||
this.guestSignin && (!!env.SMTP_HOST || env.ENVIRONMENT === "development")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -126,11 +126,11 @@ class Team extends ParanoidModel {
|
||||
return `https://${this.domain}`;
|
||||
}
|
||||
|
||||
if (!this.subdomain || process.env.SUBDOMAINS_ENABLED !== "true") {
|
||||
return process.env.URL;
|
||||
if (!this.subdomain || !env.SUBDOMAINS_ENABLED) {
|
||||
return env.URL;
|
||||
}
|
||||
|
||||
const url = new URL(process.env.URL || "");
|
||||
const url = new URL(env.URL);
|
||||
url.host = `${this.subdomain}.${stripSubdomain(url.host)}`;
|
||||
return url.href.replace(/\/$/, "");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user