@foss.global/gitmanager 0.3.0 → 0.5.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/changelog.md +22 -0
- package/dist_rust/rustgitmanager_linux_amd64 +0 -0
- package/dist_rust/rustgitmanager_linux_arm64 +0 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.gitmanager.d.ts +7 -1
- package/dist_ts/classes.gitmanager.js +61 -2
- package/dist_ts/models.d.ts +59 -0
- package/dist_ts/rust-gitmanager-bridge.d.ts +7 -1
- package/dist_ts/rust-gitmanager-bridge.js +19 -1
- package/package.json +4 -4
- package/readme.md +108 -5
- package/thirdparty.md +30 -0
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.gitmanager.ts +79 -1
- package/ts/models.ts +70 -0
- package/ts/rust-gitmanager-bridge.ts +41 -0
package/changelog.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-07-20 - 0.5.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- add durable repository bundle export and restore (repository-bundles)
|
|
8
|
+
- Add public createRepositoryBundle and restoreRepositoryBundle APIs across TypeScript and Rust IPC.
|
|
9
|
+
- Stage bundle files in a configurable transferDir with maxBundleBytes validation.
|
|
10
|
+
- Restore bundles atomically with default branch validation and strict repository integrity checks.
|
|
11
|
+
|
|
12
|
+
## 2026-07-20 - 0.4.0
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- add bounded read-only Git Smart HTTP transport (git)
|
|
17
|
+
- Serve clone and fetch through the Rust engine with Git protocol v0, v1, and v2 upload-pack support.
|
|
18
|
+
- Add default-deny repository access, revision-aware visibility updates, loopback-safe binding, transfer concurrency, request/response limits, timeouts, and graceful shutdown.
|
|
19
|
+
- Reject receive-pack and mask unavailable repositories with the same not-found response.
|
|
20
|
+
|
|
21
|
+
### Maintenance
|
|
22
|
+
|
|
23
|
+
- adopt `@foss.global/interfaces` 0.4 and update policy-eligible development tooling versions (tooling)
|
|
24
|
+
|
|
3
25
|
## 2026-06-23 - 0.3.0
|
|
4
26
|
|
|
5
27
|
### Features
|
|
Binary file
|
|
Binary file
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@foss.global/gitmanager',
|
|
6
|
-
version: '0.
|
|
6
|
+
version: '0.5.0',
|
|
7
7
|
description: 'Headless Git manager for the foss.global Git platform, with a TypeScript API and Rust engine.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx5QkFBeUI7SUFDL0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLCtGQUErRjtDQUM3RyxDQUFBIn0=
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as plugins from './plugins.js';
|
|
2
|
-
import type { IGitManagerCommitDetail, IGitManagerCommitRequest, IGitManagerCommitSummary, IGitManagerDiff, IGitManagerDiffRequest, IGitManagerFileContent, IGitManagerImportMirrorRequest, IGitManagerInitBareRepositoryRequest, IGitManagerListCommitsRequest, IGitManagerListTagsRequest, IGitManagerReadFileRequest, IGitManagerRef, IGitManagerRefRequest, IGitManagerRepositoryInfo, IGitManagerStatus, IGitManagerTag, IGitManagerTagRequest, IGitManagerTreeEntry, IGitManagerTreeRequest, IGitManagerOptions } from './models.js';
|
|
2
|
+
import type { IGitManagerCommitDetail, IGitManagerCommitRequest, IGitManagerCommitSummary, IGitManagerDiff, IGitManagerDiffRequest, IGitManagerFileContent, IGitManagerImportMirrorRequest, IGitManagerInitBareRepositoryRequest, IGitManagerListCommitsRequest, IGitManagerListTagsRequest, IGitManagerReadFileRequest, IGitManagerRef, IGitManagerRefRequest, IGitManagerRepositoryBundle, IGitManagerRepositoryInfo, IGitManagerRepositorySelector, IGitManagerRestoreBundleRequest, IGitManagerSmartHttpRepositoryAccess, IGitManagerSmartHttpRepositoryVisibility, IGitManagerStatus, IGitManagerTag, IGitManagerTagRequest, IGitManagerTreeEntry, IGitManagerTreeRequest, IGitManagerOptions } from './models.js';
|
|
3
3
|
export declare class GitManager extends plugins.EventEmitter {
|
|
4
4
|
private bridge;
|
|
5
5
|
private started;
|
|
@@ -10,9 +10,15 @@ export declare class GitManager extends plugins.EventEmitter {
|
|
|
10
10
|
start(): Promise<void>;
|
|
11
11
|
stop(): Promise<void>;
|
|
12
12
|
getStatus(): Promise<IGitManagerStatus>;
|
|
13
|
+
setSmartHttpRepositoryAccess(accessArg: IGitManagerSmartHttpRepositoryAccess): Promise<void>;
|
|
14
|
+
setSmartHttpRepositoryVisibility(visibilityArg: IGitManagerSmartHttpRepositoryVisibility): Promise<void>;
|
|
13
15
|
get running(): boolean;
|
|
14
16
|
initBareRepository(requestArg: IGitManagerInitBareRepositoryRequest): Promise<IGitManagerRepositoryInfo>;
|
|
15
17
|
importMirror(requestArg: IGitManagerImportMirrorRequest): Promise<IGitManagerRepositoryInfo>;
|
|
18
|
+
refreshMirror(requestArg: IGitManagerRepositorySelector): Promise<IGitManagerRepositoryInfo>;
|
|
19
|
+
verifyRepository(requestArg: IGitManagerRepositorySelector): Promise<IGitManagerRepositoryInfo>;
|
|
20
|
+
createRepositoryBundle(requestArg: IGitManagerRepositorySelector): Promise<IGitManagerRepositoryBundle>;
|
|
21
|
+
restoreRepositoryBundle(requestArg: IGitManagerRestoreBundleRequest): Promise<IGitManagerRepositoryInfo>;
|
|
16
22
|
listRepositories(): Promise<IGitManagerRepositoryInfo[]>;
|
|
17
23
|
listRefs(requestArg: IGitManagerRefRequest): Promise<IGitManagerRef[]>;
|
|
18
24
|
listTree(requestArg: IGitManagerTreeRequest): Promise<IGitManagerTreeEntry[]>;
|
|
@@ -7,8 +7,32 @@ export class GitManager extends plugins.EventEmitter {
|
|
|
7
7
|
this.started = false;
|
|
8
8
|
this.startPromise = null;
|
|
9
9
|
this.stopRequested = false;
|
|
10
|
+
const dataDir = optionsArg.dataDir
|
|
11
|
+
?? plugins.path.resolve(process.cwd(), '.nogit', 'gitmanager');
|
|
12
|
+
const smartHttpOptions = optionsArg.smartHttp;
|
|
10
13
|
this.config = {
|
|
11
|
-
dataDir
|
|
14
|
+
dataDir,
|
|
15
|
+
transferDir: optionsArg.transferDir ?? plugins.path.join(dataDir, 'transfers'),
|
|
16
|
+
maxBundleBytes: optionsArg.maxBundleBytes ?? 8 * 1024 * 1024 * 1024,
|
|
17
|
+
smartHttp: smartHttpOptions && smartHttpOptions.enabled !== false
|
|
18
|
+
? {
|
|
19
|
+
bindAddress: smartHttpOptions.bindAddress ?? '127.0.0.1',
|
|
20
|
+
port: smartHttpOptions.port ?? 0,
|
|
21
|
+
allowUnsafeNonLoopback: smartHttpOptions.allowUnsafeNonLoopback ?? false,
|
|
22
|
+
allowAllRepositories: smartHttpOptions.allowAllRepositories ?? false,
|
|
23
|
+
allowedRepositories: smartHttpOptions.allowedRepositories?.map((repository) => ({
|
|
24
|
+
org: repository.org,
|
|
25
|
+
repo: repository.repo,
|
|
26
|
+
})) ?? [],
|
|
27
|
+
maxConcurrentTransfers: smartHttpOptions.maxConcurrentTransfers ?? 32,
|
|
28
|
+
maxRequestBodyBytes: smartHttpOptions.maxRequestBodyBytes ?? 16 * 1024 * 1024,
|
|
29
|
+
maxAdvertisementBytes: smartHttpOptions.maxAdvertisementBytes ?? 4 * 1024 * 1024,
|
|
30
|
+
maxResponseBytes: smartHttpOptions.maxResponseBytes ?? 4 * 1024 * 1024 * 1024,
|
|
31
|
+
processTimeoutMs: smartHttpOptions.processTimeoutMs ?? 30 * 60 * 1000,
|
|
32
|
+
idleTimeoutSeconds: smartHttpOptions.idleTimeoutSeconds ?? 300,
|
|
33
|
+
gracefulShutdownMs: smartHttpOptions.gracefulShutdownMs ?? 10_000,
|
|
34
|
+
}
|
|
35
|
+
: undefined,
|
|
12
36
|
};
|
|
13
37
|
this.bridge.on('exit', (code, signal) => {
|
|
14
38
|
this.started = false;
|
|
@@ -61,6 +85,25 @@ export class GitManager extends plugins.EventEmitter {
|
|
|
61
85
|
}
|
|
62
86
|
return this.bridge.getStatus();
|
|
63
87
|
}
|
|
88
|
+
async setSmartHttpRepositoryAccess(accessArg) {
|
|
89
|
+
this.assertRunning();
|
|
90
|
+
return this.bridge.setSmartHttpRepositoryAccess({
|
|
91
|
+
allowAllRepositories: accessArg.allowAllRepositories,
|
|
92
|
+
allowedRepositories: accessArg.allowedRepositories.map((repository) => ({
|
|
93
|
+
org: repository.org,
|
|
94
|
+
repo: repository.repo,
|
|
95
|
+
})),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
async setSmartHttpRepositoryVisibility(visibilityArg) {
|
|
99
|
+
this.assertRunning();
|
|
100
|
+
return this.bridge.setSmartHttpRepositoryVisibility({
|
|
101
|
+
org: visibilityArg.org,
|
|
102
|
+
repo: visibilityArg.repo,
|
|
103
|
+
public: visibilityArg.public,
|
|
104
|
+
revision: visibilityArg.revision,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
64
107
|
get running() {
|
|
65
108
|
return this.started && this.bridge.running;
|
|
66
109
|
}
|
|
@@ -72,6 +115,22 @@ export class GitManager extends plugins.EventEmitter {
|
|
|
72
115
|
this.assertRunning();
|
|
73
116
|
return this.bridge.importMirror(requestArg);
|
|
74
117
|
}
|
|
118
|
+
async refreshMirror(requestArg) {
|
|
119
|
+
this.assertRunning();
|
|
120
|
+
return this.bridge.refreshMirror(requestArg);
|
|
121
|
+
}
|
|
122
|
+
async verifyRepository(requestArg) {
|
|
123
|
+
this.assertRunning();
|
|
124
|
+
return this.bridge.verifyRepository(requestArg);
|
|
125
|
+
}
|
|
126
|
+
async createRepositoryBundle(requestArg) {
|
|
127
|
+
this.assertRunning();
|
|
128
|
+
return this.bridge.createRepositoryBundle(requestArg);
|
|
129
|
+
}
|
|
130
|
+
async restoreRepositoryBundle(requestArg) {
|
|
131
|
+
this.assertRunning();
|
|
132
|
+
return this.bridge.restoreRepositoryBundle(requestArg);
|
|
133
|
+
}
|
|
75
134
|
async listRepositories() {
|
|
76
135
|
this.assertRunning();
|
|
77
136
|
return this.bridge.listRepositories();
|
|
@@ -143,4 +202,4 @@ export class GitManager extends plugins.EventEmitter {
|
|
|
143
202
|
}
|
|
144
203
|
}
|
|
145
204
|
}
|
|
146
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
205
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3Nlcy5naXRtYW5hZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvY2xhc3Nlcy5naXRtYW5hZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxPQUFPLE1BQU0sY0FBYyxDQUFDO0FBNkJ4QyxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUVuRSxNQUFNLE9BQU8sVUFBVyxTQUFRLE9BQU8sQ0FBQyxZQUFZO0lBT2xELFlBQVksYUFBaUMsRUFBRTtRQUM3QyxLQUFLLEVBQUUsQ0FBQztRQVBGLFdBQU0sR0FBRyxJQUFJLG9CQUFvQixFQUFFLENBQUM7UUFDcEMsWUFBTyxHQUFHLEtBQUssQ0FBQztRQUNoQixpQkFBWSxHQUF5QixJQUFJLENBQUM7UUFDMUMsa0JBQWEsR0FBRyxLQUFLLENBQUM7UUFLNUIsTUFBTSxPQ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@@
|
|
|
1
|
+
import type { IGitManagerRepositorySelector } from '@foss.global/interfaces';
|
|
2
|
+
export interface IGitManagerSmartHttpOptions {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
bindAddress?: string;
|
|
5
|
+
port?: number;
|
|
6
|
+
allowUnsafeNonLoopback?: boolean;
|
|
7
|
+
allowAllRepositories?: boolean;
|
|
8
|
+
allowedRepositories?: IGitManagerRepositorySelector[];
|
|
9
|
+
maxConcurrentTransfers?: number;
|
|
10
|
+
maxRequestBodyBytes?: number;
|
|
11
|
+
maxAdvertisementBytes?: number;
|
|
12
|
+
maxResponseBytes?: number;
|
|
13
|
+
processTimeoutMs?: number;
|
|
14
|
+
idleTimeoutSeconds?: number;
|
|
15
|
+
gracefulShutdownMs?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface IGitManagerSmartHttpRepositoryAccess {
|
|
18
|
+
allowAllRepositories: boolean;
|
|
19
|
+
allowedRepositories: IGitManagerRepositorySelector[];
|
|
20
|
+
}
|
|
21
|
+
export interface IGitManagerSmartHttpRepositoryVisibility extends IGitManagerRepositorySelector {
|
|
22
|
+
public: boolean;
|
|
23
|
+
revision: number;
|
|
24
|
+
}
|
|
25
|
+
export interface IGitManagerRepositoryBundle extends IGitManagerRepositorySelector {
|
|
26
|
+
bundlePath: string;
|
|
27
|
+
sizeBytes: number;
|
|
28
|
+
}
|
|
29
|
+
export interface IGitManagerRestoreBundleRequest extends IGitManagerRepositorySelector {
|
|
30
|
+
bundlePath: string;
|
|
31
|
+
defaultBranch?: string;
|
|
32
|
+
}
|
|
1
33
|
export interface IGitManagerOptions {
|
|
2
34
|
dataDir?: string;
|
|
35
|
+
transferDir?: string;
|
|
36
|
+
maxBundleBytes?: number;
|
|
37
|
+
smartHttp?: IGitManagerSmartHttpOptions;
|
|
38
|
+
}
|
|
39
|
+
export interface IRustGitManagerSmartHttpConfig {
|
|
40
|
+
bindAddress: string;
|
|
41
|
+
port: number;
|
|
42
|
+
allowUnsafeNonLoopback: boolean;
|
|
43
|
+
allowAllRepositories: boolean;
|
|
44
|
+
allowedRepositories: IGitManagerRepositorySelector[];
|
|
45
|
+
maxConcurrentTransfers: number;
|
|
46
|
+
maxRequestBodyBytes: number;
|
|
47
|
+
maxAdvertisementBytes: number;
|
|
48
|
+
maxResponseBytes: number;
|
|
49
|
+
processTimeoutMs: number;
|
|
50
|
+
idleTimeoutSeconds: number;
|
|
51
|
+
gracefulShutdownMs: number;
|
|
3
52
|
}
|
|
4
53
|
export interface IRustGitManagerConfig {
|
|
5
54
|
dataDir: string;
|
|
55
|
+
transferDir: string;
|
|
56
|
+
maxBundleBytes: number;
|
|
57
|
+
smartHttp?: IRustGitManagerSmartHttpConfig;
|
|
58
|
+
}
|
|
59
|
+
export interface IGitManagerSmartHttpStatus {
|
|
60
|
+
running: boolean;
|
|
61
|
+
bindAddress: string;
|
|
62
|
+
port: number;
|
|
63
|
+
baseUrl: string;
|
|
6
64
|
}
|
|
7
65
|
export interface IGitManagerStatus {
|
|
8
66
|
running: boolean;
|
|
9
67
|
dataDir: string;
|
|
10
68
|
uptimeMs: number;
|
|
69
|
+
smartHttp?: IGitManagerSmartHttpStatus;
|
|
11
70
|
}
|
|
12
71
|
export type { IGitManagerCommitDetail, IGitManagerCommitRequest, IGitManagerCommitSummary, IGitManagerDiff, IGitManagerDiffFile, IGitManagerDiffHunk, IGitManagerDiffLine, IGitManagerDiffRequest, IGitManagerDiffStats, IGitManagerFileContent, IGitManagerImportMirrorRequest, IGitManagerInitBareRepositoryRequest, IGitManagerListCommitsRequest, IGitManagerListTagsRequest, IGitManagerReadFileRequest, IGitManagerRef, IGitManagerRefRequest, IGitManagerRepositoryInfo, IGitManagerRepositorySelector, IGitManagerTag, IGitManagerTagRequest, IGitManagerTreeEntry, IGitManagerTreeRequest, TGitManagerDiffFileStatus, TGitManagerDiffLineKind, TGitManagerObjectType, TGitManagerRefType, TGitManagerTreeEntryType, } from '@foss.global/interfaces';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as plugins from './plugins.js';
|
|
2
|
-
import type { IGitManagerCommitDetail, IGitManagerCommitRequest, IGitManagerCommitSummary, IGitManagerDiff, IGitManagerDiffRequest, IGitManagerFileContent, IGitManagerImportMirrorRequest, IGitManagerInitBareRepositoryRequest, IGitManagerListCommitsRequest, IGitManagerListTagsRequest, IGitManagerReadFileRequest, IGitManagerRef, IGitManagerRefRequest, IGitManagerRepositoryInfo, IGitManagerStatus, IGitManagerTag, IGitManagerTagRequest, IGitManagerTreeEntry, IGitManagerTreeRequest, IRustGitManagerConfig } from './models.js';
|
|
2
|
+
import type { IGitManagerCommitDetail, IGitManagerCommitRequest, IGitManagerCommitSummary, IGitManagerDiff, IGitManagerDiffRequest, IGitManagerFileContent, IGitManagerImportMirrorRequest, IGitManagerInitBareRepositoryRequest, IGitManagerListCommitsRequest, IGitManagerListTagsRequest, IGitManagerReadFileRequest, IGitManagerRef, IGitManagerRefRequest, IGitManagerRepositoryBundle, IGitManagerRepositoryInfo, IGitManagerRepositorySelector, IGitManagerRestoreBundleRequest, IGitManagerSmartHttpRepositoryAccess, IGitManagerSmartHttpRepositoryVisibility, IGitManagerStatus, IGitManagerTag, IGitManagerTagRequest, IGitManagerTreeEntry, IGitManagerTreeRequest, IRustGitManagerConfig } from './models.js';
|
|
3
3
|
export declare class RustGitManagerBridge extends plugins.EventEmitter {
|
|
4
4
|
private bridge;
|
|
5
5
|
constructor();
|
|
@@ -9,8 +9,14 @@ export declare class RustGitManagerBridge extends plugins.EventEmitter {
|
|
|
9
9
|
startGitManager(configArg: IRustGitManagerConfig): Promise<void>;
|
|
10
10
|
stopGitManager(): Promise<void>;
|
|
11
11
|
getStatus(): Promise<IGitManagerStatus>;
|
|
12
|
+
setSmartHttpRepositoryAccess(accessArg: IGitManagerSmartHttpRepositoryAccess): Promise<void>;
|
|
13
|
+
setSmartHttpRepositoryVisibility(visibilityArg: IGitManagerSmartHttpRepositoryVisibility): Promise<void>;
|
|
12
14
|
initBareRepository(requestArg: IGitManagerInitBareRepositoryRequest): Promise<IGitManagerRepositoryInfo>;
|
|
13
15
|
importMirror(requestArg: IGitManagerImportMirrorRequest): Promise<IGitManagerRepositoryInfo>;
|
|
16
|
+
refreshMirror(requestArg: IGitManagerRepositorySelector): Promise<IGitManagerRepositoryInfo>;
|
|
17
|
+
verifyRepository(requestArg: IGitManagerRepositorySelector): Promise<IGitManagerRepositoryInfo>;
|
|
18
|
+
createRepositoryBundle(requestArg: IGitManagerRepositorySelector): Promise<IGitManagerRepositoryBundle>;
|
|
19
|
+
restoreRepositoryBundle(requestArg: IGitManagerRestoreBundleRequest): Promise<IGitManagerRepositoryInfo>;
|
|
14
20
|
listRepositories(): Promise<IGitManagerRepositoryInfo[]>;
|
|
15
21
|
listRefs(requestArg: IGitManagerRefRequest): Promise<IGitManagerRef[]>;
|
|
16
22
|
listTree(requestArg: IGitManagerTreeRequest): Promise<IGitManagerTreeEntry[]>;
|
|
@@ -58,12 +58,30 @@ export class RustGitManagerBridge extends plugins.EventEmitter {
|
|
|
58
58
|
async getStatus() {
|
|
59
59
|
return this.bridge.sendCommand('getStatus', {});
|
|
60
60
|
}
|
|
61
|
+
async setSmartHttpRepositoryAccess(accessArg) {
|
|
62
|
+
await this.bridge.sendCommand('setSmartHttpRepositoryAccess', accessArg);
|
|
63
|
+
}
|
|
64
|
+
async setSmartHttpRepositoryVisibility(visibilityArg) {
|
|
65
|
+
await this.bridge.sendCommand('setSmartHttpRepositoryVisibility', visibilityArg);
|
|
66
|
+
}
|
|
61
67
|
async initBareRepository(requestArg) {
|
|
62
68
|
return this.bridge.sendCommand('initBareRepository', requestArg);
|
|
63
69
|
}
|
|
64
70
|
async importMirror(requestArg) {
|
|
65
71
|
return this.bridge.sendCommand('importMirror', requestArg);
|
|
66
72
|
}
|
|
73
|
+
async refreshMirror(requestArg) {
|
|
74
|
+
return this.bridge.sendCommand('refreshMirror', requestArg);
|
|
75
|
+
}
|
|
76
|
+
async verifyRepository(requestArg) {
|
|
77
|
+
return this.bridge.sendCommand('verifyRepository', requestArg);
|
|
78
|
+
}
|
|
79
|
+
async createRepositoryBundle(requestArg) {
|
|
80
|
+
return this.bridge.sendCommand('createRepositoryBundle', requestArg);
|
|
81
|
+
}
|
|
82
|
+
async restoreRepositoryBundle(requestArg) {
|
|
83
|
+
return this.bridge.sendCommand('restoreRepositoryBundle', requestArg);
|
|
84
|
+
}
|
|
67
85
|
async listRepositories() {
|
|
68
86
|
return this.bridge.sendCommand('listRepositories', {});
|
|
69
87
|
}
|
|
@@ -92,4 +110,4 @@ export class RustGitManagerBridge extends plugins.EventEmitter {
|
|
|
92
110
|
return this.bridge.sendCommand('getTag', requestArg);
|
|
93
111
|
}
|
|
94
112
|
}
|
|
95
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
113
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicnVzdC1naXRtYW5hZ2VyLWJyaWRnZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3J1c3QtZ2l0bWFuYWdlci1icmlkZ2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE9BQU8sTUFBTSxjQUFjLENBQUM7QUFvRHhDLFNBQVMsY0FBYztJQUNyQixNQUFNLE9BQU8sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLGFBQWEsQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUM7SUFDakYsT0FBTyxPQUFPLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxPQUFPLEVBQUUsSUFBSSxDQUFDLENBQUM7QUFDN0MsQ0FBQztBQUVELFNBQVMsdUJBQXVCO0lBQzlCLE1BQU0sT0FBTyxHQUEyQixFQUFFLEdBQUcsRUFBRSxPQUFPLEVBQUUsS0FBSy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sQ0FBQyxRQUFRLEVBQUUsVUFBVSxDQUFDLENBQUM7SUFDdkQsQ0FBQztDQUNGIn0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foss.global/gitmanager",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Headless Git manager for the foss.global Git platform, with a TypeScript API and Rust engine.",
|
|
6
6
|
"exports": {
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"author": "Task Venture Capital GmbH",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@foss.global/interfaces": "^0.
|
|
13
|
+
"@foss.global/interfaces": "^0.4.0",
|
|
14
14
|
"@push.rocks/smartrust": "^1.4.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@git.zone/tsbuild": "^4.4.2",
|
|
18
18
|
"@git.zone/tsdoc": "^2.1.1",
|
|
19
|
-
"@git.zone/tsrun": "^2.0.
|
|
19
|
+
"@git.zone/tsrun": "^2.0.5",
|
|
20
20
|
"@git.zone/tsrust": "^1.6.0",
|
|
21
21
|
"@git.zone/tstest": "^3.6.6",
|
|
22
|
-
"@types/node": "^26.
|
|
22
|
+
"@types/node": "^26.1.1"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"ts/**/*",
|
package/readme.md
CHANGED
|
@@ -4,7 +4,7 @@ Headless Git manager for the foss.global Git platform.
|
|
|
4
4
|
|
|
5
5
|
This package follows the push.rocks Rust-backed package pattern: TypeScript owns the public package API and lifecycle, while Rust owns the Git/storage/protocol engine. TypeScript controls the Rust binary through `@push.rocks/smartrust`, and builds use `@git.zone/tsrust`.
|
|
6
6
|
|
|
7
|
-
The current implementation provides lifecycle IPC
|
|
7
|
+
The current implementation provides lifecycle IPC, local bare repository and mirror management, bounded read APIs, durable repository bundle transfer, and a read-only Git Smart HTTP transport for clone and fetch. SSH transport, authenticated private-repository serving, and write/admin features are outside this package's current scope.
|
|
8
8
|
|
|
9
9
|
## Issue Reporting and Security
|
|
10
10
|
|
|
@@ -47,14 +47,117 @@ const readme = await gitManager.readFile({
|
|
|
47
47
|
await gitManager.stop();
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
## Durable repository bundles
|
|
51
|
+
|
|
52
|
+
GitManager can export a repository as a full Git bundle and atomically restore it under a new managed repository identity. Bundle bytes never pass through JSON IPC: Rust writes or reads a temporary file inside the dedicated `transferDir`, and the caller streams that file to or from durable object storage.
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
const gitManager = new GitManager({
|
|
56
|
+
dataDir: '/run/foss-global/gitmanager',
|
|
57
|
+
transferDir: '/run/foss-global/git-transfers',
|
|
58
|
+
maxBundleBytes: 8 * 1024 * 1024 * 1024,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const bundle = await gitManager.createRepositoryBundle({
|
|
62
|
+
org: 'foss.global',
|
|
63
|
+
repo: 'interfaces',
|
|
64
|
+
});
|
|
65
|
+
// Stream bundle.bundlePath to durable object storage, then remove the temporary file.
|
|
66
|
+
|
|
67
|
+
await gitManager.restoreRepositoryBundle({
|
|
68
|
+
org: 'restored',
|
|
69
|
+
repo: 'interfaces',
|
|
70
|
+
bundlePath: '/run/foss-global/git-transfers/downloaded.bundle',
|
|
71
|
+
defaultBranch: 'main',
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`transferDir` defaults to `<dataDir>/transfers`; both paths must be absolute. `maxBundleBytes` defaults to 8 GiB and is enforced after export and before restore. Restore accepts only a direct, non-empty `.bundle` file inside `transferDir`, requires the declared default branch, runs strict full `git fsck`, and moves the restored bare repository into place atomically. Empty repositories have no Git refs and therefore cannot produce a bundle; persist their catalog metadata and recreate them with `initBareRepository()`.
|
|
76
|
+
|
|
77
|
+
The transfer directory is disposable staging, not persistence. The caller owns upload/download completion and removal of finished transfer files. Durable repository bytes belong in managed object storage.
|
|
78
|
+
|
|
79
|
+
## Read-only Git Smart HTTP
|
|
80
|
+
|
|
81
|
+
Smart HTTP is disabled unless a `smartHttp` options object is provided. The safe defaults bind to loopback on an operating-system-assigned port and expose no repositories:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
const gitManager = new GitManager({
|
|
85
|
+
dataDir: '/var/lib/foss-global/gitmanager',
|
|
86
|
+
smartHttp: {
|
|
87
|
+
allowedRepositories: [
|
|
88
|
+
{ org: 'foss.global', repo: 'interfaces' },
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
await gitManager.start();
|
|
94
|
+
const status = await gitManager.getStatus();
|
|
95
|
+
console.log(status.smartHttp?.baseUrl);
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The server implements `git-upload-pack` for clone and fetch with Git protocol versions 0, 1, and 2. `git-receive-pack` is disabled. Missing and inaccessible repositories both return the same not-found response.
|
|
99
|
+
|
|
100
|
+
The transport has no TLS termination or authenticated private-repository access. Keep it on loopback behind a bounded ingress that owns TLS and authentication. Binding to a non-loopback IP is rejected unless `allowUnsafeNonLoopback: true` is set explicitly.
|
|
101
|
+
|
|
102
|
+
Smart HTTP option defaults and accepted ranges:
|
|
103
|
+
|
|
104
|
+
All numeric options must be integers.
|
|
105
|
+
|
|
106
|
+
- `enabled`: enabled when the `smartHttp` object is present unless explicitly `false`.
|
|
107
|
+
- `bindAddress`: `127.0.0.1`; must be an IP address.
|
|
108
|
+
- `port`: `0`, allowing the operating system to select an available port; accepted range 0–65,535.
|
|
109
|
+
- `allowUnsafeNonLoopback`: `false`.
|
|
110
|
+
- `allowAllRepositories`: `false`.
|
|
111
|
+
- `allowedRepositories`: `[]`, with at most 100,000 entries.
|
|
112
|
+
- `maxConcurrentTransfers`: `32`; accepted range 1–1,024.
|
|
113
|
+
- `maxRequestBodyBytes`: 16 MiB; accepted range 1 KiB–64 MiB.
|
|
114
|
+
- `maxAdvertisementBytes`: 4 MiB; accepted range 1 KiB–64 MiB.
|
|
115
|
+
- `maxResponseBytes`: 4 GiB; accepted range 1 MiB–16 TiB.
|
|
116
|
+
- `processTimeoutMs`: 1,800,000; accepted range 1,000–86,400,000.
|
|
117
|
+
- `idleTimeoutSeconds`: `300`; accepted range 1–3,600.
|
|
118
|
+
- `gracefulShutdownMs`: `10,000`; accepted range 100–60,000.
|
|
119
|
+
|
|
120
|
+
While the service is running, access can be replaced atomically:
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
await gitManager.setSmartHttpRepositoryAccess({
|
|
124
|
+
allowAllRepositories: false,
|
|
125
|
+
allowedRepositories: [
|
|
126
|
+
{ org: 'foss.global', repo: 'interfaces' },
|
|
127
|
+
{ org: 'foss.global', repo: 'gitmanager' },
|
|
128
|
+
],
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`setSmartHttpRepositoryAccess()` replaces the complete allow-all/allowlist state and resets per-repository visibility revision watermarks. For ordered visibility events, keep `allowAllRepositories` disabled and update one repository at a time:
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
await gitManager.setSmartHttpRepositoryVisibility({
|
|
136
|
+
org: 'foss.global',
|
|
137
|
+
repo: 'gitmanager',
|
|
138
|
+
public: true,
|
|
139
|
+
revision: 42,
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Use monotonic, non-negative safe integers for `revision`. Stale revisions are ignored, equal revisions are idempotent when their visibility matches, conflicting equal revisions fail, and newer revisions replace the previous visibility state.
|
|
144
|
+
|
|
145
|
+
When enabled, `getStatus().smartHttp` reports `{ running, bindAddress, port, baseUrl }`. The server also exposes `GET /healthz` for a local ingress health check.
|
|
146
|
+
|
|
50
147
|
## Public API
|
|
51
148
|
|
|
52
149
|
- `GitManager`: TypeScript facade for the Rust engine lifecycle.
|
|
53
150
|
- `GitManager.start()`: spawns the Rust binary through `smartrust` and starts the engine.
|
|
54
151
|
- `GitManager.stop()`: asks the engine to stop and always kills the bridge process in cleanup.
|
|
55
|
-
- `GitManager.getStatus()`: returns `{ running, dataDir, uptimeMs }`.
|
|
152
|
+
- `GitManager.getStatus()`: returns `{ running, dataDir, uptimeMs, smartHttp? }`.
|
|
153
|
+
- `GitManager.setSmartHttpRepositoryAccess()`: atomically replaces the running Smart HTTP allow-all/allowlist state.
|
|
154
|
+
- `GitManager.setSmartHttpRepositoryVisibility()`: applies one revision-ordered repository visibility update.
|
|
56
155
|
- `GitManager.initBareRepository()`: creates an empty local bare repository.
|
|
57
156
|
- `GitManager.importMirror()`: imports a remote repository with `git clone --mirror`. Supported remote forms are `https://`, `http://`, `ssh://`, `git://`, `file://`, and SCP-like `git@host:org/repo.git` URLs.
|
|
157
|
+
- `GitManager.refreshMirror()`: atomically fetches and verifies the configured mirror source.
|
|
158
|
+
- `GitManager.verifyRepository()`: runs a strict full integrity check.
|
|
159
|
+
- `GitManager.createRepositoryBundle()`: writes a bounded full Git bundle into `transferDir` and returns its temporary path and size.
|
|
160
|
+
- `GitManager.restoreRepositoryBundle()`: validates and atomically restores a bounded bundle from `transferDir`.
|
|
58
161
|
- `GitManager.listRepositories()`: lists local repositories managed below the configured data directory.
|
|
59
162
|
- `GitManager.listRefs()`: lists branch and tag refs.
|
|
60
163
|
- `GitManager.listTree()`: lists tree entries at a ref and optional path.
|
|
@@ -70,9 +173,9 @@ await gitManager.stop();
|
|
|
70
173
|
|
|
71
174
|
Repository/read DTO contracts are re-exported from the published `@foss.global/interfaces` package.
|
|
72
175
|
|
|
73
|
-
Read/list APIs go through JSON IPC. Git packfile streaming for clone
|
|
176
|
+
Read/list APIs go through JSON IPC. Git packfile streaming for clone and fetch is served directly by the Rust engine through controlled `git upload-pack` subprocesses; packfiles do not pass through JSON IPC. Push is not supported.
|
|
74
177
|
|
|
75
|
-
|
|
178
|
+
Read APIs and Smart HTTP use the system `git` CLI with explicit arguments, non-interactive environment variables, command timeouts, ref-to-object-id resolution, path validation, bounded stdout/stderr capture, ref/tree result caps, and a 1 MiB file read cap.
|
|
76
179
|
|
|
77
180
|
## Rust Build
|
|
78
181
|
|
|
@@ -93,7 +196,7 @@ pnpm run test:rust
|
|
|
93
196
|
pnpm run build
|
|
94
197
|
```
|
|
95
198
|
|
|
96
|
-
`pnpm test` runs the `pretest` hook first, which builds the Rust binaries with `tsrust`, and then runs lifecycle
|
|
199
|
+
`pnpm test` runs the `pretest` hook first, which builds the Rust binaries with `tsrust`, and then runs lifecycle, local mirror/read API, and bounded Smart HTTP clone/fetch tests through `smartrust`.
|
|
97
200
|
|
|
98
201
|
## License and Legal Information
|
|
99
202
|
|
package/thirdparty.md
CHANGED
|
@@ -11,6 +11,9 @@ This package bundles Rust binaries in `dist_rust/`. Those binaries are built fro
|
|
|
11
11
|
| anstyle-query | 1.1.5 | Apache-2.0 OR MIT |
|
|
12
12
|
| anstyle-wincon | 3.0.11 | Apache-2.0 OR MIT |
|
|
13
13
|
| anyhow | 1.0.102 | Apache-2.0 OR MIT |
|
|
14
|
+
| atomic-waker | 1.1.2 | Apache-2.0 OR MIT |
|
|
15
|
+
| axum | 0.8.9 | MIT |
|
|
16
|
+
| axum-core | 0.5.6 | MIT |
|
|
14
17
|
| base64 | 0.22.1 | Apache-2.0 OR MIT |
|
|
15
18
|
| bitflags | 2.13.0 | Apache-2.0 OR MIT |
|
|
16
19
|
| bytes | 1.12.0 | MIT |
|
|
@@ -21,7 +24,21 @@ This package bundles Rust binaries in `dist_rust/`. Those binaries are built fro
|
|
|
21
24
|
| clap_lex | 1.1.0 | Apache-2.0 OR MIT |
|
|
22
25
|
| colorchoice | 1.0.5 | Apache-2.0 OR MIT |
|
|
23
26
|
| errno | 0.3.14 | Apache-2.0 OR MIT |
|
|
27
|
+
| form_urlencoded | 1.2.2 | Apache-2.0 OR MIT |
|
|
28
|
+
| futures-channel | 0.3.33 | Apache-2.0 OR MIT |
|
|
29
|
+
| futures-core | 0.3.33 | Apache-2.0 OR MIT |
|
|
30
|
+
| futures-macro | 0.3.33 | Apache-2.0 OR MIT |
|
|
31
|
+
| futures-sink | 0.3.33 | Apache-2.0 OR MIT |
|
|
32
|
+
| futures-task | 0.3.33 | Apache-2.0 OR MIT |
|
|
33
|
+
| futures-util | 0.3.33 | Apache-2.0 OR MIT |
|
|
24
34
|
| heck | 0.5.0 | Apache-2.0 OR MIT |
|
|
35
|
+
| http | 1.4.2 | Apache-2.0 OR MIT |
|
|
36
|
+
| http-body | 1.1.0 | MIT |
|
|
37
|
+
| http-body-util | 0.1.4 | MIT |
|
|
38
|
+
| httparse | 1.10.1 | Apache-2.0 OR MIT |
|
|
39
|
+
| httpdate | 1.0.3 | Apache-2.0 OR MIT |
|
|
40
|
+
| hyper | 1.10.1 | MIT |
|
|
41
|
+
| hyper-util | 0.1.20 | MIT |
|
|
25
42
|
| is_terminal_polyfill | 1.70.2 | Apache-2.0 OR MIT |
|
|
26
43
|
| itoa | 1.0.18 | Apache-2.0 OR MIT |
|
|
27
44
|
| lazy_static | 1.5.0 | Apache-2.0 OR MIT |
|
|
@@ -29,33 +46,46 @@ This package bundles Rust binaries in `dist_rust/`. Those binaries are built fro
|
|
|
29
46
|
| lock_api | 0.4.14 | Apache-2.0 OR MIT |
|
|
30
47
|
| log | 0.4.33 | Apache-2.0 OR MIT |
|
|
31
48
|
| matchers | 0.2.0 | MIT |
|
|
49
|
+
| matchit | 0.8.4 | BSD-3-Clause AND MIT |
|
|
32
50
|
| memchr | 2.8.2 | MIT OR Unlicense |
|
|
51
|
+
| mime | 0.3.17 | Apache-2.0 OR MIT |
|
|
33
52
|
| mio | 1.2.1 | MIT |
|
|
34
53
|
| nu-ansi-term | 0.50.3 | MIT |
|
|
35
54
|
| once_cell | 1.21.4 | Apache-2.0 OR MIT |
|
|
36
55
|
| once_cell_polyfill | 1.70.2 | Apache-2.0 OR MIT |
|
|
37
56
|
| parking_lot | 0.12.5 | Apache-2.0 OR MIT |
|
|
38
57
|
| parking_lot_core | 0.9.12 | Apache-2.0 OR MIT |
|
|
58
|
+
| percent-encoding | 2.3.2 | Apache-2.0 OR MIT |
|
|
39
59
|
| pin-project-lite | 0.2.17 | Apache-2.0 OR MIT |
|
|
40
60
|
| proc-macro2 | 1.0.106 | Apache-2.0 OR MIT |
|
|
41
61
|
| quote | 1.0.45 | Apache-2.0 OR MIT |
|
|
42
62
|
| redox_syscall | 0.5.18 | MIT |
|
|
43
63
|
| regex-automata | 0.4.14 | Apache-2.0 OR MIT |
|
|
44
64
|
| regex-syntax | 0.8.11 | Apache-2.0 OR MIT |
|
|
65
|
+
| ryu | 1.0.23 | Apache-2.0 OR BSL-1.0 |
|
|
45
66
|
| scopeguard | 1.2.0 | Apache-2.0 OR MIT |
|
|
46
67
|
| serde | 1.0.228 | Apache-2.0 OR MIT |
|
|
47
68
|
| serde_core | 1.0.228 | Apache-2.0 OR MIT |
|
|
48
69
|
| serde_derive | 1.0.228 | Apache-2.0 OR MIT |
|
|
49
70
|
| serde_json | 1.0.150 | Apache-2.0 OR MIT |
|
|
71
|
+
| serde_path_to_error | 0.1.20 | Apache-2.0 OR MIT |
|
|
72
|
+
| serde_urlencoded | 0.7.1 | Apache-2.0 OR MIT |
|
|
50
73
|
| sharded-slab | 0.1.7 | MIT |
|
|
51
74
|
| signal-hook-registry | 1.4.8 | Apache-2.0 OR MIT |
|
|
75
|
+
| slab | 0.4.12 | MIT |
|
|
52
76
|
| smallvec | 1.15.2 | Apache-2.0 OR MIT |
|
|
53
77
|
| socket2 | 0.6.4 | Apache-2.0 OR MIT |
|
|
54
78
|
| strsim | 0.11.1 | MIT |
|
|
55
79
|
| syn | 2.0.118 | Apache-2.0 OR MIT |
|
|
80
|
+
| sync_wrapper | 1.0.2 | Apache-2.0 |
|
|
56
81
|
| thread_local | 1.1.9 | Apache-2.0 OR MIT |
|
|
57
82
|
| tokio | 1.52.3 | MIT |
|
|
58
83
|
| tokio-macros | 2.7.0 | MIT |
|
|
84
|
+
| tokio-stream | 0.1.18 | MIT |
|
|
85
|
+
| tokio-util | 0.7.18 | MIT |
|
|
86
|
+
| tower | 0.5.3 | MIT |
|
|
87
|
+
| tower-layer | 0.3.3 | MIT |
|
|
88
|
+
| tower-service | 0.3.3 | MIT |
|
|
59
89
|
| tracing | 0.1.44 | MIT |
|
|
60
90
|
| tracing-attributes | 0.1.31 | MIT |
|
|
61
91
|
| tracing-core | 0.1.36 | MIT |
|
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/classes.gitmanager.ts
CHANGED
|
@@ -13,7 +13,12 @@ import type {
|
|
|
13
13
|
IGitManagerReadFileRequest,
|
|
14
14
|
IGitManagerRef,
|
|
15
15
|
IGitManagerRefRequest,
|
|
16
|
+
IGitManagerRepositoryBundle,
|
|
16
17
|
IGitManagerRepositoryInfo,
|
|
18
|
+
IGitManagerRepositorySelector,
|
|
19
|
+
IGitManagerRestoreBundleRequest,
|
|
20
|
+
IGitManagerSmartHttpRepositoryAccess,
|
|
21
|
+
IGitManagerSmartHttpRepositoryVisibility,
|
|
17
22
|
IGitManagerStatus,
|
|
18
23
|
IGitManagerTag,
|
|
19
24
|
IGitManagerTagRequest,
|
|
@@ -33,8 +38,32 @@ export class GitManager extends plugins.EventEmitter {
|
|
|
33
38
|
|
|
34
39
|
constructor(optionsArg: IGitManagerOptions = {}) {
|
|
35
40
|
super();
|
|
41
|
+
const dataDir = optionsArg.dataDir
|
|
42
|
+
?? plugins.path.resolve(process.cwd(), '.nogit', 'gitmanager');
|
|
43
|
+
const smartHttpOptions = optionsArg.smartHttp;
|
|
36
44
|
this.config = {
|
|
37
|
-
dataDir
|
|
45
|
+
dataDir,
|
|
46
|
+
transferDir: optionsArg.transferDir ?? plugins.path.join(dataDir, 'transfers'),
|
|
47
|
+
maxBundleBytes: optionsArg.maxBundleBytes ?? 8 * 1024 * 1024 * 1024,
|
|
48
|
+
smartHttp: smartHttpOptions && smartHttpOptions.enabled !== false
|
|
49
|
+
? {
|
|
50
|
+
bindAddress: smartHttpOptions.bindAddress ?? '127.0.0.1',
|
|
51
|
+
port: smartHttpOptions.port ?? 0,
|
|
52
|
+
allowUnsafeNonLoopback: smartHttpOptions.allowUnsafeNonLoopback ?? false,
|
|
53
|
+
allowAllRepositories: smartHttpOptions.allowAllRepositories ?? false,
|
|
54
|
+
allowedRepositories: smartHttpOptions.allowedRepositories?.map((repository) => ({
|
|
55
|
+
org: repository.org,
|
|
56
|
+
repo: repository.repo,
|
|
57
|
+
})) ?? [],
|
|
58
|
+
maxConcurrentTransfers: smartHttpOptions.maxConcurrentTransfers ?? 32,
|
|
59
|
+
maxRequestBodyBytes: smartHttpOptions.maxRequestBodyBytes ?? 16 * 1024 * 1024,
|
|
60
|
+
maxAdvertisementBytes: smartHttpOptions.maxAdvertisementBytes ?? 4 * 1024 * 1024,
|
|
61
|
+
maxResponseBytes: smartHttpOptions.maxResponseBytes ?? 4 * 1024 * 1024 * 1024,
|
|
62
|
+
processTimeoutMs: smartHttpOptions.processTimeoutMs ?? 30 * 60 * 1000,
|
|
63
|
+
idleTimeoutSeconds: smartHttpOptions.idleTimeoutSeconds ?? 300,
|
|
64
|
+
gracefulShutdownMs: smartHttpOptions.gracefulShutdownMs ?? 10_000,
|
|
65
|
+
}
|
|
66
|
+
: undefined,
|
|
38
67
|
};
|
|
39
68
|
this.bridge.on('exit', (code: number | null, signal: string | null) => {
|
|
40
69
|
this.started = false;
|
|
@@ -90,6 +119,31 @@ export class GitManager extends plugins.EventEmitter {
|
|
|
90
119
|
return this.bridge.getStatus();
|
|
91
120
|
}
|
|
92
121
|
|
|
122
|
+
public async setSmartHttpRepositoryAccess(
|
|
123
|
+
accessArg: IGitManagerSmartHttpRepositoryAccess,
|
|
124
|
+
): Promise<void> {
|
|
125
|
+
this.assertRunning();
|
|
126
|
+
return this.bridge.setSmartHttpRepositoryAccess({
|
|
127
|
+
allowAllRepositories: accessArg.allowAllRepositories,
|
|
128
|
+
allowedRepositories: accessArg.allowedRepositories.map((repository) => ({
|
|
129
|
+
org: repository.org,
|
|
130
|
+
repo: repository.repo,
|
|
131
|
+
})),
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
public async setSmartHttpRepositoryVisibility(
|
|
136
|
+
visibilityArg: IGitManagerSmartHttpRepositoryVisibility,
|
|
137
|
+
): Promise<void> {
|
|
138
|
+
this.assertRunning();
|
|
139
|
+
return this.bridge.setSmartHttpRepositoryVisibility({
|
|
140
|
+
org: visibilityArg.org,
|
|
141
|
+
repo: visibilityArg.repo,
|
|
142
|
+
public: visibilityArg.public,
|
|
143
|
+
revision: visibilityArg.revision,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
93
147
|
public get running(): boolean {
|
|
94
148
|
return this.started && this.bridge.running;
|
|
95
149
|
}
|
|
@@ -104,6 +158,30 @@ export class GitManager extends plugins.EventEmitter {
|
|
|
104
158
|
return this.bridge.importMirror(requestArg);
|
|
105
159
|
}
|
|
106
160
|
|
|
161
|
+
public async refreshMirror(requestArg: IGitManagerRepositorySelector): Promise<IGitManagerRepositoryInfo> {
|
|
162
|
+
this.assertRunning();
|
|
163
|
+
return this.bridge.refreshMirror(requestArg);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
public async verifyRepository(requestArg: IGitManagerRepositorySelector): Promise<IGitManagerRepositoryInfo> {
|
|
167
|
+
this.assertRunning();
|
|
168
|
+
return this.bridge.verifyRepository(requestArg);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
public async createRepositoryBundle(
|
|
172
|
+
requestArg: IGitManagerRepositorySelector,
|
|
173
|
+
): Promise<IGitManagerRepositoryBundle> {
|
|
174
|
+
this.assertRunning();
|
|
175
|
+
return this.bridge.createRepositoryBundle(requestArg);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
public async restoreRepositoryBundle(
|
|
179
|
+
requestArg: IGitManagerRestoreBundleRequest,
|
|
180
|
+
): Promise<IGitManagerRepositoryInfo> {
|
|
181
|
+
this.assertRunning();
|
|
182
|
+
return this.bridge.restoreRepositoryBundle(requestArg);
|
|
183
|
+
}
|
|
184
|
+
|
|
107
185
|
public async listRepositories(): Promise<IGitManagerRepositoryInfo[]> {
|
|
108
186
|
this.assertRunning();
|
|
109
187
|
return this.bridge.listRepositories();
|
package/ts/models.ts
CHANGED
|
@@ -1,15 +1,85 @@
|
|
|
1
|
+
import type { IGitManagerRepositorySelector } from '@foss.global/interfaces';
|
|
2
|
+
|
|
3
|
+
export interface IGitManagerSmartHttpOptions {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
bindAddress?: string;
|
|
6
|
+
port?: number;
|
|
7
|
+
allowUnsafeNonLoopback?: boolean;
|
|
8
|
+
allowAllRepositories?: boolean;
|
|
9
|
+
allowedRepositories?: IGitManagerRepositorySelector[];
|
|
10
|
+
maxConcurrentTransfers?: number;
|
|
11
|
+
maxRequestBodyBytes?: number;
|
|
12
|
+
maxAdvertisementBytes?: number;
|
|
13
|
+
maxResponseBytes?: number;
|
|
14
|
+
processTimeoutMs?: number;
|
|
15
|
+
idleTimeoutSeconds?: number;
|
|
16
|
+
gracefulShutdownMs?: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface IGitManagerSmartHttpRepositoryAccess {
|
|
20
|
+
allowAllRepositories: boolean;
|
|
21
|
+
allowedRepositories: IGitManagerRepositorySelector[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface IGitManagerSmartHttpRepositoryVisibility
|
|
25
|
+
extends IGitManagerRepositorySelector {
|
|
26
|
+
public: boolean;
|
|
27
|
+
revision: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface IGitManagerRepositoryBundle
|
|
31
|
+
extends IGitManagerRepositorySelector {
|
|
32
|
+
bundlePath: string;
|
|
33
|
+
sizeBytes: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface IGitManagerRestoreBundleRequest
|
|
37
|
+
extends IGitManagerRepositorySelector {
|
|
38
|
+
bundlePath: string;
|
|
39
|
+
defaultBranch?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
1
42
|
export interface IGitManagerOptions {
|
|
2
43
|
dataDir?: string;
|
|
44
|
+
transferDir?: string;
|
|
45
|
+
maxBundleBytes?: number;
|
|
46
|
+
smartHttp?: IGitManagerSmartHttpOptions;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface IRustGitManagerSmartHttpConfig {
|
|
50
|
+
bindAddress: string;
|
|
51
|
+
port: number;
|
|
52
|
+
allowUnsafeNonLoopback: boolean;
|
|
53
|
+
allowAllRepositories: boolean;
|
|
54
|
+
allowedRepositories: IGitManagerRepositorySelector[];
|
|
55
|
+
maxConcurrentTransfers: number;
|
|
56
|
+
maxRequestBodyBytes: number;
|
|
57
|
+
maxAdvertisementBytes: number;
|
|
58
|
+
maxResponseBytes: number;
|
|
59
|
+
processTimeoutMs: number;
|
|
60
|
+
idleTimeoutSeconds: number;
|
|
61
|
+
gracefulShutdownMs: number;
|
|
3
62
|
}
|
|
4
63
|
|
|
5
64
|
export interface IRustGitManagerConfig {
|
|
6
65
|
dataDir: string;
|
|
66
|
+
transferDir: string;
|
|
67
|
+
maxBundleBytes: number;
|
|
68
|
+
smartHttp?: IRustGitManagerSmartHttpConfig;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface IGitManagerSmartHttpStatus {
|
|
72
|
+
running: boolean;
|
|
73
|
+
bindAddress: string;
|
|
74
|
+
port: number;
|
|
75
|
+
baseUrl: string;
|
|
7
76
|
}
|
|
8
77
|
|
|
9
78
|
export interface IGitManagerStatus {
|
|
10
79
|
running: boolean;
|
|
11
80
|
dataDir: string;
|
|
12
81
|
uptimeMs: number;
|
|
82
|
+
smartHttp?: IGitManagerSmartHttpStatus;
|
|
13
83
|
}
|
|
14
84
|
|
|
15
85
|
export type {
|
|
@@ -13,7 +13,12 @@ import type {
|
|
|
13
13
|
IGitManagerReadFileRequest,
|
|
14
14
|
IGitManagerRef,
|
|
15
15
|
IGitManagerRefRequest,
|
|
16
|
+
IGitManagerRepositoryBundle,
|
|
16
17
|
IGitManagerRepositoryInfo,
|
|
18
|
+
IGitManagerRepositorySelector,
|
|
19
|
+
IGitManagerRestoreBundleRequest,
|
|
20
|
+
IGitManagerSmartHttpRepositoryAccess,
|
|
21
|
+
IGitManagerSmartHttpRepositoryVisibility,
|
|
17
22
|
IGitManagerStatus,
|
|
18
23
|
IGitManagerTag,
|
|
19
24
|
IGitManagerTagRequest,
|
|
@@ -26,8 +31,14 @@ type TGitManagerCommands = {
|
|
|
26
31
|
start: { params: { config: IRustGitManagerConfig }; result: Record<string, never> };
|
|
27
32
|
stop: { params: Record<string, never>; result: Record<string, never> };
|
|
28
33
|
getStatus: { params: Record<string, never>; result: IGitManagerStatus };
|
|
34
|
+
setSmartHttpRepositoryAccess: { params: IGitManagerSmartHttpRepositoryAccess; result: Record<string, never> };
|
|
35
|
+
setSmartHttpRepositoryVisibility: { params: IGitManagerSmartHttpRepositoryVisibility; result: Record<string, never> };
|
|
29
36
|
initBareRepository: { params: IGitManagerInitBareRepositoryRequest; result: IGitManagerRepositoryInfo };
|
|
30
37
|
importMirror: { params: IGitManagerImportMirrorRequest; result: IGitManagerRepositoryInfo };
|
|
38
|
+
refreshMirror: { params: IGitManagerRepositorySelector; result: IGitManagerRepositoryInfo };
|
|
39
|
+
verifyRepository: { params: IGitManagerRepositorySelector; result: IGitManagerRepositoryInfo };
|
|
40
|
+
createRepositoryBundle: { params: IGitManagerRepositorySelector; result: IGitManagerRepositoryBundle };
|
|
41
|
+
restoreRepositoryBundle: { params: IGitManagerRestoreBundleRequest; result: IGitManagerRepositoryInfo };
|
|
31
42
|
listRepositories: { params: Record<string, never>; result: IGitManagerRepositoryInfo[] };
|
|
32
43
|
listRefs: { params: IGitManagerRefRequest; result: IGitManagerRef[] };
|
|
33
44
|
listTree: { params: IGitManagerTreeRequest; result: IGitManagerTreeEntry[] };
|
|
@@ -113,6 +124,16 @@ export class RustGitManagerBridge extends plugins.EventEmitter {
|
|
|
113
124
|
return this.bridge.sendCommand('getStatus', {});
|
|
114
125
|
}
|
|
115
126
|
|
|
127
|
+
public async setSmartHttpRepositoryAccess(accessArg: IGitManagerSmartHttpRepositoryAccess): Promise<void> {
|
|
128
|
+
await this.bridge.sendCommand('setSmartHttpRepositoryAccess', accessArg);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
public async setSmartHttpRepositoryVisibility(
|
|
132
|
+
visibilityArg: IGitManagerSmartHttpRepositoryVisibility,
|
|
133
|
+
): Promise<void> {
|
|
134
|
+
await this.bridge.sendCommand('setSmartHttpRepositoryVisibility', visibilityArg);
|
|
135
|
+
}
|
|
136
|
+
|
|
116
137
|
public async initBareRepository(requestArg: IGitManagerInitBareRepositoryRequest): Promise<IGitManagerRepositoryInfo> {
|
|
117
138
|
return this.bridge.sendCommand('initBareRepository', requestArg);
|
|
118
139
|
}
|
|
@@ -121,6 +142,26 @@ export class RustGitManagerBridge extends plugins.EventEmitter {
|
|
|
121
142
|
return this.bridge.sendCommand('importMirror', requestArg);
|
|
122
143
|
}
|
|
123
144
|
|
|
145
|
+
public async refreshMirror(requestArg: IGitManagerRepositorySelector): Promise<IGitManagerRepositoryInfo> {
|
|
146
|
+
return this.bridge.sendCommand('refreshMirror', requestArg);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
public async verifyRepository(requestArg: IGitManagerRepositorySelector): Promise<IGitManagerRepositoryInfo> {
|
|
150
|
+
return this.bridge.sendCommand('verifyRepository', requestArg);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
public async createRepositoryBundle(
|
|
154
|
+
requestArg: IGitManagerRepositorySelector,
|
|
155
|
+
): Promise<IGitManagerRepositoryBundle> {
|
|
156
|
+
return this.bridge.sendCommand('createRepositoryBundle', requestArg);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
public async restoreRepositoryBundle(
|
|
160
|
+
requestArg: IGitManagerRestoreBundleRequest,
|
|
161
|
+
): Promise<IGitManagerRepositoryInfo> {
|
|
162
|
+
return this.bridge.sendCommand('restoreRepositoryBundle', requestArg);
|
|
163
|
+
}
|
|
164
|
+
|
|
124
165
|
public async listRepositories(): Promise<IGitManagerRepositoryInfo[]> {
|
|
125
166
|
return this.bridge.sendCommand('listRepositories', {});
|
|
126
167
|
}
|