@jmanuelcorral/bond-app 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +280 -23
- package/app/brand/TOKENS.md +5 -5
- package/app/layouts/bond.json +10 -14
- package/app/mods/bond-agents/api.js +35 -0
- package/app/mods/bond-agents/branch.svg +1 -0
- package/app/mods/bond-agents/brand.js +53 -2
- package/app/mods/bond-agents/config.js +4 -0
- package/app/mods/bond-agents/eye-off.svg +1 -0
- package/app/mods/bond-agents/eye.svg +1 -0
- package/app/mods/bond-agents/main.js +308 -327
- package/app/mods/bond-agents/model.js +376 -5
- package/app/mods/bond-board/api.js +35 -0
- package/app/mods/bond-board/branch.svg +1 -0
- package/app/mods/bond-board/brand.js +53 -2
- package/app/mods/bond-board/config.js +4 -0
- package/app/mods/bond-board/main.js +1000 -449
- package/app/mods/bond-board/model.js +170 -28
- package/app/mods/bond-pane/close.svg +1 -0
- package/app/mods/bond-pane/hide.svg +1 -0
- package/app/mods/bond-pane/main.js +103 -0
- package/app/mods/bond-pane/mod.json +1 -0
- package/app/mods/bond-pane/model.js +18 -0
- package/app/mods/bond-pane/split-down.svg +1 -0
- package/app/mods/bond-pane/split-right.svg +1 -0
- package/app/mods/bond-pane/unzoom.svg +1 -0
- package/app/mods/bond-pane/zoom.svg +1 -0
- package/app/mods/bond-settings/api.js +35 -0
- package/app/mods/bond-settings/brand.js +53 -2
- package/app/mods/bond-settings/config.js +4 -0
- package/app/mods/bond-settings/main.js +1216 -272
- package/app/mods/bond-settings/mod.json +1 -1
- package/app/mods/bond-status/api.js +35 -0
- package/app/mods/bond-status/brand.js +53 -2
- package/app/mods/bond-status/config.js +4 -0
- package/app/mods/bond-status/main.js +37 -15
- package/app/mods/bond-status/model.js +19 -1
- package/app/mods/bond-tabs/brand.js +53 -2
- package/app/mods/bond-tabs/main.js +45 -3
- package/app/mods/bond-titlebar/brand.js +53 -2
- package/app/mods/bond-titlebar/main.js +85 -29
- package/app/mods/bond-titlebar/version.js +3 -0
- package/app/themes/bond-dark.json +5 -5
- package/app/themes/bond-light.json +5 -5
- package/package.json +1 -1
- package/runner/Dockerfile +16 -2
- package/runner/SPIKE-BOND.md +6 -2
- package/runner/entrypoint.sh +16 -0
- package/runner/setup.sh +439 -8
- package/runner/versions.env +32 -1
- package/scripts/app-install.ts +322 -27
- package/src/cli.ts +562 -21
- package/src/config.ts +15 -3
- package/src/core/agy-login.ts +683 -0
- package/src/core/delivery.ts +125 -6
- package/src/core/doctor.ts +748 -0
- package/src/core/hub-session.ts +108 -91
- package/src/core/hub.ts +40 -8
- package/src/core/orchestrator.ts +1481 -187
- package/src/core/paths.ts +107 -0
- package/src/core/permissions.ts +143 -0
- package/src/core/pr-source.ts +147 -0
- package/src/core/repo-host.ts +60 -0
- package/src/core/service-windows.ts +180 -0
- package/src/core/service.ts +861 -0
- package/src/core/setup-install.ts +1380 -0
- package/src/core/setup.ts +62 -1
- package/src/core/watchdog.ts +6 -6
- package/src/db/database.ts +54 -7
- package/src/db/settings-repo.ts +332 -7
- package/src/db/ticket-repo.ts +73 -25
- package/src/index.ts +4 -4
- package/src/runner/azure-devops-client.ts +273 -0
- package/src/runner/docker-client.ts +93 -9
- package/src/runner/github-client.ts +148 -3
- package/src/runner/hc-client.ts +33 -5
- package/src/runner/image-builder.ts +123 -5
- package/src/runner/jira-client.ts +368 -0
- package/src/runner/tool-catalog.ts +84 -0
- package/src/server/app.ts +467 -8
- package/src/types.ts +140 -2
package/src/config.ts
CHANGED
|
@@ -2,6 +2,8 @@ import path from 'node:path';
|
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import crypto from 'node:crypto';
|
|
5
|
+
import { defaultDataDir } from './core/paths.ts';
|
|
6
|
+
import { restrictPathSync } from './core/permissions.ts';
|
|
5
7
|
|
|
6
8
|
export interface AppConfig {
|
|
7
9
|
port: number;
|
|
@@ -77,15 +79,20 @@ export function getOrCreateAuthToken(dataDir: string): string {
|
|
|
77
79
|
if (dataDir === ':memory:') {
|
|
78
80
|
return 'test-token-in-memory-mode-1234567890';
|
|
79
81
|
}
|
|
80
|
-
// N8: Only apply mode 0700 if creating the directory; do not alter pre-existing dirs
|
|
82
|
+
// N8: Only apply mode 0700 / user ACL if creating the directory; do not alter pre-existing dirs
|
|
81
83
|
if (!fs.existsSync(dataDir)) {
|
|
82
84
|
fs.mkdirSync(dataDir, { recursive: true, mode: 0o700 });
|
|
85
|
+
try {
|
|
86
|
+
restrictPathSync(dataDir, 0o700);
|
|
87
|
+
} catch {
|
|
88
|
+
// ignore
|
|
89
|
+
}
|
|
83
90
|
}
|
|
84
91
|
|
|
85
92
|
const tokenPath = path.join(dataDir, 'token');
|
|
86
93
|
if (fs.existsSync(tokenPath)) {
|
|
87
94
|
try {
|
|
88
|
-
|
|
95
|
+
restrictPathSync(tokenPath, 0o600);
|
|
89
96
|
} catch {
|
|
90
97
|
// ignore
|
|
91
98
|
}
|
|
@@ -94,11 +101,16 @@ export function getOrCreateAuthToken(dataDir: string): string {
|
|
|
94
101
|
|
|
95
102
|
const token = crypto.randomBytes(32).toString('hex');
|
|
96
103
|
fs.writeFileSync(tokenPath, token, { encoding: 'utf8', mode: 0o600 });
|
|
104
|
+
try {
|
|
105
|
+
restrictPathSync(tokenPath, 0o600);
|
|
106
|
+
} catch {
|
|
107
|
+
// ignore
|
|
108
|
+
}
|
|
97
109
|
return token;
|
|
98
110
|
}
|
|
99
111
|
|
|
100
112
|
export function loadConfig(overrides: Partial<AppConfig> = {}): AppConfig {
|
|
101
|
-
const dataDir = overrides.dataDir ||
|
|
113
|
+
const dataDir = overrides.dataDir || defaultDataDir();
|
|
102
114
|
const host = overrides.host || process.env.BOND_APP_HOST || '127.0.0.1';
|
|
103
115
|
|
|
104
116
|
// D13: refuse to start on non-loopback interface
|