From 286f2abae46130112152e06c0be84e89ca654667 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Sat, 20 Feb 2021 18:23:49 +0100 Subject: [PATCH] clickable logo --- docker-compose.accounts.yml | 8 +----- packages/dashboard/.env | 4 ++- packages/dashboard/Dockerfile | 2 +- packages/dashboard/src/config.js | 43 ++++++-------------------------- 4 files changed, 12 insertions(+), 45 deletions(-) diff --git a/docker-compose.accounts.yml b/docker-compose.accounts.yml index 411776d6..dad7ff95 100644 --- a/docker-compose.accounts.yml +++ b/docker-compose.accounts.yml @@ -108,14 +108,8 @@ services: env_file: - .env environment: - - SECURITY_MODE=jwks - - BASE_URL=/ - - KRATOS_BROWSER_URL=/.ory/kratos/public - - JWKS_URL=http://oathkeeper:4456/.well-known/jwks.json - - KRATOS_PUBLIC_URL=http://kratos:4433/ - - KRATOS_ADMIN_URL=http://kratos:4434/ - - SQA_OPT_OUT=true - NEXT_PUBLIC_SKYNET_PORTAL_API=${SKYNET_PORTAL_API} + - NEXT_PUBLIC_KRATOS_BROWSER_URL=${KRATOS_BROWSER_URL} networks: shared: ipv4_address: 10.10.10.85 diff --git a/packages/dashboard/.env b/packages/dashboard/.env index 3b030c27..03131679 100644 --- a/packages/dashboard/.env +++ b/packages/dashboard/.env @@ -1 +1,3 @@ -SKYNET_PORTAL_API=https://siasky.net +NEXT_PUBLIC_SKYNET_PORTAL_API=https://siasky.net +NEXT_PUBLIC_KRATOS_BROWSER_URL=https://secure.siasky.net/.ory/kratos/public +KRATOS_PUBLIC_URL=https://secure.siasky.net/.ory/kratos/public diff --git a/packages/dashboard/Dockerfile b/packages/dashboard/Dockerfile index 2efa163f..9206a4d3 100644 --- a/packages/dashboard/Dockerfile +++ b/packages/dashboard/Dockerfile @@ -13,4 +13,4 @@ COPY styles ./styles COPY postcss.config.js . COPY tailwind.config.js . -CMD ["sh", "-c", "env | grep NEXT_PUBLIC_ > .env.local && yarn build && yarn start"] +CMD ["sh", "-c", "env | grep -E 'NEXT_PUBLIC|KRATOS' > .env.local && yarn build && yarn start"] diff --git a/packages/dashboard/src/config.js b/packages/dashboard/src/config.js index b8ec3d9f..e1a3329b 100644 --- a/packages/dashboard/src/config.js +++ b/packages/dashboard/src/config.js @@ -1,40 +1,11 @@ -export const SECURITY_MODE_STANDALONE = "cookie"; -export const SECURITY_MODE_JWT = "jwt"; - -const baseUrl = process.env.BASE_URL || "/"; - -let securityMode = SECURITY_MODE_STANDALONE; -let browserUrl = process.env.KRATOS_BROWSER_URL || "https://secure.siasky.xyz/.ory/kratos/public"; -let publicUrl = process.env.KRATOS_PUBLIC_URL || "https://secure.siasky.xyz/.ory/kratos/public"; -switch ((process.env.SECURITY_MODE || "").toLowerCase()) { - case "jwt": - case "oathkeeper": - securityMode = SECURITY_MODE_JWT; - break; - case "cookie": - case "standalone": - default: - securityMode = SECURITY_MODE_STANDALONE; -} - export default { + // https://github.com/ory/kratos-selfservice-ui-node#configuration kratos: { - browser: browserUrl.replace(/\/+$/, ""), - admin: (process.env.KRATOS_ADMIN_URL || "").replace(/\/+$/, ""), - public: publicUrl.replace(/\/+$/, ""), + // The URL where ORY Kratos's Public API is located at. If this app and ORY Kratos are running in the same + // private network, this should be the private network address (e.g. kratos-public.svc.cluster.local) + public: process.env.KRATOS_PUBLIC_URL.replace(/\/+$/, ""), + // The URL where ORY Kratos's public API is located, when accessible from the public internet via ORY Oathkeeper. + // This could be for example http://kratos.my-app.com/. + browser: process.env.NEXT_PUBLIC_KRATOS_BROWSER_URL.replace(/\/+$/, ""), }, - baseUrl, - jwksUrl: process.env.JWKS_URL || "/", - - securityMode, - SECURITY_MODE_JWT, - SECURITY_MODE_STANDALONE, - - https: { - enabled: process.env.hasOwnProperty("TLS_KEY_PATH") && process.env.hasOwnProperty("TLS_CERT_PATH"), - certificatePath: process.env.TLS_CERT_PATH || "", - keyPath: process.env.TLS_KEY_PATH || "", - }, - - tiers: {}, };