mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-21 17:58:27 +02:00
Pull dashboard url for the newt config
This commit is contained in:
parent
b6963a9c35
commit
0e73365106
4 changed files with 6 additions and 8 deletions
|
@ -274,6 +274,7 @@ export class Config {
|
||||||
?.allow_base_domain_resources
|
?.allow_base_domain_resources
|
||||||
? "true"
|
? "true"
|
||||||
: "false";
|
: "false";
|
||||||
|
process.env.DASHBOARD_URL = parsedConfig.data.app.dashboard_url;
|
||||||
|
|
||||||
this.rawConfig = parsedConfig.data;
|
this.rawConfig = parsedConfig.data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,7 @@ export default function CreateSiteForm({
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
|
|
||||||
const api = createApiClient(useEnvContext());
|
const api = createApiClient(useEnvContext());
|
||||||
|
const { env } = useEnvContext();
|
||||||
|
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [isChecked, setIsChecked] = useState(false);
|
const [isChecked, setIsChecked] = useState(false);
|
||||||
|
@ -234,13 +235,7 @@ Endpoint = ${siteDefaults.endpoint}:${siteDefaults.listenPort}
|
||||||
PersistentKeepalive = 5`
|
PersistentKeepalive = 5`
|
||||||
: "";
|
: "";
|
||||||
|
|
||||||
// am I at http or https?
|
const newtConfig = `newt --id ${siteDefaults?.newtId} --secret ${siteDefaults?.newtSecret} --endpoint ${env.app.dashboardUrl}`;
|
||||||
let proto = "https:";
|
|
||||||
// if (typeof window !== "undefined") {
|
|
||||||
// proto = window.location.protocol;
|
|
||||||
// }
|
|
||||||
|
|
||||||
const newtConfig = `newt --id ${siteDefaults?.newtId} --secret ${siteDefaults?.newtSecret} --endpoint ${proto}//${siteDefaults?.endpoint}`;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
|
|
|
@ -13,7 +13,8 @@ export function pullEnv(): Env {
|
||||||
},
|
},
|
||||||
app: {
|
app: {
|
||||||
environment: process.env.ENVIRONMENT as string,
|
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: {
|
email: {
|
||||||
emailEnabled: process.env.EMAIL_ENABLED === "true" ? true : false
|
emailEnabled: process.env.EMAIL_ENABLED === "true" ? true : false
|
||||||
|
|
|
@ -2,6 +2,7 @@ export type Env = {
|
||||||
app: {
|
app: {
|
||||||
environment: string;
|
environment: string;
|
||||||
version: string;
|
version: string;
|
||||||
|
dashboardUrl: string;
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
externalPort: string;
|
externalPort: string;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue