#[derive(Debug)]
pub struct Job {
#[cfg_attr(
not(any(target_os = "macos", test)),
expect(dead_code, reason = "only launchd's plist names it")
)]
pub label: &'static str,
#[cfg_attr(
not(any(target_os = "linux", test)),
expect(dead_code, reason = "only systemd's unit names it")
)]
pub unit: &'static str,
#[cfg_attr(
not(any(target_os = "linux", test)),
expect(dead_code, reason = "only systemd's unit names it")
)]
pub title: &'static str,
#[cfg_attr(
not(any(target_os = "linux", test)),
expect(dead_code, reason = "only systemd's unit names it")
)]
pub description: &'static str,
pub noun: &'static str,
#[cfg_attr(
not(any(target_os = "macos", target_os = "linux", test)),
expect(dead_code, reason = "only macOS and Linux write a service file")
)]
pub args: &'static [&'static str],
pub terminal: &'static str,
pub install: &'static str,
pub uninstall: &'static str,
#[cfg_attr(
not(any(target_os = "macos", target_os = "linux", test)),
expect(dead_code, reason = "only macOS and Linux write a service file")
)]
pub log: &'static str,
#[cfg_attr(
not(any(target_os = "macos", target_os = "linux", test)),
expect(dead_code, reason = "only macOS and Linux write a service file")
)]
pub private: bool,
#[cfg_attr(
not(any(target_os = "macos", target_os = "linux", test)),
expect(dead_code, reason = "only macOS and Linux write a service file")
)]
pub exit_64: &'static str,
}
pub const PROXY: Job = Job {
label: "dev.openmoat.proxy",
unit: "moat-proxy.service",
title: "OpenMoat egress proxy",
description: "OpenMoat default-deny egress proxy",
noun: "the proxy",
args: &["proxy"],
terminal: "proxy",
install: "openmoat proxy install",
uninstall: "openmoat proxy uninstall",
log: "proxy",
private: false,
exit_64: "the proxy exited because of policy-lock drift. Fix the drift (`openmoat doctor`), \
then `openmoat proxy install` restarts it",
};
pub const APPROVALS: Job = Job {
label: "dev.openmoat.approvals",
unit: "openmoat-approvals.service",
title: "OpenMoat approvals listener",
description: "OpenMoat remote approvals listener",
noun: "the listener",
args: &["approvals", "listen", "--service"],
terminal: "approvals listen",
install: "openmoat approvals install",
uninstall: "openmoat approvals uninstall",
log: "approvals",
private: true,
exit_64: "the listener stopped with an error; its log says why. Fix it, then \
`openmoat approvals install` restarts it",
};