Fixes persmission issue for eth.key on windows

This commit is contained in:
Ben 2025-05-26 09:37:59 +02:00
parent 79faa827af
commit 29997f6009
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
3 changed files with 4 additions and 2 deletions

View File

@ -34,6 +34,8 @@ export class EthersService {
const username = this.os.getUsername();
this.shell.run(`icacls ${paths.key} /inheritance:r >nul 2>&1`);
this.shell.run(`icacls ${paths.key} /grant:r ${username}:F >nul 2>&1`);
this.shell.run(`icacls ${paths.key} /remove SYSTEM >nul 2>&1`);
this.shell.run(`icacls ${paths.key} /remove Administrators >nul 2>&1`);
} else {
this.shell.run(`chmod 600 "${paths.key}"`);
}

View File

@ -61,7 +61,7 @@ export class MainMenu {
action: this.stopCodex,
},
{
label: "Exit",
label: "Exit (Codex keeps running)",
action: this.loop.stopLoop,
},
]);

View File

@ -110,7 +110,7 @@ describe("mainmenu", () => {
[
{ label: "Open Codex app", action: mockCodexApp.openCodexApp },
{ label: "Stop Codex", action: mainmenu.stopCodex },
{ label: "Exit", action: mockMenuLoop.stopLoop },
{ label: "Exit (Codex keeps running)", action: mockMenuLoop.stopLoop },
],
);
});