1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Declarative execution plans for Hel session targets.
//!
//! Plans deliberately contain argv vectors instead of local shell strings. A
//! shell is used only at the SSH boundary, where OpenSSH necessarily sends a
//! command string; every remotely supplied argument is POSIX-quoted there.
use std::collections::BTreeMap;
use std::fs;
use std::path::{Path, PathBuf};
use anyhow::{Context, Result, bail, ensure};
use mj_core::config::ImagePullPolicy;
pub use mj_core::targets::*;
pub const PODMAN_DOCUMENTATION_PATH: &str = "docs/PODMAN.md";
pub const DOCKER_DOCUMENTATION_PATH: &str = "docs/DOCKER.md";
// `mj doctor` prints a self-contained setup page that quotes these two pages in
// full. They are embedded here, beside the paths that name them, because this
// crate's `include` list is what carries `docs/` into the published package;
// the controller crate that renders the page cannot reach outside its own
// directory.
/// The rootless Podman postconditions page, verbatim.
pub const PODMAN_DOCUMENTATION: &str = include_str!("../docs/PODMAN.md");
/// The Docker postconditions page, verbatim.
pub const DOCKER_DOCUMENTATION: &str = include_str!("../docs/DOCKER.md");
/// `--userns=keep-id:uid=,gid=`, which maps a session container's image user
/// onto the host user, landed in Podman 4.3.0.
const PODMAN_MINIMUM_VERSION: (u32, u32) = (4, 3);
mod preflight;
pub use preflight::*;
mod provision;
pub use provision::*;
mod recovery;
pub use recovery::*;
mod resources;
pub use resources::*;
mod worker_daemon;
pub use worker_daemon::*;
mod cleanup;
pub use cleanup::*;
mod bootstrap;
pub use bootstrap::*;
mod container;
use container::*;
#[cfg(test)]
mod tests;