diff --git a/config/config.example.yml b/config/config.example.yml index 33ed9370..5a78ae5e 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -46,4 +46,3 @@ flags: disable_signup_without_invite: true disable_user_create_org: true allow_raw_resources: true - allow_base_domain_resources: true diff --git a/install/config/config.yml b/install/config/config.yml index 74b3d009..c4145fa2 100644 --- a/install/config/config.yml +++ b/install/config/config.yml @@ -30,7 +30,7 @@ orgs: email: smtp_host: "{{.EmailSMTPHost}}" smtp_port: {{.EmailSMTPPort}} - smtp_user: "{{.EmailSMTPUser}}" + smtp_user: "{{.EmailSMTPUser}allow_base_domain_resources}" smtp_pass: "{{.EmailSMTPPass}}" no_reply: "{{.EmailNoReply}}" {{end}} @@ -40,4 +40,3 @@ flags: disable_signup_without_invite: true disable_user_create_org: false allow_raw_resources: true - allow_base_domain_resources: true diff --git a/server/db/pg/schema.ts b/server/db/pg/schema.ts index 1a2175c4..6df02338 100644 --- a/server/db/pg/schema.ts +++ b/server/db/pg/schema.ts @@ -88,7 +88,6 @@ export const resources = pgTable("resources", { emailWhitelistEnabled: boolean("emailWhitelistEnabled") .notNull() .default(false), - isBaseDomain: boolean("isBaseDomain"), applyRules: boolean("applyRules").notNull().default(false), enabled: boolean("enabled").notNull().default(true), stickySession: boolean("stickySession").notNull().default(false), @@ -629,4 +628,4 @@ export type Olm = InferSelectModel; export type OlmSession = InferSelectModel; export type UserClient = InferSelectModel; export type RoleClient = InferSelectModel; -export type OrgDomains = InferSelectModel; \ No newline at end of file +export type OrgDomains = InferSelectModel; diff --git a/server/db/sqlite/schema.ts b/server/db/sqlite/schema.ts index c4191c34..94f3e1bc 100644 --- a/server/db/sqlite/schema.ts +++ b/server/db/sqlite/schema.ts @@ -97,7 +97,6 @@ export const resources = sqliteTable("resources", { emailWhitelistEnabled: integer("emailWhitelistEnabled", { mode: "boolean" }) .notNull() .default(false), - isBaseDomain: integer("isBaseDomain", { mode: "boolean" }), applyRules: integer("applyRules", { mode: "boolean" }) .notNull() .default(false), @@ -674,4 +673,4 @@ export type Idp = InferSelectModel; export type ApiKey = InferSelectModel; export type ApiKeyAction = InferSelectModel; export type ApiKeyOrg = InferSelectModel; -export type OrgDomains = InferSelectModel; \ No newline at end of file +export type OrgDomains = InferSelectModel; diff --git a/server/lib/config.ts b/server/lib/config.ts index 8e23ae0f..0a964469 100644 --- a/server/lib/config.ts +++ b/server/lib/config.ts @@ -81,10 +81,6 @@ export class Config { parsedConfig.server.resource_access_token_headers.token; process.env.RESOURCE_SESSION_REQUEST_PARAM = parsedConfig.server.resource_session_request_param; - process.env.FLAGS_ALLOW_BASE_DOMAIN_RESOURCES = parsedConfig.flags - ?.allow_base_domain_resources - ? "true" - : "false"; process.env.DASHBOARD_URL = parsedConfig.app.dashboard_url; process.env.FLAGS_DISABLE_LOCAL_SITES = parsedConfig.flags ?.disable_local_sites diff --git a/server/lib/readConfigFile.ts b/server/lib/readConfigFile.ts index 220348fc..f3057128 100644 --- a/server/lib/readConfigFile.ts +++ b/server/lib/readConfigFile.ts @@ -233,7 +233,6 @@ export const configSchema = z disable_signup_without_invite: z.boolean().optional(), disable_user_create_org: z.boolean().optional(), allow_raw_resources: z.boolean().optional(), - allow_base_domain_resources: z.boolean().optional(), enable_integration_api: z.boolean().optional(), enable_redis: z.boolean().optional(), disable_local_sites: z.boolean().optional(), diff --git a/server/routers/org/updateOrg.ts b/server/routers/org/updateOrg.ts index 06c92fad..6dcd1016 100644 --- a/server/routers/org/updateOrg.ts +++ b/server/routers/org/updateOrg.ts @@ -19,7 +19,6 @@ const updateOrgParamsSchema = z const updateOrgBodySchema = z .object({ name: z.string().min(1).max(255).optional() - // domain: z.string().min(1).max(255).optional(), }) .strict() .refine((data) => Object.keys(data).length > 0, { diff --git a/server/routers/resource/createResource.ts b/server/routers/resource/createResource.ts index 784dc639..94bd3d10 100644 --- a/server/routers/resource/createResource.ts +++ b/server/routers/resource/createResource.ts @@ -307,8 +307,7 @@ async function createHttpResource( subdomain, http: true, protocol: "tcp", - ssl: true, - isBaseDomain: false + ssl: true }) .returning(); diff --git a/server/routers/traefik/getTraefikConfig.ts b/server/routers/traefik/getTraefikConfig.ts index 95968858..79a56130 100644 --- a/server/routers/traefik/getTraefikConfig.ts +++ b/server/routers/traefik/getTraefikConfig.ts @@ -61,7 +61,7 @@ export async function traefikConfigProvider( http: resources.http, proxyPort: resources.proxyPort, protocol: resources.protocol, - isBaseDomain: resources.isBaseDomain, + subdomain: resources.subdomain, domainId: resources.domainId, // Site fields site: { @@ -210,7 +210,7 @@ export async function traefikConfigProvider( wildCard = `*.${domainParts.slice(1).join(".")}`; } - if (resource.isBaseDomain) { + if (!resource.subdomain) { wildCard = resource.fullDomain; } diff --git a/server/setup/copyInConfig.ts b/server/setup/copyInConfig.ts index 376a5df4..2c8e1110 100644 --- a/server/setup/copyInConfig.ts +++ b/server/setup/copyInConfig.ts @@ -115,7 +115,7 @@ async function copyInDomains() { } let fullDomain = ""; - if (resource.isBaseDomain) { + if (!resource.subdomain) { fullDomain = domain.baseDomain; } else { fullDomain = `${resource.subdomain}.${domain.baseDomain}`; diff --git a/src/app/[orgId]/settings/general/page.tsx b/src/app/[orgId]/settings/general/page.tsx index b986c832..0eba0a3d 100644 --- a/src/app/[orgId]/settings/general/page.tsx +++ b/src/app/[orgId]/settings/general/page.tsx @@ -124,7 +124,7 @@ export default function GeneralPage() { await api .post(`/org/${org?.org.orgId}`, { name: data.name, - subnet: data.subnet // Include subnet in the API request + // subnet: data.subnet // Include subnet in the API request }) .then(() => { toast({ diff --git a/src/app/[orgId]/settings/resources/[resourceId]/general/page.tsx b/src/app/[orgId]/settings/resources/[resourceId]/general/page.tsx index df04ec2a..c8ed5521 100644 --- a/src/app/[orgId]/settings/resources/[resourceId]/general/page.tsx +++ b/src/app/[orgId]/settings/resources/[resourceId]/general/page.tsx @@ -109,9 +109,6 @@ export default function GeneralForm() { >([]); const [loadingPage, setLoadingPage] = useState(true); - const [domainType, setDomainType] = useState<"subdomain" | "basedomain">( - resource.isBaseDomain ? "basedomain" : "subdomain" - ); const [resourceFullDomain, setResourceFullDomain] = useState( `${resource.ssl ? "https" : "http"}://${resource.fullDomain}` ); diff --git a/src/components/LayoutHeader.tsx b/src/components/LayoutHeader.tsx index f667cd02..2584b259 100644 --- a/src/components/LayoutHeader.tsx +++ b/src/components/LayoutHeader.tsx @@ -1,15 +1,11 @@ "use client"; import React, { useEffect, useState } from "react"; -import { cn } from "@app/lib/cn"; import Image from "next/image"; import Link from "next/link"; import ProfileIcon from "@app/components/ProfileIcon"; import ThemeSwitcher from "@app/components/ThemeSwitcher"; import { useTheme } from "next-themes"; -import BrandingLogo from "./$BrandingLogo"; -import { useEnvContext } from "@app/hooks/useEnvContext"; -import { Badge } from "./ui/badge"; interface LayoutHeaderProps { showTopBar: boolean; @@ -18,7 +14,6 @@ interface LayoutHeaderProps { export function LayoutHeader({ showTopBar }: LayoutHeaderProps) { const { theme } = useTheme(); const [path, setPath] = useState(""); - const { env } = useEnvContext(); useEffect(() => { function getPath() { diff --git a/src/lib/pullEnv.ts b/src/lib/pullEnv.ts index 3b3f43e8..39d8b66a 100644 --- a/src/lib/pullEnv.ts +++ b/src/lib/pullEnv.ts @@ -36,10 +36,6 @@ export function pullEnv(): Env { : false, allowRawResources: process.env.FLAGS_ALLOW_RAW_RESOURCES === "true" ? true : false, - allowBaseDomainResources: - process.env.FLAGS_ALLOW_BASE_DOMAIN_RESOURCES === "true" - ? true - : false, disableLocalSites: process.env.FLAGS_DISABLE_LOCAL_SITES === "true" ? true : false, disableBasicWireguardSites: diff --git a/src/lib/types/env.ts b/src/lib/types/env.ts index 2bd36505..a01b9cfd 100644 --- a/src/lib/types/env.ts +++ b/src/lib/types/env.ts @@ -21,7 +21,6 @@ export type Env = { disableUserCreateOrg: boolean; emailVerificationRequired: boolean; allowRawResources: boolean; - allowBaseDomainResources: boolean; disableLocalSites: boolean; disableBasicWireguardSites: boolean; enableClients: boolean;