mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-21 04:16:38 +00:00
Compare commits
4 Commits
1.14.0
...
1.14.0-s.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
729c2adb3f | ||
|
|
ddaaf34dbd | ||
|
|
373e35324e | ||
|
|
09b2f27749 |
96
:w
96
:w
@@ -1,96 +0,0 @@
|
|||||||
import { db } from "@server/db/pg/driver";
|
|
||||||
import { sql } from "drizzle-orm";
|
|
||||||
import { __DIRNAME } from "@server/lib/consts";
|
|
||||||
|
|
||||||
const version = "1.14.0";
|
|
||||||
|
|
||||||
export default async function migration() {
|
|
||||||
console.log(`Running setup script ${version}...`);
|
|
||||||
|
|
||||||
try {
|
|
||||||
await db.execute(sql`BEGIN`);
|
|
||||||
|
|
||||||
await db.execute(sql`
|
|
||||||
CREATE TABLE "loginPageBranding" (
|
|
||||||
"loginPageBrandingId" serial PRIMARY KEY NOT NULL,
|
|
||||||
"logoUrl" text NOT NULL,
|
|
||||||
"logoWidth" integer NOT NULL,
|
|
||||||
"logoHeight" integer NOT NULL,
|
|
||||||
"primaryColor" text,
|
|
||||||
"resourceTitle" text NOT NULL,
|
|
||||||
"resourceSubtitle" text,
|
|
||||||
"orgTitle" text,
|
|
||||||
"orgSubtitle" text
|
|
||||||
);
|
|
||||||
`);
|
|
||||||
|
|
||||||
await db.execute(sql`
|
|
||||||
CREATE TABLE "loginPageBrandingOrg" (
|
|
||||||
"loginPageBrandingId" integer NOT NULL,
|
|
||||||
"orgId" varchar NOT NULL
|
|
||||||
);
|
|
||||||
`);
|
|
||||||
|
|
||||||
await db.execute(sql`
|
|
||||||
CREATE TABLE "resourceHeaderAuthExtendedCompatibility" (
|
|
||||||
"headerAuthExtendedCompatibilityId" serial PRIMARY KEY NOT NULL,
|
|
||||||
"resourceId" integer NOT NULL,
|
|
||||||
"extendedCompatibilityIsActivated" boolean DEFAULT false NOT NULL
|
|
||||||
);
|
|
||||||
`);
|
|
||||||
|
|
||||||
await db.execute(
|
|
||||||
sql`ALTER TABLE "resources" ADD COLUMN "maintenanceModeEnabled" boolean DEFAULT false NOT NULL;`
|
|
||||||
);
|
|
||||||
|
|
||||||
await db.execute(
|
|
||||||
sql`ALTER TABLE "resources" ADD COLUMN "maintenanceModeType" text DEFAULT 'forced';`
|
|
||||||
);
|
|
||||||
|
|
||||||
await db.execute(
|
|
||||||
sql`ALTER TABLE "resources" ADD COLUMN "maintenanceTitle" text;`
|
|
||||||
);
|
|
||||||
|
|
||||||
await db.execute(
|
|
||||||
sql`ALTER TABLE "resources" ADD COLUMN "maintenanceMessage" text;`
|
|
||||||
);
|
|
||||||
|
|
||||||
await db.execute(
|
|
||||||
sql`ALTER TABLE "resources" ADD COLUMN "maintenanceEstimatedTime" text;`
|
|
||||||
);
|
|
||||||
|
|
||||||
await db.execute(
|
|
||||||
sql`ALTER TABLE "siteResources" ADD COLUMN "tcpPortRangeString" varchar;`
|
|
||||||
);
|
|
||||||
|
|
||||||
await db.execute(
|
|
||||||
sql`ALTER TABLE "siteResources" ADD COLUMN "udpPortRangeString" varchar;`
|
|
||||||
);
|
|
||||||
|
|
||||||
await db.execute(
|
|
||||||
sql`ALTER TABLE "siteResources" ADD COLUMN "disableIcmp" boolean DEFAULT false NOT NULL;`
|
|
||||||
);
|
|
||||||
|
|
||||||
await db.execute(
|
|
||||||
sql`ALTER TABLE "loginPageBrandingOrg" ADD CONSTRAINT "loginPageBrandingOrg_loginPageBrandingId_loginPageBranding_loginPageBrandingId_fk" FOREIGN KEY ("loginPageBrandingId") REFERENCES "public"."loginPageBranding"("loginPageBrandingId") ON DELETE cascade ON UPDATE no action;`
|
|
||||||
);
|
|
||||||
|
|
||||||
await db.execute(
|
|
||||||
sql`ALTER TABLE "loginPageBrandingOrg" ADD CONSTRAINT "loginPageBrandingOrg_orgId_orgs_orgId_fk" FOREIGN KEY ("orgId") REFERENCES "public"."orgs"("orgId") ON DELETE cascade ON UPDATE no action;`
|
|
||||||
);
|
|
||||||
|
|
||||||
await db.execute(
|
|
||||||
sql`ALTER TABLE "resourceHeaderAuthExtendedCompatibility" ADD CONSTRAINT "resourceHeaderAuthExtendedCompatibility_resourceId_resources_resourceId_fk" FOREIGN KEY ("resourceId") REFERENCES "public"."resources"("resourceId") ON DELETE cascade ON UPDATE no action;`
|
|
||||||
);
|
|
||||||
|
|
||||||
await db.execute(sql`COMMIT`);
|
|
||||||
console.log("Migrated database");
|
|
||||||
} catch (e) {
|
|
||||||
await db.execute(sql`ROLLBACK`);
|
|
||||||
console.log("Unable to migrate database");
|
|
||||||
console.log(e);
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`${version} migration complete`);
|
|
||||||
}
|
|
||||||
@@ -850,6 +850,7 @@
|
|||||||
"orgPolicyConfig": "Configure access for an organization",
|
"orgPolicyConfig": "Configure access for an organization",
|
||||||
"idpUpdatedDescription": "Identity provider updated successfully",
|
"idpUpdatedDescription": "Identity provider updated successfully",
|
||||||
"redirectUrl": "Redirect URL",
|
"redirectUrl": "Redirect URL",
|
||||||
|
"orgIdpRedirectUrls": "Redirect URLs",
|
||||||
"redirectUrlAbout": "About Redirect URL",
|
"redirectUrlAbout": "About Redirect URL",
|
||||||
"redirectUrlAboutDescription": "This is the URL to which users will be redirected after authentication. You need to configure this URL in the identity provider's settings.",
|
"redirectUrlAboutDescription": "This is the URL to which users will be redirected after authentication. You need to configure this URL in the identity provider's settings.",
|
||||||
"pangolinAuth": "Auth - Pangolin",
|
"pangolinAuth": "Auth - Pangolin",
|
||||||
|
|||||||
@@ -41,9 +41,10 @@ type TargetWithSite = Target & {
|
|||||||
export async function getTraefikConfig(
|
export async function getTraefikConfig(
|
||||||
exitNodeId: number,
|
exitNodeId: number,
|
||||||
siteTypes: string[],
|
siteTypes: string[],
|
||||||
filterOutNamespaceDomains = false,
|
filterOutNamespaceDomains = false, // UNUSED BUT USED IN PRIVATE
|
||||||
generateLoginPageRouters = false,
|
generateLoginPageRouters = false, // UNUSED BUT USED IN PRIVATE
|
||||||
allowRawResources = true
|
allowRawResources = true,
|
||||||
|
allowMaintenancePage = true, // UNUSED BUT USED IN PRIVATE
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
// Get resources with their targets and sites in a single optimized query
|
// Get resources with their targets and sites in a single optimized query
|
||||||
// Start from sites on this exit node, then join to targets and resources
|
// Start from sites on this exit node, then join to targets and resources
|
||||||
|
|||||||
@@ -464,7 +464,7 @@ export async function getTraefikConfig(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showMaintenancePage) {
|
if (showMaintenancePage && allowMaintenancePage) {
|
||||||
const maintenanceServiceName = `${key}-maintenance-service`;
|
const maintenanceServiceName = `${key}-maintenance-service`;
|
||||||
const maintenanceRouterName = `${key}-maintenance-router`;
|
const maintenanceRouterName = `${key}-maintenance-router`;
|
||||||
const rewriteMiddlewareName = `${key}-maintenance-rewrite`;
|
const rewriteMiddlewareName = `${key}-maintenance-rewrite`;
|
||||||
|
|||||||
@@ -247,7 +247,8 @@ hybridRouter.get(
|
|||||||
["newt", "local", "wireguard"], // Allow them to use all the site types
|
["newt", "local", "wireguard"], // Allow them to use all the site types
|
||||||
true, // But don't allow domain namespace resources
|
true, // But don't allow domain namespace resources
|
||||||
false, // Dont include login pages,
|
false, // Dont include login pages,
|
||||||
true // allow raw resources
|
true, // allow raw resources
|
||||||
|
false // dont generate maintenance page
|
||||||
);
|
);
|
||||||
|
|
||||||
return response(res, {
|
return response(res, {
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ export default function GeneralPage() {
|
|||||||
const [variant, setVariant] = useState<"oidc" | "google" | "azure">("oidc");
|
const [variant, setVariant] = useState<"oidc" | "google" | "azure">("oidc");
|
||||||
const { isUnlocked } = useLicenseStatusContext();
|
const { isUnlocked } = useLicenseStatusContext();
|
||||||
|
|
||||||
|
const dashboardRedirectUrl = `${env.app.dashboardUrl}/auth/idp/${idpId}/oidc/callback`;
|
||||||
const [redirectUrl, setRedirectUrl] = useState(
|
const [redirectUrl, setRedirectUrl] = useState(
|
||||||
`${env.app.dashboardUrl}/auth/idp/${idpId}/oidc/callback`
|
`${env.app.dashboardUrl}/auth/idp/${idpId}/oidc/callback`
|
||||||
);
|
);
|
||||||
@@ -423,11 +424,18 @@ export default function GeneralPage() {
|
|||||||
<InfoSections cols={3}>
|
<InfoSections cols={3}>
|
||||||
<InfoSection>
|
<InfoSection>
|
||||||
<InfoSectionTitle>
|
<InfoSectionTitle>
|
||||||
{t("redirectUrl")}
|
{t("orgIdpRedirectUrls")}
|
||||||
</InfoSectionTitle>
|
</InfoSectionTitle>
|
||||||
<InfoSectionContent>
|
<InfoSectionContent>
|
||||||
<CopyToClipboard text={redirectUrl} />
|
<CopyToClipboard text={redirectUrl} />
|
||||||
</InfoSectionContent>
|
</InfoSectionContent>
|
||||||
|
{redirectUrl !== dashboardRedirectUrl && (
|
||||||
|
<InfoSectionContent>
|
||||||
|
<CopyToClipboard
|
||||||
|
text={dashboardRedirectUrl}
|
||||||
|
/>
|
||||||
|
</InfoSectionContent>
|
||||||
|
)}
|
||||||
</InfoSection>
|
</InfoSection>
|
||||||
</InfoSections>
|
</InfoSections>
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ function MaintenanceSectionForm({
|
|||||||
name="maintenanceModeEnabled"
|
name="maintenanceModeEnabled"
|
||||||
render={({ field }) => {
|
render={({ field }) => {
|
||||||
const isDisabled =
|
const isDisabled =
|
||||||
isSecurityFeatureDisabled();
|
isSecurityFeatureDisabled() || resource.http === false;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
|
|||||||
Reference in New Issue
Block a user