redkite 0.1.7 → 0.1.8

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.
Files changed (109) hide show
  1. package/README.md +313 -25
  2. package/dist/checks.d.ts.map +1 -1
  3. package/dist/checks.js +4 -0
  4. package/dist/checks.js.map +1 -1
  5. package/dist/cli/agent.d.ts +2 -0
  6. package/dist/cli/agent.d.ts.map +1 -1
  7. package/dist/cli/agent.js +23 -1
  8. package/dist/cli/agent.js.map +1 -1
  9. package/dist/cli/index.d.ts.map +1 -1
  10. package/dist/cli/index.js +98 -30
  11. package/dist/cli/index.js.map +1 -1
  12. package/dist/config.d.ts.map +1 -1
  13. package/dist/config.js +16 -1
  14. package/dist/config.js.map +1 -1
  15. package/dist/deploy.d.ts +4 -1
  16. package/dist/deploy.d.ts.map +1 -1
  17. package/dist/deploy.js +77 -23
  18. package/dist/deploy.js.map +1 -1
  19. package/dist/dockerfile.js +6 -7
  20. package/dist/dockerfile.js.map +1 -1
  21. package/dist/environment.d.ts +5 -0
  22. package/dist/environment.d.ts.map +1 -0
  23. package/dist/environment.js +20 -0
  24. package/dist/environment.js.map +1 -0
  25. package/dist/host.d.ts +2 -0
  26. package/dist/host.d.ts.map +1 -1
  27. package/dist/host.js +6 -0
  28. package/dist/host.js.map +1 -1
  29. package/dist/index.d.ts +4 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +4 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/localHost.d.ts.map +1 -1
  34. package/dist/localHost.js +2 -0
  35. package/dist/localHost.js.map +1 -1
  36. package/dist/plugin.d.ts +15 -0
  37. package/dist/plugin.d.ts.map +1 -0
  38. package/dist/plugin.js +21 -0
  39. package/dist/plugin.js.map +1 -0
  40. package/dist/plugins/bitwarden.d.ts +11 -0
  41. package/dist/plugins/bitwarden.d.ts.map +1 -0
  42. package/dist/plugins/bitwarden.js +40 -0
  43. package/dist/plugins/bitwarden.js.map +1 -0
  44. package/dist/plugins/digitalOcean.d.ts +19 -0
  45. package/dist/plugins/digitalOcean.d.ts.map +1 -0
  46. package/dist/plugins/digitalOcean.js +71 -0
  47. package/dist/plugins/digitalOcean.js.map +1 -0
  48. package/dist/plugins/index.d.ts +5 -0
  49. package/dist/plugins/index.d.ts.map +1 -0
  50. package/dist/plugins/index.js +5 -0
  51. package/dist/plugins/index.js.map +1 -0
  52. package/dist/plugins/rds.d.ts +14 -0
  53. package/dist/plugins/rds.d.ts.map +1 -0
  54. package/dist/plugins/rds.js +86 -0
  55. package/dist/plugins/rds.js.map +1 -0
  56. package/dist/plugins/snapshot.d.ts +7 -0
  57. package/dist/plugins/snapshot.d.ts.map +1 -0
  58. package/dist/plugins/snapshot.js +29 -0
  59. package/dist/plugins/snapshot.js.map +1 -0
  60. package/dist/presets/nodeApp.d.ts +1 -2
  61. package/dist/presets/nodeApp.d.ts.map +1 -1
  62. package/dist/presets/nodeApp.js +0 -1
  63. package/dist/presets/nodeApp.js.map +1 -1
  64. package/dist/recover.d.ts +19 -0
  65. package/dist/recover.d.ts.map +1 -0
  66. package/dist/recover.js +58 -0
  67. package/dist/recover.js.map +1 -0
  68. package/dist/secrets/store.d.ts +5 -2
  69. package/dist/secrets/store.d.ts.map +1 -1
  70. package/dist/secrets/store.js +25 -14
  71. package/dist/secrets/store.js.map +1 -1
  72. package/dist/sshHost.d.ts +2 -0
  73. package/dist/sshHost.d.ts.map +1 -1
  74. package/dist/sshHost.js +29 -11
  75. package/dist/sshHost.js.map +1 -1
  76. package/dist/steps.d.ts +0 -7
  77. package/dist/steps.d.ts.map +1 -1
  78. package/dist/steps.js +6 -3
  79. package/dist/steps.js.map +1 -1
  80. package/dist/types.d.ts +4 -5
  81. package/dist/types.d.ts.map +1 -1
  82. package/package.json +1 -1
  83. package/src/checks.ts +4 -0
  84. package/src/cli/agent.ts +28 -1
  85. package/src/cli/index.ts +118 -29
  86. package/src/config.ts +19 -1
  87. package/src/deploy.ts +101 -29
  88. package/src/dockerfile.ts +7 -11
  89. package/src/environment.ts +24 -0
  90. package/src/host.ts +11 -0
  91. package/src/index.ts +4 -1
  92. package/src/localHost.ts +3 -0
  93. package/src/plugin.ts +50 -0
  94. package/src/plugins/bitwarden.ts +57 -0
  95. package/src/plugins/digitalOcean.ts +111 -0
  96. package/src/plugins/index.ts +4 -0
  97. package/src/plugins/rds.ts +126 -0
  98. package/src/plugins/snapshot.ts +44 -0
  99. package/src/presets/nodeApp.ts +1 -3
  100. package/src/recover.ts +90 -0
  101. package/src/secrets/store.ts +39 -20
  102. package/src/sshHost.ts +35 -11
  103. package/src/steps.ts +7 -6
  104. package/src/types.ts +22 -12
  105. package/dist/secrets/bitwarden.d.ts +0 -3
  106. package/dist/secrets/bitwarden.d.ts.map +0 -1
  107. package/dist/secrets/bitwarden.js +0 -6
  108. package/dist/secrets/bitwarden.js.map +0 -1
  109. package/src/secrets/bitwarden.ts +0 -7
package/src/types.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { AnyStep } from "./pipeline.js";
2
+ import type { Plugin } from "./plugin.js";
2
3
 
3
4
  // The shapes a deploy config is written against. Nothing here knows about
4
5
  // Docker or git, so a config can be planned and asserted on without a host to
@@ -33,11 +34,26 @@ export type Environment = {
33
34
  // the alias the apps know it by
34
35
  export type StepNetwork = "host" | "deployment" | "none" | { named: string };
35
36
 
37
+ // How the deploy host proves it is the machine it says it is, before a key,
38
+ // an environment file or an image is handed to it
39
+ export type HostKeys =
40
+ // Trusted the first time and refused if the key ever changes after that,
41
+ // which is what a host on a stable address wants and needs no setup
42
+ | "accept-new"
43
+ // Refused unless it is already in known_hosts. Nothing is taken on trust,
44
+ // at the cost of putting the key there before the first deploy
45
+ | "strict"
46
+ // Checked not at all. For a host whose address is handed out again and
47
+ // again, and only where nothing on the way to it can be listened to
48
+ | "off";
49
+
36
50
  export type DeployHost = {
37
51
  // SSH destination, user@address
38
52
  bastion: string;
39
53
  // Socket path on that machine. Local when absent, deploying to this one
40
54
  socket?: string;
55
+ // Defaults to accept-new
56
+ hostKeys?: HostKeys;
41
57
  };
42
58
 
43
59
  // One item in a store, named at the point of use rather than through a lookup
@@ -127,16 +143,6 @@ export type BuildSpec = {
127
143
  // Shell commands run in the runtime image, for what a package manager cannot
128
144
  // install. Above the output copy, so a new commit does not repeat them
129
145
  runtimeSteps: string[];
130
- // Uploads source maps during the build, then deletes them from the image
131
- sourcemaps?: SourcemapSpec;
132
- };
133
-
134
- export type SourcemapSpec = {
135
- // Which service receives the maps, "sentry" is the only one today
136
- provider: "sentry";
137
- // Env var stripped from the shipped file, it is a build-time credential and
138
- // has no reason to travel inside the image
139
- stripFromImage: string;
140
146
  };
141
147
 
142
148
  // How a build is decided to work. The commands run in the builder image, which
@@ -237,7 +243,11 @@ export type Deployment = {
237
243
  // The applications. Everything derived, addresses, container names, nginx
238
244
  // upstreams and location blocks, is a function of this list
239
245
  apps: AppSpec[];
240
- // Work injected into the run, from this file or from a plugin that answers
241
- // with some. Addressed by where it runs, so nothing here has to be called
246
+ // Work injected into the run. Addressed by where it runs, so nothing here
247
+ // has to be called
242
248
  steps?: AnyStep[];
249
+ // Everything this deployment opts into: the vault that answers its secret
250
+ // refs, and whatever else brings steps of its own. Nothing a plugin carries
251
+ // happens until it is listed here, redkite's own vault included
252
+ plugins?: Plugin[];
243
253
  };
@@ -1,3 +0,0 @@
1
- import type { SecretRef } from "../types.js";
2
- export declare function bitwarden(id: string): SecretRef;
3
- //# sourceMappingURL=bitwarden.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bitwarden.d.ts","sourceRoot":"","sources":["../../src/secrets/bitwarden.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAE/C"}
@@ -1,6 +0,0 @@
1
- // Names an item in a Bitwarden vault. The id is not a secret, it is a pointer,
2
- // so it belongs in the config while the credentials arrive at deploy time
3
- export function bitwarden(id) {
4
- return { provider: "bitwarden", id };
5
- }
6
- //# sourceMappingURL=bitwarden.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bitwarden.js","sourceRoot":"","sources":["../../src/secrets/bitwarden.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,0EAA0E;AAC1E,MAAM,UAAU,SAAS,CAAC,EAAU;IAClC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;AACvC,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { SecretRef } from "../types.js";
2
-
3
- // Names an item in a Bitwarden vault. The id is not a secret, it is a pointer,
4
- // so it belongs in the config while the credentials arrive at deploy time
5
- export function bitwarden(id: string): SecretRef {
6
- return { provider: "bitwarden", id };
7
- }