mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-20 19:22:37 +02:00
Show a warning if the logs are disabled to reduce confusion
This commit is contained in:
@@ -69,7 +69,7 @@ export const orgs = pgTable("orgs", {
|
||||
"settingsLogRetentionDaysAISessions"
|
||||
) // where 0 = dont keep logs and -1 = keep forever and 9001 = end of the following year
|
||||
.notNull()
|
||||
.default(7),
|
||||
.default(0),
|
||||
sshCaPrivateKey: text("sshCaPrivateKey"), // Encrypted SSH CA private key (PEM format)
|
||||
sshCaPublicKey: text("sshCaPublicKey"), // SSH CA public key (OpenSSH format)
|
||||
isBillingOrg: boolean("isBillingOrg"),
|
||||
|
||||
@@ -443,7 +443,11 @@ export const configSchema = z
|
||||
disable_config_managed_domains: z.boolean().optional(),
|
||||
disable_product_help_banners: z.boolean().optional(),
|
||||
disable_enterprise_features: z.boolean().optional(),
|
||||
enable_acme_cert_sync: z.boolean().optional().default(true)
|
||||
enable_acme_cert_sync: z.boolean().optional().default(true),
|
||||
disable_private_http_placeholder: z
|
||||
.boolean()
|
||||
.optional()
|
||||
.default(false)
|
||||
})
|
||||
.optional(),
|
||||
acme: z
|
||||
|
||||
@@ -48,7 +48,7 @@ export class PrivateConfig {
|
||||
|
||||
this.rawPrivateConfig = parsedPrivateConfig;
|
||||
|
||||
this.migrateDeprecatedAcmeConfig(privateEnvironment);
|
||||
this.migrateDeprecatedConfig(privateEnvironment);
|
||||
|
||||
process.env.BRANDING_HIDE_AUTH_LAYOUT_FOOTER =
|
||||
this.rawPrivateConfig.branding?.hide_auth_layout_footer === true
|
||||
@@ -152,12 +152,12 @@ export class PrivateConfig {
|
||||
return this.rawPrivateConfig;
|
||||
}
|
||||
|
||||
// `flags.enable_acme_cert_sync` and `acme` used to live in the private
|
||||
// config file. They now live in the public config file. If an operator
|
||||
// still has them set in the private config and hasn't moved them over to
|
||||
// the public config, pull them forward so behavior doesn't silently
|
||||
// change out from under them.
|
||||
private migrateDeprecatedAcmeConfig(privateEnvironment: any) {
|
||||
// `flags.enable_acme_cert_sync`, `flags.disable_private_http_placeholder`,
|
||||
// and `acme` used to live in the private config file. They now live in
|
||||
// the public config file. If an operator still has them set in the
|
||||
// private config and hasn't moved them over to the public config, pull
|
||||
// them forward so behavior doesn't silently change out from under them.
|
||||
private migrateDeprecatedConfig(privateEnvironment: any) {
|
||||
const publicEnvironment: any = readPublicConfigFile();
|
||||
const rawConfig: any = config.getRawConfig();
|
||||
|
||||
@@ -182,6 +182,20 @@ export class PrivateConfig {
|
||||
);
|
||||
rawConfig.acme = this.rawPrivateConfig.acme;
|
||||
}
|
||||
|
||||
if (
|
||||
privateEnvironment?.flags?.disable_private_http_placeholder !==
|
||||
undefined &&
|
||||
publicEnvironment?.flags?.disable_private_http_placeholder ===
|
||||
undefined
|
||||
) {
|
||||
logger.warn(
|
||||
"`flags.disable_private_http_placeholder` is deprecated in the private config file and has moved to the public config file. Using the value from the private config file for now, but please move it to the public config."
|
||||
);
|
||||
rawConfig.flags = rawConfig.flags ?? {};
|
||||
rawConfig.flags.disable_private_http_placeholder =
|
||||
this.rawPrivateConfig.flags.disable_private_http_placeholder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,10 +115,13 @@ export const privateConfigSchema = z
|
||||
// any value set here is migrated into the public config at
|
||||
// startup by PrivateConfig (server/private/lib/config.ts).
|
||||
enable_acme_cert_sync: z.boolean().optional(),
|
||||
disable_private_http_placeholder: z
|
||||
.boolean()
|
||||
.optional()
|
||||
.default(false)
|
||||
// @deprecated Moved to the public config file as
|
||||
// `flags.disable_private_http_placeholder`
|
||||
// (server/lib/readConfigFile.ts). Kept here only so existing
|
||||
// private config files keep parsing; any value set here is
|
||||
// migrated into the public config at startup by PrivateConfig
|
||||
// (server/private/lib/config.ts).
|
||||
disable_private_http_placeholder: z.boolean().optional()
|
||||
})
|
||||
.optional()
|
||||
.prefault({}),
|
||||
|
||||
@@ -329,8 +329,7 @@ export async function getTraefikConfig(
|
||||
}[] = [];
|
||||
if (
|
||||
build == "enterprise" &&
|
||||
!privateConfig.getRawPrivateConfig().flags
|
||||
.disable_private_http_placeholder
|
||||
!config.getRawConfig().flags?.disable_private_http_placeholder
|
||||
) {
|
||||
// we dont want to do this on the cloud
|
||||
// Query siteResources in HTTP mode with SSL enabled and aliases - cert generation / HTTPS edge
|
||||
|
||||
Reference in New Issue
Block a user