@rizom/ops 0.2.0-alpha.2 → 0.2.0-alpha.200
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 +9 -3
- package/dist/age-key-bootstrap.d.ts +17 -0
- package/dist/brains-ops.js +288 -173
- package/dist/cert-bootstrap.d.ts +24 -0
- package/dist/content-repo-ref.d.ts +10 -0
- package/dist/content-repo.d.ts +13 -0
- package/dist/default-user-runner.d.ts +1 -1
- package/dist/deploy.js +99 -166
- package/dist/entries/deploy.d.ts +3 -2
- package/dist/images.d.ts +76 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +289 -173
- package/dist/load-registry.d.ts +38 -3
- package/dist/observed-status.d.ts +12 -0
- package/dist/onboard-user.d.ts +2 -2
- package/dist/origin-ca.d.ts +1 -0
- package/dist/parse-args.d.ts +4 -0
- package/dist/push-secrets.d.ts +2 -0
- package/dist/push-target.d.ts +1 -0
- package/dist/reconcile-all.d.ts +2 -2
- package/dist/reconcile-cohort.d.ts +2 -2
- package/dist/reconcile-lib.d.ts +4 -2
- package/dist/run-command.d.ts +8 -2
- package/dist/run-subprocess.d.ts +1 -0
- package/dist/schema.d.ts +68 -64
- package/dist/secrets-encrypt.d.ts +24 -0
- package/dist/secrets-push.d.ts +2 -5
- package/dist/ssh-key-bootstrap.d.ts +1 -0
- package/dist/user-add.d.ts +15 -0
- package/dist/user-runner.d.ts +5 -0
- package/dist/verify-user.d.ts +19 -0
- package/package.json +44 -40
- package/templates/rover-pilot/.env.schema +21 -2
- package/templates/rover-pilot/.github/workflows/build.yml +65 -17
- package/templates/rover-pilot/.github/workflows/deploy.yml +150 -45
- package/templates/rover-pilot/.github/workflows/reconcile.yml +22 -2
- package/templates/rover-pilot/README.md +8 -3
- package/templates/rover-pilot/deploy/scripts/decrypt-user-secrets.ts +119 -0
- package/templates/rover-pilot/deploy/scripts/helpers.ts +3 -0
- package/templates/rover-pilot/deploy/scripts/provision-server.ts +1 -1
- package/templates/rover-pilot/deploy/scripts/resolve-deploy-handles.ts +15 -4
- package/templates/rover-pilot/deploy/scripts/resolve-missing-images.ts +13 -0
- package/templates/rover-pilot/deploy/scripts/resolve-user-config.ts +68 -14
- package/templates/rover-pilot/deploy/scripts/sync-content-repo.ts +183 -0
- package/templates/rover-pilot/deploy/scripts/update-dns.ts +14 -4
- package/templates/rover-pilot/deploy/scripts/validate-secrets.ts +1 -1
- package/templates/rover-pilot/docs/onboarding-checklist.md +43 -8
- package/templates/rover-pilot/docs/operator-playbook.md +182 -0
- package/templates/rover-pilot/docs/user-onboarding.md +119 -0
- package/templates/rover-pilot/package.json +3 -0
- package/templates/rover-pilot/pilot.yaml +3 -0
- package/templates/rover-pilot/users/alice.yaml +5 -1
- package/dist/user-secret-names.d.ts +0 -6
- package/templates/rover-pilot/.kamal/hooks/pre-deploy +0 -9
- package/templates/rover-pilot/deploy/Dockerfile +0 -15
- package/templates/rover-pilot/deploy/kamal/deploy.yml +0 -39
package/dist/load-registry.d.ts
CHANGED
|
@@ -13,6 +13,35 @@ export interface ResolvedCohort {
|
|
|
13
13
|
brainVersionOverride?: string;
|
|
14
14
|
presetOverride?: PilotPreset;
|
|
15
15
|
aiApiKeyOverride?: string;
|
|
16
|
+
gitSyncTokenOverride?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ResolvedAnchorProfileSocialLink {
|
|
19
|
+
platform: "github" | "instagram" | "linkedin" | "email" | "website";
|
|
20
|
+
url: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ResolvedAnchorProfile {
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
website?: string;
|
|
27
|
+
email?: string;
|
|
28
|
+
story?: string;
|
|
29
|
+
socialLinks?: ResolvedAnchorProfileSocialLink[];
|
|
30
|
+
}
|
|
31
|
+
export interface ResolvedSetupDelivery {
|
|
32
|
+
delivery: "email";
|
|
33
|
+
email: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ResolvedAtprotoConfig {
|
|
36
|
+
identifier: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ResolvedPlaybooksConfig {
|
|
39
|
+
onboarding?: boolean | undefined;
|
|
40
|
+
}
|
|
41
|
+
export interface ResolvedSiteOverride {
|
|
42
|
+
package: string;
|
|
43
|
+
version: string;
|
|
44
|
+
theme?: string | undefined;
|
|
16
45
|
}
|
|
17
46
|
export interface ResolvedUserIdentity {
|
|
18
47
|
handle: string;
|
|
@@ -21,9 +50,18 @@ export interface ResolvedUserIdentity {
|
|
|
21
50
|
model: "rover";
|
|
22
51
|
preset: PilotPreset;
|
|
23
52
|
domain: string;
|
|
53
|
+
cloudflareZoneId?: string | undefined;
|
|
24
54
|
contentRepo: string;
|
|
55
|
+
addOverride?: string[];
|
|
56
|
+
siteOverride?: ResolvedSiteOverride;
|
|
25
57
|
discordEnabled: boolean;
|
|
58
|
+
discordAnchorUserId?: string;
|
|
26
59
|
effectiveAiApiKey: string;
|
|
60
|
+
effectiveGitSyncToken: string;
|
|
61
|
+
setup?: ResolvedSetupDelivery;
|
|
62
|
+
atproto?: ResolvedAtprotoConfig;
|
|
63
|
+
playbooks?: ResolvedPlaybooksConfig;
|
|
64
|
+
anchorProfile: ResolvedAnchorProfile;
|
|
27
65
|
snapshotStatus: SnapshotStatus;
|
|
28
66
|
}
|
|
29
67
|
export interface ResolvedUser extends ResolvedUserIdentity {
|
|
@@ -40,7 +78,4 @@ export interface PilotRegistry {
|
|
|
40
78
|
cohorts: ResolvedCohort[];
|
|
41
79
|
users: ResolvedUser[];
|
|
42
80
|
}
|
|
43
|
-
declare class PilotRegistryError extends Error {
|
|
44
|
-
}
|
|
45
81
|
export declare function loadPilotRegistry(rootDir: string, options?: LoadPilotRegistryOptions): Promise<PilotRegistry>;
|
|
46
|
-
export { PilotRegistryError };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FetchLike } from "@brains/deploy-support/origin-ca";
|
|
2
|
+
import type { ObservedUserStatus, ResolvedUserIdentity } from "./load-registry";
|
|
3
|
+
export interface LookupResult {
|
|
4
|
+
address: string;
|
|
5
|
+
family: number;
|
|
6
|
+
}
|
|
7
|
+
export type LookupHost = (hostname: string) => Promise<LookupResult>;
|
|
8
|
+
export interface CreateObservedStatusResolverOptions {
|
|
9
|
+
fetchImpl?: FetchLike;
|
|
10
|
+
lookupHost?: LookupHost;
|
|
11
|
+
}
|
|
12
|
+
export declare function createObservedStatusResolver(options?: CreateObservedStatusResolverOptions): (user: ResolvedUserIdentity) => Promise<ObservedUserStatus>;
|
package/dist/onboard-user.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type UserRunner } from "./reconcile-lib";
|
|
2
|
-
export declare function onboardUser(rootDir: string, handle: string, runner?: UserRunner): Promise<void>;
|
|
1
|
+
import { type UserRunner, type ContentRepoSyncOptions } from "./reconcile-lib";
|
|
2
|
+
export declare function onboardUser(rootDir: string, handle: string, runner?: UserRunner, contentRepoOptions?: ContentRepoSyncOptions): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createOriginCertificateRequest, generateOriginKeyPair, issueCloudflareOriginCertificate, setCloudflareZoneSslStrict, type CloudflareOriginCaResult, type FetchLike, type OriginCertificateRequest, type OriginKeyPair, } from "@brains/deploy-support/origin-ca";
|
package/dist/parse-args.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ export interface ParsedArgs {
|
|
|
5
5
|
help?: boolean | undefined;
|
|
6
6
|
version?: boolean | undefined;
|
|
7
7
|
dryRun?: boolean | undefined;
|
|
8
|
+
pushTo?: string | undefined;
|
|
9
|
+
cohort?: string | undefined;
|
|
10
|
+
anchorId?: string | undefined;
|
|
11
|
+
handle?: string | undefined;
|
|
8
12
|
};
|
|
9
13
|
}
|
|
10
14
|
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { normalizePushTarget, type PushTarget, } from "@brains/deploy-support/push-target";
|
package/dist/reconcile-all.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type UserRunner } from "./reconcile-lib";
|
|
2
|
-
export declare function reconcileAll(rootDir: string, runner?: UserRunner): Promise<void>;
|
|
1
|
+
import { type UserRunner, type ContentRepoSyncOptions } from "./reconcile-lib";
|
|
2
|
+
export declare function reconcileAll(rootDir: string, runner?: UserRunner, contentRepoOptions?: ContentRepoSyncOptions): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type UserRunner } from "./reconcile-lib";
|
|
2
|
-
export declare function reconcileCohort(rootDir: string, cohortId: string, runner?: UserRunner): Promise<void>;
|
|
1
|
+
import { type UserRunner, type ContentRepoSyncOptions } from "./reconcile-lib";
|
|
2
|
+
export declare function reconcileCohort(rootDir: string, cohortId: string, runner?: UserRunner, contentRepoOptions?: ContentRepoSyncOptions): Promise<void>;
|
package/dist/reconcile-lib.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { type ContentRepoSyncOptions } from "./content-repo";
|
|
1
2
|
import { type PilotRegistry, type ResolvedUser } from "./load-registry";
|
|
2
3
|
import type { UserRunner } from "./user-runner";
|
|
3
|
-
export type {
|
|
4
|
-
export
|
|
4
|
+
export type { ContentRepoSyncOptions } from "./content-repo";
|
|
5
|
+
export type { ContentRepoFile, UserRunResult, UserRunner } from "./user-runner";
|
|
6
|
+
export declare function runUsers(rootDir: string, registry: PilotRegistry, users: ResolvedUser[], runner?: UserRunner, contentRepoOptions?: ContentRepoSyncOptions): Promise<void>;
|
|
5
7
|
export declare function findUser(rootDir: string, handle: string): Promise<{
|
|
6
8
|
registry: PilotRegistry;
|
|
7
9
|
user: ResolvedUser;
|
package/dist/run-command.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import type { FetchLike } from "@brains/deploy-support/origin-ca";
|
|
1
2
|
import type { LoadPilotRegistryOptions } from "./load-registry";
|
|
3
|
+
import { type LookupHost } from "./observed-status";
|
|
2
4
|
import type { ParsedArgs } from "./parse-args";
|
|
3
|
-
import { type RunCommand as
|
|
5
|
+
import { type RunCommand as OpsRunCommand } from "./run-subprocess";
|
|
6
|
+
import { type SshKeygen } from "./ssh-key-bootstrap";
|
|
4
7
|
import type { UserRunner } from "./user-runner";
|
|
5
8
|
export interface CommandResult {
|
|
6
9
|
success: boolean;
|
|
@@ -10,6 +13,9 @@ export interface CommandDependencies extends LoadPilotRegistryOptions {
|
|
|
10
13
|
runner?: UserRunner;
|
|
11
14
|
env?: NodeJS.ProcessEnv | undefined;
|
|
12
15
|
logger?: ((message: string) => void) | undefined;
|
|
13
|
-
|
|
16
|
+
fetchImpl?: FetchLike | undefined;
|
|
17
|
+
lookupHost?: LookupHost | undefined;
|
|
18
|
+
bootstrapRunCommand?: OpsRunCommand | undefined;
|
|
19
|
+
sshKeygen?: SshKeygen | undefined;
|
|
14
20
|
}
|
|
15
21
|
export declare function runCommand(parsed: ParsedArgs, dependencies?: CommandDependencies): Promise<CommandResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { runSubprocess, type RunCommand, } from "@brains/deploy-support/run-subprocess";
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { z } from "@brains/utils";
|
|
2
|
-
export declare const presetSchema: z.ZodEnum<
|
|
1
|
+
import { z } from "@brains/utils/zod";
|
|
2
|
+
export declare const presetSchema: z.ZodEnum<{
|
|
3
|
+
core: "core";
|
|
4
|
+
default: "default";
|
|
5
|
+
pro: "pro";
|
|
6
|
+
}>;
|
|
3
7
|
export declare const exactVersionSchema: z.ZodString;
|
|
4
8
|
export declare const handleSchema: z.ZodString;
|
|
5
9
|
export declare const secretNameSchema: z.ZodString;
|
|
10
|
+
export declare const agePublicKeySchema: z.ZodString;
|
|
6
11
|
export declare const pilotSchema: z.ZodObject<{
|
|
7
12
|
schemaVersion: z.ZodLiteral<1>;
|
|
8
13
|
brainVersion: z.ZodString;
|
|
@@ -10,77 +15,76 @@ export declare const pilotSchema: z.ZodObject<{
|
|
|
10
15
|
githubOrg: z.ZodString;
|
|
11
16
|
contentRepoPrefix: z.ZodString;
|
|
12
17
|
domainSuffix: z.ZodString;
|
|
13
|
-
preset:
|
|
18
|
+
preset: typeof presetSchema;
|
|
14
19
|
aiApiKey: z.ZodString;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
gitSyncToken: z.ZodString;
|
|
21
|
+
contentRepoAdminToken: z.ZodString;
|
|
22
|
+
agePublicKey: z.ZodString;
|
|
23
|
+
}>;
|
|
24
|
+
declare const anchorProfileSocialLinkSchema: z.ZodObject<{
|
|
25
|
+
platform: z.ZodEnum<{
|
|
26
|
+
github: "github";
|
|
27
|
+
instagram: "instagram";
|
|
28
|
+
linkedin: "linkedin";
|
|
29
|
+
email: "email";
|
|
30
|
+
website: "website";
|
|
31
|
+
}>;
|
|
32
|
+
url: z.ZodString;
|
|
33
|
+
label: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}>;
|
|
35
|
+
declare const anchorProfileSchema: z.ZodObject<{
|
|
36
|
+
name: z.ZodOptional<z.ZodString>;
|
|
37
|
+
description: z.ZodOptional<z.ZodString>;
|
|
38
|
+
website: z.ZodOptional<z.ZodString>;
|
|
39
|
+
email: z.ZodOptional<z.ZodString>;
|
|
40
|
+
story: z.ZodOptional<z.ZodString>;
|
|
41
|
+
socialLinks: z.ZodOptional<z.ZodArray<typeof anchorProfileSocialLinkSchema>>;
|
|
42
|
+
}>;
|
|
43
|
+
declare const setupDeliverySchema: z.ZodObject<{
|
|
44
|
+
delivery: z.ZodLiteral<"email">;
|
|
45
|
+
email: z.ZodString;
|
|
46
|
+
}>;
|
|
47
|
+
declare const atprotoSchema: z.ZodObject<{
|
|
48
|
+
identifier: z.ZodString;
|
|
49
|
+
}>;
|
|
50
|
+
declare const siteOverrideSchema: z.ZodObject<{
|
|
51
|
+
package: z.ZodString;
|
|
52
|
+
version: typeof exactVersionSchema;
|
|
53
|
+
theme: z.ZodOptional<z.ZodString>;
|
|
54
|
+
}>;
|
|
55
|
+
declare const playbooksSchema: z.ZodObject<{
|
|
56
|
+
onboarding: z.ZodOptional<z.ZodBoolean>;
|
|
33
57
|
}>;
|
|
34
58
|
export declare const userSchema: z.ZodObject<{
|
|
35
59
|
handle: z.ZodString;
|
|
36
60
|
discord: z.ZodObject<{
|
|
37
61
|
enabled: z.ZodBoolean;
|
|
38
|
-
|
|
39
|
-
enabled: boolean;
|
|
40
|
-
}, {
|
|
41
|
-
enabled: boolean;
|
|
62
|
+
anchorUserId: z.ZodOptional<z.ZodString>;
|
|
42
63
|
}>;
|
|
43
64
|
aiApiKeyOverride: z.ZodOptional<z.ZodString>;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
};
|
|
55
|
-
aiApiKeyOverride?: string | undefined;
|
|
65
|
+
gitSyncTokenOverride: z.ZodOptional<z.ZodString>;
|
|
66
|
+
domainOverride: z.ZodOptional<z.ZodString>;
|
|
67
|
+
cloudflareZoneId: z.ZodOptional<z.ZodString>;
|
|
68
|
+
contentRepoOverride: z.ZodOptional<z.ZodString>;
|
|
69
|
+
addOverride: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
+
siteOverride: z.ZodOptional<typeof siteOverrideSchema>;
|
|
71
|
+
setup: z.ZodOptional<typeof setupDeliverySchema>;
|
|
72
|
+
atproto: z.ZodOptional<typeof atprotoSchema>;
|
|
73
|
+
playbooks: z.ZodOptional<typeof playbooksSchema>;
|
|
74
|
+
anchorProfile: z.ZodOptional<typeof anchorProfileSchema>;
|
|
56
75
|
}>;
|
|
57
|
-
export declare const cohortSchema: z.
|
|
58
|
-
members: z.ZodArray<z.ZodString
|
|
76
|
+
export declare const cohortSchema: z.ZodObject<{
|
|
77
|
+
members: z.ZodArray<z.ZodString>;
|
|
59
78
|
brainVersionOverride: z.ZodOptional<z.ZodString>;
|
|
60
|
-
presetOverride: z.ZodOptional<
|
|
79
|
+
presetOverride: z.ZodOptional<typeof presetSchema>;
|
|
61
80
|
aiApiKeyOverride: z.ZodOptional<z.ZodString>;
|
|
62
|
-
|
|
63
|
-
members: string[];
|
|
64
|
-
aiApiKeyOverride?: string | undefined;
|
|
65
|
-
brainVersionOverride?: string | undefined;
|
|
66
|
-
presetOverride?: "core" | "default" | "pro" | undefined;
|
|
67
|
-
}, {
|
|
68
|
-
members: string[];
|
|
69
|
-
aiApiKeyOverride?: string | undefined;
|
|
70
|
-
brainVersionOverride?: string | undefined;
|
|
71
|
-
presetOverride?: "core" | "default" | "pro" | undefined;
|
|
72
|
-
}>, {
|
|
73
|
-
members: string[];
|
|
74
|
-
aiApiKeyOverride?: string | undefined;
|
|
75
|
-
brainVersionOverride?: string | undefined;
|
|
76
|
-
presetOverride?: "core" | "default" | "pro" | undefined;
|
|
77
|
-
}, {
|
|
78
|
-
members: string[];
|
|
79
|
-
aiApiKeyOverride?: string | undefined;
|
|
80
|
-
brainVersionOverride?: string | undefined;
|
|
81
|
-
presetOverride?: "core" | "default" | "pro" | undefined;
|
|
81
|
+
gitSyncTokenOverride: z.ZodOptional<z.ZodString>;
|
|
82
82
|
}>;
|
|
83
|
-
export type PilotConfig = z.
|
|
84
|
-
export type
|
|
85
|
-
export type
|
|
86
|
-
export type
|
|
83
|
+
export type PilotConfig = z.output<typeof pilotSchema>;
|
|
84
|
+
export type PilotConfigInput = z.input<typeof pilotSchema>;
|
|
85
|
+
export type UserConfig = z.output<typeof userSchema>;
|
|
86
|
+
export type UserConfigInput = z.input<typeof userSchema>;
|
|
87
|
+
export type CohortConfig = z.output<typeof cohortSchema>;
|
|
88
|
+
export type CohortConfigInput = z.input<typeof cohortSchema>;
|
|
89
|
+
export type PilotPreset = z.output<typeof presetSchema>;
|
|
90
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from "@brains/utils/zod";
|
|
2
|
+
declare const encryptedUserSecretsSchema: z.ZodObject<{
|
|
3
|
+
gitSyncToken: z.ZodOptional<z.ZodString>;
|
|
4
|
+
discordBotToken: z.ZodOptional<z.ZodString>;
|
|
5
|
+
aiApiKey: z.ZodOptional<z.ZodString>;
|
|
6
|
+
atprotoAppPassword: z.ZodOptional<z.ZodString>;
|
|
7
|
+
certificatePem: z.ZodOptional<z.ZodString>;
|
|
8
|
+
privateKeyPem: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}>;
|
|
10
|
+
export type EncryptedUserSecrets = z.output<typeof encryptedUserSecretsSchema>;
|
|
11
|
+
export interface SecretsEncryptOptions {
|
|
12
|
+
env?: NodeJS.ProcessEnv | undefined;
|
|
13
|
+
logger?: ((message: string) => void) | undefined;
|
|
14
|
+
dryRun?: boolean | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface SecretsEncryptResult {
|
|
17
|
+
encryptedPath: string;
|
|
18
|
+
plaintextPath: string;
|
|
19
|
+
deletedPlaintext: boolean;
|
|
20
|
+
encryptedKeys: Array<keyof EncryptedUserSecrets>;
|
|
21
|
+
dryRun?: boolean | undefined;
|
|
22
|
+
}
|
|
23
|
+
export declare function encryptPilotSecrets(rootDir: string, handle: string, options?: SecretsEncryptOptions): Promise<SecretsEncryptResult>;
|
|
24
|
+
export {};
|
package/dist/secrets-push.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type RunCommand } from "./run-subprocess";
|
|
1
2
|
export interface SecretsPushOptions {
|
|
2
3
|
env?: NodeJS.ProcessEnv | undefined;
|
|
3
4
|
logger?: ((message: string) => void) | undefined;
|
|
@@ -9,8 +10,4 @@ export interface SecretsPushResult {
|
|
|
9
10
|
skippedKeys: string[];
|
|
10
11
|
dryRun?: boolean | undefined;
|
|
11
12
|
}
|
|
12
|
-
export
|
|
13
|
-
stdin?: string;
|
|
14
|
-
env?: NodeJS.ProcessEnv;
|
|
15
|
-
}) => Promise<void>;
|
|
16
|
-
export declare function pushPilotSecrets(rootDir: string, handle: string, options?: SecretsPushOptions): Promise<SecretsPushResult>;
|
|
13
|
+
export declare function pushPilotSecrets(rootDir: string, options?: SecretsPushOptions): Promise<SecretsPushResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { bootstrapSshKey as bootstrapPilotSshKey, runSshKeyBootstrap as runPilotSshKeyBootstrap, type SshKeyBootstrapOptions, type SshKeyBootstrapResult, type SshKeygen, } from "@brains/deploy-support/ssh-key-bootstrap";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface AddPilotUserOptions {
|
|
2
|
+
cohort: string;
|
|
3
|
+
anchorId?: string | undefined;
|
|
4
|
+
}
|
|
5
|
+
export interface AddPilotUserResult {
|
|
6
|
+
handle: string;
|
|
7
|
+
cohort: string;
|
|
8
|
+
userPath: string;
|
|
9
|
+
secretsTemplatePath: string;
|
|
10
|
+
cohortPath: string;
|
|
11
|
+
createdUser: boolean;
|
|
12
|
+
createdSecretsTemplate: boolean;
|
|
13
|
+
addedToCohort: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function addPilotUser(rootDir: string, handle: string, options: AddPilotUserOptions): Promise<AddPilotUserResult>;
|
package/dist/user-runner.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { ResolvedUser } from "./load-registry";
|
|
2
|
+
export interface ContentRepoFile {
|
|
3
|
+
path: string;
|
|
4
|
+
content: string;
|
|
5
|
+
}
|
|
2
6
|
export interface UserRunResult {
|
|
3
7
|
brainYaml?: string;
|
|
4
8
|
envFile?: string;
|
|
9
|
+
contentRepoFiles?: ContentRepoFile[];
|
|
5
10
|
}
|
|
6
11
|
export type UserRunner = (user: ResolvedUser) => Promise<UserRunResult | void>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FetchLike } from "@brains/deploy-support/origin-ca";
|
|
2
|
+
import { type ResolvedUser } from "./load-registry";
|
|
3
|
+
export interface VerifyPilotUserOptions {
|
|
4
|
+
fetchImpl?: FetchLike;
|
|
5
|
+
logger?: (message: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export interface FailedCheck {
|
|
8
|
+
name: string;
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
export interface VerifyPilotUserResult {
|
|
12
|
+
handle: string;
|
|
13
|
+
preset: ResolvedUser["preset"];
|
|
14
|
+
domain: string;
|
|
15
|
+
contentRepo: string;
|
|
16
|
+
checks: string[];
|
|
17
|
+
failedChecks: FailedCheck[];
|
|
18
|
+
}
|
|
19
|
+
export declare function verifyPilotUser(rootDir: string, handle: string, options?: VerifyPilotUserOptions): Promise<VerifyPilotUserResult>;
|
package/package.json
CHANGED
|
@@ -1,65 +1,69 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rizom/ops",
|
|
3
|
+
"version": "0.2.0-alpha.200",
|
|
3
4
|
"description": "Operator CLI for managing private brain fleet registry repos",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"brains",
|
|
7
|
+
"ops",
|
|
8
|
+
"cli",
|
|
9
|
+
"deploy",
|
|
10
|
+
"fleet",
|
|
11
|
+
"operator"
|
|
12
|
+
],
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"author": "Yeehaa <yeehaa@rizom.ai> (https://rizom.ai)",
|
|
15
|
+
"bin": {
|
|
16
|
+
"brains-ops": "./dist/brains-ops.js"
|
|
17
|
+
},
|
|
18
|
+
"bugs": "https://github.com/rizom-ai/brains/issues",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"age-encryption": "^0.3.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@brains/deploy-support": "workspace:*",
|
|
24
|
+
"@brains/eslint-config": "workspace:*",
|
|
25
|
+
"@brains/typescript-config": "workspace:*",
|
|
26
|
+
"@brains/utils": "workspace:*",
|
|
27
|
+
"@types/bun": "^1.3.14",
|
|
28
|
+
"typescript": "^7.0.2"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"bun": ">=1.3.3"
|
|
6
32
|
},
|
|
7
|
-
"version": "0.2.0-alpha.2",
|
|
8
|
-
"type": "module",
|
|
9
33
|
"exports": {
|
|
10
34
|
".": {
|
|
11
35
|
"types": "./dist/index.d.ts",
|
|
12
36
|
"import": "./dist/index.js"
|
|
13
37
|
},
|
|
14
38
|
"./deploy": {
|
|
15
|
-
"bun": "./dist/deploy.js",
|
|
16
39
|
"types": "./dist/deploy.d.ts",
|
|
17
|
-
"import": "./dist/deploy.js"
|
|
40
|
+
"import": "./dist/deploy.js",
|
|
41
|
+
"bun": "./dist/deploy.js"
|
|
18
42
|
}
|
|
19
43
|
},
|
|
20
|
-
"main": "./dist/index.js",
|
|
21
|
-
"types": "./dist/index.d.ts",
|
|
22
|
-
"bin": {
|
|
23
|
-
"brains-ops": "./dist/brains-ops.js"
|
|
24
|
-
},
|
|
25
44
|
"files": [
|
|
26
45
|
"dist",
|
|
27
46
|
"templates"
|
|
28
47
|
],
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"lint": "eslint . --ext .ts",
|
|
34
|
-
"lint:fix": "eslint . --ext .ts --fix",
|
|
35
|
-
"test": "bun test"
|
|
36
|
-
},
|
|
37
|
-
"dependencies": {},
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"@brains/eslint-config": "workspace:*",
|
|
40
|
-
"@brains/typescript-config": "workspace:*",
|
|
41
|
-
"@brains/utils": "workspace:*",
|
|
42
|
-
"@types/bun": "latest",
|
|
43
|
-
"typescript": "^5.3.3"
|
|
48
|
+
"homepage": "https://github.com/rizom-ai/brains/tree/main/packages/brains-ops#readme",
|
|
49
|
+
"main": "./dist/index.js",
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
44
52
|
},
|
|
45
53
|
"repository": {
|
|
46
54
|
"type": "git",
|
|
47
55
|
"url": "https://github.com/rizom-ai/brains.git",
|
|
48
56
|
"directory": "packages/brains-ops"
|
|
49
57
|
},
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "bun scripts/build.ts",
|
|
60
|
+
"lint": "eslint . --max-warnings 0",
|
|
61
|
+
"lint:fix": "eslint . --max-warnings 0 --fix",
|
|
62
|
+
"prepublishOnly": "bun scripts/build.ts",
|
|
63
|
+
"test": "bun run build && bun test --timeout 20000",
|
|
64
|
+
"test:smoke": "bun run build && RUN_SMOKE_TESTS=1 bun test --timeout 60000",
|
|
65
|
+
"typecheck": "tsc --noEmit"
|
|
56
66
|
},
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
"ops",
|
|
60
|
-
"cli",
|
|
61
|
-
"deploy",
|
|
62
|
-
"fleet",
|
|
63
|
-
"operator"
|
|
64
|
-
]
|
|
67
|
+
"type": "module",
|
|
68
|
+
"types": "./dist/index.d.ts"
|
|
65
69
|
}
|
|
@@ -4,21 +4,40 @@
|
|
|
4
4
|
# ----------
|
|
5
5
|
|
|
6
6
|
# AI provider
|
|
7
|
+
# Shared GitHub secret by default; a per-user override may come from the decrypted
|
|
8
|
+
# users/<handle>.secrets.yaml.age file at deploy time.
|
|
7
9
|
# @required @sensitive
|
|
8
10
|
AI_API_KEY=
|
|
9
11
|
|
|
10
12
|
# Git sync
|
|
13
|
+
# Comes from the decrypted users/<handle>.secrets.yaml.age file.
|
|
11
14
|
# @required @sensitive
|
|
12
15
|
GIT_SYNC_TOKEN=
|
|
13
16
|
|
|
14
|
-
#
|
|
17
|
+
# Content repo administration
|
|
18
|
+
# Local/operator secret only. Used by brains-ops to create missing GitHub repos;
|
|
19
|
+
# do not deploy it into Rover runtime config.
|
|
15
20
|
# @required @sensitive
|
|
16
|
-
|
|
21
|
+
CONTENT_REPO_ADMIN_TOKEN=
|
|
17
22
|
|
|
18
23
|
# Discord (optional, per-user)
|
|
24
|
+
# Comes from the decrypted users/<handle>.secrets.yaml.age file when enabled.
|
|
19
25
|
# @sensitive
|
|
20
26
|
DISCORD_BOT_TOKEN=
|
|
21
27
|
|
|
28
|
+
# AT Protocol publishing/discovery (optional, per-user)
|
|
29
|
+
# Comes from the decrypted users/<handle>.secrets.yaml.age file when configured.
|
|
30
|
+
# @sensitive
|
|
31
|
+
ATPROTO_APP_PASSWORD=
|
|
32
|
+
|
|
33
|
+
# Setup email delivery (optional, shared)
|
|
34
|
+
# Used when a user file declares setup.delivery: email.
|
|
35
|
+
# @sensitive
|
|
36
|
+
SETUP_EMAIL_API_KEY=
|
|
37
|
+
|
|
38
|
+
# @sensitive
|
|
39
|
+
SETUP_EMAIL_FROM=
|
|
40
|
+
|
|
22
41
|
# ---- deploy/provision vars ----
|
|
23
42
|
|
|
24
43
|
# @required @sensitive
|