From d698cf5478f5dfcd1b3590a15e9f93348b7c171c Mon Sep 17 00:00:00 2001 From: Aarnav Tale Date: Wed, 2 Apr 2025 13:40:01 -0400 Subject: [PATCH] fix: open file in a+ to avoid read issues --- app/server/web/sessions.ts | 2 +- config.example.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/server/web/sessions.ts b/app/server/web/sessions.ts index 25e1216..af29ab2 100644 --- a/app/server/web/sessions.ts +++ b/app/server/web/sessions.ts @@ -202,7 +202,7 @@ async function loadUserFile(path: string) { const realPath = resolve(path); try { - const handle = await open(realPath, 'r+'); + const handle = await open(realPath, 'a+'); log.info('config', 'Using user database file at %s', realPath); await handle.close(); } catch (error) { diff --git a/config.example.yaml b/config.example.yaml index 465730b..02ad0d6 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -105,3 +105,7 @@ oidc: # This should point to your publicly accessibly URL # for your Headplane instance with /admin/oidc/callback redirect_uri: "http://localhost:3000/admin/oidc/callback" + + # Stores the users and their permissions for Headplane + # This is a path to a JSON file, default is specified below. + user_storage_file: "/var/lib/headplane/users.json"