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_user_create_org: true
allow_raw_resources: true
allow_base_domain_resources: true

View file

@ -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

View file

@ -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),

View file

@ -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),

View file

@ -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

View file

@ -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(),

View file

@ -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, {

View file

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

View file

@ -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;
}

View file

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

View file

@ -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({

View file

@ -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}`
);

View file

@ -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<string>("");
const { env } = useEnvContext();
useEffect(() => {
function getPath() {

View file

@ -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:

View file

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