diff --git a/CHANGELOG.md b/CHANGELOG.md index 34a8248..b15c054 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +### 0.5.8 (April 3, 2025) +- You can now skip the onboarding page if desired. +- Added the UI to change user roles in the dashboard. +- Fixed an issue where integrations would throw instead of loading properly. +- Loading the ACL page no longer spams blank updates to the Headscale database (fixes [#151](https://github.com/tale/headplane/issues/151)) +- Automatically create `/var/lib/headplane` in the Docker container (fixes [#166](https://github.com/tale/headplane/issues/166)) +- OIDC logout with `disable_api_key_login` set to true will not automatically login again (fixes [#149](https://github.com/tale/headplane/issues/149)) + ### 0.5.7 (April 2, 2025) - Hotfix an issue where assets aren't served under `/admin` or the prefix. diff --git a/app/server/web/sessions.ts b/app/server/web/sessions.ts index 0cc05a0..164dc33 100644 --- a/app/server/web/sessions.ts +++ b/app/server/web/sessions.ts @@ -86,7 +86,11 @@ class Sessionizer { } roleForSubject(subject: string): keyof typeof Roles | undefined { - const role = this.caps[subject].c; + const role = this.caps[subject]?.c; + if (!role) { + return; + } + // We need this in string form based on Object.keys of the roles for (const [key, value] of Object.entries(Roles)) { if (value === role) { @@ -96,7 +100,7 @@ class Sessionizer { } onboardForSubject(subject: string) { - return this.caps[subject].oo ?? false; + return this.caps[subject]?.oo ?? false; } // Given an OR of capabilities, check if the session has the required @@ -201,14 +205,21 @@ class Sessionizer { return false; } - this.caps[subject].c = Roles[role]; + this.caps[subject] = { + ...this.caps[subject], // Preserve the existing capabilities if any + c: Roles[role], + }; + await this.flushUserDatabase(); return true; } // Overrides the onboarding status for a subject async overrideOnboarding(subject: string, onboarding: boolean) { - this.caps[subject].oo = onboarding; + this.caps[subject] = { + ...this.caps[subject], // Preserve the existing capabilities if any + oo: onboarding, + }; await this.flushUserDatabase(); } diff --git a/docs/Integrated-Mode.md b/docs/Integrated-Mode.md index 17d8962..20acc10 100644 --- a/docs/Integrated-Mode.md +++ b/docs/Integrated-Mode.md @@ -34,7 +34,7 @@ Here is what a sample Docker Compose deployment would look like: services: headplane: # I recommend you pin the version to a specific release - image: ghcr.io/tale/headplane:0.5.7 + image: ghcr.io/tale/headplane:0.5.8 container_name: headplane restart: unless-stopped ports: @@ -151,7 +151,7 @@ spec: serviceAccountName: default containers: - name: headplane - image: ghcr.io/tale/headplane:0.5.7 + image: ghcr.io/tale/headplane:0.5.8 env: # Set these if the pod name for Headscale is not static # We will use the downward API to get the pod name instead diff --git a/docs/Simple-Mode.md b/docs/Simple-Mode.md index 8280099..24349cc 100644 --- a/docs/Simple-Mode.md +++ b/docs/Simple-Mode.md @@ -19,7 +19,7 @@ Here is what a sample Docker Compose deployment would look like: services: headplane: # I recommend you pin the version to a specific release - image: ghcr.io/tale/headplane:0.5.7 + image: ghcr.io/tale/headplane:0.5.8 container_name: headplane restart: unless-stopped ports: diff --git a/package.json b/package.json index 710f8ea..cdb6504 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "headplane", "private": true, "sideEffects": false, - "version": "0.5.7", + "version": "0.5.8", "type": "module", "scripts": { "build": "react-router build",