This repository has been archived by the owner on Dec 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: update env variables according to nextjs docs
- Loading branch information
Showing
4 changed files
with
21 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
NEXT_PUBLIC_GRAPHQL_HOSTNAME=api.mainnet.galoy.io | ||
NEXT_PUBLIC_GRAPHQL_URI=https://$NEXT_PUBLIC_GRAPHQL_HOSTNAME/graphql | ||
NEXT_PUBLIC_GRAPHQL_SUBSCRIPTION_URI=wss://$NEXT_PUBLIC_GRAPHQL_HOSTNAME/graphql | ||
|
||
GRAPHQL_HOSTNAME_INTERNAL=api.galoy-name-galoy.svc.cluster.local | ||
GRAPHQL_URI_INTERNAL=http://$GRAPHQL_HOSTNAME_INTERNAL/graphql | ||
|
||
NEXT_PUBLIC_PLAY_STORE_LINK=https://play.google.com/store/apps/details?id=com.galoyapp | ||
NEXT_PUBLIC_APP_STORE_LINK=https://apps.apple.com/app/bitcoin-beach-wallet/id1531383905 | ||
NEXT_PUBLIC_APK_LINK=https://storage.googleapis.com/bitcoin-beach-wallet/latest.apk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,13 @@ | ||
let GRAPHQL_HOSTNAME = process.env.NEXT_PUBLIC_GRAPHQL_HOSTNAME as string | ||
if (!process.env.NEXT_PUBLIC_GRAPHQL_HOSTNAME) { | ||
throw new Error("NEXT_PUBLIC_GRAPHQL_HOSTNAME env variable is required") | ||
} | ||
|
||
const GRAPHQL_URI = process.env.NEXT_PUBLIC_GRAPHQL_URI || "" | ||
const GRAPHQL_SUBSCRIPTION_URI = process.env.NEXT_PUBLIC_GRAPHQL_SUBSCRIPTION_URI || "" | ||
|
||
// we need an internal dns to properly propagate the ip related headers to api | ||
// if we use the api endpoints, nginx will rewrite the header to prevent spoofing | ||
// for example: "api.galoy-name-galoy.svc.cluster.local" | ||
const GRAPHQL_HOSTNAME_INTERNAL = process.env.GRAPHQL_HOSTNAME_INTERNAL as string | ||
|
||
// FIXME: remove once dns has been migrated out of ln.bitcoinbeach.com | ||
if (!GRAPHQL_HOSTNAME) { | ||
if (typeof window !== "undefined") { | ||
let hostParts = window.location.host.split(".") | ||
if (hostParts.length <= 3) { | ||
// throw new Error("Missing env variables") | ||
hostParts = "pay.mainnet.galoy.io".split(".") | ||
} | ||
hostParts[0] = "api" | ||
GRAPHQL_HOSTNAME = hostParts.join(".") | ||
} else { | ||
GRAPHQL_HOSTNAME = "api.mainnet.galoy.io" | ||
} | ||
} | ||
|
||
const GRAPHQL_URI_INTERNAL = `http://${GRAPHQL_HOSTNAME_INTERNAL}/graphql` | ||
const GRAPHQL_URI = `https://${GRAPHQL_HOSTNAME}/graphql` | ||
const GRAPHQL_SUBSCRIPTION_URI = `wss://${GRAPHQL_HOSTNAME}/graphql` | ||
const GRAPHQL_URI_INTERNAL = process.env.GRAPHQL_URI_INTERNAL || "" | ||
|
||
export { GRAPHQL_URI, GRAPHQL_SUBSCRIPTION_URI, GRAPHQL_URI_INTERNAL } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters