Pull dashboard url for the newt config

This commit is contained in:
Owen 2025-02-04 22:14:11 -05:00
parent b6963a9c35
commit 0e73365106
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
4 changed files with 6 additions and 8 deletions

View file

@ -274,6 +274,7 @@ export class Config {
?.allow_base_domain_resources
? "true"
: "false";
process.env.DASHBOARD_URL = parsedConfig.data.app.dashboard_url;
this.rawConfig = parsedConfig.data;
}

View file

@ -75,6 +75,7 @@ export default function CreateSiteForm({
const { toast } = useToast();
const api = createApiClient(useEnvContext());
const { env } = useEnvContext();
const [isLoading, setIsLoading] = useState(false);
const [isChecked, setIsChecked] = useState(false);
@ -234,13 +235,7 @@ Endpoint = ${siteDefaults.endpoint}:${siteDefaults.listenPort}
PersistentKeepalive = 5`
: "";
// am I at http or https?
let proto = "https:";
// if (typeof window !== "undefined") {
// proto = window.location.protocol;
// }
const newtConfig = `newt --id ${siteDefaults?.newtId} --secret ${siteDefaults?.newtSecret} --endpoint ${proto}//${siteDefaults?.endpoint}`;
const newtConfig = `newt --id ${siteDefaults?.newtId} --secret ${siteDefaults?.newtSecret} --endpoint ${env.app.dashboardUrl}`;
return (
<div className="space-y-4">

View file

@ -13,7 +13,8 @@ export function pullEnv(): Env {
},
app: {
environment: process.env.ENVIRONMENT as string,
version: process.env.APP_VERSION as string
version: process.env.APP_VERSION as string,
dashboardUrl: process.env.DASHBOARD_URL as string,
},
email: {
emailEnabled: process.env.EMAIL_ENABLED === "true" ? true : false

View file

@ -2,6 +2,7 @@ export type Env = {
app: {
environment: string;
version: string;
dashboardUrl: string;
},
server: {
externalPort: string;