Skip to content

Commit

Permalink
chore: add required files for custom domains on the marketing page
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondk committed Sep 23, 2024
1 parent 5020511 commit 8f334b7
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
5 changes: 5 additions & 0 deletions frontend/scripts/readCanisterIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import { execSync } from "child_process";

// dfx deploy --network ic = ic
export const network = process.env.DFX_NETWORK ?? "local";

// TODO When the custom domains are registered
// this should be set to the custom domain
// when we're not using the local network
// The domain name used on the http gateway.
export const host =
process.env.DFX_NETWORK_HOST ??
(network === "local" ? "http://localhost:8000" : "https://icp0.io");
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/frontend/static/.well-known/ic-domains
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
test.docutrack.ai
test.docutrack.one
demoapp.docutrack.ai
demoapp.docutrack.one
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"alternativeOrigins": [
"https://test.docutrack.ai",
"https://test.docutrack.one"
"https://demoapp.docutrack.ai",
"https://demoapp.docutrack.one"
]
}
2 changes: 2 additions & 0 deletions landing-page/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { host, readCanisterIds } from "../frontend/scripts/readCanisterIds";
const canisterIds = readCanisterIds({});
const hostUrl = new URL(host);

// TODO after the custom domains a registered, the PUBLIC_DAPP_URL
// needs to be be set to the custom domain
if (hostUrl.port) {
process.env.PUBLIC_DAPP_URL = `${hostUrl.protocol}//${canisterIds.FRONTEND_CANISTER_ID}.${hostUrl.hostname}:${hostUrl.port}`;
} else {
Expand Down
6 changes: 6 additions & 0 deletions landing-page/public/.ic-assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"match": ".well-known",
"ignore": false
}
]
2 changes: 2 additions & 0 deletions landing-page/public/.well-known/ic-domains
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docutrack.ai
docutrack.one

0 comments on commit 8f334b7

Please sign in to comment.