remove is base domain resource and flag

This commit is contained in:
miloschwartz 2025-07-15 15:07:34 -07:00
parent ff809416f5
commit f1291d4d7d
No known key found for this signature in database
15 changed files with 8 additions and 32 deletions

View file

@ -46,4 +46,3 @@ flags:
disable_signup_without_invite: true disable_signup_without_invite: true
disable_user_create_org: true disable_user_create_org: true
allow_raw_resources: true allow_raw_resources: true
allow_base_domain_resources: true

View file

@ -30,7 +30,7 @@ orgs:
email: email:
smtp_host: "{{.EmailSMTPHost}}" smtp_host: "{{.EmailSMTPHost}}"
smtp_port: {{.EmailSMTPPort}} smtp_port: {{.EmailSMTPPort}}
smtp_user: "{{.EmailSMTPUser}}" smtp_user: "{{.EmailSMTPUser}allow_base_domain_resources}"
smtp_pass: "{{.EmailSMTPPass}}" smtp_pass: "{{.EmailSMTPPass}}"
no_reply: "{{.EmailNoReply}}" no_reply: "{{.EmailNoReply}}"
{{end}} {{end}}
@ -40,4 +40,3 @@ flags:
disable_signup_without_invite: true disable_signup_without_invite: true
disable_user_create_org: false disable_user_create_org: false
allow_raw_resources: true allow_raw_resources: true
allow_base_domain_resources: true

View file

@ -88,7 +88,6 @@ export const resources = pgTable("resources", {
emailWhitelistEnabled: boolean("emailWhitelistEnabled") emailWhitelistEnabled: boolean("emailWhitelistEnabled")
.notNull() .notNull()
.default(false), .default(false),
isBaseDomain: boolean("isBaseDomain"),
applyRules: boolean("applyRules").notNull().default(false), applyRules: boolean("applyRules").notNull().default(false),
enabled: boolean("enabled").notNull().default(true), enabled: boolean("enabled").notNull().default(true),
stickySession: boolean("stickySession").notNull().default(false), stickySession: boolean("stickySession").notNull().default(false),
@ -629,4 +628,4 @@ export type Olm = InferSelectModel<typeof olms>;
export type OlmSession = InferSelectModel<typeof olmSessions>; export type OlmSession = InferSelectModel<typeof olmSessions>;
export type UserClient = InferSelectModel<typeof userClients>; export type UserClient = InferSelectModel<typeof userClients>;
export type RoleClient = InferSelectModel<typeof roleClients>; export type RoleClient = InferSelectModel<typeof roleClients>;
export type OrgDomains = InferSelectModel<typeof orgDomains>; export type OrgDomains = InferSelectModel<typeof orgDomains>;

View file

@ -97,7 +97,6 @@ export const resources = sqliteTable("resources", {
emailWhitelistEnabled: integer("emailWhitelistEnabled", { mode: "boolean" }) emailWhitelistEnabled: integer("emailWhitelistEnabled", { mode: "boolean" })
.notNull() .notNull()
.default(false), .default(false),
isBaseDomain: integer("isBaseDomain", { mode: "boolean" }),
applyRules: integer("applyRules", { mode: "boolean" }) applyRules: integer("applyRules", { mode: "boolean" })
.notNull() .notNull()
.default(false), .default(false),
@ -674,4 +673,4 @@ export type Idp = InferSelectModel<typeof idp>;
export type ApiKey = InferSelectModel<typeof apiKeys>; export type ApiKey = InferSelectModel<typeof apiKeys>;
export type ApiKeyAction = InferSelectModel<typeof apiKeyActions>; export type ApiKeyAction = InferSelectModel<typeof apiKeyActions>;
export type ApiKeyOrg = InferSelectModel<typeof apiKeyOrg>; export type ApiKeyOrg = InferSelectModel<typeof apiKeyOrg>;
export type OrgDomains = InferSelectModel<typeof orgDomains>; export type OrgDomains = InferSelectModel<typeof orgDomains>;

View file

@ -81,10 +81,6 @@ export class Config {
parsedConfig.server.resource_access_token_headers.token; parsedConfig.server.resource_access_token_headers.token;
process.env.RESOURCE_SESSION_REQUEST_PARAM = process.env.RESOURCE_SESSION_REQUEST_PARAM =
parsedConfig.server.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.DASHBOARD_URL = parsedConfig.app.dashboard_url;
process.env.FLAGS_DISABLE_LOCAL_SITES = parsedConfig.flags process.env.FLAGS_DISABLE_LOCAL_SITES = parsedConfig.flags
?.disable_local_sites ?.disable_local_sites

View file

@ -233,7 +233,6 @@ export const configSchema = z
disable_signup_without_invite: z.boolean().optional(), disable_signup_without_invite: z.boolean().optional(),
disable_user_create_org: z.boolean().optional(), disable_user_create_org: z.boolean().optional(),
allow_raw_resources: z.boolean().optional(), allow_raw_resources: z.boolean().optional(),
allow_base_domain_resources: z.boolean().optional(),
enable_integration_api: z.boolean().optional(), enable_integration_api: z.boolean().optional(),
enable_redis: z.boolean().optional(), enable_redis: z.boolean().optional(),
disable_local_sites: z.boolean().optional(), disable_local_sites: z.boolean().optional(),

View file

@ -19,7 +19,6 @@ const updateOrgParamsSchema = z
const updateOrgBodySchema = z const updateOrgBodySchema = z
.object({ .object({
name: z.string().min(1).max(255).optional() name: z.string().min(1).max(255).optional()
// domain: z.string().min(1).max(255).optional(),
}) })
.strict() .strict()
.refine((data) => Object.keys(data).length > 0, { .refine((data) => Object.keys(data).length > 0, {

View file

@ -307,8 +307,7 @@ async function createHttpResource(
subdomain, subdomain,
http: true, http: true,
protocol: "tcp", protocol: "tcp",
ssl: true, ssl: true
isBaseDomain: false
}) })
.returning(); .returning();

View file

@ -61,7 +61,7 @@ export async function traefikConfigProvider(
http: resources.http, http: resources.http,
proxyPort: resources.proxyPort, proxyPort: resources.proxyPort,
protocol: resources.protocol, protocol: resources.protocol,
isBaseDomain: resources.isBaseDomain, subdomain: resources.subdomain,
domainId: resources.domainId, domainId: resources.domainId,
// Site fields // Site fields
site: { site: {
@ -210,7 +210,7 @@ export async function traefikConfigProvider(
wildCard = `*.${domainParts.slice(1).join(".")}`; wildCard = `*.${domainParts.slice(1).join(".")}`;
} }
if (resource.isBaseDomain) { if (!resource.subdomain) {
wildCard = resource.fullDomain; wildCard = resource.fullDomain;
} }

View file

@ -115,7 +115,7 @@ async function copyInDomains() {
} }
let fullDomain = ""; let fullDomain = "";
if (resource.isBaseDomain) { if (!resource.subdomain) {
fullDomain = domain.baseDomain; fullDomain = domain.baseDomain;
} else { } else {
fullDomain = `${resource.subdomain}.${domain.baseDomain}`; fullDomain = `${resource.subdomain}.${domain.baseDomain}`;

View file

@ -124,7 +124,7 @@ export default function GeneralPage() {
await api await api
.post(`/org/${org?.org.orgId}`, { .post(`/org/${org?.org.orgId}`, {
name: data.name, name: data.name,
subnet: data.subnet // Include subnet in the API request // subnet: data.subnet // Include subnet in the API request
}) })
.then(() => { .then(() => {
toast({ toast({

View file

@ -109,9 +109,6 @@ export default function GeneralForm() {
>([]); >([]);
const [loadingPage, setLoadingPage] = useState(true); const [loadingPage, setLoadingPage] = useState(true);
const [domainType, setDomainType] = useState<"subdomain" | "basedomain">(
resource.isBaseDomain ? "basedomain" : "subdomain"
);
const [resourceFullDomain, setResourceFullDomain] = useState( const [resourceFullDomain, setResourceFullDomain] = useState(
`${resource.ssl ? "https" : "http"}://${resource.fullDomain}` `${resource.ssl ? "https" : "http"}://${resource.fullDomain}`
); );

View file

@ -1,15 +1,11 @@
"use client"; "use client";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { cn } from "@app/lib/cn";
import Image from "next/image"; import Image from "next/image";
import Link from "next/link"; import Link from "next/link";
import ProfileIcon from "@app/components/ProfileIcon"; import ProfileIcon from "@app/components/ProfileIcon";
import ThemeSwitcher from "@app/components/ThemeSwitcher"; import ThemeSwitcher from "@app/components/ThemeSwitcher";
import { useTheme } from "next-themes"; import { useTheme } from "next-themes";
import BrandingLogo from "./$BrandingLogo";
import { useEnvContext } from "@app/hooks/useEnvContext";
import { Badge } from "./ui/badge";
interface LayoutHeaderProps { interface LayoutHeaderProps {
showTopBar: boolean; showTopBar: boolean;
@ -18,7 +14,6 @@ interface LayoutHeaderProps {
export function LayoutHeader({ showTopBar }: LayoutHeaderProps) { export function LayoutHeader({ showTopBar }: LayoutHeaderProps) {
const { theme } = useTheme(); const { theme } = useTheme();
const [path, setPath] = useState<string>(""); const [path, setPath] = useState<string>("");
const { env } = useEnvContext();
useEffect(() => { useEffect(() => {
function getPath() { function getPath() {

View file

@ -36,10 +36,6 @@ export function pullEnv(): Env {
: false, : false,
allowRawResources: allowRawResources:
process.env.FLAGS_ALLOW_RAW_RESOURCES === "true" ? true : false, process.env.FLAGS_ALLOW_RAW_RESOURCES === "true" ? true : false,
allowBaseDomainResources:
process.env.FLAGS_ALLOW_BASE_DOMAIN_RESOURCES === "true"
? true
: false,
disableLocalSites: disableLocalSites:
process.env.FLAGS_DISABLE_LOCAL_SITES === "true" ? true : false, process.env.FLAGS_DISABLE_LOCAL_SITES === "true" ? true : false,
disableBasicWireguardSites: disableBasicWireguardSites:

View file

@ -21,7 +21,6 @@ export type Env = {
disableUserCreateOrg: boolean; disableUserCreateOrg: boolean;
emailVerificationRequired: boolean; emailVerificationRequired: boolean;
allowRawResources: boolean; allowRawResources: boolean;
allowBaseDomainResources: boolean;
disableLocalSites: boolean; disableLocalSites: boolean;
disableBasicWireguardSites: boolean; disableBasicWireguardSites: boolean;
enableClients: boolean; enableClients: boolean;