Compare commits

...

9 Commits
1.7.1 ... 1.7.2

Author SHA1 Message Date
Owen
2e986def78 const 2025-07-17 23:15:16 -07:00
miloschwartz
d16a05959d Merge branch 'main' into dev 2025-07-17 23:14:50 -07:00
Owen
7e58e0b490 Correctly handle ssl on new domains 2025-07-17 22:57:47 -07:00
Owen
9b01aecf3c Add default cert resovler 2025-07-17 22:37:33 -07:00
miloschwartz
86043fd5f8 add defaults for domain cert resolver and prefer wildcard cert 2025-07-17 22:35:07 -07:00
Milo Schwartz
372a1758e9 Update README.md 2025-07-17 19:35:27 -04:00
Owen
0a2b1d9e53 Use a records for the wildcard 2025-07-17 16:17:01 -07:00
Owen
e562946308 Fix logic 2025-07-17 16:03:34 -07:00
Owen
398e15b3c6 Format 2025-07-17 15:59:28 -07:00
6 changed files with 292 additions and 195 deletions

View File

@@ -16,7 +16,7 @@ _Pangolin tunnels your services to the internet so you can access anything from
<div align="center"> <div align="center">
<h5> <h5>
<a href="https://fossorial.io"> <a href="https://digpangolin.com">
Website Website
</a> </a>
<span> | </span> <span> | </span>
@@ -111,7 +111,7 @@ Host the full application on your own server or on the cloud with a VPS. Take a
### Pangolin Cloud ### Pangolin Cloud
Easy to use with simple [pay as you go pricing](https://fossorial.io/pricing). [Check it out here](https://pangolin.fossorial.io/auth/signup). Easy to use with simple [pay as you go pricing](https://digpangolin.io/pricing). [Check it out here](https://pangolin.fossorial.io/auth/signup).
- Everything you get with self hosted Pangolin, but fully managed for you. - Everything you get with self hosted Pangolin, but fully managed for you.

View File

@@ -1266,6 +1266,7 @@
"createDomainName": "Name:", "createDomainName": "Name:",
"createDomainValue": "Value:", "createDomainValue": "Value:",
"createDomainCnameRecords": "CNAME Records", "createDomainCnameRecords": "CNAME Records",
"createDomainARecords": "A Records",
"createDomainRecordNumber": "Record {number}", "createDomainRecordNumber": "Record {number}",
"createDomainTxtRecords": "TXT Records", "createDomainTxtRecords": "TXT Records",
"createDomainSaveTheseRecords": "Save These Records", "createDomainSaveTheseRecords": "Save These Records",

View File

@@ -128,7 +128,9 @@ export const configSchema = z
.object({ .object({
http_entrypoint: z.string().optional().default("web"), http_entrypoint: z.string().optional().default("web"),
https_entrypoint: z.string().optional().default("websecure"), https_entrypoint: z.string().optional().default("websecure"),
additional_middlewares: z.array(z.string()).optional() additional_middlewares: z.array(z.string()).optional(),
cert_resolver: z.string().optional().default("letsencrypt"),
prefer_wildcard_cert: z.boolean().optional().default(false)
}) })
.optional() .optional()
.default({}), .default({}),
@@ -157,10 +159,13 @@ export const configSchema = z
}) })
.optional() .optional()
.default({}), .default({}),
orgs: z.object({ orgs: z
.object({
block_size: z.number().positive().gt(0).optional().default(24), block_size: z.number().positive().gt(0).optional().default(24),
subnet_group: z.string().optional().default("100.90.128.0/24") subnet_group: z.string().optional().default("100.90.128.0/24")
}).optional().default({ })
.optional()
.default({
block_size: 24, block_size: 24,
subnet_group: "100.90.128.0/24" subnet_group: "100.90.128.0/24"
}), }),
@@ -242,7 +247,7 @@ export const configSchema = z
{ {
message: "At least one domain must be defined" message: "At least one domain must be defined"
} }
) );
export function readConfigFile() { export function readConfigFile() {
const loadConfig = (configPath: string) => { const loadConfig = (configPath: string) => {

View File

@@ -29,6 +29,7 @@ export type CreateDomainResponse = {
domainId: string; domainId: string;
nsRecords?: string[]; nsRecords?: string[];
cnameRecords?: { baseDomain: string; value: string }[]; cnameRecords?: { baseDomain: string; value: string }[];
aRecords?: { baseDomain: string; value: string }[];
txtRecords?: { baseDomain: string; value: string }[]; txtRecords?: { baseDomain: string; value: string }[];
}; };
@@ -97,6 +98,7 @@ export async function createOrgDomain(
} }
let numOrgDomains: OrgDomains[] | undefined; let numOrgDomains: OrgDomains[] | undefined;
let aRecords: CreateDomainResponse["aRecords"];
let cnameRecords: CreateDomainResponse["cnameRecords"]; let cnameRecords: CreateDomainResponse["cnameRecords"];
let txtRecords: CreateDomainResponse["txtRecords"]; let txtRecords: CreateDomainResponse["txtRecords"];
let nsRecords: CreateDomainResponse["nsRecords"]; let nsRecords: CreateDomainResponse["nsRecords"];
@@ -239,7 +241,7 @@ export async function createOrgDomain(
} }
]; ];
} else if (type === "wildcard") { } else if (type === "wildcard") {
cnameRecords = [ aRecords = [
{ {
value: `Server IP Address`, value: `Server IP Address`,
baseDomain: `*.${baseDomain}` baseDomain: `*.${baseDomain}`
@@ -271,7 +273,8 @@ export async function createOrgDomain(
domainId: returned.domainId, domainId: returned.domainId,
cnameRecords, cnameRecords,
txtRecords, txtRecords,
nsRecords nsRecords,
aRecords
}, },
success: true, success: true,
error: false, error: false,

View File

@@ -214,11 +214,19 @@ export async function traefikConfigProvider(
const configDomain = config.getDomain(resource.domainId); const configDomain = config.getDomain(resource.domainId);
let tls = {}; let certResolver: string, preferWildcardCert: boolean;
if (configDomain) { if (!configDomain) {
tls = { certResolver = config.getRawConfig().traefik.cert_resolver;
certResolver: configDomain.cert_resolver, preferWildcardCert =
...(configDomain.prefer_wildcard_cert config.getRawConfig().traefik.prefer_wildcard_cert;
} else {
certResolver = configDomain.cert_resolver;
preferWildcardCert = configDomain.prefer_wildcard_cert;
}
const tls = {
certResolver: certResolver,
...(preferWildcardCert
? { ? {
domains: [ domains: [
{ {
@@ -228,7 +236,6 @@ export async function traefikConfigProvider(
} }
: {}) : {})
}; };
}
const additionalMiddlewares = const additionalMiddlewares =
config.getRawConfig().traefik.additional_middlewares || []; config.getRawConfig().traefik.additional_middlewares || [];

View File

@@ -205,8 +205,8 @@ export default function CreateDomainForm({
</Alert> </Alert>
<div className="space-y-4"> <div className="space-y-4">
{domainType === "ns" && {createdDomain.nsRecords &&
createdDomain.nsRecords && ( createdDomain.nsRecords.length > 0 && (
<div> <div>
<h3 className="font-medium mb-3"> <h3 className="font-medium mb-3">
{t("createDomainNsRecords")} {t("createDomainNsRecords")}
@@ -220,7 +220,9 @@ export default function CreateDomainForm({
<div className="space-y-2"> <div className="space-y-2">
<div className="flex justify-between items-center"> <div className="flex justify-between items-center">
<span className="text-sm font-medium"> <span className="text-sm font-medium">
{t("createDomainType")} {t(
"createDomainType"
)}
</span> </span>
<span className="text-sm font-mono"> <span className="text-sm font-mono">
NS NS
@@ -228,14 +230,18 @@ export default function CreateDomainForm({
</div> </div>
<div className="flex justify-between items-center"> <div className="flex justify-between items-center">
<span className="text-sm font-medium"> <span className="text-sm font-medium">
{t("createDomainName")} {t(
"createDomainName"
)}
</span> </span>
<span className="text-sm font-mono"> <span className="text-sm font-mono">
{baseDomain} {baseDomain}
</span> </span>
</div> </div>
<span className="text-sm font-medium"> <span className="text-sm font-medium">
{t("createDomainValue")} {t(
"createDomainValue"
)}
</span> </span>
{createdDomain.nsRecords.map( {createdDomain.nsRecords.map(
( (
@@ -244,9 +250,7 @@ export default function CreateDomainForm({
) => ( ) => (
<div <div
className="flex justify-between items-center" className="flex justify-between items-center"
key={ key={index}
index
}
> >
<CopyToClipboard <CopyToClipboard
text={ text={
@@ -263,35 +267,35 @@ export default function CreateDomainForm({
</div> </div>
)} )}
{domainType === "cname" ||
(domainType == "wildcard" && (
<>
{createdDomain.cnameRecords && {createdDomain.cnameRecords &&
createdDomain.cnameRecords createdDomain.cnameRecords.length > 0 && (
.length > 0 && (
<div> <div>
<h3 className="font-medium mb-3"> <h3 className="font-medium mb-3">
{t("createDomainCnameRecords")} {t("createDomainCnameRecords")}
</h3> </h3>
<InfoSections cols={1}> <InfoSections cols={1}>
{createdDomain.cnameRecords.map( {createdDomain.cnameRecords.map(
( (cnameRecord, index) => (
cnameRecord,
index
) => (
<InfoSection <InfoSection
key={ key={index}
index
}
> >
<InfoSectionTitle> <InfoSectionTitle>
{t("createDomainRecordNumber", { number: index + 1 })} {t(
"createDomainRecordNumber",
{
number:
index +
1
}
)}
</InfoSectionTitle> </InfoSectionTitle>
<InfoSectionContent> <InfoSectionContent>
<div className="space-y-2"> <div className="space-y-2">
<div className="flex justify-between items-center"> <div className="flex justify-between items-center">
<span className="text-sm font-medium"> <span className="text-sm font-medium">
{t("createDomainType")} {t(
"createDomainType"
)}
</span> </span>
<span className="text-sm font-mono"> <span className="text-sm font-mono">
CNAME CNAME
@@ -299,7 +303,9 @@ export default function CreateDomainForm({
</div> </div>
<div className="flex justify-between items-center"> <div className="flex justify-between items-center">
<span className="text-sm font-medium"> <span className="text-sm font-medium">
{t("createDomainName")} {t(
"createDomainName"
)}
</span> </span>
<span className="text-sm font-mono"> <span className="text-sm font-mono">
{ {
@@ -309,7 +315,9 @@ export default function CreateDomainForm({
</div> </div>
<div className="flex justify-between items-center"> <div className="flex justify-between items-center">
<span className="text-sm font-medium"> <span className="text-sm font-medium">
{t("createDomainValue")} {t(
"createDomainValue"
)}
</span> </span>
<CopyToClipboard <CopyToClipboard
text={ text={
@@ -326,32 +334,101 @@ export default function CreateDomainForm({
</div> </div>
)} )}
{createdDomain.aRecords &&
createdDomain.aRecords.length > 0 && (
<div>
<h3 className="font-medium mb-3">
{t("createDomainARecords")}
</h3>
<InfoSections cols={1}>
{createdDomain.aRecords.map(
(aRecord, index) => (
<InfoSection
key={index}
>
<InfoSectionTitle>
{t(
"createDomainRecordNumber",
{
number:
index +
1
}
)}
</InfoSectionTitle>
<InfoSectionContent>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-sm font-medium">
{t(
"createDomainType"
)}
</span>
<span className="text-sm font-mono">
A
</span>
</div>
<div className="flex justify-between items-center">
<span className="text-sm font-medium">
{t(
"createDomainName"
)}
</span>
<span className="text-sm font-mono">
{
aRecord.baseDomain
}
</span>
</div>
<div className="flex justify-between items-center">
<span className="text-sm font-medium">
{t(
"createDomainValue"
)}
</span>
<span className="text-sm font-mono">
{
aRecord.value
}
</span>
</div>
</div>
</InfoSectionContent>
</InfoSection>
)
)}
</InfoSections>
</div>
)}
{createdDomain.txtRecords && {createdDomain.txtRecords &&
createdDomain.txtRecords createdDomain.txtRecords.length > 0 && (
.length > 0 && (
<div> <div>
<h3 className="font-medium mb-3"> <h3 className="font-medium mb-3">
{t("createDomainTxtRecords")} {t("createDomainTxtRecords")}
</h3> </h3>
<InfoSections cols={1}> <InfoSections cols={1}>
{createdDomain.txtRecords.map( {createdDomain.txtRecords.map(
( (txtRecord, index) => (
txtRecord,
index
) => (
<InfoSection <InfoSection
key={ key={index}
index
}
> >
<InfoSectionTitle> <InfoSectionTitle>
{t("createDomainRecordNumber", { number: index + 1 })} {t(
"createDomainRecordNumber",
{
number:
index +
1
}
)}
</InfoSectionTitle> </InfoSectionTitle>
<InfoSectionContent> <InfoSectionContent>
<div className="space-y-2"> <div className="space-y-2">
<div className="flex justify-between items-center"> <div className="flex justify-between items-center">
<span className="text-sm font-medium"> <span className="text-sm font-medium">
{t("createDomainType")} {t(
"createDomainType"
)}
</span> </span>
<span className="text-sm font-mono"> <span className="text-sm font-mono">
TXT TXT
@@ -359,7 +436,9 @@ export default function CreateDomainForm({
</div> </div>
<div className="flex justify-between items-center"> <div className="flex justify-between items-center">
<span className="text-sm font-medium"> <span className="text-sm font-medium">
{t("createDomainName")} {t(
"createDomainName"
)}
</span> </span>
<span className="text-sm font-mono"> <span className="text-sm font-mono">
{ {
@@ -369,7 +448,9 @@ export default function CreateDomainForm({
</div> </div>
<div className="flex justify-between items-center"> <div className="flex justify-between items-center">
<span className="text-sm font-medium"> <span className="text-sm font-medium">
{t("createDomainValue")} {t(
"createDomainValue"
)}
</span> </span>
<CopyToClipboard <CopyToClipboard
text={ text={
@@ -385,8 +466,6 @@ export default function CreateDomainForm({
</InfoSections> </InfoSections>
</div> </div>
)} )}
</>
))}
</div> </div>
{build == "saas" || {build == "saas" ||
@@ -397,7 +476,9 @@ export default function CreateDomainForm({
{t("createDomainSaveTheseRecords")} {t("createDomainSaveTheseRecords")}
</AlertTitle> </AlertTitle>
<AlertDescription> <AlertDescription>
{t("createDomainSaveTheseRecordsDescription")} {t(
"createDomainSaveTheseRecordsDescription"
)}
</AlertDescription> </AlertDescription>
</Alert> </Alert>
))} ))}