fix: default dev password for keycloak refer to env

This commit is contained in:
Théo LAGACHE
2026-06-25 15:20:02 +02:00
parent 45c82f9ef5
commit 1a210c6de9
2 changed files with 158 additions and 84 deletions
+14 -16
View File
@@ -1,11 +1,10 @@
import type {NextConfig} from "next"; import type { NextConfig } from "next";
import {PORTABASE_DEFAULT_SETTINGS} from "./portabase.config"; import { PORTABASE_DEFAULT_SETTINGS } from "./portabase.config";
const isDev = process.env.NODE_ENV === "development"; const isDev = process.env.NODE_ENV === "development";
function buildCSPHeader(): string { function buildCSPHeader(): string {
const {CSP} = PORTABASE_DEFAULT_SETTINGS.SECURITY; const { CSP } = PORTABASE_DEFAULT_SETTINGS.SECURITY;
const directives = [ const directives = [
`default-src ${CSP.DEFAULT_SRC.join(" ")}`, `default-src ${CSP.DEFAULT_SRC.join(" ")}`,
@@ -37,9 +36,9 @@ function buildPermissionsPolicy(): string {
.join(", "); .join(", ");
} }
const nextConfig: NextConfig = { const nextConfig: NextConfig = {
output: "standalone", output: "standalone",
devIndicators: false,
typescript: { typescript: {
ignoreBuildErrors: true, ignoreBuildErrors: true,
}, },
@@ -50,7 +49,7 @@ const nextConfig: NextConfig = {
serverActions: { serverActions: {
bodySizeLimit: "10gb", bodySizeLimit: "10gb",
}, },
proxyClientMaxBodySize: '10gb', proxyClientMaxBodySize: "10gb",
}, },
async rewrites() { async rewrites() {
if (!isDev) return []; if (!isDev) return [];
@@ -77,22 +76,21 @@ const nextConfig: NextConfig = {
value: buildPermissionsPolicy(), value: buildPermissionsPolicy(),
}, },
{ {
key: 'X-Content-Type-Options', key: "X-Content-Type-Options",
value: 'nosniff', value: "nosniff",
}, },
{ {
key: 'X-Frame-Options', key: "X-Frame-Options",
value: 'DENY', value: "DENY",
}, },
{ {
key: 'Referrer-Policy', key: "Referrer-Policy",
value: 'strict-origin-when-cross-origin', value: "strict-origin-when-cross-origin",
}, },
{ {
key: 'Strict-Transport-Security', key: "Strict-Transport-Security",
value: 'max-age=63072000; includeSubDomains; preload', value: "max-age=63072000; includeSubDomains; preload",
} },
// ...other security headers
], ],
}, },
]; ];
+78 -2
View File
@@ -351,6 +351,14 @@
"clientRole" : true, "clientRole" : true,
"containerId" : "18b5dfb2-44d4-448e-98df-9652daef1a22", "containerId" : "18b5dfb2-44d4-448e-98df-9652daef1a22",
"attributes" : { } "attributes" : { }
} ],
"exemple-client" : [ {
"id" : "67766209-57dd-45c7-940d-ed3313473101",
"name" : "uma_protection",
"composite" : false,
"clientRole" : true,
"containerId" : "248d3eaa-466f-4b85-8903-9242959e67ba",
"attributes" : { }
} ] } ]
} }
}, },
@@ -458,8 +466,8 @@
"id" : "b1cedcac-5207-4479-bc29-065ba849e414", "id" : "b1cedcac-5207-4479-bc29-065ba849e414",
"type" : "password", "type" : "password",
"userLabel" : "My password", "userLabel" : "My password",
"createdDate" : 1772179391727, "createdDate" : 1782393421785,
"secretData" : "{\"value\":\"IXr6L3pvO2BAkn/cH3rh3v2tg1R83u2f8SWEZK2fq5E=\",\"salt\":\"XWV8/yKm7Rw/YXiwXZZUig==\",\"additionalParameters\":{}}", "secretData" : "{\"value\":\"L585pLqSeHaNW4HzOu+GzZm+VJWWBO3Df+rPs04gUGk=\",\"salt\":\"w3pmQ0hsMDJnCX+qJ3K+zQ==\",\"additionalParameters\":{}}",
"credentialData" : "{\"hashIterations\":5,\"algorithm\":\"argon2\",\"additionalParameters\":{\"hashLength\":[\"32\"],\"memory\":[\"7168\"],\"type\":[\"id\"],\"version\":[\"1.3\"],\"parallelism\":[\"1\"]}}" "credentialData" : "{\"hashIterations\":5,\"algorithm\":\"argon2\",\"additionalParameters\":{\"hashLength\":[\"32\"],\"memory\":[\"7168\"],\"type\":[\"id\"],\"version\":[\"1.3\"],\"parallelism\":[\"1\"]}}"
} ], } ],
"disableableCredentialTypes" : [ ], "disableableCredentialTypes" : [ ],
@@ -467,6 +475,23 @@
"realmRoles" : [ "admin", "default-roles-master" ], "realmRoles" : [ "admin", "default-roles-master" ],
"notBefore" : 0, "notBefore" : 0,
"groups" : [ "/Admin" ] "groups" : [ "/Admin" ]
}, {
"id" : "8c749a0c-f2ed-4bc7-9f54-4e0bcbc36626",
"username" : "service-account-exemple-client",
"emailVerified" : false,
"enabled" : true,
"createdTimestamp" : 1772190246795,
"totp" : false,
"serviceAccountClientId" : "exemple-client",
"credentials" : [ ],
"disableableCredentialTypes" : [ ],
"requiredActions" : [ ],
"realmRoles" : [ "default-roles-master" ],
"clientRoles" : {
"exemple-client" : [ "uma_protection" ]
},
"notBefore" : 0,
"groups" : [ ]
}, { }, {
"id" : "718dfe46-dbef-41a3-9120-78aeac240431", "id" : "718dfe46-dbef-41a3-9120-78aeac240431",
"username" : "service-account-portabase", "username" : "service-account-portabase",
@@ -625,6 +650,57 @@
"nodeReRegistrationTimeout" : 0, "nodeReRegistrationTimeout" : 0,
"defaultClientScopes" : [ "web-origins", "acr", "profile", "roles", "basic", "email" ], "defaultClientScopes" : [ "web-origins", "acr", "profile", "roles", "basic", "email" ],
"optionalClientScopes" : [ "address", "phone", "organization", "offline_access", "microprofile-jwt" ] "optionalClientScopes" : [ "address", "phone", "organization", "offline_access", "microprofile-jwt" ]
}, {
"id" : "248d3eaa-466f-4b85-8903-9242959e67ba",
"clientId" : "exemple-client",
"name" : "Exemple Client",
"description" : "",
"rootUrl" : "https://your-instance.portabase.io",
"adminUrl" : "https://your-instance.portabase.io",
"baseUrl" : "https://your-instance.portabase.io",
"surrogateAuthRequired" : false,
"enabled" : true,
"alwaysDisplayInConsole" : false,
"clientAuthenticatorType" : "client-secret",
"secret" : "lFZY6fXzh9uxCXwvucw9JtXGhNRKgnnj",
"redirectUris" : [ "https://your-instance.portabase.io/api/auth/sso/callback/exemple-client" ],
"webOrigins" : [ "https://your-instance.portabase.io" ],
"notBefore" : 0,
"bearerOnly" : false,
"consentRequired" : false,
"standardFlowEnabled" : true,
"implicitFlowEnabled" : false,
"directAccessGrantsEnabled" : false,
"serviceAccountsEnabled" : true,
"authorizationServicesEnabled" : true,
"publicClient" : false,
"frontchannelLogout" : true,
"protocol" : "openid-connect",
"attributes" : {
"realm_client" : "false",
"oidc.ciba.grant.enabled" : "false",
"client.secret.creation.time" : "1772190246",
"backchannel.logout.session.required" : "true",
"standard.token.exchange.enabled" : "false",
"post.logout.redirect.uris" : "https://your-instance.portabase.io",
"oauth2.device.authorization.grant.enabled" : "true",
"pkce.code.challenge.method" : "S256",
"backchannel.logout.revoke.offline.tokens" : "false",
"dpop.bound.access.tokens" : "false"
},
"authenticationFlowBindingOverrides" : { },
"fullScopeAllowed" : true,
"nodeReRegistrationTimeout" : -1,
"defaultClientScopes" : [ "web-origins", "service_account", "acr", "profile", "roles", "basic", "email" ],
"optionalClientScopes" : [ "address", "phone", "organization", "offline_access", "microprofile-jwt" ],
"authorizationSettings" : {
"allowRemoteResourceManagement" : true,
"policyEnforcementMode" : "ENFORCING",
"resources" : [ ],
"policies" : [ ],
"scopes" : [ ],
"decisionStrategy" : "UNANIMOUS"
}
}, { }, {
"id" : "6022c206-5f1f-45b7-af07-74ce6804cbc7", "id" : "6022c206-5f1f-45b7-af07-74ce6804cbc7",
"clientId" : "master-realm", "clientId" : "master-realm",