mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-04 01:55:10 +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
|
||||
? "true"
|
||||
: "false";
|
||||
process.env.DASHBOARD_URL = parsedConfig.data.app.dashboard_url;
|
||||
|
||||
this.rawConfig = parsedConfig.data;
|
||||
}
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -2,6 +2,7 @@ export type Env = {
|
|||
app: {
|
||||
environment: string;
|
||||
version: string;
|
||||
dashboardUrl: string;
|
||||
},
|
||||
server: {
|
||||
externalPort: string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue