mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-02 08:46:38 +00:00
Hide cname and ns if not using dns
This commit is contained in:
@@ -310,7 +310,7 @@ export class TraefikConfigManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
process.env.GENERATE_OWN_CERTIFICATES === "true" &&
|
process.env.USE_PANGOLIN_DNS === "true" &&
|
||||||
build != "oss"
|
build != "oss"
|
||||||
) {
|
) {
|
||||||
// Scan current local certificate state
|
// Scan current local certificate state
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export const privateConfigSchema = z.object({
|
|||||||
flags: z
|
flags: z
|
||||||
.object({
|
.object({
|
||||||
enable_redis: z.boolean().optional().default(false),
|
enable_redis: z.boolean().optional().default(false),
|
||||||
generate_own_certificates: z.boolean().optional().default(false)
|
use_pangolin_dns: z.boolean().optional().default(false)
|
||||||
})
|
})
|
||||||
.optional()
|
.optional()
|
||||||
.default({}),
|
.default({}),
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ export async function getTraefikConfig(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: for now dont filter it out because if you have multiple domain ids and one is failed it causes all of them to fail
|
// TODO: for now dont filter it out because if you have multiple domain ids and one is failed it causes all of them to fail
|
||||||
// if (resource.certificateStatus !== "valid" && privateConfig.getRawPrivateConfig().flags.generate_own_certificates) {
|
// if (resource.certificateStatus !== "valid" && privateConfig.getRawPrivateConfig().flags.use_pangolin_dns) {
|
||||||
// logger.debug(
|
// logger.debug(
|
||||||
// `Resource ${resource.resourceId} has certificate stats ${resource.certificateStats}`
|
// `Resource ${resource.resourceId} has certificate stats ${resource.certificateStats}`
|
||||||
// );
|
// );
|
||||||
@@ -267,7 +267,7 @@ export async function getTraefikConfig(
|
|||||||
let tls = {};
|
let tls = {};
|
||||||
if (
|
if (
|
||||||
!privateConfig.getRawPrivateConfig().flags
|
!privateConfig.getRawPrivateConfig().flags
|
||||||
.generate_own_certificates
|
.use_pangolin_dns
|
||||||
) {
|
) {
|
||||||
let certResolver: string, preferWildcardCert: boolean;
|
let certResolver: string, preferWildcardCert: boolean;
|
||||||
if (!configDomain) {
|
if (!configDomain) {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export async function createCertificate(
|
|||||||
domain: string,
|
domain: string,
|
||||||
trx: Transaction | typeof db
|
trx: Transaction | typeof db
|
||||||
) {
|
) {
|
||||||
if (!privateConfig.getRawPrivateConfig().flags.generate_own_certificates) {
|
if (!privateConfig.getRawPrivateConfig().flags.use_pangolin_dns) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ export default function CreateDomainForm({
|
|||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const { org } = useOrgContext();
|
const { org } = useOrgContext();
|
||||||
|
const { env } = useEnvContext();
|
||||||
|
|
||||||
const form = useForm<FormValues>({
|
const form = useForm<FormValues>({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
@@ -169,7 +170,7 @@ export default function CreateDomainForm({
|
|||||||
}, [domainInputValue]);
|
}, [domainInputValue]);
|
||||||
|
|
||||||
let domainOptions: any = [];
|
let domainOptions: any = [];
|
||||||
if (build == "enterprise" || build == "saas") {
|
if (build != "oss" && env.flags.usePangolinDns) {
|
||||||
domainOptions = [
|
domainOptions = [
|
||||||
{
|
{
|
||||||
id: "ns",
|
id: "ns",
|
||||||
@@ -182,7 +183,7 @@ export default function CreateDomainForm({
|
|||||||
description: t("selectDomainTypeCnameDescription")
|
description: t("selectDomainTypeCnameDescription")
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
} else if (build == "oss") {
|
} else {
|
||||||
domainOptions = [
|
domainOptions = [
|
||||||
{
|
{
|
||||||
id: "wildcard",
|
id: "wildcard",
|
||||||
@@ -559,8 +560,7 @@ export default function CreateDomainForm({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{build == "saas" ||
|
{build != "oss" && env.flags.usePangolinDns && (
|
||||||
(build == "enterprise" && (
|
|
||||||
<Alert variant="destructive">
|
<Alert variant="destructive">
|
||||||
<AlertTriangle className="h-4 w-4" />
|
<AlertTriangle className="h-4 w-4" />
|
||||||
<AlertTitle className="font-semibold">
|
<AlertTitle className="font-semibold">
|
||||||
@@ -572,7 +572,7 @@ export default function CreateDomainForm({
|
|||||||
)}
|
)}
|
||||||
</AlertDescription>
|
</AlertDescription>
|
||||||
</Alert>
|
</Alert>
|
||||||
))}
|
)}
|
||||||
|
|
||||||
<Alert variant="info">
|
<Alert variant="info">
|
||||||
<AlertTriangle className="h-4 w-4" />
|
<AlertTriangle className="h-4 w-4" />
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ export function pullEnv(): Env {
|
|||||||
process.env.FLAGS_ENABLE_CLIENTS === "true" ? true : false,
|
process.env.FLAGS_ENABLE_CLIENTS === "true" ? true : false,
|
||||||
hideSupporterKey:
|
hideSupporterKey:
|
||||||
process.env.HIDE_SUPPORTER_KEY === "true" ? true : false,
|
process.env.HIDE_SUPPORTER_KEY === "true" ? true : false,
|
||||||
generateOwnCertificates:
|
usePangolinDns:
|
||||||
process.env.GENERATE_OWN_CERTIFICATES === "true"
|
process.env.USE_PANGOLIN_DNS === "true"
|
||||||
? true
|
? true
|
||||||
: false
|
: false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export type Env = {
|
|||||||
disableBasicWireguardSites: boolean;
|
disableBasicWireguardSites: boolean;
|
||||||
enableClients: boolean;
|
enableClients: boolean;
|
||||||
hideSupporterKey: boolean;
|
hideSupporterKey: boolean;
|
||||||
generateOwnCertificates: boolean;
|
usePangolinDns: boolean;
|
||||||
},
|
},
|
||||||
branding: {
|
branding: {
|
||||||
appName?: string;
|
appName?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user