@rcpooley/concord 0.1.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/LICENSE +21 -0
- package/README.md +318 -0
- package/bin/concord.service +69 -0
- package/dist/age.d.ts +20 -0
- package/dist/age.d.ts.map +1 -0
- package/dist/age.js +58 -0
- package/dist/age.js.map +1 -0
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +301 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/daemon.d.ts +4 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +394 -0
- package/dist/daemon.js.map +1 -0
- package/dist/eval-config.d.ts +2 -0
- package/dist/eval-config.d.ts.map +1 -0
- package/dist/eval-config.js +45 -0
- package/dist/eval-config.js.map +1 -0
- package/dist/exec.d.ts +168 -0
- package/dist/exec.d.ts.map +1 -0
- package/dist/exec.js +313 -0
- package/dist/exec.js.map +1 -0
- package/dist/git.d.ts +59 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +265 -0
- package/dist/git.js.map +1 -0
- package/dist/hook.d.ts +37 -0
- package/dist/hook.d.ts.map +1 -0
- package/dist/hook.js +89 -0
- package/dist/hook.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts +76 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +236 -0
- package/dist/init.js.map +1 -0
- package/dist/loader.d.ts +35 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +230 -0
- package/dist/loader.js.map +1 -0
- package/dist/module.d.ts +116 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +100 -0
- package/dist/module.js.map +1 -0
- package/dist/modules/apt/index.d.ts +45 -0
- package/dist/modules/apt/index.d.ts.map +1 -0
- package/dist/modules/apt/index.js +249 -0
- package/dist/modules/apt/index.js.map +1 -0
- package/dist/modules/apt/schema.d.ts +63 -0
- package/dist/modules/apt/schema.d.ts.map +1 -0
- package/dist/modules/apt/schema.js +75 -0
- package/dist/modules/apt/schema.js.map +1 -0
- package/dist/modules/checkout/index.d.ts +88 -0
- package/dist/modules/checkout/index.d.ts.map +1 -0
- package/dist/modules/checkout/index.js +382 -0
- package/dist/modules/checkout/index.js.map +1 -0
- package/dist/modules/checkout/schema.d.ts +52 -0
- package/dist/modules/checkout/schema.d.ts.map +1 -0
- package/dist/modules/checkout/schema.js +132 -0
- package/dist/modules/checkout/schema.js.map +1 -0
- package/dist/modules/cloudflare/api.d.ts +64 -0
- package/dist/modules/cloudflare/api.d.ts.map +1 -0
- package/dist/modules/cloudflare/api.js +98 -0
- package/dist/modules/cloudflare/api.js.map +1 -0
- package/dist/modules/cloudflare/index.d.ts +74 -0
- package/dist/modules/cloudflare/index.d.ts.map +1 -0
- package/dist/modules/cloudflare/index.js +374 -0
- package/dist/modules/cloudflare/index.js.map +1 -0
- package/dist/modules/cloudflare/schema.d.ts +62 -0
- package/dist/modules/cloudflare/schema.d.ts.map +1 -0
- package/dist/modules/cloudflare/schema.js +85 -0
- package/dist/modules/cloudflare/schema.js.map +1 -0
- package/dist/modules/docker/index.d.ts +83 -0
- package/dist/modules/docker/index.d.ts.map +1 -0
- package/dist/modules/docker/index.js +470 -0
- package/dist/modules/docker/index.js.map +1 -0
- package/dist/modules/docker/registry.d.ts +35 -0
- package/dist/modules/docker/registry.d.ts.map +1 -0
- package/dist/modules/docker/registry.js +95 -0
- package/dist/modules/docker/registry.js.map +1 -0
- package/dist/modules/docker/render.d.ts +45 -0
- package/dist/modules/docker/render.d.ts.map +1 -0
- package/dist/modules/docker/render.js +162 -0
- package/dist/modules/docker/render.js.map +1 -0
- package/dist/modules/docker/schema.d.ts +231 -0
- package/dist/modules/docker/schema.d.ts.map +1 -0
- package/dist/modules/docker/schema.js +335 -0
- package/dist/modules/docker/schema.js.map +1 -0
- package/dist/modules/docker/sweeper.d.ts +64 -0
- package/dist/modules/docker/sweeper.d.ts.map +1 -0
- package/dist/modules/docker/sweeper.js +94 -0
- package/dist/modules/docker/sweeper.js.map +1 -0
- package/dist/modules/file/index.d.ts +79 -0
- package/dist/modules/file/index.d.ts.map +1 -0
- package/dist/modules/file/index.js +305 -0
- package/dist/modules/file/index.js.map +1 -0
- package/dist/modules/file/schema.d.ts +45 -0
- package/dist/modules/file/schema.d.ts.map +1 -0
- package/dist/modules/file/schema.js +114 -0
- package/dist/modules/file/schema.js.map +1 -0
- package/dist/modules/index.d.ts +20 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +11 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/modules/porkbun/api.d.ts +36 -0
- package/dist/modules/porkbun/api.d.ts.map +1 -0
- package/dist/modules/porkbun/api.js +62 -0
- package/dist/modules/porkbun/api.js.map +1 -0
- package/dist/modules/porkbun/index.d.ts +50 -0
- package/dist/modules/porkbun/index.d.ts.map +1 -0
- package/dist/modules/porkbun/index.js +236 -0
- package/dist/modules/porkbun/index.js.map +1 -0
- package/dist/modules/porkbun/schema.d.ts +38 -0
- package/dist/modules/porkbun/schema.d.ts.map +1 -0
- package/dist/modules/porkbun/schema.js +39 -0
- package/dist/modules/porkbun/schema.js.map +1 -0
- package/dist/modules/script/index.d.ts +43 -0
- package/dist/modules/script/index.d.ts.map +1 -0
- package/dist/modules/script/index.js +116 -0
- package/dist/modules/script/index.js.map +1 -0
- package/dist/modules/script/schema.d.ts +25 -0
- package/dist/modules/script/schema.d.ts.map +1 -0
- package/dist/modules/script/schema.js +63 -0
- package/dist/modules/script/schema.js.map +1 -0
- package/dist/modules/systemd/index.d.ts +93 -0
- package/dist/modules/systemd/index.d.ts.map +1 -0
- package/dist/modules/systemd/index.js +394 -0
- package/dist/modules/systemd/index.js.map +1 -0
- package/dist/modules/systemd/render.d.ts +41 -0
- package/dist/modules/systemd/render.d.ts.map +1 -0
- package/dist/modules/systemd/render.js +252 -0
- package/dist/modules/systemd/render.js.map +1 -0
- package/dist/modules/systemd/schema.d.ts +293 -0
- package/dist/modules/systemd/schema.d.ts.map +1 -0
- package/dist/modules/systemd/schema.js +302 -0
- package/dist/modules/systemd/schema.js.map +1 -0
- package/dist/modules/systemd/sweeper.d.ts +31 -0
- package/dist/modules/systemd/sweeper.d.ts.map +1 -0
- package/dist/modules/systemd/sweeper.js +77 -0
- package/dist/modules/systemd/sweeper.js.map +1 -0
- package/dist/plans.d.ts +132 -0
- package/dist/plans.d.ts.map +1 -0
- package/dist/plans.js +315 -0
- package/dist/plans.js.map +1 -0
- package/dist/records.d.ts +37 -0
- package/dist/records.d.ts.map +1 -0
- package/dist/records.js +100 -0
- package/dist/records.js.map +1 -0
- package/dist/registry.d.ts +38 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +31 -0
- package/dist/registry.js.map +1 -0
- package/dist/runner.d.ts +48 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +150 -0
- package/dist/runner.js.map +1 -0
- package/dist/scheduler.d.ts +36 -0
- package/dist/scheduler.d.ts.map +1 -0
- package/dist/scheduler.js +77 -0
- package/dist/scheduler.js.map +1 -0
- package/dist/schema.d.ts +762 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +185 -0
- package/dist/schema.js.map +1 -0
- package/dist/secret.d.ts +24 -0
- package/dist/secret.d.ts.map +1 -0
- package/dist/secret.js +3 -0
- package/dist/secret.js.map +1 -0
- package/dist/ui.d.ts +62 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +288 -0
- package/dist/ui.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rendering and comparison of unit files.
|
|
3
|
+
*
|
|
4
|
+
* Units are GENERATED from typed fields rather than installed from checked-in
|
|
5
|
+
* files, and compared as DIRECTIVE SETS rather than as text — so adopting an
|
|
6
|
+
* existing hand-written unit whose directives already match is a zero-restart
|
|
7
|
+
* operation.
|
|
8
|
+
*/
|
|
9
|
+
export const MANAGED_HEADER = '# Managed by Concord. Local edits are reverted on the next run.';
|
|
10
|
+
/**
|
|
11
|
+
* The ownership tag, present in `[Unit]` of every file Concord writes.
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ WIRE FORMAT — never rename. The sweep identifies Concord-written units by
|
|
14
|
+
* this exact directive, so renaming it orphans every unit written before the
|
|
15
|
+
* rename. systemd documents that `X-`-prefixed directives are ignored
|
|
16
|
+
* (verified against .service, .timer, .target and template units).
|
|
17
|
+
*
|
|
18
|
+
* Deliberately a CONSTANT, not the module id: a directive participates in
|
|
19
|
+
* `unitsEquivalent`, so an id here would restart every unit a module writes
|
|
20
|
+
* when the module is renamed in config — and at sweep time the id would be
|
|
21
|
+
* stale by definition, since the sweep only ever reads the tag on units whose
|
|
22
|
+
* module is gone. The module id lives in the comment header instead, where
|
|
23
|
+
* humans look and the comparison doesn't.
|
|
24
|
+
*/
|
|
25
|
+
export const OWNER_TAG = ['X-Concord', '1'];
|
|
26
|
+
const yn = (b) => (b ? 'yes' : 'no');
|
|
27
|
+
/**
|
|
28
|
+
* Escape a value for the double quotes Concord wraps around `Environment=`.
|
|
29
|
+
*
|
|
30
|
+
* Inside them systemd unescapes C-style — `\\` is one backslash and `\"` a
|
|
31
|
+
* quote — so an unescaped `"` ended the assignment early and a `\` started an
|
|
32
|
+
* escape sequence. `$` means nothing in `Environment=` (verified on a live unit).
|
|
33
|
+
*
|
|
34
|
+
* `%` is deliberately NOT escaped. Specifiers are how template units work —
|
|
35
|
+
* template `%i` units depend on them — so a unit field here is systemd
|
|
36
|
+
* syntax: write `%%` for a literal percent.
|
|
37
|
+
*/
|
|
38
|
+
const quoted = (v) => v.replace(/[\\"]/g, (c) => `\\${c}`);
|
|
39
|
+
const list = (v) => v.join(' ');
|
|
40
|
+
const span = (v) => String(v);
|
|
41
|
+
function emit(out, directive, value, fmt) {
|
|
42
|
+
if (value === undefined)
|
|
43
|
+
return;
|
|
44
|
+
out.push([directive, fmt(value)]);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Directives whose value is an unordered, whitespace-separated SET.
|
|
48
|
+
*
|
|
49
|
+
* systemd treats `After=a b` and two separate `After=` lines identically, so
|
|
50
|
+
* these are normalised before comparison. Everything else — `ExecStart` above
|
|
51
|
+
* all — keeps its order, because there the order is the meaning.
|
|
52
|
+
*/
|
|
53
|
+
const SET_VALUED = new Set([
|
|
54
|
+
'After',
|
|
55
|
+
'Before',
|
|
56
|
+
'Wants',
|
|
57
|
+
'Requires',
|
|
58
|
+
'BindsTo',
|
|
59
|
+
'PartOf',
|
|
60
|
+
'Conflicts',
|
|
61
|
+
'WantedBy',
|
|
62
|
+
'RequiredBy',
|
|
63
|
+
'Also',
|
|
64
|
+
'Alias',
|
|
65
|
+
'Documentation',
|
|
66
|
+
// systemd reads `SuccessExitStatus=0 1 128` as a set of codes, so a
|
|
67
|
+
// hand-written unit listing them in another order is the SAME unit — and
|
|
68
|
+
// adopting one without a restart is the point of comparing directives.
|
|
69
|
+
'SuccessExitStatus',
|
|
70
|
+
]);
|
|
71
|
+
// --------------------------------------------------------------- render ----
|
|
72
|
+
/** @param owner The writing module's scope (`systemd:<id>`), for the header. */
|
|
73
|
+
export function renderUnit(u, owner) {
|
|
74
|
+
const sections = [];
|
|
75
|
+
const unit = [OWNER_TAG];
|
|
76
|
+
emit(unit, 'Description', u.description, String);
|
|
77
|
+
emit(unit, 'Documentation', u.documentation, list);
|
|
78
|
+
emit(unit, 'Requires', u.requires, list);
|
|
79
|
+
emit(unit, 'BindsTo', u.bindsTo, list);
|
|
80
|
+
emit(unit, 'PartOf', u.partOf, list);
|
|
81
|
+
emit(unit, 'Wants', u.wants, list);
|
|
82
|
+
emit(unit, 'After', u.after, list);
|
|
83
|
+
emit(unit, 'Before', u.before, list);
|
|
84
|
+
emit(unit, 'Conflicts', u.conflicts, list);
|
|
85
|
+
emit(unit, 'ConditionPathExists', u.conditionPathExists, String);
|
|
86
|
+
emit(unit, 'StartLimitIntervalSec', u.startLimitIntervalSec, span);
|
|
87
|
+
emit(unit, 'StartLimitBurst', u.startLimitBurst, String);
|
|
88
|
+
sections.push(['Unit', unit]);
|
|
89
|
+
if (u.service) {
|
|
90
|
+
const s = u.service;
|
|
91
|
+
const svc = [];
|
|
92
|
+
emit(svc, 'Type', s.type, String);
|
|
93
|
+
emit(svc, 'User', s.user, String);
|
|
94
|
+
emit(svc, 'Group', s.group, String);
|
|
95
|
+
emit(svc, 'WorkingDirectory', s.workingDirectory, String);
|
|
96
|
+
for (const [k, v] of Object.entries(s.environment ?? {})) {
|
|
97
|
+
svc.push(['Environment', `"${k}=${quoted(v)}"`]);
|
|
98
|
+
}
|
|
99
|
+
for (const f of toArray(s.environmentFile))
|
|
100
|
+
svc.push(['EnvironmentFile', f]);
|
|
101
|
+
for (const c of s.execStartPre ?? [])
|
|
102
|
+
svc.push(['ExecStartPre', c]);
|
|
103
|
+
for (const c of toArray(s.execStart))
|
|
104
|
+
svc.push(['ExecStart', c]);
|
|
105
|
+
for (const c of s.execStartPost ?? [])
|
|
106
|
+
svc.push(['ExecStartPost', c]);
|
|
107
|
+
emit(svc, 'ExecReload', s.execReload, String);
|
|
108
|
+
emit(svc, 'ExecStop', s.execStop, String);
|
|
109
|
+
emit(svc, 'Restart', s.restart, String);
|
|
110
|
+
emit(svc, 'RestartSec', s.restartSec, span);
|
|
111
|
+
emit(svc, 'KillMode', s.killMode, String);
|
|
112
|
+
emit(svc, 'SuccessExitStatus', s.successExitStatus, String);
|
|
113
|
+
emit(svc, 'RemainAfterExit', s.remainAfterExit, yn);
|
|
114
|
+
emit(svc, 'TimeoutStartSec', s.timeoutStartSec, span);
|
|
115
|
+
emit(svc, 'TimeoutStopSec', s.timeoutStopSec, span);
|
|
116
|
+
emit(svc, 'StandardOutput', s.standardOutput, String);
|
|
117
|
+
emit(svc, 'StandardError', s.standardError, String);
|
|
118
|
+
emit(svc, 'SyslogIdentifier', s.syslogIdentifier, String);
|
|
119
|
+
emit(svc, 'OOMScoreAdjust', s.oomScoreAdjust, String);
|
|
120
|
+
sections.push(['Service', svc]);
|
|
121
|
+
}
|
|
122
|
+
if (u.timer) {
|
|
123
|
+
const t = u.timer;
|
|
124
|
+
const tim = [];
|
|
125
|
+
for (const c of toArray(t.onCalendar))
|
|
126
|
+
tim.push(['OnCalendar', c]);
|
|
127
|
+
emit(tim, 'OnBootSec', t.onBootSec, span);
|
|
128
|
+
emit(tim, 'OnStartupSec', t.onStartupSec, span);
|
|
129
|
+
emit(tim, 'OnActiveSec', t.onActiveSec, span);
|
|
130
|
+
emit(tim, 'OnUnitActiveSec', t.onUnitActiveSec, span);
|
|
131
|
+
emit(tim, 'RandomizedDelaySec', t.randomizedDelaySec, span);
|
|
132
|
+
emit(tim, 'AccuracySec', t.accuracySec, span);
|
|
133
|
+
emit(tim, 'Persistent', t.persistent, yn);
|
|
134
|
+
emit(tim, 'Unit', t.unit, String);
|
|
135
|
+
sections.push(['Timer', tim]);
|
|
136
|
+
}
|
|
137
|
+
if (u.path) {
|
|
138
|
+
const p = u.path;
|
|
139
|
+
const pth = [];
|
|
140
|
+
for (const x of p.pathModified ?? [])
|
|
141
|
+
pth.push(['PathModified', x]);
|
|
142
|
+
for (const x of p.pathExists ?? [])
|
|
143
|
+
pth.push(['PathExists', x]);
|
|
144
|
+
for (const x of p.directoryNotEmpty ?? [])
|
|
145
|
+
pth.push(['DirectoryNotEmpty', x]);
|
|
146
|
+
emit(pth, 'MakeDirectory', p.makeDirectory, yn);
|
|
147
|
+
emit(pth, 'Unit', p.unit, String);
|
|
148
|
+
sections.push(['Path', pth]);
|
|
149
|
+
}
|
|
150
|
+
const install = [];
|
|
151
|
+
emit(install, 'WantedBy', u.wantedBy, list);
|
|
152
|
+
emit(install, 'RequiredBy', u.requiredBy, list);
|
|
153
|
+
if (install.length)
|
|
154
|
+
sections.push(['Install', install]);
|
|
155
|
+
for (const [, lines] of sections) {
|
|
156
|
+
for (const [directive, value] of lines) {
|
|
157
|
+
if (/[\r\n]/.test(value)) {
|
|
158
|
+
throw new Error(`systemd: ${directive}= value contains a line break, which would end the directive ` +
|
|
159
|
+
`and start another — refusing to render it`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
const text = sections
|
|
164
|
+
.filter(([, lines]) => lines.length)
|
|
165
|
+
.map(([name, lines]) => `[${name}]\n` + lines.map(([k, v]) => `${k}=${v}`).join('\n') + '\n')
|
|
166
|
+
.join('\n');
|
|
167
|
+
const header = owner
|
|
168
|
+
? `# Managed by Concord (${owner}). Local edits are reverted on the next run.`
|
|
169
|
+
: MANAGED_HEADER;
|
|
170
|
+
return `${header}\n\n${text}`;
|
|
171
|
+
}
|
|
172
|
+
function toArray(v) {
|
|
173
|
+
if (v === undefined)
|
|
174
|
+
return [];
|
|
175
|
+
return Array.isArray(v) ? v : [v];
|
|
176
|
+
}
|
|
177
|
+
export function parseUnit(text) {
|
|
178
|
+
const out = new Map();
|
|
179
|
+
let section = '';
|
|
180
|
+
// systemd joins lines ending in a backslash before parsing directives.
|
|
181
|
+
// Whitespace on BOTH sides is absorbed: `foo \` + ` --flag` must collapse to
|
|
182
|
+
// one space, or the same unit written with a continuation would read as a
|
|
183
|
+
// difference from one written on a single line.
|
|
184
|
+
const joined = text.replace(/[ \t]*\\\n[ \t]*/g, ' ');
|
|
185
|
+
for (const raw of joined.split('\n')) {
|
|
186
|
+
const line = raw.trim();
|
|
187
|
+
if (!line || line.startsWith('#') || line.startsWith(';'))
|
|
188
|
+
continue;
|
|
189
|
+
const header = /^\[(.+)\]$/.exec(line);
|
|
190
|
+
if (header) {
|
|
191
|
+
section = header[1];
|
|
192
|
+
if (!out.has(section))
|
|
193
|
+
out.set(section, []);
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
const eq = line.indexOf('=');
|
|
197
|
+
if (eq <= 0 || !section)
|
|
198
|
+
continue;
|
|
199
|
+
out.get(section).push([line.slice(0, eq).trim(), line.slice(eq + 1).trim()]);
|
|
200
|
+
}
|
|
201
|
+
return out;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Normalise one section into a comparable form.
|
|
205
|
+
*
|
|
206
|
+
* Directives are grouped BY NAME and the groups sorted, because within a section
|
|
207
|
+
* systemd does not care whether `ExecStart` precedes `EnvironmentFile`. What it
|
|
208
|
+
* does care about is the order of REPEATED instances of the same directive —
|
|
209
|
+
* two `ExecStart=` lines run in the order written — so order is preserved
|
|
210
|
+
* within each group and only across groups is it discarded.
|
|
211
|
+
*/
|
|
212
|
+
/** NUL separator: any printable one could occur inside a value and make two
|
|
213
|
+
* genuinely different directive lists compare equal. */
|
|
214
|
+
const join = (vals) => vals.join('\u0000');
|
|
215
|
+
function normalise(lines) {
|
|
216
|
+
const groups = new Map();
|
|
217
|
+
for (const [k, v] of lines) {
|
|
218
|
+
if (!groups.has(k))
|
|
219
|
+
groups.set(k, []);
|
|
220
|
+
if (SET_VALUED.has(k)) {
|
|
221
|
+
// `After=a b` and two `After=` lines mean the same thing to systemd.
|
|
222
|
+
groups.get(k).push(...v.split(/\s+/).filter(Boolean));
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
groups.get(k).push(v);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return [...groups.entries()]
|
|
229
|
+
.map(([k, vals]) => `${k}=${join(SET_VALUED.has(k) ? [...new Set(vals)].sort() : vals)}`)
|
|
230
|
+
.sort()
|
|
231
|
+
.join('\n');
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Do two unit files mean the same thing?
|
|
235
|
+
*
|
|
236
|
+
* Ignores comments, blank lines, section order and the ordering of set-valued
|
|
237
|
+
* directives — so a hand-written unit that already says the right thing is
|
|
238
|
+
* adopted without a restart.
|
|
239
|
+
*/
|
|
240
|
+
export function unitsEquivalent(a, b) {
|
|
241
|
+
const pa = parseUnit(a);
|
|
242
|
+
const pb = parseUnit(b);
|
|
243
|
+
const names = new Set([...pa.keys(), ...pb.keys()]);
|
|
244
|
+
for (const name of names) {
|
|
245
|
+
const la = pa.get(name) ?? [];
|
|
246
|
+
const lb = pb.get(name) ?? [];
|
|
247
|
+
if (normalise(la) !== normalise(lb))
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../../src/modules/systemd/render.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,iEAAiE,CAAA;AAE/F;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,SAAS,GAAqB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAA;AAE7D,MAAM,EAAE,GAAG,CAAC,CAAU,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAE7C;;;;;;;;;;GAUG;AACH,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;AAClE,MAAM,IAAI,GAAG,CAAC,CAAW,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACzC,MAAM,IAAI,GAAG,CAAC,CAAkB,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;AAI9C,SAAS,IAAI,CAAC,GAAW,EAAE,SAAiB,EAAE,KAAc,EAAE,GAAuB;IACnF,IAAI,KAAK,KAAK,SAAS;QAAE,OAAM;IAC/B,GAAG,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACnC,CAAC;AA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AAC,CAAC,CAAA;IACnD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;QAC7B,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;QAC7B,IAAI,SAAS,CAAC,EAAE,CAAC,KAAK,SAAS,CAAC,EAAE,CAAC;YAAE,OAAO,KAAK,CAAA;IACnD,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* [Path] — activate a unit when a filesystem path changes.
|
|
4
|
+
*
|
|
5
|
+
* The one way a container can ask the host to do something without a socket, a
|
|
6
|
+
* docker socket mount, or any privilege: it writes a file, and systemd on the
|
|
7
|
+
* host reacts. Used by the webhook receiver to trigger a reconcile.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PathSectionSchema: z.ZodObject<{
|
|
10
|
+
pathModified: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
|
+
pathExists: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
12
|
+
directoryNotEmpty: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
13
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
14
|
+
makeDirectory: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
export declare const UnitFileSchema: z.ZodObject<{
|
|
17
|
+
service: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
19
|
+
simple: "simple";
|
|
20
|
+
exec: "exec";
|
|
21
|
+
forking: "forking";
|
|
22
|
+
oneshot: "oneshot";
|
|
23
|
+
notify: "notify";
|
|
24
|
+
idle: "idle";
|
|
25
|
+
}>>;
|
|
26
|
+
execStart: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
27
|
+
execStartPre: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
|
+
execStartPost: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
+
execStop: z.ZodOptional<z.ZodString>;
|
|
30
|
+
execReload: z.ZodOptional<z.ZodString>;
|
|
31
|
+
user: z.ZodOptional<z.ZodString>;
|
|
32
|
+
group: z.ZodOptional<z.ZodString>;
|
|
33
|
+
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
34
|
+
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
35
|
+
environmentFile: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
36
|
+
restart: z.ZodOptional<z.ZodEnum<{
|
|
37
|
+
no: "no";
|
|
38
|
+
always: "always";
|
|
39
|
+
"on-success": "on-success";
|
|
40
|
+
"on-failure": "on-failure";
|
|
41
|
+
"on-abnormal": "on-abnormal";
|
|
42
|
+
"on-abort": "on-abort";
|
|
43
|
+
"on-watchdog": "on-watchdog";
|
|
44
|
+
}>>;
|
|
45
|
+
restartSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
46
|
+
killMode: z.ZodOptional<z.ZodEnum<{
|
|
47
|
+
"control-group": "control-group";
|
|
48
|
+
mixed: "mixed";
|
|
49
|
+
process: "process";
|
|
50
|
+
none: "none";
|
|
51
|
+
}>>;
|
|
52
|
+
successExitStatus: z.ZodOptional<z.ZodString>;
|
|
53
|
+
remainAfterExit: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
timeoutStartSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
55
|
+
timeoutStopSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
56
|
+
standardOutput: z.ZodOptional<z.ZodString>;
|
|
57
|
+
standardError: z.ZodOptional<z.ZodString>;
|
|
58
|
+
syslogIdentifier: z.ZodOptional<z.ZodString>;
|
|
59
|
+
oomScoreAdjust: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
}, z.core.$strict>>;
|
|
61
|
+
timer: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
onCalendar: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
63
|
+
onBootSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
64
|
+
onStartupSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
65
|
+
onActiveSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
66
|
+
onUnitActiveSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
67
|
+
randomizedDelaySec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
68
|
+
persistent: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
+
accuracySec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
70
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
71
|
+
}, z.core.$strict>>;
|
|
72
|
+
path: z.ZodOptional<z.ZodObject<{
|
|
73
|
+
pathModified: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
74
|
+
pathExists: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
|
+
directoryNotEmpty: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
76
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
77
|
+
makeDirectory: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
+
}, z.core.$strict>>;
|
|
79
|
+
wantedBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
80
|
+
requiredBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
81
|
+
description: z.ZodString;
|
|
82
|
+
documentation: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
83
|
+
after: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
84
|
+
before: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
85
|
+
wants: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
86
|
+
requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
87
|
+
bindsTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
|
+
partOf: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
89
|
+
conflicts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
90
|
+
conditionPathExists: z.ZodOptional<z.ZodString>;
|
|
91
|
+
startLimitIntervalSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
92
|
+
startLimitBurst: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
}, z.core.$strict>;
|
|
94
|
+
export declare const WatchSchema: z.ZodObject<{
|
|
95
|
+
paths: z.ZodArray<z.ZodString>;
|
|
96
|
+
onChange: z.ZodEnum<{
|
|
97
|
+
restart: "restart";
|
|
98
|
+
reload: "reload";
|
|
99
|
+
}>;
|
|
100
|
+
}, z.core.$strict>;
|
|
101
|
+
export declare const UnitSchema: z.ZodObject<{
|
|
102
|
+
name: z.ZodString;
|
|
103
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
105
|
+
unit: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
service: z.ZodOptional<z.ZodObject<{
|
|
107
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
108
|
+
simple: "simple";
|
|
109
|
+
exec: "exec";
|
|
110
|
+
forking: "forking";
|
|
111
|
+
oneshot: "oneshot";
|
|
112
|
+
notify: "notify";
|
|
113
|
+
idle: "idle";
|
|
114
|
+
}>>;
|
|
115
|
+
execStart: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
116
|
+
execStartPre: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
117
|
+
execStartPost: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
118
|
+
execStop: z.ZodOptional<z.ZodString>;
|
|
119
|
+
execReload: z.ZodOptional<z.ZodString>;
|
|
120
|
+
user: z.ZodOptional<z.ZodString>;
|
|
121
|
+
group: z.ZodOptional<z.ZodString>;
|
|
122
|
+
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
123
|
+
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
124
|
+
environmentFile: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
125
|
+
restart: z.ZodOptional<z.ZodEnum<{
|
|
126
|
+
no: "no";
|
|
127
|
+
always: "always";
|
|
128
|
+
"on-success": "on-success";
|
|
129
|
+
"on-failure": "on-failure";
|
|
130
|
+
"on-abnormal": "on-abnormal";
|
|
131
|
+
"on-abort": "on-abort";
|
|
132
|
+
"on-watchdog": "on-watchdog";
|
|
133
|
+
}>>;
|
|
134
|
+
restartSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
135
|
+
killMode: z.ZodOptional<z.ZodEnum<{
|
|
136
|
+
"control-group": "control-group";
|
|
137
|
+
mixed: "mixed";
|
|
138
|
+
process: "process";
|
|
139
|
+
none: "none";
|
|
140
|
+
}>>;
|
|
141
|
+
successExitStatus: z.ZodOptional<z.ZodString>;
|
|
142
|
+
remainAfterExit: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
timeoutStartSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
144
|
+
timeoutStopSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
145
|
+
standardOutput: z.ZodOptional<z.ZodString>;
|
|
146
|
+
standardError: z.ZodOptional<z.ZodString>;
|
|
147
|
+
syslogIdentifier: z.ZodOptional<z.ZodString>;
|
|
148
|
+
oomScoreAdjust: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
}, z.core.$strict>>;
|
|
150
|
+
timer: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
onCalendar: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
152
|
+
onBootSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
153
|
+
onStartupSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
154
|
+
onActiveSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
155
|
+
onUnitActiveSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
156
|
+
randomizedDelaySec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
157
|
+
persistent: z.ZodOptional<z.ZodBoolean>;
|
|
158
|
+
accuracySec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
159
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
160
|
+
}, z.core.$strict>>;
|
|
161
|
+
path: z.ZodOptional<z.ZodObject<{
|
|
162
|
+
pathModified: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
163
|
+
pathExists: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
164
|
+
directoryNotEmpty: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
165
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
166
|
+
makeDirectory: z.ZodOptional<z.ZodBoolean>;
|
|
167
|
+
}, z.core.$strict>>;
|
|
168
|
+
wantedBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
169
|
+
requiredBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
170
|
+
description: z.ZodString;
|
|
171
|
+
documentation: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
172
|
+
after: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
173
|
+
before: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
174
|
+
wants: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
175
|
+
requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
176
|
+
bindsTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
177
|
+
partOf: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
178
|
+
conflicts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
179
|
+
conditionPathExists: z.ZodOptional<z.ZodString>;
|
|
180
|
+
startLimitIntervalSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
181
|
+
startLimitBurst: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
}, z.core.$strict>>;
|
|
183
|
+
watches: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
184
|
+
paths: z.ZodArray<z.ZodString>;
|
|
185
|
+
onChange: z.ZodEnum<{
|
|
186
|
+
restart: "restart";
|
|
187
|
+
reload: "reload";
|
|
188
|
+
}>;
|
|
189
|
+
}, z.core.$strict>>>;
|
|
190
|
+
healthTimeout: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
}, z.core.$strict>;
|
|
192
|
+
export declare const SystemdConfigSchema: z.ZodObject<{
|
|
193
|
+
type: z.ZodLiteral<"systemd">;
|
|
194
|
+
id: z.ZodString;
|
|
195
|
+
host: z.ZodString;
|
|
196
|
+
units: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
197
|
+
name: z.ZodString;
|
|
198
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
199
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
200
|
+
unit: z.ZodOptional<z.ZodObject<{
|
|
201
|
+
service: z.ZodOptional<z.ZodObject<{
|
|
202
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
203
|
+
simple: "simple";
|
|
204
|
+
exec: "exec";
|
|
205
|
+
forking: "forking";
|
|
206
|
+
oneshot: "oneshot";
|
|
207
|
+
notify: "notify";
|
|
208
|
+
idle: "idle";
|
|
209
|
+
}>>;
|
|
210
|
+
execStart: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
211
|
+
execStartPre: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
212
|
+
execStartPost: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
213
|
+
execStop: z.ZodOptional<z.ZodString>;
|
|
214
|
+
execReload: z.ZodOptional<z.ZodString>;
|
|
215
|
+
user: z.ZodOptional<z.ZodString>;
|
|
216
|
+
group: z.ZodOptional<z.ZodString>;
|
|
217
|
+
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
218
|
+
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
219
|
+
environmentFile: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
220
|
+
restart: z.ZodOptional<z.ZodEnum<{
|
|
221
|
+
no: "no";
|
|
222
|
+
always: "always";
|
|
223
|
+
"on-success": "on-success";
|
|
224
|
+
"on-failure": "on-failure";
|
|
225
|
+
"on-abnormal": "on-abnormal";
|
|
226
|
+
"on-abort": "on-abort";
|
|
227
|
+
"on-watchdog": "on-watchdog";
|
|
228
|
+
}>>;
|
|
229
|
+
restartSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
230
|
+
killMode: z.ZodOptional<z.ZodEnum<{
|
|
231
|
+
"control-group": "control-group";
|
|
232
|
+
mixed: "mixed";
|
|
233
|
+
process: "process";
|
|
234
|
+
none: "none";
|
|
235
|
+
}>>;
|
|
236
|
+
successExitStatus: z.ZodOptional<z.ZodString>;
|
|
237
|
+
remainAfterExit: z.ZodOptional<z.ZodBoolean>;
|
|
238
|
+
timeoutStartSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
239
|
+
timeoutStopSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
240
|
+
standardOutput: z.ZodOptional<z.ZodString>;
|
|
241
|
+
standardError: z.ZodOptional<z.ZodString>;
|
|
242
|
+
syslogIdentifier: z.ZodOptional<z.ZodString>;
|
|
243
|
+
oomScoreAdjust: z.ZodOptional<z.ZodNumber>;
|
|
244
|
+
}, z.core.$strict>>;
|
|
245
|
+
timer: z.ZodOptional<z.ZodObject<{
|
|
246
|
+
onCalendar: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
247
|
+
onBootSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
248
|
+
onStartupSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
249
|
+
onActiveSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
250
|
+
onUnitActiveSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
251
|
+
randomizedDelaySec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
252
|
+
persistent: z.ZodOptional<z.ZodBoolean>;
|
|
253
|
+
accuracySec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
254
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
255
|
+
}, z.core.$strict>>;
|
|
256
|
+
path: z.ZodOptional<z.ZodObject<{
|
|
257
|
+
pathModified: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
258
|
+
pathExists: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
259
|
+
directoryNotEmpty: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
260
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
261
|
+
makeDirectory: z.ZodOptional<z.ZodBoolean>;
|
|
262
|
+
}, z.core.$strict>>;
|
|
263
|
+
wantedBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
264
|
+
requiredBy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
265
|
+
description: z.ZodString;
|
|
266
|
+
documentation: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
267
|
+
after: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
268
|
+
before: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
269
|
+
wants: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
270
|
+
requires: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
271
|
+
bindsTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
272
|
+
partOf: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
273
|
+
conflicts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
274
|
+
conditionPathExists: z.ZodOptional<z.ZodString>;
|
|
275
|
+
startLimitIntervalSec: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
276
|
+
startLimitBurst: z.ZodOptional<z.ZodNumber>;
|
|
277
|
+
}, z.core.$strict>>;
|
|
278
|
+
watches: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
279
|
+
paths: z.ZodArray<z.ZodString>;
|
|
280
|
+
onChange: z.ZodEnum<{
|
|
281
|
+
restart: "restart";
|
|
282
|
+
reload: "reload";
|
|
283
|
+
}>;
|
|
284
|
+
}, z.core.$strict>>>;
|
|
285
|
+
healthTimeout: z.ZodOptional<z.ZodNumber>;
|
|
286
|
+
}, z.core.$strict>>>;
|
|
287
|
+
masked: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
288
|
+
}, z.core.$strict>;
|
|
289
|
+
export type UnitConfig = z.output<typeof UnitSchema>;
|
|
290
|
+
export type UnitFileConfig = z.output<typeof UnitFileSchema>;
|
|
291
|
+
export type WatchConfig = z.output<typeof WatchSchema>;
|
|
292
|
+
export type SystemdConfig = z.output<typeof SystemdConfigSchema>;
|
|
293
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/modules/systemd/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA6IvB;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;;;;kBAsB1B,CAAA;AAIJ,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAqBvB,CAAA;AAIJ,eAAO,MAAM,WAAW;;;;;;kBAab,CAAA;AAIX,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0FnB,CAAA;AAEJ,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA4BrB,CAAA;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,UAAU,CAAC,CAAA;AACpD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,CAAA;AAC5D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,CAAA;AACtD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
|