Compare commits

..
43 Commits
Author SHA1 Message Date
xavierandClaude Opus 5.5 2d9d1c0136 Merge branch 'main' into dev
Bring dev up to date with main. dev had nothing pending (its changes were
already in main in newer form), so the merge keeps main's tree as is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJhddwLWVwYhGB8t6RP
2026-11-22 15:57:02 +01:00
xavier 9cd92707d7 Merge pull request 'Dump de la base Gitea et Nextcloud dans le volume data' (#19) from feat/nextcloud-db-dump into main
Reviewed-on: #19
2026-11-22 15:55:53 +01:00
xavierandClaude Opus 5.5 8f5255f36c feat(profiles): nextcloud profile : Add DB dump script and systemd timers
Add a script to dump the DB in the volume dir so DB dumps can be backed
up alongside data files, like the gitea profile.

The DB is much bigger than gitea's (~216 MB of SQL): the dump runs every
4 hours and the last 24 hours are kept. The dump is plain SQL, not
gzipped, so that restic deduplicates between dumps: measured, a gzipped
dump adds ~67 MB to the repository each time, a plain one ~5 MB.

The dump goes through a pipe: the snap's AppArmor profile prevents
nextcloud.mysqldump from writing to a redirected file. --single-transaction
gives a consistent dump without locking the tables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJhddwLWVwYhGB8t6RP
2026-11-22 15:55:42 +01:00
xavierandClaude Opus 5.5 b8b847fe68 refactor(profiles): gitea profile : Use explicit variable names in the DB dump script
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:55:42 +01:00
xavierandClaude Opus 5.5 ef76fb8fec fix(profiles): gitea profile : Enable the DB dump timer after installing gitea
The timer was enabled before the snap install, so a first run could fire
while gitea was not installed yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:55:42 +01:00
xavier 200160976e Merge pull request 'Demo/backrest' (#20) from demo/backrest into main
Reviewed-on: #20
2026-11-22 15:51:30 +01:00
xavierandClaude Opus 5.5 17c9b04780 docs: Backrest tutorial with recorded demos and UI screenshots (demo/backrest)
- demo/backrest/README.md (fr) and README.en.md: a backup instance reading
  the data volume of another instance read-only, restic repository on its own
  volume, Backrest configured from the web UI, then restic on the command
  line and restoring a lost file
- install and restore scenarios recorded with autocast; restore configures
  Backrest through its configuration file (autoInitialize)
- UI screenshots made by screenshots.sh: a Debian instance with Chromium
  driven by Playwright fills in the forms
- demo/lib.sh: helpers shared by the tutorial preambles
- Docker tutorial: a filesystem volume can be shared by several instances,
  two Docker daemons must not share /var/lib/docker

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJkPw1qcoCubeKqfffm
2026-11-22 15:51:14 +01:00
xavier 296d45e295 feat(profiles): gitea profile : Add DB dump script and systemd timers
Add a script to dump the DB in the volume dir so DB dumps can be backed
up alongside data files.
Also add systemd timers to run the script each hour.
2026-11-22 13:52:40 +01:00
xavier abd1f7f4b2 Merge pull request 'Demo/docker' (#18) from demo/docker into main
Reviewed-on: #18
2026-11-21 20:27:37 +01:00
xavierandClaude Opus 5.5 f278c14bcb docs: Docker tutorial: data volume with snapshots, adapting an installed profile
- docker-volume-data uses the default pool (present after any lxd init)
  instead of btrfs, so that it installs everywhere; the volume must exist
  before the profile is installed
- Going further: create the volume and schedule its snapshots, launch with
  the profile, manual snapshot and restore
- Adapt an installed profile: copy the volume to another pool, change the
  profile in LXD, see the difference with mise list/diff, then go back with
  install or keep it with import; a copy of the profile for a second instance

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJkPw1qcoCubeKqfffm
2026-11-21 19:59:51 +01:00
xavierandClaude Opus 5.5 d33ee6d84f docs: Cast links in their own paragraph under the GIFs (Gitea rendering)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJkPw1qcoCubeKqfffm
2026-11-21 19:58:06 +01:00
xavierandClaude Opus 5.5 be68264e5c docs: Docker tutorial review: ubuntu:lts, long options, links to the casts
- ubuntu:lts instead of ubuntu:24.04 (26.04 today)
- cloud-init status --wait --long gives the summary, no need to read the log
- long options everywhere in the tutorial and its demos
- a discreet link to the asciinema recording under each GIF (pause, fast
  forward in Gitea's player), in the main README too
- castfix.py only restores the prompt after autocast's own !Clear

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJkPw1qcoCubeKqfffm
2026-11-21 19:49:56 +01:00
xavierandClaude Opus 5.5 372bf5d84b docs: Docker tutorial with recorded demos (demo/docker)
- demo/docker/README.md (fr) and README.en.md: step-by-step tutorial, from
  the clone of the repository to Docker used in an unprivileged LXD instance
- install and usage scenarios recorded with autocast, with their own hidden
  preamble (demo/docker/setup.sh) creating and removing what they need
- demo/castfix.py: puts back the shell prompt autocast drops and squeezes the
  cloud-init progress dots
- Tutorials section in the main READMEs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJkPw1qcoCubeKqfffm
2026-11-21 18:39:35 +01:00
xavierandClaude Opus 5.5 1333664688 feat: Add homedir and Musique volume profiles, fit streamrip to them
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 16:38:06 +01:00
xavierandClaude Opus 5.5 5076154a54 docs: Update raw URLs after the repository moved to xavier/lxd-profiles
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJksoKAfKRWoSo1tvv6
2026-11-21 16:21:43 +01:00
xavierandClaude Opus 5.5 fb896eb086 docs: French demo README, English version in demo/README.en.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJksoKAfKRWoSo1tvv6
2026-11-21 16:08:05 +01:00
xavierandClaude Opus 5.5 1253ecd07b feat: Legend and terminal-wide descriptions in list
- list: legend with one status per line (symbol, meaning, count)
- list: description column sized to the terminal width (20 to 60
  characters), 50 when the output is not a terminal
- welcome: drop the status emojis, now explained by the legend
- demo: tour re-recorded (taller window for the legend)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJksoKAfKRWoSo1tvv6
2026-11-21 16:00:22 +01:00
xavierandClaude Opus 5.5 80533c18c4 docs: French README, plain lxc usage and demo, colored status emoji
- README in French (README.md) with an English version (README.en.md),
  linked from each other
- Usage split between plain lxc (mise is optional) and mise, with the
  prerequisites of each case
- New demo of plain lxc usage (demo/lxc.yaml), one subsection per demo
- list: 📝 instead of ⚠️ for profiles that differ, rendered in color
  like the other status emojis

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJksoKAfKRWoSo1tvv6
2026-11-21 15:40:12 +01:00
xavierandClaude Opus 5.5 e31a1b9111 feat: Add animated demos recorded with autocast and agg
Scenarios in demo/*.yaml are played by autocast into asciinema
recordings (.cast, playable in Gitea) and rendered as GIFs by agg for the
README. The recording tools and fonts (Inconsolata Nerd Font, Noto Color
Emoji) live in a separate mise environment:

    MISE_ENV=demo mise run demo <tour|install>

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJksoKAfKRWoSo1tvv6
2026-11-21 15:16:46 +01:00
xavierandClaude Opus 5.5 3caef59c36 style: Normalize unattended-upgrades profile formatting
Drop the quoted description and the empty devices map, as written by
`mise run import`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJksoKAfKRWoSo1tvv6
2026-11-21 15:14:00 +01:00
xavierandClaude Opus 5.5 c921cfc6db feat: Add app-backrest profile (backrest + restic via cloud-init)
Installs the latest backrest release, run as root by a systemd unit
listening on 0.0.0.0:9898, with its config in /etc/backrest/config.json
and its data in /var/lib/backrest. Backrest downloads and maintains the
restic version it requires (>= 0.19.1, Ubuntu ships 0.18.1) in
/var/lib/backrest/restic, symlinked to /usr/local/bin/restic for CLI use.
Meant for a backup instance mounting volume-*-ro profiles (POC).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJksoKAfKRWoSo1tvv6
2026-11-21 02:28:48 +01:00
xavierandClaude Opus 5.5 37cfecf923 fix: Ignore YAML comments when comparing profiles
Comments in a repository file made an identical profile show as
different in list/diff/install.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJksoKAfKRWoSo1tvv6
2026-11-21 01:45:44 +01:00
xavierandClaude Opus 5.5 206290d88b feat: Move gitea and nextcloud data volumes to dedicated profiles
- volume-gitea-data / volume-nextcloud-data: data volume mounted in the
  application instance (daily snapshots are configured on the volume)
- volume-gitea-data-ro / volume-nextcloud-data-ro: same volumes mounted
  read-only under /backup for the backup instance (restic + backrest),
  which must be unprivileged to share the volumes idmap
- app-gitea / app-nextcloud: only install the application, the volume
  now comes from the volume-* profile

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJksoKAfKRWoSo1tvv6
2026-11-21 01:45:44 +01:00
xavier 63333b2c1a feat: Update profile user-xavier 2026-11-21 00:41:17 +01:00
xavierandClaude Opus 5.5 2788a7f886 feat: Add microk8s-config and proxy-stun-turn profiles
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJksoKAfKRWoSo1tvv6
2026-11-21 00:27:16 +01:00
xavierandClaude Opus 5.5 f37c01df57 feat: Switch profiles to cgroup v2 and drop raw.lxc from docker profiles
- Use lxc.cgroup2.devices.allow instead of the cgroup v1 key, ignored on
  cgroup v2 hosts (Ubuntu >= 21.10)
- Remove raw.lxc (unconfined apparmor, all devices, no cap drop) from
  docker, dokploy and coolify: privileged + nesting is enough, tested
  with build, published ports, privileged containers, limits and restart
- Add docker-unprivileged profile (nesting + mknod/setxattr syscall
  interception) for new containers
- Sync microk8s with the deployed version (device numbering)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018inUJksoKAfKRWoSo1tvv6
2026-11-21 00:27:16 +01:00
xavier f99bd9e65a feat: Improve description for some profiles 2026-11-21 00:07:17 +01:00
xavier 1930cc67e0 feat: Improve profile listing by adding a desc and add a task to display profiles 2026-11-21 00:03:28 +01:00
xavier 19b6b16ea8 feat: Update or fix some profiles 2026-11-20 23:41:58 +01:00
xavier eff9cfc92c feat: Use mise tasks to ease list/install/update/diff of LXC profiles between LXC and the repo 2026-11-20 23:40:55 +01:00
xavier d21bb31d95 feat: Add a profile to deploy Coolify 2026-10-11 16:48:57 +02:00
xavier ed50804599 feat: Add a profile to deploy Dokploy 2026-10-11 16:48:46 +02:00
xavier 01b95ebe08 Revert "feat: Add "proxy" profile to share lxd socket from host to a container"
This reverts commit 6feb8ebad2.
2025-10-27 15:05:00 +01:00
xavier 6feb8ebad2 feat: Add "proxy" profile to share lxd socket from host to a container 2025-10-20 18:57:17 +02:00
xavier 232f528aca chore: minor changes in profiles
- reorder keys
- clean useless (dynamic) fields
- rename somes profile to normalize naming
2025-10-11 22:09:43 +02:00
xavier 523626a1e5 feat: Add profile to install streamrip application 2025-10-11 22:09:43 +02:00
xavier a528e569c4 Merge pull request 'chore: minor changes in profiles' (#13) from feature/clean-profiles into dev
Reviewed-on: cloud.logerais.com/lxd-profiles#13
2025-10-11 22:07:47 +02:00
xavier ce80ba0ee8 chore: minor changes in profiles
- reorder keys
- clean useless (dynamic) fields
- rename somes profile to normalize naming
2025-10-11 22:07:37 +02:00
xavier cb09ad0dbd Merge pull request 'feat: Add unattended-upgrades system profile' (#14) from feat/unattended-upgrades-profile into dev
Reviewed-on: cloud.logerais.com/lxd-profiles#14
2025-10-11 22:07:27 +02:00
xavier 25f0947ce2 Merge branch 'dev' into feat/unattended-upgrades-profile 2025-10-11 22:06:44 +02:00
xavier d1d509a584 Merge pull request 'feat: Add profile to install streamrip application' (#15) from feat/streamrip into dev
Reviewed-on: cloud.logerais.com/lxd-profiles#15
2025-10-11 22:06:30 +02:00
xavier 0a363c086a feat: Add profile to install streamrip application 2025-10-11 19:25:47 +02:00
xavierandClaude 582f351216 feat: Add unattended-upgrades system profile
Add a new system profile to enable automatic security updates on Ubuntu
containers using unattended-upgrades.

Features:
- Automatic installation of unattended-upgrades and apt-listchanges
- Daily security updates for Ubuntu packages
- Weekly cleanup of unused packages
- Configurable automatic reboot (disabled by default)
- ESM (Extended Security Maintenance) updates support

Configuration:
- Updates check: Daily
- Security updates: Automatic
- Autoclean interval: 7 days
- Automatic reboot: Disabled (can be enabled by setting to "true")
- Reboot time: 02:00 (if enabled)
- Remove unused dependencies: Enabled

Usage:
Apply this profile to any Ubuntu container to enable automatic security updates:
  lxc profile assign mycontainer default,unattended-upgrades

Closes #5

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 00:07:42 +02:00
94 changed files with 8068 additions and 227 deletions

No files matched your search

+117
View File
@@ -0,0 +1,117 @@
# shellcheck shell=bash
# Fonctions partagées par les tâches mise (sourcé, non exécutable).
PROFILES_DIR="${MISE_PROJECT_ROOT:-.}/profiles"
# shellcheck disable=SC2034 # couleurs utilisées par les tâches
if [ -t 1 ]; then
B=$'\033[1m'; D=$'\033[2m'; R=$'\033[0m'
RED=$'\033[31m'; GREEN=$'\033[32m'; YELLOW=$'\033[33m'; CYAN=$'\033[36m'
else
B=""; D=""; R=""; RED=""; GREEN=""; YELLOW=""; CYAN=""
fi
die() { echo "${RED}✖${R} $*" >&2; exit 1; }
warn() { echo "${YELLOW}⚠${R} $*" >&2; }
info() { echo "${CYAN}▸${R} $*"; }
# Forme canonique d'un profil, pour comparer dépôt et LXD :
# - seules name/description/config/devices sont conservées (used_by, project... écartés)
# - les valeurs sont converties en chaînes (LXD stocke `cpu: 1` sous la forme "1")
# - les clés sont triées
# Les clés inconnues (ex. `limits:` imbriqué au lieu de `limits.cpu`) sont gardées
# côté dépôt pour apparaître dans le diff : LXD les ignorerait silencieusement.
YQ_NORMALIZE='
. as $p
| {
"name": ($p.name // ""),
"description": ($p.description // ""),
"config": (($p.config // {}) | map_values(tostring)),
"devices": (($p.devices // {}) | map_values(map_values(tostring)))
}
+ ($p | del(.name, .description, .config, .devices, .used_by, .project))
| sort_keys(..)
| ... comments = ""
| (.. | select(tag == "!!str")) style = ""
| (.. | select(tag == "!!str" and test("\n"))) style = "literal"
'
# Liste "nom<TAB>fichier" des profils du dépôt, triée par nom.
repo_index() {
local f name
while IFS= read -r -d '' f; do
name=$(yq -r '.name // ""' "$f")
printf '%s\t%s\n' "$name" "${f#"${MISE_PROJECT_ROOT:-.}"/}"
done < <(find "$PROFILES_DIR" -type f -name '*.profile.yaml' -print0) | sort
}
# Résout un argument (chemin de fichier ou nom de profil) en chemin de fichier.
resolve_file() {
local arg="$1" matches
if [ -f "$arg" ]; then
echo "$arg"
return
fi
matches=$(repo_index | awk -F'\t' -v n="$arg" '$1 == n { print $2 }')
case "$(printf '%s' "$matches" | grep -c '^')" in
0) die "Profil '$arg' introuvable dans le dépôt (ni fichier, ni nom)" ;;
1) echo "$matches" ;;
*) die "Plusieurs fichiers déclarent le profil '$arg' :"$'\n'"$matches" ;;
esac
}
profile_name() { yq -r '.name // ""' "$1"; }
is_installed() { lxc profile show "$1" >/dev/null 2>&1; }
normalize_file() { yq "$YQ_NORMALIZE" "$1"; }
normalize_installed() { lxc profile show "$1" | yq "$YQ_NORMALIZE"; }
# Clés de premier niveau du fichier que LXD ne prendrait pas en compte
# (used_by et project, en lecture seule, sont tolérés : fichiers importés).
unknown_keys() {
yq -r 'keys - ["name", "description", "config", "devices", "used_by", "project"] | join(", ")' "$1"
}
# 0 si le profil installé est identique au fichier du dépôt.
is_same() {
local file="$1" name="$2"
cmp -s <(normalize_file "$file") <(normalize_installed "$name")
}
# Diff unifié : LXD (installé) → dépôt (ce que `install` appliquerait).
# Rendu avec delta dans un terminal. Retourne 1 s'il y a des différences.
show_diff() {
local file="$1" name="$2" out
out=$(diff -u --label "lxd:$name (installé)" --label "$file (dépôt)" \
<(normalize_installed "$name") <(normalize_file "$file")) && return 0
if [ -t 1 ] && command -v delta >/dev/null 2>&1; then
delta --paging=never <<<"$out"
else
printf '%s\n' "$out"
fi
return 1
}
has_tty() { [ -t 1 ] && { : </dev/tty; } 2>/dev/null; }
# Sélection interactive (gum filter) parmi des lignes lues sur stdin.
pick() {
has_tty && command -v gum >/dev/null 2>&1 || die "Sélection interactive impossible (pas de terminal ou gum absent) : préciser le profil"
gum filter --header "$1" "${@:2}" </dev/tty
}
# Demande une confirmation oui/non (défaut : non).
confirm() {
local answer
if ! has_tty; then
warn "Pas de terminal pour confirmer (utiliser --yes)"
return 1
fi
if command -v gum >/dev/null 2>&1; then
gum confirm --default=false --affirmative "Oui" --negative "Non" "$1" </dev/tty >/dev/tty
else
read -r -p "$1 [o/N] " answer </dev/tty
[[ "$answer" =~ ^[oOyY] ]]
fi
}
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
#MISE description="(interne) Noms des profils du dépôt, pour l'autocomplétion"
#MISE hide=true
source "$MISE_PROJECT_ROOT/.mise/lib.sh"
repo_index | cut -f1 | uniq
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
#MISE description="Affiche le diff entre un profil du dépôt et le profil installé dans LXD"
#MISE quiet=true
#USAGE arg "[profile]..." help="Nom de profil ou fichier du dépôt (défaut : tous les profils installés)"
#USAGE flag "--exit-code" help="Code retour 1 en cas de différence (comme git diff --exit-code)"
#USAGE complete "profile" run="mise run --quiet _names"
set -uo pipefail
source "$MISE_PROJECT_ROOT/.mise/lib.sh"
eval "args=(${usage_profile:-})"
all=false
if [ "${#args[@]}" -eq 0 ]; then
all=true
mapfile -t args < <(repo_index | cut -f2)
fi
status=0
for arg in "${args[@]}"; do
file=$(resolve_file "$arg") || { status=2; continue; }
name=$(profile_name "$file")
if ! is_installed "$name"; then
$all || warn "$name : non installé dans LXD"
continue
fi
keys=$(unknown_keys "$file")
[ -z "$keys" ] || warn "$file : clé(s) ignorée(s) par LXD : $keys"
if show_diff "$file" "$name"; then
$all || info "$name : identique"
else
status=1
fi
done
[ "$status" -eq 1 ] && [ "${usage_exit_code:-false}" != "true" ] && status=0
exit "$status"
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
#MISE description="Importe un profil installé dans LXD vers un fichier du dépôt"
#MISE quiet=true
#USAGE arg "[profile]" help="Nom du profil LXD (défaut : sélection interactive)"
#USAGE arg "[file]" help="Fichier de destination (défaut : fichier existant du dépôt, sinon profiles/<profil>.profile.yaml)"
#USAGE complete "profile" run="lxc profile list --format csv --columns n"
set -euo pipefail
source "$MISE_PROJECT_ROOT/.mise/lib.sh"
name="${usage_profile:-}"
[ -n "$name" ] || name=$(lxc profile list --format csv --columns n | pick "Profil LXD à importer")
is_installed "$name" || die "Profil '$name' absent de LXD"
file="${usage_file:-}"
if [ -z "$file" ]; then
file=$(repo_index | awk -F'\t' -v n="$name" '$1 == n { print $2; exit }')
file="${file:-profiles/$name.profile.yaml}"
fi
mkdir -p "$(dirname "$file")"
# Champs en lecture seule ou propres à l'installation retirés,
# ainsi que config/devices vides, pour un fichier minimal.
lxc profile show "$name" \
| yq '
del(.used_by, .project)
| del(.config | select(length == 0))
| del(.devices | select(length == 0))
' >"$file"
echo "${GREEN}✔${R} ${B}$name${R} → $file"
if git -C "$MISE_PROJECT_ROOT" ls-files --error-unmatch "$file" >/dev/null 2>&1; then
git -C "$MISE_PROJECT_ROOT" --no-pager diff --stat -- "$file"
echo " ${D}git diff -- $file pour le détail${R}"
else
echo " ${D}nouveau fichier (non suivi par git)${R}"
fi
+59
View File
@@ -0,0 +1,59 @@
#!/usr/bin/env bash
#MISE description="Installe ou met à jour des profils du dépôt dans LXD"
#MISE quiet=true
#MISE raw=true
#USAGE arg "[profile]..." help="Nom de profil ou fichier du dépôt (défaut : sélection interactive)"
#USAGE flag "-a --all" help="Installe / met à jour tous les profils du dépôt"
#USAGE flag "-y --yes" help="Met à jour sans demander de confirmation"
#USAGE complete "profile" run="mise run --quiet _names"
set -uo pipefail
source "$MISE_PROJECT_ROOT/.mise/lib.sh"
eval "args=(${usage_profile:-})"
if [ "${#args[@]}" -eq 0 ]; then
if [ "${usage_all:-false}" = "true" ]; then
mapfile -t args < <(repo_index | cut -f2)
else
selection=$(repo_index | cut -f2 | pick "Profils à installer (tab : sélection multiple)" --no-limit) || exit 1
[ -n "$selection" ] || exit 0
mapfile -t args <<<"$selection"
fi
fi
failed=0
for arg in "${args[@]}"; do
file=$(resolve_file "$arg") || { failed=$((failed + 1)); continue; }
name=$(profile_name "$file")
[ -n "$name" ] || { warn "$file : pas de champ 'name', ignoré"; failed=$((failed + 1)); continue; }
keys=$(unknown_keys "$file")
if [ -n "$keys" ]; then
warn "$file : clé(s) inconnue(s) de LXD ($keys), profil ignoré"
failed=$((failed + 1))
continue
fi
if is_installed "$name"; then
if is_same "$file" "$name"; then
info "${B}$name${R} : déjà à jour"
continue
fi
echo "${YELLOW}⚠${R} ${B}$name${R} existe déjà et diffère du dépôt :"
show_diff "$file" "$name"
if [ "${usage_yes:-false}" != "true" ] && ! confirm "Mettre à jour le profil $name ?"; then
info "$name : inchangé"
continue
fi
else
info "${B}$name${R} : création"
lxc profile create "$name" </dev/null || { failed=$((failed + 1)); continue; }
fi
# used_by/project éventuels (fichiers importés) sont retirés avant l'édition
if yq 'del(.used_by, .project)' "$file" | lxc profile edit "$name"; then
echo "${GREEN}✔${R} ${B}$name${R} : à jour (depuis $file)"
else
failed=$((failed + 1))
fi
done
[ "$failed" -eq 0 ] || die "$failed profil(s) en erreur"
+76
View File
@@ -0,0 +1,76 @@
#!/usr/bin/env bash
#MISE description="Liste les profils du dépôt et leur état dans LXD"
#MISE quiet=true
#USAGE flag "-a --all" help="Affiche aussi les profils installés dans LXD absents du dépôt"
set -euo pipefail
source "$MISE_PROJECT_ROOT/.mise/lib.sh"
installed=$(lxc profile list --format yaml 2>/dev/null) || die "Impossible d'interroger LXD (lxc profile list)"
declare -A used lxd_desc
while IFS=$'\t' read -r n u d; do
used[$n]=$u
lxd_desc[$n]=$d
done < <(yq -r '.[] | [.name, (.used_by | length), (.description // "")] | @tsv' <<<"$installed")
index=$(repo_index)
# Description tronquée pour tenir dans sa colonne : dans un terminal, la largeur
# restante une fois les autres colonnes placées (entre 20 et 60), sinon 50.
DESC_WIDTH=50
if [ -t 1 ] && cols=$(tput cols 2>/dev/null); then
file_width=$(awk -F'\t' '{ if (length($2) > m) m = length($2) } END { print m + 0 }' <<<"$index")
# 39 = marge, icône, nom (24), « utilisé » (7) et espaces entre colonnes
DESC_WIDTH=$((cols - 39 - file_width))
DESC_WIDTH=$((DESC_WIDTH < 20 ? 20 : DESC_WIDTH > 60 ? 60 : DESC_WIDTH))
fi
short() {
local d="${1//$'\n'/ }"
if [ "${#d}" -gt "$DESC_WIDTH" ]; then d="${d:0:$((DESC_WIDTH - 1))}…"; fi
printf '%s' "$d"
}
# Ligne : icône, couleur du nom, nom, description, utilisé, fichier, suffixe.
row() {
printf " %s %s%-24s${R} ${D}%s${R}%*s %-7s ${D}%s${R}%s\n" \
"$1" "$2" "$3" "$4" $((DESC_WIDTH - ${#4})) "" "$5" "$6" "${7:-}"
}
declare -A seen
same=0; changed=0; absent=0
printf " ${B} %-24s %-${DESC_WIDTH}s %-7s %s${R}\n" "PROFIL" "DESCRIPTION" "UTILISÉ" "FICHIER"
while IFS=$'\t' read -r name file; do
desc=$(short "$(yq -r '.description // ""' "$MISE_PROJECT_ROOT/$file")")
extra=""
if [ -n "${seen[$name]:-}" ]; then
extra=" ${RED}(nom en double : ${seen[$name]})${R}"
fi
seen[$name]=$file
if [ -z "${used[$name]+x}" ]; then
row "⬜" "$D" "$name" "$desc" "-" "$file" "$extra"
absent=$((absent + 1))
elif is_same "$file" "$name"; then
row "✅" "$GREEN" "$name" "$desc" "${used[$name]}" "$file" "$extra"
same=$((same + 1))
else
row "📝" "$YELLOW" "$name" "$desc" "${used[$name]}" "$file" "$extra"
changed=$((changed + 1))
fi
done <<<"$index"
others=()
for n in "${!used[@]}"; do [ -n "${seen[$n]:-}" ] || others+=("$n"); done
if [ "${usage_all:-false}" = "true" ] && [ "${#others[@]}" -gt 0 ]; then
printf "\n ${B}Hors dépôt${R} ${D}(mise run import <profil>)${R}\n"
while IFS= read -r n; do
row "🔹" "$CYAN" "$n" "$(short "${lxd_desc[$n]}")" "${used[$n]}" ""
done < <(printf '%s\n' "${others[@]}" | sort)
fi
echo
hint_all=""; [ "${usage_all:-false}" = "true" ] || hint_all=" ${D}(--all)${R}"
echo " ${B}Légende :${R}"
echo " • ✅ à jour (${same})"
echo " • 📝 installé, différent du dépôt (${changed}) ${D}→ mise run diff${R}"
echo " • ⬜ non installé (${absent})"
echo " • 🔹 installé, absent du dépôt (${#others[@]})${hint_all}"
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
#MISE description="Affiche le contenu d'un profil du dépôt (ou sa version installée dans LXD)"
#MISE quiet=true
#USAGE arg "[profile]" help="Nom de profil ou fichier du dépôt (défaut : sélection interactive)"
#USAGE flag "-l --lxd" help="Affiche la version installée dans LXD plutôt que le fichier du dépôt"
#USAGE complete "profile" run="mise run --quiet _names"
set -euo pipefail
source "$MISE_PROJECT_ROOT/.mise/lib.sh"
arg="${usage_profile:-}"
[ -n "$arg" ] || arg=$(repo_index | cut -f2 | pick "Profil à afficher")
file=$(resolve_file "$arg")
# Coloration YAML avec bat dans un terminal, sortie brute sinon.
render() {
if [ -t 1 ] && command -v bat >/dev/null 2>&1; then
bat --language yaml --paging never --style header,grid,numbers --file-name "$1"
else
cat
fi
}
if [ "${usage_lxd:-false}" = "true" ]; then
name=$(profile_name "$file")
is_installed "$name" || die "Profil '$name' absent de LXD"
lxc profile show "$name" | render "lxd:$name"
else
render "$file" <"$MISE_PROJECT_ROOT/$file"
fi
+118
View File
@@ -0,0 +1,118 @@
# LXD Profiles
🇫🇷 [Lire en français](README.md)
This repository contains a collection of LXD profiles and network configurations designed to streamline the deployment and management of LXD containers.
## Directory Structure
- `profiles/`: Contains various LXD profile definitions categorized by their purpose (e.g., applications, networking, storage).
- `network/`: Defines LXD network configurations.
- `docs/`: Additional documentation and helper scripts.
- `demo/`: Animated demos of the mise tasks ([how they are made](demo/README.en.md)).
- `mise.toml`, `.mise/`: optional [mise](https://mise.jdx.dev) tasks to manage LXD profiles (`mise.demo.toml`: demo recording tools).
## Demo
### Plain `lxc`, without mise
![Create a profile from its YAML file with lxc](demo/lxc.gif)
<sub>▶ [asciinema recording](demo/lxc.cast)</sub>
### Tour of the mise tasks
Welcome message when entering the directory, profile list with their state in
LXD, profile content and diff between LXD and the repository.
![Welcome message, profile list, profile content and diff](demo/tour.gif)
<sub>▶ [asciinema recording](demo/tour.cast)</sub>
### Install, update and import a profile
A profile is installed, then changed directly in LXD: installing it again shows
the diff and asks for confirmation; `import` brings the change back into the
repository instead.
![Install a profile, update it after a change in LXD, import it back](demo/install.gif)
<sub>▶ [asciinema recording](demo/install.cast)</sub>
## Tutorials
Step-by-step use cases, from the clone of the repository to a ready instance:
- [Docker in an LXD container](demo/docker/README.en.md): install the
`docker-unprivileged` profile, launch an instance and use Docker.
- [Back up your LXD instances with Backrest](demo/backrest/README.en.md): a
backup instance reading the volumes of the others read-only, configured from
the web UI, then restic on the command line.
## Usage
Profiles can be used with the `lxc` client alone; [mise](https://mise.jdx.dev)
is optional and only adds comfort on top of it.
| Use case | Prerequisites |
|---|---|
| Plain `lxc` | LXD and the `lxc` client |
| With mise | LXD, the `lxc` client and [mise](https://mise.jdx.dev) (it installs `yq`, `gum`, `delta` and `bat` with `mise install`) |
### Plain `lxc`, without mise
Each `*.profile.yaml` file is a regular LXD profile, as printed by
`lxc profile show`: it can be applied as is.
```bash
# Create (or update) a profile from its file
lxc profile create docker
lxc profile edit docker < profiles/containerization/docker.profile.yaml
# Use it when launching an instance
lxc launch ubuntu:24.04 web -p default -p docker
# Compare the installed profile with the repository
# (raw diff: field order, quoting and used_by also show up)
diff <(lxc profile show docker) profiles/containerization/docker.profile.yaml
# Save a profile changed in LXD back into the repository
# (then remove the read-only used_by and project fields)
lxc profile show docker > profiles/containerization/docker.profile.yaml
```
### With mise
The mise tasks wrap the same `lxc` commands and add:
- a short help displayed when entering the directory (mise `enter` hook), and
`mise tasks` to list every task;
- a profile list showing each one's state in LXD (up to date, different, not
installed);
- colored diffs (`delta`) computed on a normalized form, so formatting or
quoting alone never shows up as a change;
- interactivity: profile selection and yes/no confirmation before overwriting
a profile that differs (`gum`), YAML highlighting (`bat`);
- a clean import of LXD profiles into the repository.
A profile can be designated by its name (`docker`) or its file
(`profiles/containerization/docker.profile.yaml`).
| Task | Description |
|---|---|
| `mise run list [--all]` | Repository profiles and their state in LXD: ✅ up to date, 📝 installed but different, ⬜ not installed. `--all` also shows 🔹 profiles installed in LXD but missing from the repository |
| `mise run show [profile] [--lxd]` | Displays a repository profile (YAML highlighted with `bat`), or with `--lxd` the version installed in LXD |
| `mise run diff [profile...]` | Diff between the installed profile (LXD) and the repository file. Without argument, every installed profile that differs. `--exit-code` returns 1 when there are differences |
| `mise run install [profile...]` | Creates or updates profiles. An existing profile that differs shows its diff and asks for confirmation (`--yes` to skip). Without argument, interactive selection; `--all` for every profile |
| `mise run import [profile] [file]` | Writes an installed LXD profile to the repository (without `used_by`, `project`, empty `config`/`devices`). Defaults to the repository file declaring that name, or `profiles/<profile>.profile.yaml`. Review with `git diff` before committing |
Differences are computed on a normalized form (keys sorted, values as strings,
read-only fields dropped). Top-level keys unknown to LXD (silently ignored by `lxc profile edit`)
are reported, and `install` refuses such files.
```bash
mise run list --all
mise run diff docker
mise run install docker profiles/applications/traefik.profile.yaml
mise run import s3 profiles/applications/s3.profile.yaml && git diff
```
+104 -18
View File
@@ -1,34 +1,120 @@
# LXD Profiles
# Profils LXD
This repository contains a collection of LXD profiles and network configurations designed to streamline the deployment and management of LXD containers.
🇬🇧 [Read in English](README.en.md)
## Directory Structure
Ce dépôt rassemble des profils et des configurations réseau LXD, pour simplifier
le déploiement et la gestion de conteneurs LXD.
- `profiles/`: Contains various LXD profile definitions categorized by their purpose (e.g., applications, networking, storage).
- `network/`: Defines LXD network configurations.
- `docs/`: Additional documentation and helper scripts.
- `install.bash`: A utility script to manage LXD profiles.
## Organisation du dépôt
## Usage
- `profiles/` : les profils LXD, classés par usage (applications, réseau, stockage…).
- `network/` : les configurations réseau LXD.
- `docs/` : documentation complémentaire et scripts d'aide.
- `demo/` : les démos animées ([comment elles sont produites](demo/README.md)).
- `mise.toml`, `.mise/` : tâches [mise](https://mise.jdx.dev), optionnelles, pour gérer les profils LXD (`mise.demo.toml` : outils d'enregistrement des démos).
### `install.bash`
## Démo
This script allows you to create and update LXD profiles based on the YAML files in the `profiles/` directory.
### Avec `lxc` seul, sans mise
#### Update all profiles
![Création d'un profil à partir de son fichier YAML avec lxc](demo/lxc.gif)
To update all profiles defined in this repository, run the script without any arguments:
<sub>▶ [Enregistrement asciinema](demo/lxc.cast)</sub>
### Tour des tâches mise
Message d'accueil à l'entrée dans le dossier, liste des profils avec leur état
dans LXD, contenu d'un profil et différences entre LXD et le dépôt.
![Message d'accueil, liste des profils, contenu d'un profil et diff](demo/tour.gif)
<sub>▶ [Enregistrement asciinema](demo/tour.cast)</sub>
### Installer, mettre à jour et importer un profil
Un profil est installé, puis modifié directement dans LXD : le réinstaller
affiche le diff et demande une confirmation ; `import` rapatrie au contraire
la modification dans le dépôt.
![Installation d'un profil, mise à jour après une modification dans LXD, puis import](demo/install.gif)
<sub>▶ [Enregistrement asciinema](demo/install.cast)</sub>
## Tutoriels
Des cas d'usage pas à pas, du clone du dépôt à une instance prête à servir :
- [Docker dans un conteneur LXD](demo/docker/README.md) : installer le profil
`docker-unprivileged`, lancer une instance et utiliser Docker.
- [Sauvegarder ses instances LXD avec Backrest](demo/backrest/README.md) : une
instance de sauvegarde qui lit les volumes des autres en lecture seule,
configurée depuis l'interface web, puis restic en ligne de commande.
## Utilisation
Les profils s'utilisent avec le seul client `lxc` ; [mise](https://mise.jdx.dev)
est optionnel et n'apporte que du confort en plus.
| Cas d'usage | Prérequis |
|---|---|
| `lxc` seul | LXD et le client `lxc` |
| Avec mise | LXD, le client `lxc` et [mise](https://mise.jdx.dev) (qui installe `yq`, `gum`, `delta` et `bat` avec `mise install`) |
### Avec `lxc` seul, sans mise
Chaque fichier `*.profile.yaml` est un profil LXD ordinaire, au format de
`lxc profile show` : il s'applique tel quel.
```bash
./install.bash
# Créer (ou mettre à jour) un profil à partir de son fichier
lxc profile create docker
lxc profile edit docker < profiles/containerization/docker.profile.yaml
# L'utiliser au lancement d'une instance
lxc launch ubuntu:24.04 web -p default -p docker
# Comparer le profil installé avec le dépôt
# (diff brut : l'ordre des champs, les guillemets et used_by apparaissent aussi)
diff <(lxc profile show docker) profiles/containerization/docker.profile.yaml
# Enregistrer dans le dépôt un profil modifié dans LXD
# (puis retirer les champs en lecture seule used_by et project)
lxc profile show docker > profiles/containerization/docker.profile.yaml
```
#### Update specific profiles
### Avec mise
To update one or more specific profiles, provide their file paths as arguments to the script:
Les tâches mise s'appuient sur les mêmes commandes `lxc` et ajoutent :
- une aide courte affichée à l'entrée dans le dossier (hook `enter` de mise),
et `mise tasks` pour lister toutes les tâches ;
- une liste des profils avec l'état de chacun dans LXD (à jour, différent,
non installé) ;
- des diff colorés (`delta`), calculés sur une forme normalisée : une simple
différence de mise en forme ou de guillemets n'apparaît jamais ;
- de l'interactivité : sélection des profils et confirmation oui/non avant
d'écraser un profil qui diffère (`gum`), coloration du YAML (`bat`) ;
- un import propre des profils LXD dans le dépôt.
Un profil se désigne par son nom (`docker`) ou par son fichier
(`profiles/containerization/docker.profile.yaml`).
| Tâche | Description |
|---|---|
| `mise run list [--all]` | Profils du dépôt et leur état dans LXD : ✅ à jour, 📝 installé mais différent, ⬜ non installé. `--all` affiche aussi 🔹 les profils installés dans LXD mais absents du dépôt |
| `mise run show [profil] [--lxd]` | Affiche un profil du dépôt (YAML coloré par `bat`), ou avec `--lxd` la version installée dans LXD |
| `mise run diff [profil...]` | Diff entre le profil installé (LXD) et le fichier du dépôt. Sans argument, tous les profils installés qui diffèrent. `--exit-code` renvoie 1 s'il y a des différences |
| `mise run install [profil...]` | Crée ou met à jour des profils. Un profil existant qui diffère affiche son diff et demande confirmation (`--yes` pour passer outre). Sans argument, sélection interactive ; `--all` pour tous les profils |
| `mise run import [profil] [fichier]` | Écrit un profil installé dans LXD vers le dépôt (sans `used_by`, `project`, ni `config`/`devices` vides). Par défaut, le fichier du dépôt qui déclare ce nom, sinon `profiles/<profil>.profile.yaml`. À relire avec `git diff` avant de commiter |
Les différences sont calculées sur une forme normalisée (clés triées, valeurs
converties en chaînes, champs en lecture seule écartés). Les clés de premier
niveau inconnues de LXD (ignorées sans avertissement par `lxc profile edit`)
sont signalées, et `install` refuse ces fichiers.
```bash
./install.bash profiles/containerization/docker.profile.yaml profiles/applications/traefik.profile.yaml
mise run list --all
mise run diff docker
mise run install docker profiles/applications/traefik.profile.yaml
mise run import s3 profiles/applications/s3.profile.yaml && git diff
```
This will update only the `docker` and `traefik` profiles.
+59
View File
@@ -0,0 +1,59 @@
# Demos
🇫🇷 [Lire en français](README.md)
The animations of the [README](../README.en.md) are recorded with
[autocast](https://github.com/k9withabone/autocast) from scenarios written in
YAML (`<scenario>.yaml`): the commands really run in a bash shell and the
session is written as an [asciinema](https://asciinema.org) recording
(`<scenario>.cast`), then rendered as a GIF with
[agg](https://github.com/asciinema/agg).
The `.cast` files can be played in Gitea's file view (asciinema player).
| Scenario | Demo | Prerequisites |
|---|---|---|
| `tour.yaml` | welcome message, `list`, `show`, `diff` (read only) | LXD |
| `lxc.yaml` | plain `lxc`, without mise: create a profile from its YAML file | LXD, profile `unattended-upgrades` not installed |
| `install.yaml` | `install`, diff and confirmation after a change in LXD, `import` | LXD, profile `unattended-upgrades` not installed |
| `docker/install.yaml` | [Docker tutorial](docker/README.en.md): clone the repository, install the `docker-unprivileged` profile, launch an instance and follow cloud-init | LXD, mise, no instance `docker` nor profile `docker-unprivileged` |
| `docker/usage.yaml` | [Docker tutorial](docker/README.en.md): `lxc exec`, then `lxc shell` and Docker commands in the instance | LXD, mise |
| `backrest/install.yaml` | [Backrest tutorial](backrest/README.en.md): `app-backrest` profile, volumes, backup instance | LXD, mise, no `backrest` nor `app` instance, no `backups` nor `app-data` volume, no `app-backrest` profile |
| `backrest/restore.yaml` | [Backrest tutorial](backrest/README.en.md): restic on the command line, restoring a file | LXD, mise |
## Recording a demo
The recording tools live in a separate mise environment (`mise.demo.toml`), so
they are only installed when making demos:
```shell
MISE_ENV=demo mise run demo <scenario> # demo/<scenario>.cast and demo/<scenario>.gif
```
`setup.sh` is the hidden preamble of every scenario (mise activated, `delta` as
git pager). `lxc.yaml` and `install.yaml` install the profile
`unattended-upgrades` in LXD (`install.yaml` also modifies it and imports it
into the repository); their hidden epilogue restores the repository file as it
was and deletes the profile. These scenarios refuse to start if that profile is
already installed.
The scenarios of a tutorial live in a subdirectory (`docker/`, `backrest/`),
with their own `setup.sh` preamble (shared functions in `lib.sh`): it creates or checks what the scenario needs (instance,
profile, clone of the repository in a temporary directory), and its epilogue
removes what the demo created. These scenarios let the shell display its own
prompt (`prompt: ""` for autocast), so that the instance root shell opened by
`lxc shell` keeps its own.
Web UI screenshots (`backrest/*.png`) are made by `backrest/screenshots.sh`: a
Debian instance with Chromium, driven by Playwright (`screenshots.mjs`), fills
in the UI forms; everything is removed at the end.
`castfix.py` touches up each recording: it puts back the shell prompt that
autocast drops (at the start and after a `!Clear`) and speeds up the progress
dots of `cloud-init status --wait`.
agg draws the text itself, with fonts installed by mise in the demo environment
(nothing is installed on the system, which can be headless):
[Inconsolata Nerd Font](https://www.nerdfonts.com) and
[Noto Color Emoji](https://github.com/googlefonts/noto-emoji), passed with
`--font-dir`.
+62
View File
@@ -0,0 +1,62 @@
# Démos
🇬🇧 [Read in English](README.en.md)
Les animations du [README](../README.md) sont enregistrées avec
[autocast](https://github.com/k9withabone/autocast) à partir de scénarios
écrits en YAML (`<scénario>.yaml`) : les commandes sont réellement exécutées
dans un shell bash et la session est enregistrée au format
[asciinema](https://asciinema.org) (`<scénario>.cast`), puis convertie en GIF
avec [agg](https://github.com/asciinema/agg).
Les fichiers `.cast` se lisent dans la vue fichier de Gitea (lecteur asciinema).
| Scénario | Démo | Prérequis |
|---|---|---|
| `tour.yaml` | message d'accueil, `list`, `show`, `diff` (lecture seule) | LXD |
| `lxc.yaml` | `lxc` seul, sans mise : création d'un profil à partir de son fichier YAML | LXD, profil `unattended-upgrades` non installé |
| `install.yaml` | `install`, diff et confirmation après une modification dans LXD, `import` | LXD, profil `unattended-upgrades` non installé |
| `docker/install.yaml` | [tutoriel Docker](docker/README.md) : clone du dépôt, installation du profil `docker-unprivileged`, lancement d'une instance et suivi de cloud-init | LXD, mise, ni instance `docker` ni profil `docker-unprivileged` |
| `docker/usage.yaml` | [tutoriel Docker](docker/README.md) : `lxc exec`, puis `lxc shell` et commandes Docker dans l'instance | LXD, mise |
| `backrest/install.yaml` | [tutoriel Backrest](backrest/README.md) : profil `app-backrest`, volumes, instance de sauvegarde | LXD, mise, ni instances `backrest` et `app`, ni volumes `backups` et `app-data`, ni profil `app-backrest` |
| `backrest/restore.yaml` | [tutoriel Backrest](backrest/README.md) : restic en ligne de commande, restauration d'un fichier | LXD, mise |
## Enregistrer une démo
Les outils d'enregistrement sont déclarés dans un environnement mise à part
(`mise.demo.toml`) : ils ne sont installés que pour produire les démos.
```shell
MISE_ENV=demo mise run demo <scénario> # demo/<scénario>.cast et demo/<scénario>.gif
```
`setup.sh` est le préambule masqué de chaque scénario (mise activé, `delta`
comme pager de git). `lxc.yaml` et `install.yaml` installent le profil
`unattended-upgrades` dans LXD (`install.yaml` le modifie aussi et l'importe
dans le dépôt) ; leur épilogue masqué remet le fichier du dépôt dans son état
d'origine et supprime le profil. Ces scénarios refusent de démarrer si ce
profil est déjà installé.
Les scénarios d'un tutoriel sont rangés dans un sous-dossier (`docker/`,
`backrest/`), avec leur propre préambule `setup.sh` (fonctions communes dans
`lib.sh`) : il crée ou vérifie ce dont le scénario a
besoin (instance, profil, clone du dépôt dans un dossier temporaire) et son
épilogue supprime ce que la démo a créé. Ces scénarios laissent le shell
afficher lui-même son prompt (`prompt: ""` côté autocast), pour que le shell
root de l'instance ouvert par `lxc shell` garde le sien.
Les captures d'écran d'une interface web (`backrest/*.png`) sont produites par
`backrest/screenshots.sh` : une instance Debian avec Chromium, pilotée par
Playwright (`screenshots.mjs`), remplit les formulaires de l'interface ; tout
est supprimé à la fin.
`castfix.py` retouche chaque enregistrement : il remet le prompt du shell que
autocast efface (au début et après un `!Clear`) et accélère les points de
progression de `cloud-init status --wait`.
agg dessine lui-même le texte, avec des polices installées par mise dans
l'environnement de démo (rien n'est installé sur le système, qui peut être
sans interface graphique) :
[Inconsolata Nerd Font](https://www.nerdfonts.com) et
[Noto Color Emoji](https://github.com/googlefonts/noto-emoji), passées avec
`--font-dir`.
+256
View File
@@ -0,0 +1,256 @@
# Back up your LXD instances with Backrest
🇫🇷 [Lire en français](README.md)
Your LXD instances are running, their data lives in volumes… what about
backups? [restic](https://restic.net) is a great backup tool: deduplicated,
encrypted, able to write to a local disk, an SFTP server or S3 storage.
[Backrest](https://github.com/garethgeorge/backrest) adds a web UI on top of
it: scheduling, retention, history and snapshot browsing, restore in a few
clicks.
This tutorial sets up a dedicated **backup instance**. It reads the data of
another instance through a volume mounted **read-only**, and backs it up to a
restic repository stored on a separate volume. The application has nothing to
install, and the backup instance cannot damage what it backs up.
```mermaid
flowchart LR
app["app instance"] -- "read/write<br>/srv/app" --> data[("app-data volume<br>data to protect")]
backrest["backrest instance<br>Backrest + restic"] -- "read-only<br>/backup/app-data" --> data
backrest -- "write<br>/backups" --> backups[("backups volume<br>restic repository")]
```
![app-backrest profile, volumes, launch of the backup instance and cloud-init](install.gif)
<sub>▶ [asciinema recording](install.cast)</sub>
## What you need
The same prerequisites as the [Docker tutorial](../docker/README.en.md#what-you-need):
- **LXD** installed and initialized (`lxc list` answers without error);
- **[mise](https://mise.jdx.dev)**, and this repository cloned and trusted
(`mise trust`), see [Get the repository](../docker/README.en.md#1-get-the-repository);
- **internet access** from the instances (Ubuntu packages, GitHub to download
Backrest and restic);
- a **browser** that reaches the instances (on the host, that is the case by
default: the `lxdbr0` bridge is routed);
- room on a storage pool for the backup repository.
From here on, the data to protect is that of an `app` instance, in an
`app-data` volume mounted on `/srv/app`. Replace it with yours. To follow the
tutorial as is, create it:
```shell
lxc storage volume create default app-data size=5GiB
lxc launch ubuntu:lts app
lxc storage volume attach default app-data app /srv/app
lxc exec app -- sh -c 'echo "Hello from app" > /srv/app/notes.txt'
```
## 1. The `app-backrest` profile
```shell
mise run show app-backrest
```
The profile only holds cloud-init:
- a `backrest` systemd service, listening on port **9898** of the instance,
with its configuration in `/etc/backrest/config.json` and its data in
`/var/lib/backrest`;
- at first boot, the download of the latest Backrest release from GitHub, then
the start of the service;
- Backrest downloads by itself the restic version it needs, and the profile
makes it available on the command line (`/usr/local/bin/restic`) for
restores and manual checks.
The service runs as `root` in the instance, to read every file of the mounted
volumes, whoever owns them. As the instance is unprivileged, that root has no
rights on the host.
```shell
mise run install app-backrest
```
## 2. The volumes
The restic repository has its own volume: it outlives the backup instance, and
can live on another pool, ideally another disk than the data.
```shell
lxc storage volume create default backups size=20GiB
```
`lxc storage volume list` shows the volumes and how many instances use them:
```shell
lxc storage volume list default type=custom --columns nu
```
## 3. The backup instance
```shell
lxc launch ubuntu:lts backrest --profile default --profile app-backrest
lxc config device add backrest backups disk pool=default source=backups path=/backups
lxc config device add backrest app-data disk pool=default source=app-data path=/backup/app-data readonly=true
```
- `backups` is mounted read/write on `/backups`: the restic repository will
live there;
- `app-data` is mounted **read-only** (`readonly=true`) on `/backup/app-data`.
A filesystem volume can be attached to several instances at once: `app`
keeps writing to it, `backrest` reads it.
Devices are hot-plugged, no need to restart the instance. Wait for the end of
the installation, then check the service:
```shell
lxc exec backrest -- cloud-init status --wait --long
lxc exec backrest -- systemctl is-active backrest
lxc list backrest --columns ns4
```
The web UI answers on `http://<IPv4 address of the instance>:9898`.
> [!TIP]
> The read-only mounts of this repository follow this pattern:
> `volume-gitea-data-ro` and `volume-nextcloud-data-ro` mount the Gitea and
> Nextcloud data volumes under `/backup/`. For your own applications, one
> profile per backed up volume saves typing these commands. As for the
> `docker-volume-data` profile of the Docker tutorial, adapt the pool to your
> setup ([see how](../docker/README.en.md#adapt-an-installed-profile-to-your-needs)).
## 4. Configure Backrest
Everything happens in the web UI.
### First run
Backrest asks for an **instance ID** (it shows in the snapshots and cannot be
changed afterwards) and an administrator account. Disabling authentication is
possible, but not advised as soon as the UI is reachable from the network.
![First run settings: instance ID and administrator account](settings.png)
### The repository
**Add Repo**: a name (`local`), the repository URI (`/backups/restic`, on the
`backups` volume) and a password. **The password encrypts the repository:
without it, the backups cannot be read.** Keep a copy of it outside the
instance.
Backrest initializes the restic repository on submit. The next tabs schedule
the repository maintenance: `prune` (reclaim the space of forgotten snapshots)
and `check` (verify its integrity).
![Adding the local restic repository](repo.png)
The URI can also point to remote storage (`s3:…`, `sftp:…`, `rclone:…`): the
best protection against losing the host disk.
### The backup plan
**Add Plan**: a name (`app-data`), the repository and the path(s) to back up
(`/backup/app-data`)…
![Backup plan: name, repository and paths](plan.png)
… the schedule (here every day at 3am, cron expression `0 3 * * *`) and the
retention: how many snapshots to keep per hour, day, month…
![Plan schedule: every day at 3am](plan-schedule.png)
### First backup
On the plan page, **Backup Now** runs a backup without waiting for the
schedule. The history shows every operation, the next scheduled backup and the
details of the snapshots:
![Plan page after the first backup](backup.png)
The **Snapshot Browser** walks through the content of a snapshot. The `…` menu
of each file or directory restores it, or downloads it.
![Browsing the content of the snapshot](snapshot.png)
## 5. restic on the command line, and restoring a file
![restic snapshots, ls and stats in the backup instance, then restoring a lost file of the app instance](restore.gif)
<sub>▶ [asciinema recording](restore.cast)</sub>
restic is available in the backup instance, next to Backrest. Backrest
snapshots are regular restic snapshots, tagged with the plan name:
```shell
lxc shell backrest
```
```shell
export RESTIC_REPOSITORY=/backups/restic RESTIC_PASSWORD=<repository password>
restic snapshots # list of snapshots
restic ls latest /backup/app-data --recursive # content of the latest
restic stats latest # size
exit
```
To put a lost file back in the `app` instance, `restic dump` writes the file
taken from a snapshot to its standard output, and `lxc file push` drops it in
the instance:
```shell
lxc exec backrest --env RESTIC_PASSWORD=<repository password> -- \
restic --repo /backups/restic dump latest /backup/app-data/notes.txt \
| lxc file push --uid 0 --gid 0 --mode 0644 - app/srv/app/notes.txt
```
As the `app-data` volume is read-only for Backrest, it cannot restore in place.
To restore a whole directory, restore it into a directory of the backup
instance (from the UI: *Restore to path*, or
`restic restore latest --target /backups/restore`), then transfer it, or
attach the volume read/write for the time of the restore.
## Going further
- **Reach the UI from the network.** A `proxy` device publishes port 9898 on
the host:
```shell
lxc config device add backrest web proxy listen=tcp:0.0.0.0:9898 connect=tcp:127.0.0.1:9898
```
- **Protect the repository too.** The `backups` volume can have its own LXD
snapshots (`snapshots.schedule`, see the
[Docker tutorial](../docker/README.en.md#keep-docker-data-in-a-volume-with-automatic-snapshots)),
and a second plan can back up the same data to a remote repository (S3,
SFTP…).
- **Back up other instances.** One read-only device per volume, one plan per
volume: a single backup instance is enough for a whole host.
- **Clean up.**
```shell
lxc delete --force backrest app
lxc storage volume delete default backups # the backup repository!
lxc storage volume delete default app-data
lxc profile delete app-backrest
```
## Replaying the demos and screenshots
The animations of this page are recorded from the `install.yaml` and
`restore.yaml` scenarios (see [how the demos are made](../README.en.md)), the
UI screenshots with `screenshots.sh`: a Debian instance with Chromium, driven
by [Playwright](https://playwright.dev) (`screenshots.mjs`), fills in the
forms as described above.
```shell
MISE_ENV=demo mise run demo backrest/install
MISE_ENV=demo mise run demo backrest/restore
demo/backrest/screenshots.sh
```
They create the `backrest` and `app` instances, the `backups` and `app-data`
volumes and the `app-backrest` profile, then remove them at the end.
`restore.yaml` configures Backrest through its configuration file rather than
the UI. In the animation, the cloud-init wait is sped up.
+265
View File
@@ -0,0 +1,265 @@
# Sauvegarder ses instances LXD avec Backrest
🇬🇧 [Read in English](README.en.md)
Vos instances LXD tournent, leurs données vivent dans des volumes… et les
sauvegardes ? [restic](https://restic.net) est un excellent outil de
sauvegarde : dédupliqué, chiffré, capable d'écrire sur un disque local, un
serveur SFTP ou un stockage S3. [Backrest](https://github.com/garethgeorge/backrest)
lui ajoute une interface web : planification, rétention, historique et
navigation dans les snapshots, restauration en quelques clics.
Ce tutoriel met en place une **instance de sauvegarde** dédiée. Elle lit les
données d'une autre instance à travers un volume monté **en lecture seule** et
les sauvegarde dans un dépôt restic posé sur un volume à part. L'application
n'a rien à installer, et l'instance de sauvegarde ne peut pas abîmer ce
qu'elle sauvegarde.
```mermaid
flowchart LR
app["instance app"] -- "lecture/écriture<br>/srv/app" --> data[("volume app-data<br>données à protéger")]
backrest["instance backrest<br>Backrest + restic"] -- "lecture seule<br>/backup/app-data" --> data
backrest -- "écriture<br>/backups" --> backups[("volume backups<br>dépôt restic")]
```
![Profil app-backrest, volumes, lancement de l'instance de sauvegarde et suivi de cloud-init](install.gif)
<sub>▶ [Enregistrement asciinema](install.cast)</sub>
## Ce qu'il vous faut
Les mêmes prérequis que pour le [tutoriel Docker](../docker/README.md#ce-quil-vous-faut) :
- **LXD** installé et initialisé (`lxc list` répond sans erreur) ;
- **[mise](https://mise.jdx.dev)** et ce dépôt cloné et approuvé
(`mise trust`), voir [Récupérer le dépôt](../docker/README.md#1-récupérer-le-dépôt) ;
- un **accès à internet** depuis les instances (paquets Ubuntu, GitHub pour
télécharger Backrest et restic) ;
- un **navigateur** qui atteint les instances (sur la machine hôte, c'est le
cas par défaut : le bridge `lxdbr0` est routé) ;
- de la place sur un pool de stockage pour le dépôt de sauvegarde.
Dans la suite, les données à protéger sont celles d'une instance `app`, dans
un volume `app-data` monté sur `/srv/app`. Remplacez-les par les vôtres. Pour
suivre le tutoriel à l'identique, créez-les :
```shell
lxc storage volume create default app-data size=5GiB
lxc launch ubuntu:lts app
lxc storage volume attach default app-data app /srv/app
lxc exec app -- sh -c 'echo "Hello from app" > /srv/app/notes.txt'
```
## 1. Le profil `app-backrest`
```shell
mise run show app-backrest
```
Le profil ne contient que du cloud-init :
- un service systemd `backrest`, qui écoute sur le port **9898** de
l'instance, garde sa configuration dans `/etc/backrest/config.json` et ses
données dans `/var/lib/backrest` ;
- au premier démarrage, le téléchargement de la dernière version de Backrest
depuis GitHub, puis le démarrage du service ;
- Backrest télécharge lui-même la version de restic dont il a besoin, et le
profil la rend disponible en ligne de commande (`/usr/local/bin/restic`) pour
les restaurations et les vérifications à la main.
Le service tourne en `root` dans l'instance, pour lire tous les fichiers des
volumes montés, quels que soient leurs propriétaires. Comme l'instance n'est
pas privilégiée, ce root n'a aucun droit sur l'hôte.
```shell
mise run install app-backrest
```
## 2. Les volumes
Le dépôt restic a son propre volume : il survit à l'instance de sauvegarde, et
on peut le placer sur un autre pool, idéalement un autre disque que les
données.
```shell
lxc storage volume create default backups size=20GiB
```
`lxc storage volume list` montre les volumes et le nombre d'instances qui les
utilisent :
```shell
lxc storage volume list default type=custom --columns nu
```
## 3. L'instance de sauvegarde
```shell
lxc launch ubuntu:lts backrest --profile default --profile app-backrest
lxc config device add backrest backups disk pool=default source=backups path=/backups
lxc config device add backrest app-data disk pool=default source=app-data path=/backup/app-data readonly=true
```
- `backups` est monté en lecture/écriture sur `/backups` : c'est là que vivra
le dépôt restic ;
- `app-data` est monté **en lecture seule** (`readonly=true`) sur
`/backup/app-data`. Un volume de type système de fichiers peut être attaché
à plusieurs instances à la fois : `app` continue d'y écrire, `backrest` le
lit.
Les devices s'ajoutent à chaud, pas besoin de redémarrer l'instance. On attend
la fin de l'installation, puis on vérifie le service :
```shell
lxc exec backrest -- cloud-init status --wait --long
lxc exec backrest -- systemctl is-active backrest
lxc list backrest --columns ns4
```
L'interface web répond sur `http://<adresse IPv4 de l'instance>:9898`.
> [!TIP]
> Les montages en lecture seule de ce dépôt suivent ce modèle :
> `volume-gitea-data-ro` et `volume-nextcloud-data-ro` montent les volumes de
> données de Gitea et Nextcloud sous `/backup/`. Pour vos propres
> applications, un profil par volume sauvegardé évite de retaper ces
> commandes. Comme pour le profil `docker-volume-data` du tutoriel Docker,
> adaptez le pool à votre installation
> ([voir comment](../docker/README.md#adapter-un-profil-installé-à-son-besoin)).
## 4. Configurer Backrest
Tout se passe dans l'interface web.
### Premier démarrage
Backrest demande un **identifiant d'instance** (il apparaît dans les snapshots
et ne se change plus ensuite) et un compte administrateur. Désactiver
l'authentification est possible, mais déconseillé dès que l'interface est
joignable depuis le réseau.
![Réglages du premier démarrage : identifiant d'instance et compte administrateur](settings.png)
### Le dépôt
**Add Repo** : un nom (`local`), l'URI du dépôt (`/backups/restic`, sur le
volume `backups`) et un mot de passe. **Le mot de passe chiffre le dépôt : sans
lui, les sauvegardes sont illisibles.** Gardez-en une copie ailleurs que dans
l'instance.
Backrest initialise le dépôt restic à la validation. Les onglets suivants
programment la maintenance du dépôt : `prune` (récupérer la place des
snapshots oubliés) et `check` (vérifier son intégrité).
![Ajout du dépôt restic local](repo.png)
L'URI peut aussi désigner un stockage distant (`s3:…`, `sftp:…`, `rclone:…`) :
c'est la meilleure protection contre la perte du disque de l'hôte.
### Le plan de sauvegarde
**Add Plan** : un nom (`app-data`), le dépôt et le ou les chemins à
sauvegarder (`/backup/app-data`)…
![Plan de sauvegarde : nom, dépôt et chemins](plan.png)
… la planification (ici, tous les jours à 3 h, expression cron `0 3 * * *`) et
la rétention : combien de snapshots garder par heure, jour, mois…
![Planification du plan : tous les jours à 3 h](plan-schedule.png)
### Première sauvegarde
Sur la page du plan, **Backup Now** lance une sauvegarde sans attendre la
planification. L'historique montre chaque opération, la prochaine sauvegarde
programmée et le détail des snapshots :
![Page du plan après la première sauvegarde](backup.png)
Le **Snapshot Browser** parcourt le contenu d'un snapshot. Le menu `…` de
chaque fichier ou dossier permet de le restaurer, ou de le télécharger.
![Navigation dans le contenu du snapshot](snapshot.png)
## 5. restic en ligne de commande, et restaurer un fichier
![restic snapshots, ls et stats dans l'instance de sauvegarde, puis restauration d'un fichier perdu de l'instance app](restore.gif)
<sub>▶ [Enregistrement asciinema](restore.cast)</sub>
restic est disponible dans l'instance de sauvegarde, à côté de Backrest. Les
snapshots de Backrest sont des snapshots restic ordinaires, étiquetés avec le
nom du plan :
```shell
lxc shell backrest
```
```shell
export RESTIC_REPOSITORY=/backups/restic RESTIC_PASSWORD=<mot de passe du dépôt>
restic snapshots # liste des snapshots
restic ls latest /backup/app-data --recursive # contenu du dernier
restic stats latest # taille
exit
```
Pour remettre un fichier perdu en place dans l'instance `app`, `restic dump`
écrit le fichier tiré d'un snapshot sur sa sortie standard, et
`lxc file push` le dépose dans l'instance :
```shell
lxc exec backrest --env RESTIC_PASSWORD=<mot de passe du dépôt> -- \
restic --repo /backups/restic dump latest /backup/app-data/notes.txt \
| lxc file push --uid 0 --gid 0 --mode 0644 - app/srv/app/notes.txt
```
Comme le volume `app-data` est en lecture seule pour Backrest, il ne peut pas
restaurer directement à sa place. Pour restaurer un dossier entier, on
restaure dans un dossier de l'instance de sauvegarde (depuis l'interface :
*Restore to path*, ou `restic restore latest --target /backups/restore`), puis
on le transfère, ou on attache le volume en écriture le temps de la
restauration.
## Pour aller plus loin
- **Accéder à l'interface depuis le réseau.** Un device `proxy` publie le port
9898 sur l'hôte :
```shell
lxc config device add backrest web proxy listen=tcp:0.0.0.0:9898 connect=tcp:127.0.0.1:9898
```
- **Protéger aussi le dépôt.** Le volume `backups` peut avoir ses propres
snapshots LXD (`snapshots.schedule`, voir le
[tutoriel Docker](../docker/README.md#garder-les-données-docker-dans-un-volume-avec-des-snapshots-automatiques)),
et un second plan peut sauvegarder les mêmes données vers un dépôt distant
(S3, SFTP…).
- **Sauvegarder d'autres instances.** Un device en lecture seule par volume,
un plan par volume : une seule instance de sauvegarde suffit pour tout un
hôte.
- **Faire le ménage.**
```shell
lxc delete --force backrest app
lxc storage volume delete default backups # le dépôt de sauvegarde !
lxc storage volume delete default app-data
lxc profile delete app-backrest
```
## Rejouer les démos et les captures
Les animations de cette page sont enregistrées à partir des scénarios
`install.yaml` et `restore.yaml` (voir [comment sont produites les démos](../README.md)),
les captures de l'interface avec `screenshots.sh` : une instance Debian avec
Chromium, pilotée par [Playwright](https://playwright.dev) (`screenshots.mjs`),
remplit les formulaires comme décrit plus haut.
```shell
MISE_ENV=demo mise run demo backrest/install
MISE_ENV=demo mise run demo backrest/restore
demo/backrest/screenshots.sh
```
Ils créent les instances `backrest` et `app`, les volumes `backups` et
`app-data` et le profil `app-backrest`, puis les suppriment à la fin.
`restore.yaml` configure Backrest par son fichier de configuration plutôt que
par l'interface. Dans l'animation, l'attente de cloud-init est accélérée.
Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

File diff suppressed because it is too large. Load diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 684 KiB

+51
View File
@@ -0,0 +1,51 @@
# Demo: a backup instance with Backrest, reading the data of another instance through a read-only volume
# (prerequisites: LXD, mise, no instance backrest nor app, no profile app-backrest, no volume backups nor app-data;
# all created, then removed at the end)
settings:
width: 156
height: 50
type_speed: 35ms
# Empty: the prompts are the shell's own (PS1), so that the instance's root shell keeps its own prompt
prompt: ""
timeout: 300s
# bash without rc files: the real prompt (PS1) is used to detect the end of commands
shell:
program: bash
args: [--norc, --noprofile]
prompt: AUTOCAST_PROMPT
line_split: " \\"
quit_command: exit
environment:
- {name: PS1, value: "\\[\\e[1;34m\\]lxd\\[\\e[0m\\] > AUTOCAST_PROMPT"}
- {name: PROMPT_COMMAND, value: "bind 'set enable-bracketed-paste off'"}
- {name: TERM, value: xterm-256color}
instructions:
- !Command {command: "source demo/backrest/setup.sh install", hidden: true}
- !Marker Profile
- !Command {command: "# The Backrest profile: a systemd service, Backrest and restic downloaded at first boot"}
- !Command {command: "mise run show app-backrest"}
- !Wait 5s
- !Command {command: "mise run install app-backrest"}
- !Wait 2s
- !Clear
- !Marker Volumes
- !Command {command: "# The data to protect: the app-data volume of the app instance"}
- !Command {command: "lxc storage volume list default type=custom --columns nu"}
- !Command {command: "lxc exec app -- ls /srv/app"}
- !Wait 2s
- !Command {command: "# A dedicated volume for the restic repository"}
- !Command {command: "lxc storage volume create default backups size=20GiB"}
- !Wait 2s
- !Clear
- !Marker Launch
- !Command {command: "# The backup instance: the repository volume, and the data volume read-only"}
- !Command {command: "lxc launch ubuntu:lts backrest --profile default --profile app-backrest"}
- !Command {command: "lxc config device add backrest backups disk pool=default source=backups path=/backups"}
- !Command {command: "lxc config device add backrest app-data disk pool=default source=app-data path=/backup/app-data readonly=true"}
- !Command {command: "lxc exec backrest -- cloud-init status --wait --long"}
- !Command {command: "lxc exec backrest -- systemctl is-active backrest"}
- !Command {command: "# The web UI listens on port 9898 of the instance"}
- !Command {command: "lxc list backrest --columns ns4"}
- !Wait 6s
- !Command {command: "demo_cleanup", hidden: true}
Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

+752
View File
@@ -0,0 +1,752 @@
{"version": 2, "width": 156, "height": 40, "timestamp": 1795292296, "duration": 41.630631, "env": {"SHELL": "/usr/bin/bash", "TERM": "xterm-256color", "PS1": "\\[\\e[1;34m\\]lxd\\[\\e[0m\\] > AUTOCAST_PROMPT", "PROMPT_COMMAND": "bind 'set enable-bracketed-paste off'"}}
[0.0, "o", "\u001b[1;34mlxd\u001b[0m > "]
[0.0, "o", ""]
[0.0, "m", "Restic"]
[0.035, "o", "#"]
[0.07, "o", " "]
[0.105, "o", "r"]
[0.14, "o", "e"]
[0.175, "o", "s"]
[0.21, "o", "t"]
[0.245, "o", "i"]
[0.28, "o", "c"]
[0.315, "o", " "]
[0.35, "o", "i"]
[0.385, "o", "s"]
[0.42, "o", " "]
[0.455, "o", "a"]
[0.49, "o", "v"]
[0.525, "o", "a"]
[0.56, "o", "i"]
[0.595, "o", "l"]
[0.63, "o", "a"]
[0.665, "o", "b"]
[0.7, "o", "l"]
[0.735, "o", "e"]
[0.77, "o", " "]
[0.805, "o", "i"]
[0.84, "o", "n"]
[0.875, "o", " "]
[0.91, "o", "t"]
[0.945, "o", "h"]
[0.98, "o", "e"]
[1.015, "o", " "]
[1.05, "o", "b"]
[1.085, "o", "a"]
[1.12, "o", "c"]
[1.155, "o", "k"]
[1.19, "o", "u"]
[1.225, "o", "p"]
[1.26, "o", " "]
[1.295, "o", "i"]
[1.33, "o", "n"]
[1.365, "o", "s"]
[1.4, "o", "t"]
[1.435, "o", "a"]
[1.47, "o", "n"]
[1.505, "o", "c"]
[1.54, "o", "e"]
[1.575, "o", ","]
[1.61, "o", " "]
[1.645, "o", "n"]
[1.68, "o", "e"]
[1.715, "o", "x"]
[1.75, "o", "t"]
[1.785, "o", " "]
[1.82, "o", "t"]
[1.855, "o", "o"]
[1.89, "o", " "]
[1.925, "o", "B"]
[1.96, "o", "a"]
[1.995, "o", "c"]
[2.03, "o", "k"]
[2.065, "o", "r"]
[2.1, "o", "e"]
[2.135, "o", "s"]
[2.17, "o", "t"]
[2.205, "o", "\r\n"]
[2.209259, "o", "\u001b[1;34mlxd\u001b[0m > "]
[2.20926, "o", ""]
[2.24426, "o", "l"]
[2.27926, "o", "x"]
[2.31426, "o", "c"]
[2.34926, "o", " "]
[2.38426, "o", "s"]
[2.41926, "o", "h"]
[2.45426, "o", "e"]
[2.48926, "o", "l"]
[2.52426, "o", "l"]
[2.55926, "o", " "]
[2.59426, "o", "b"]
[2.62926, "o", "a"]
[2.66426, "o", "c"]
[2.69926, "o", "k"]
[2.73426, "o", "r"]
[2.76926, "o", "e"]
[2.80426, "o", "s"]
[2.83926, "o", "t"]
[2.87426, "o", "\r\n"]
[3.192797, "o", "\u001b]3008;start=26fe51b93ef44c8daa8fdc2c61848f83;user=root;hostname=backrest;machineid=3eb50194b2f745eca62b4e3a672ec22c;bootid=a6976f29528446918536c5bfcfddc9bb;pid=3775;pidfdid=608822;comm=su;targetuser=root;sessionid=c1;type=session\u001b\\"]
[3.230722, "o", "\u001b]3008;start=6237fdd2-49c6-4d91-bf2a-abfdd0da2bf0;type=shell;machineid=3eb50194b2f745eca62b4e3a672ec22c;user=root;hostname=backrest;bootid=a6976f29-5284-4691-8536-c5bfcfddc9bb;pid=3799;cwd=/root\u001b\\"]
[3.230835, "o", "\u001b[1;32mroot@backrest\u001b[0m:~# "]
[3.230835, "o", ""]
[3.265835, "o", "e"]
[3.300835, "o", "x"]
[3.335835, "o", "p"]
[3.370835, "o", "o"]
[3.405835, "o", "r"]
[3.440835, "o", "t"]
[3.475835, "o", " "]
[3.510835, "o", "R"]
[3.545835, "o", "E"]
[3.580835, "o", "S"]
[3.615835, "o", "T"]
[3.650835, "o", "I"]
[3.685835, "o", "C"]
[3.720835, "o", "_"]
[3.755835, "o", "R"]
[3.790835, "o", "E"]
[3.825835, "o", "P"]
[3.860835, "o", "O"]
[3.895835, "o", "S"]
[3.930835, "o", "I"]
[3.965835, "o", "T"]
[4.000835, "o", "O"]
[4.035835, "o", "R"]
[4.070835, "o", "Y"]
[4.105835, "o", "="]
[4.140835, "o", "/"]
[4.175835, "o", "b"]
[4.210835, "o", "a"]
[4.245835, "o", "c"]
[4.280835, "o", "k"]
[4.315835, "o", "u"]
[4.350835, "o", "p"]
[4.385835, "o", "s"]
[4.420835, "o", "/"]
[4.455835, "o", "r"]
[4.490835, "o", "e"]
[4.525835, "o", "s"]
[4.560835, "o", "t"]
[4.595835, "o", "i"]
[4.630835, "o", "c"]
[4.665835, "o", " "]
[4.700835, "o", "R"]
[4.735835, "o", "E"]
[4.770835, "o", "S"]
[4.805835, "o", "T"]
[4.840835, "o", "I"]
[4.875835, "o", "C"]
[4.910835, "o", "_"]
[4.945835, "o", "P"]
[4.980835, "o", "A"]
[5.015835, "o", "S"]
[5.050835, "o", "S"]
[5.085835, "o", "W"]
[5.120835, "o", "O"]
[5.155835, "o", "R"]
[5.190835, "o", "D"]
[5.225835, "o", "="]
[5.260835, "o", "d"]
[5.295835, "o", "e"]
[5.330835, "o", "m"]
[5.365835, "o", "o"]
[5.400835, "o", "-"]
[5.435835, "o", "r"]
[5.470835, "o", "e"]
[5.505835, "o", "p"]
[5.540835, "o", "o"]
[5.575835, "o", "-"]
[5.610835, "o", "p"]
[5.645835, "o", "a"]
[5.680835, "o", "s"]
[5.715835, "o", "s"]
[5.750835, "o", "w"]
[5.785835, "o", "o"]
[5.820835, "o", "r"]
[5.855835, "o", "d"]
[5.890835, "o", "\r\n"]
[5.89258, "o", "\u001b]3008;start=03654584-1fa2-4c51-bb85-06611a0038d1;type=command;machineid=3eb50194b2f745eca62b4e3a672ec22c;user=root;hostname=backrest;bootid=a6976f29-5284-4691-8536-c5bfcfddc9bb;pid=3799;cwd=/root\u001b\\"]
[5.892742, "o", "\u001b]3008;end=03654584-1fa2-4c51-bb85-06611a0038d1;exit=success\u001b\\"]
[5.893457, "o", "\u001b]3008;start=6237fdd2-49c6-4d91-bf2a-abfdd0da2bf0;type=shell;machineid=3eb50194b2f745eca62b4e3a672ec22c;user=root;hostname=backrest;bootid=a6976f29-5284-4691-8536-c5bfcfddc9bb;pid=3799;cwd=/root\u001b\\"]
[5.893591, "o", "\u001b[1;32mroot@backrest\u001b[0m:~# "]
[5.893592, "o", ""]
[5.928592, "o", "r"]
[5.963592, "o", "e"]
[5.998592, "o", "s"]
[6.033592, "o", "t"]
[6.068592, "o", "i"]
[6.103592, "o", "c"]
[6.138592, "o", " "]
[6.173592, "o", "s"]
[6.208592, "o", "n"]
[6.243592, "o", "a"]
[6.278592, "o", "p"]
[6.313592, "o", "s"]
[6.348592, "o", "h"]
[6.383592, "o", "o"]
[6.418592, "o", "t"]
[6.453592, "o", "s"]
[6.488592, "o", "\r\n"]
[6.490192, "o", "\u001b]3008;start=6915a2d1-c57a-4ba0-b89e-2749f0b6b790;type=command;machineid=3eb50194b2f745eca62b4e3a672ec22c;user=root;hostname=backrest;bootid=a6976f29-5284-4691-8536-c5bfcfddc9bb;pid=3799;cwd=/root\u001b\\"]
[7.015473, "o", "\r\u001b[2Krepository 9f8fbdd5 opened (version 2, compression level auto)\r\n"]
[7.227199, "o", "\r\u001b[2KID Time Host Tags Paths Size\r\n\r\u001b[2K-----------------------------------------------------------------------------------------------------------\r\n\r\u001b[2Ka098093f 2026-11-21 21:18:03 backrest plan:app-data,created-by:backrest /backup/app-data 312.356 KiB\r\n\r\u001b[2K-----------------------------------------------------------------------------------------------------------\r\n"]
[7.227204, "o", "\r\u001b[2KTimestamps shown in local time\r\n1 snapshots\r\n"]
[7.230976, "o", "\u001b]3008;end=6915a2d1-c57a-4ba0-b89e-2749f0b6b790;exit=success\u001b\\"]
[7.231874, "o", "\u001b]3008;start=6237fdd2-49c6-4d91-bf2a-abfdd0da2bf0;type=shell;machineid=3eb50194b2f745eca62b4e3a672ec22c;user=root;hostname=backrest;bootid=a6976f29-5284-4691-8536-c5bfcfddc9bb;pid=3799;cwd=/root\u001b\\"]
[7.232106, "o", "\u001b[1;32mroot@backrest\u001b[0m:~# "]
[7.232106, "o", ""]
[9.267106, "o", "r"]
[9.302106, "o", "e"]
[9.337106, "o", "s"]
[9.372106, "o", "t"]
[9.407106, "o", "i"]
[9.442106, "o", "c"]
[9.477106, "o", " "]
[9.512106, "o", "l"]
[9.547106, "o", "s"]
[9.582106, "o", " "]
[9.617106, "o", "l"]
[9.652106, "o", "a"]
[9.687106, "o", "t"]
[9.722106, "o", "e"]
[9.757106, "o", "s"]
[9.792106, "o", "t"]
[9.827106, "o", " "]
[9.862106, "o", "/"]
[9.897106, "o", "b"]
[9.932106, "o", "a"]
[9.967106, "o", "c"]
[10.002106, "o", "k"]
[10.037106, "o", "u"]
[10.072106, "o", "p"]
[10.107106, "o", "/"]
[10.142106, "o", "a"]
[10.177106, "o", "p"]
[10.212106, "o", "p"]
[10.247106, "o", "-"]
[10.282106, "o", "d"]
[10.317106, "o", "a"]
[10.352106, "o", "t"]
[10.387106, "o", "a"]
[10.422106, "o", " "]
[10.457106, "o", "-"]
[10.492106, "o", "-"]
[10.527106, "o", "r"]
[10.562106, "o", "e"]
[10.597106, "o", "c"]
[10.632106, "o", "u"]
[10.667106, "o", "r"]
[10.702106, "o", "s"]
[10.737106, "o", "i"]
[10.772106, "o", "v"]
[10.807106, "o", "e"]
[10.842106, "o", " "]
[10.877106, "o", "|"]
[10.912106, "o", " "]
[10.947106, "o", "h"]
[10.982106, "o", "e"]
[11.017106, "o", "a"]
[11.052106, "o", "d"]
[11.087106, "o", " "]
[11.122106, "o", "-"]
[11.157106, "o", "1"]
[11.192106, "o", "2"]
[11.227106, "o", "\r\n"]
[11.229846, "o", "\u001b]3008;start=d720e610-1d36-49fd-9e20-ce5d3db74074;type=command;machineid=3eb50194b2f745eca62b4e3a672ec22c;user=root;hostname=backrest;bootid=a6976f29-5284-4691-8536-c5bfcfddc9bb;pid=3799;cwd=/root\u001b\\"]
[12.010121, "o", "snapshot a098093f of [/backup/app-data] at 2026-11-21 21:18:03.143304819 +0100 CET by root@backrest filtered by [/backup/app-data]:\r\n/backup/app-data\r\n/backup/app-data/documents\r\n/backup/app-data/documents/bash\r\n/backup/app-data/documents/bash/COMPAT.gz\r\n/backup/app-data/documents/bash/INTRO.gz\r\n/backup/app-data/documents/bash/NEWS.gz\r\n/backup/app-data/documents/bash/POSIX.gz\r\n/backup/app-data/documents/bash/RBASH\r\n/backup/app-data/documents/bash/README.Debian.gz\r\n/backup/app-data/documents/bash/README.abs-guide\r\n/backup/app-data/documents/bash/README.commands.gz\r\n"]
[12.017389, "o", "\u001b]3008;end=d720e610-1d36-49fd-9e20-ce5d3db74074;exit=success\u001b\\"]
[12.01834, "o", "\u001b]3008;start=6237fdd2-49c6-4d91-bf2a-abfdd0da2bf0;type=shell;machineid=3eb50194b2f745eca62b4e3a672ec22c;user=root;hostname=backrest;bootid=a6976f29-5284-4691-8536-c5bfcfddc9bb;pid=3799;cwd=/root\u001b\\"]
[12.018501, "o", "\u001b[1;32mroot@backrest\u001b[0m:~# "]
[12.018503, "o", ""]
[14.053503, "o", "r"]
[14.088503, "o", "e"]
[14.123503, "o", "s"]
[14.158503, "o", "t"]
[14.193503, "o", "i"]
[14.228503, "o", "c"]
[14.263503, "o", " "]
[14.298503, "o", "s"]
[14.333503, "o", "t"]
[14.368503, "o", "a"]
[14.403503, "o", "t"]
[14.438503, "o", "s"]
[14.473503, "o", " "]
[14.508503, "o", "l"]
[14.543503, "o", "a"]
[14.578503, "o", "t"]
[14.613503, "o", "e"]
[14.648503, "o", "s"]
[14.683503, "o", "t"]
[14.718503, "o", "\r\n"]
[14.720267, "o", "\u001b]3008;start=0734097c-fbf3-43bd-914a-fd8f23ef0477;type=command;machineid=3eb50194b2f745eca62b4e3a672ec22c;user=root;hostname=backrest;bootid=a6976f29-5284-4691-8536-c5bfcfddc9bb;pid=3799;cwd=/root\u001b\\"]
[15.278388, "o", "\r\u001b[2Krepository 9f8fbdd5 opened (version 2, compression level auto)\r\n"]
[15.501736, "o", "\r\u001b[2K[0:00] 100.00% 1 / 1 index files loaded\r\n"]
[15.502447, "o", "\r\u001b[2Kscanning...\r\n"]
[15.503931, "o", "\r\u001b[2K[0:00] 100.00% 1 / 1 snapshots, 36 files, 312.356 KiB\r\n\r\u001b[2KStats in restore-size mode:\r\n\r\u001b[2K Snapshots processed: 1\r\n\r\u001b[2K Total File Count: 36\r\n\r\u001b[2K Total Size: 312.356 KiB\r\n"]
[15.508906, "o", "\u001b]3008;end=0734097c-fbf3-43bd-914a-fd8f23ef0477;exit=success\u001b\\"]
[15.509776, "o", "\u001b]3008;start=6237fdd2-49c6-4d91-bf2a-abfdd0da2bf0;type=shell;machineid=3eb50194b2f745eca62b4e3a672ec22c;user=root;hostname=backrest;bootid=a6976f29-5284-4691-8536-c5bfcfddc9bb;pid=3799;cwd=/root\u001b\\"]
[15.509911, "o", "\u001b[1;32mroot@backrest\u001b[0m:~# "]
[15.509912, "o", ""]
[15.544912, "o", "e"]
[15.579912, "o", "x"]
[15.614912, "o", "i"]
[15.649912, "o", "t"]
[15.684912, "o", "\r\n"]
[15.686426, "o", "\u001b]3008;start=4b7763f8-887b-406e-8a7b-0d12db9e3554;type=command;machineid=3eb50194b2f745eca62b4e3a672ec22c;user=root;hostname=backrest;bootid=a6976f29-5284-4691-8536-c5bfcfddc9bb;pid=3799;cwd=/root\u001b\\logout\r\n"]
[15.686996, "o", "\u001b]3008;end=26fe51b93ef44c8daa8fdc2c61848f83\u001b\\"]
[15.71306, "o", "\u001b[1;34mlxd\u001b[0m > "]
[15.71306, "o", ""]
[18.74806, "o", "\r\u001b[H\u001b[2J\u001b[3J\u001b[1;34mlxd\u001b[0m > "]
[18.78306, "o", ""]
[18.78306, "m", "Restore"]
[18.81806, "o", "#"]
[18.85306, "o", " "]
[18.88806, "o", "O"]
[18.92306, "o", "o"]
[18.95806, "o", "p"]
[18.99306, "o", "s"]
[19.02806, "o", ":"]
[19.06306, "o", " "]
[19.09806, "o", "a"]
[19.13306, "o", " "]
[19.16806, "o", "f"]
[19.20306, "o", "i"]
[19.23806, "o", "l"]
[19.27306, "o", "e"]
[19.30806, "o", " "]
[19.34306, "o", "o"]
[19.37806, "o", "f"]
[19.41306, "o", " "]
[19.44806, "o", "t"]
[19.48306, "o", "h"]
[19.51806, "o", "e"]
[19.55306, "o", " "]
[19.58806, "o", "a"]
[19.62306, "o", "p"]
[19.65806, "o", "p"]
[19.69306, "o", " "]
[19.72806, "o", "i"]
[19.76306, "o", "n"]
[19.79806, "o", "s"]
[19.83306, "o", "t"]
[19.86806, "o", "a"]
[19.90306, "o", "n"]
[19.93806, "o", "c"]
[19.97306, "o", "e"]
[20.00806, "o", " "]
[20.04306, "o", "i"]
[20.07806, "o", "s"]
[20.11306, "o", " "]
[20.14806, "o", "l"]
[20.18306, "o", "o"]
[20.21806, "o", "s"]
[20.25306, "o", "t"]
[20.28806, "o", "\r\n"]
[20.29352, "o", "\u001b[1;34mlxd\u001b[0m > "]
[20.293521, "o", ""]
[20.328521, "o", "l"]
[20.363521, "o", "x"]
[20.398521, "o", "c"]
[20.433521, "o", " "]
[20.468521, "o", "e"]
[20.503521, "o", "x"]
[20.538521, "o", "e"]
[20.573521, "o", "c"]
[20.608521, "o", " "]
[20.643521, "o", "a"]
[20.678521, "o", "p"]
[20.713521, "o", "p"]
[20.748521, "o", " "]
[20.783521, "o", "-"]
[20.818521, "o", "-"]
[20.853521, "o", " "]
[20.888521, "o", "r"]
[20.923521, "o", "m"]
[20.958521, "o", " "]
[20.993521, "o", "/"]
[21.028521, "o", "s"]
[21.063521, "o", "r"]
[21.098521, "o", "v"]
[21.133521, "o", "/"]
[21.168521, "o", "a"]
[21.203521, "o", "p"]
[21.238521, "o", "p"]
[21.273521, "o", "/"]
[21.308521, "o", "n"]
[21.343521, "o", "o"]
[21.378521, "o", "t"]
[21.413521, "o", "e"]
[21.448521, "o", "s"]
[21.483521, "o", "."]
[21.518521, "o", "t"]
[21.553521, "o", "x"]
[21.588521, "o", "t"]
[21.623521, "o", "\r\n"]
[21.817423, "o", "\u001b[1;34mlxd\u001b[0m > "]
[21.817423, "o", ""]
[21.852423, "o", "l"]
[21.887423, "o", "x"]
[21.922423, "o", "c"]
[21.957423, "o", " "]
[21.992423, "o", "e"]
[22.027423, "o", "x"]
[22.062423, "o", "e"]
[22.097423, "o", "c"]
[22.132423, "o", " "]
[22.167423, "o", "a"]
[22.202423, "o", "p"]
[22.237423, "o", "p"]
[22.272423, "o", " "]
[22.307423, "o", "-"]
[22.342423, "o", "-"]
[22.377423, "o", " "]
[22.412423, "o", "c"]
[22.447423, "o", "a"]
[22.482423, "o", "t"]
[22.517423, "o", " "]
[22.552423, "o", "/"]
[22.587423, "o", "s"]
[22.622423, "o", "r"]
[22.657423, "o", "v"]
[22.692423, "o", "/"]
[22.727423, "o", "a"]
[22.762423, "o", "p"]
[22.797423, "o", "p"]
[22.832423, "o", "/"]
[22.867423, "o", "n"]
[22.902423, "o", "o"]
[22.937423, "o", "t"]
[22.972423, "o", "e"]
[23.007423, "o", "s"]
[23.042423, "o", "."]
[23.077423, "o", "t"]
[23.112423, "o", "x"]
[23.147423, "o", "t"]
[23.182423, "o", "\r\n"]
[23.375436, "o", "cat: /srv/app/notes.txt: No such file or directory\r\n"]
[23.388642, "o", "\u001b[1;34mlxd\u001b[0m > "]
[23.388643, "o", ""]
[23.423643, "o", "#"]
[23.458643, "o", " "]
[23.493643, "o", "r"]
[23.528643, "o", "e"]
[23.563643, "o", "s"]
[23.598643, "o", "t"]
[23.633643, "o", "i"]
[23.668643, "o", "c"]
[23.703643, "o", " "]
[23.738643, "o", "d"]
[23.773643, "o", "u"]
[23.808643, "o", "m"]
[23.843643, "o", "p"]
[23.878643, "o", " "]
[23.913643, "o", "w"]
[23.948643, "o", "r"]
[23.983643, "o", "i"]
[24.018643, "o", "t"]
[24.053643, "o", "e"]
[24.088643, "o", "s"]
[24.123643, "o", " "]
[24.158643, "o", "i"]
[24.193643, "o", "t"]
[24.228643, "o", " "]
[24.263643, "o", "f"]
[24.298643, "o", "r"]
[24.333643, "o", "o"]
[24.368643, "o", "m"]
[24.403643, "o", " "]
[24.438643, "o", "t"]
[24.473643, "o", "h"]
[24.508643, "o", "e"]
[24.543643, "o", " "]
[24.578643, "o", "l"]
[24.613643, "o", "a"]
[24.648643, "o", "t"]
[24.683643, "o", "e"]
[24.718643, "o", "s"]
[24.753643, "o", "t"]
[24.788643, "o", " "]
[24.823643, "o", "s"]
[24.858643, "o", "n"]
[24.893643, "o", "a"]
[24.928643, "o", "p"]
[24.963643, "o", "s"]
[24.998643, "o", "h"]
[25.033643, "o", "o"]
[25.068643, "o", "t"]
[25.103643, "o", ","]
[25.138643, "o", " "]
[25.173643, "o", "l"]
[25.208643, "o", "x"]
[25.243643, "o", "c"]
[25.278643, "o", " "]
[25.313643, "o", "f"]
[25.348643, "o", "i"]
[25.383643, "o", "l"]
[25.418643, "o", "e"]
[25.453643, "o", " "]
[25.488643, "o", "p"]
[25.523643, "o", "u"]
[25.558643, "o", "s"]
[25.593643, "o", "h"]
[25.628643, "o", " "]
[25.663643, "o", "p"]
[25.698643, "o", "u"]
[25.733643, "o", "t"]
[25.768643, "o", "s"]
[25.803643, "o", " "]
[25.838643, "o", "i"]
[25.873643, "o", "t"]
[25.908643, "o", " "]
[25.943643, "o", "b"]
[25.978643, "o", "a"]
[26.013643, "o", "c"]
[26.048643, "o", "k"]
[26.083643, "o", "\r\n"]
[26.093186, "o", "\u001b[1;34mlxd\u001b[0m > "]
[26.093187, "o", ""]
[26.128187, "o", "l"]
[26.163187, "o", "x"]
[26.198187, "o", "c"]
[26.233187, "o", " "]
[26.268187, "o", "e"]
[26.303187, "o", "x"]
[26.338187, "o", "e"]
[26.373187, "o", "c"]
[26.408187, "o", " "]
[26.443187, "o", "b"]
[26.478187, "o", "a"]
[26.513187, "o", "c"]
[26.548187, "o", "k"]
[26.583187, "o", "r"]
[26.618187, "o", "e"]
[26.653187, "o", "s"]
[26.688187, "o", "t"]
[26.723187, "o", " "]
[26.758187, "o", "-"]
[26.793187, "o", "-"]
[26.828187, "o", "e"]
[26.863187, "o", "n"]
[26.898187, "o", "v"]
[26.933187, "o", " "]
[26.968187, "o", "R"]
[27.003187, "o", "E"]
[27.038187, "o", "S"]
[27.073187, "o", "T"]
[27.108187, "o", "I"]
[27.143187, "o", "C"]
[27.178187, "o", "_"]
[27.213187, "o", "P"]
[27.248187, "o", "A"]
[27.283187, "o", "S"]
[27.318187, "o", "S"]
[27.353187, "o", "W"]
[27.388187, "o", "O"]
[27.423187, "o", "R"]
[27.458187, "o", "D"]
[27.493187, "o", "="]
[27.528187, "o", "d"]
[27.563187, "o", "e"]
[27.598187, "o", "m"]
[27.633187, "o", "o"]
[27.668187, "o", "-"]
[27.703187, "o", "r"]
[27.738187, "o", "e"]
[27.773187, "o", "p"]
[27.808187, "o", "o"]
[27.843187, "o", "-"]
[27.878187, "o", "p"]
[27.913187, "o", "a"]
[27.948187, "o", "s"]
[27.983187, "o", "s"]
[28.018187, "o", "w"]
[28.053187, "o", "o"]
[28.088187, "o", "r"]
[28.123187, "o", "d"]
[28.158187, "o", " "]
[28.193187, "o", "-"]
[28.228187, "o", "-"]
[28.263187, "o", " "]
[28.298187, "o", "r"]
[28.333187, "o", "e"]
[28.368187, "o", "s"]
[28.403187, "o", "t"]
[28.438187, "o", "i"]
[28.473187, "o", "c"]
[28.508187, "o", " "]
[28.543187, "o", "-"]
[28.578187, "o", "-"]
[28.613187, "o", "r"]
[28.648187, "o", "e"]
[28.683187, "o", "p"]
[28.718187, "o", "o"]
[28.753187, "o", " "]
[28.788187, "o", "/"]
[28.823187, "o", "b"]
[28.858187, "o", "a"]
[28.893187, "o", "c"]
[28.928187, "o", "k"]
[28.963187, "o", "u"]
[28.998187, "o", "p"]
[29.033187, "o", "s"]
[29.068187, "o", "/"]
[29.103187, "o", "r"]
[29.138187, "o", "e"]
[29.173187, "o", "s"]
[29.208187, "o", "t"]
[29.243187, "o", "i"]
[29.278187, "o", "c"]
[29.313187, "o", " "]
[29.348187, "o", "d"]
[29.383187, "o", "u"]
[29.418187, "o", "m"]
[29.453187, "o", "p"]
[29.488187, "o", " "]
[29.523187, "o", "l"]
[29.558187, "o", "a"]
[29.593187, "o", "t"]
[29.628187, "o", "e"]
[29.663187, "o", "s"]
[29.698187, "o", "t"]
[29.733187, "o", " "]
[29.768187, "o", "/"]
[29.803187, "o", "b"]
[29.838187, "o", "a"]
[29.873187, "o", "c"]
[29.908187, "o", "k"]
[29.943187, "o", "u"]
[29.978187, "o", "p"]
[30.013187, "o", "/"]
[30.048187, "o", "a"]
[30.083187, "o", "p"]
[30.118187, "o", "p"]
[30.153187, "o", "-"]
[30.188187, "o", "d"]
[30.223187, "o", "a"]
[30.258187, "o", "t"]
[30.293187, "o", "a"]
[30.328187, "o", "/"]
[30.363187, "o", "n"]
[30.398187, "o", "o"]
[30.433187, "o", "t"]
[30.468187, "o", "e"]
[30.503187, "o", "s"]
[30.538187, "o", "."]
[30.573187, "o", "t"]
[30.608187, "o", "x"]
[30.643187, "o", "t"]
[30.678187, "o", " "]
[30.713187, "o", "|"]
[30.748187, "o", " "]
[30.783187, "o", "l"]
[30.818187, "o", "x"]
[30.853187, "o", "c"]
[30.888187, "o", " "]
[30.923187, "o", "f"]
[30.958187, "o", "i"]
[30.993187, "o", "l"]
[31.028187, "o", "e"]
[31.063187, "o", " "]
[31.098187, "o", "p"]
[31.133187, "o", "u"]
[31.168187, "o", "s"]
[31.203187, "o", "h"]
[31.238187, "o", " "]
[31.273187, "o", "-"]
[31.308187, "o", "-"]
[31.343187, "o", "u"]
[31.378187, "o", "i"]
[31.413187, "o", "d"]
[31.448187, "o", " "]
[31.483187, "o", "0"]
[31.518187, "o", " "]
[31.553187, "o", "-"]
[31.588187, "o", "-"]
[31.623187, "o", "g"]
[31.658187, "o", "i"]
[31.693187, "o", "d"]
[31.728187, "o", " "]
[31.763187, "o", "0"]
[31.798187, "o", " "]
[31.833187, "o", "-"]
[31.868187, "o", "-"]
[31.903187, "o", "m"]
[31.938187, "o", "o"]
[31.973187, "o", "d"]
[32.008187, "o", "e"]
[32.043187, "o", " "]
[32.078187, "o", "0"]
[32.113187, "o", "6"]
[32.148187, "o", "4"]
[32.183187, "o", "4"]
[32.218187, "o", " "]
[32.253187, "o", "-"]
[32.288187, "o", " "]
[32.323187, "o", "a"]
[32.358187, "o", "p"]
[32.393187, "o", "p"]
[32.428187, "o", "/"]
[32.463187, "o", "s"]
[32.498187, "o", "r"]
[32.533187, "o", "v"]
[32.568187, "o", "/"]
[32.603187, "o", "a"]
[32.638187, "o", "p"]
[32.673187, "o", "p"]
[32.708187, "o", "/"]
[32.743187, "o", "n"]
[32.778187, "o", "o"]
[32.813187, "o", "t"]
[32.848187, "o", "e"]
[32.883187, "o", "s"]
[32.918187, "o", "."]
[32.953187, "o", "t"]
[32.988187, "o", "x"]
[33.023187, "o", "t"]
[33.058187, "o", "\r\n"]
[34.064948, "o", "\u001b[1;34mlxd\u001b[0m > "]
[34.064949, "o", ""]
[34.099949, "o", "l"]
[34.134949, "o", "x"]
[34.169949, "o", "c"]
[34.204949, "o", " "]
[34.239949, "o", "e"]
[34.274949, "o", "x"]
[34.309949, "o", "e"]
[34.344949, "o", "c"]
[34.379949, "o", " "]
[34.414949, "o", "a"]
[34.449949, "o", "p"]
[34.484949, "o", "p"]
[34.519949, "o", " "]
[34.554949, "o", "-"]
[34.589949, "o", "-"]
[34.624949, "o", " "]
[34.659949, "o", "c"]
[34.694949, "o", "a"]
[34.729949, "o", "t"]
[34.764949, "o", " "]
[34.799949, "o", "/"]
[34.834949, "o", "s"]
[34.869949, "o", "r"]
[34.904949, "o", "v"]
[34.939949, "o", "/"]
[34.974949, "o", "a"]
[35.009949, "o", "p"]
[35.044949, "o", "p"]
[35.079949, "o", "/"]
[35.114949, "o", "n"]
[35.149949, "o", "o"]
[35.184949, "o", "t"]
[35.219949, "o", "e"]
[35.254949, "o", "s"]
[35.289949, "o", "."]
[35.324949, "o", "t"]
[35.359949, "o", "x"]
[35.394949, "o", "t"]
[35.429949, "o", "\r\n"]
[35.578345, "o", "Hello from app\r\n"]
[35.59563, "o", "\u001b[1;34mlxd\u001b[0m > "]
[35.595631, "o", ""]
[41.630631, "o", "\r\n"]
Binary file not shown.

After

Width:  |  Height:  |  Size: 421 KiB

+44
View File
@@ -0,0 +1,44 @@
# Demo: restic on the command line in the backup instance, then restore a lost file of the app instance
# (prerequisites: LXD, mise; everything created and configured if missing, then removed at the end)
settings:
width: 156
height: 40
type_speed: 35ms
# Empty: the prompts are the shell's own (PS1), so that the instance's root shell keeps its own prompt
prompt: ""
timeout: 300s
# bash without rc files: the real prompt (PS1) is used to detect the end of commands
shell:
program: bash
args: [--norc, --noprofile]
prompt: AUTOCAST_PROMPT
line_split: " \\"
quit_command: exit
environment:
- {name: PS1, value: "\\[\\e[1;34m\\]lxd\\[\\e[0m\\] > AUTOCAST_PROMPT"}
- {name: PROMPT_COMMAND, value: "bind 'set enable-bracketed-paste off'"}
- {name: TERM, value: xterm-256color}
instructions:
- !Command {command: "source demo/backrest/setup.sh restore", hidden: true}
- !Marker Restic
- !Command {command: "# restic is available in the backup instance, next to Backrest"}
- !Command {command: "lxc shell backrest"}
- !Command {command: "export RESTIC_REPOSITORY=/backups/restic RESTIC_PASSWORD=demo-repo-password"}
- !Command {command: "restic snapshots"}
- !Wait 2s
- !Command {command: "restic ls latest /backup/app-data --recursive | head -12"}
- !Wait 2s
- !Command {command: "restic stats latest"}
- !Command {command: "exit"}
- !Wait 3s
- !Clear
- !Marker Restore
- !Command {command: "# Oops: a file of the app instance is lost"}
- !Command {command: "lxc exec app -- rm /srv/app/notes.txt"}
- !Command {command: "lxc exec app -- cat /srv/app/notes.txt"}
- !Command {command: "# restic dump writes it from the latest snapshot, lxc file push puts it back"}
- !Command {command: "lxc exec backrest --env RESTIC_PASSWORD=demo-repo-password -- restic --repo /backups/restic dump latest /backup/app-data/notes.txt | lxc file push --uid 0 --gid 0 --mode 0644 - app/srv/app/notes.txt"}
- !Command {command: "lxc exec app -- cat /srv/app/notes.txt"}
- !Wait 6s
- !Command {command: "demo_cleanup", hidden: true}
+84
View File
@@ -0,0 +1,84 @@
// Screenshots of the Backrest web UI for the tutorial (run by screenshots.sh in
// a browser instance): first-run settings, repository, plan, backup, snapshot.
// node screenshots.mjs <backrest URL> <output directory>
import { chromium } from "playwright-core";
const [url, out] = process.argv.slice(2);
const browser = await chromium.launch({ executablePath: "/usr/bin/chromium" });
const page = await browser.newPage({ viewport: { width: 1280, height: 960 }, timezoneId: "Europe/Paris" });
const shot = (name) => page.screenshot({ path: `${out}/${name}.png` });
const pause = (ms = 800) => page.waitForTimeout(ms);
const button = (name) => page.getByRole("button", { name, exact: true });
const toTop = (locator) => locator.evaluate((e) => e.scrollIntoView({ block: "start" }));
// First run: instance ID and an administrator account
await page.goto(url);
await page.getByPlaceholder("Unique instance ID").fill("backrest");
await page.getByText("Disable Authentication").click();
await button("Add user").click();
await page.getByPlaceholder("Username").fill("admin");
await page.getByPlaceholder("Password").fill("demo-password");
await toTop(page.getByText("Instance ID").first());
await pause();
await shot("settings");
await button("Save changes").click();
await pause(2500);
// Log in
await page.goto(url);
await page.getByPlaceholder("Username").fill("admin");
await page.getByPlaceholder("Password").fill("demo-password");
await button("Log in").click();
await pause(1500);
// Repository: restic repository on the backups volume
await button("Add Repo").click();
await pause();
await page.getByPlaceholder("repo1").fill("local");
await page.getByRole("combobox").first().fill("/backups/restic");
await page.locator("input[type=password]").first().fill("demo-repo-password");
await page.getByText("Repository URI").first().click();
await pause();
await shot("repo");
await button("Submit").click();
await pause(4000);
// Plan: the read-only data volume, every night at 3am
await button("Add Plan").click();
await pause();
await page.getByPlaceholder("plan1").fill("app-data");
await page.getByRole("combobox").filter({ hasText: "Select repository" }).click();
await page.getByRole("option", { name: "local" }).click();
await button("Add").first().click();
await page.getByPlaceholder("Paths").fill("/backup/app-data");
await page.getByText("Plan Name").first().click();
await page.locator('input[value="0 * * * *"]').fill("0 3 * * *");
await page.getByText("Plan Name").first().click();
await pause();
await shot("plan");
await page.getByText("Cron Expression").first().scrollIntoViewIfNeeded();
await pause();
await shot("plan-schedule");
await button("Submit").click();
await pause(3000);
// First backup, then its details and the snapshot browser
await page.getByText("app-data").first().click();
await pause();
await button("Backup Now").click();
await page.getByText(/ID: [0-9a-f]+/).first().waitFor({ timeout: 60000 });
await pause(2000);
await page.getByText(/ID: [0-9a-f]+/).first().click();
await pause(1500);
await shot("backup");
await button("Snapshot Browser").click();
await pause(1500);
for (const name of ["backup", "app-data", "documents"]) {
await page.locator(".ant-tree-title, [role=treeitem]").filter({ hasText: new RegExp(`^${name}$`) }).first().click();
await pause();
}
await toTop(page.getByText("Snapshot Browser").last());
await pause();
await shot("snapshot");
await browser.close();
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Screenshots of the Backrest web UI for the tutorial (demo/backrest/*.png), from
# the repository root: a backrest instance as at the end of the install demo, and
# a Debian instance with Chromium driven by Playwright. Everything is removed at
# the end. Prerequisites: LXD, mise, nothing named as in setup.sh, no "browser" instance.
set -euo pipefail
source demo/backrest/setup.sh ui
trap 'lxc delete --force browser >/dev/null 2>&1; demo_cleanup' EXIT
lxc launch images:debian/13 browser >/dev/null
until lxc exec browser -- test -e /run/systemd/resolve/stub-resolv.conf -o -s /etc/resolv.conf; do sleep 1; done
sleep 5
lxc exec browser -- sh -c 'apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq chromium nodejs npm fonts-dejavu >/dev/null 2>&1'
lxc exec browser -- sh -c 'mkdir -p /pw /shots && cd /pw && npm init -y >/dev/null && npm install --silent playwright-core@1.65.1'
lxc file push demo/backrest/screenshots.mjs browser/pw/screenshots.mjs >/dev/null
until curl --silent --output /dev/null "http://$(lxc list backrest --columns 4 --format csv | grep -o '^[0-9.]*'):9898/"; do sleep 1; done
lxc exec browser -- node /pw/screenshots.mjs "http://$(lxc list backrest --columns 4 --format csv | grep -o '^[0-9.]*'):9898/" /shots
for shot in settings repo plan plan-schedule backup snapshot; do
lxc file pull "browser/shots/$shot.png" "demo/backrest/$shot.png"
done
Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

+87
View File
@@ -0,0 +1,87 @@
# shellcheck shell=bash
# Hidden preamble of the Backrest demos (autocast), sourced from the repository root.
# source demo/backrest/setup.sh install # only the data to protect: instance "app" and its volume app-data
# source demo/backrest/setup.sh ui # backrest instance launched, not configured (screenshots.sh)
# source demo/backrest/setup.sh restore # everything ready: backrest configured, one snapshot taken
# demo_cleanup (epilogue) removes what the demo created.
eval "$(mise activate bash)"
source demo/lib.sh
DEMO_PROFILE=app-backrest
DEMO_REPO_PASSWORD=demo-repo-password
DEMO_CREATED=
demo_exists() {
lxc info backrest >/dev/null 2>&1 || lxc info app >/dev/null 2>&1 \
|| lxc profile show "$DEMO_PROFILE" >/dev/null 2>&1 \
|| lxc storage volume show default backups >/dev/null 2>&1 \
|| lxc storage volume show default app-data >/dev/null 2>&1
}
# The data to protect: an "app" instance writing in its app-data volume
demo_app() {
lxc storage volume create default app-data size=5GiB >/dev/null
lxc launch ubuntu:lts app >/dev/null
lxc storage volume attach default app-data app /srv/app
lxc exec app -- sh -c 'mkdir -p /srv/app/documents && cp -r /usr/share/doc/bash /usr/share/common-licenses /srv/app/documents/ && echo "Hello from app" > /srv/app/notes.txt'
}
# What the install demo does: the backrest instance with its two volumes
demo_backrest_instance() {
mise run install --yes "$DEMO_PROFILE" >/dev/null
lxc storage volume create default backups size=20GiB >/dev/null
lxc launch ubuntu:lts backrest --profile default --profile "$DEMO_PROFILE" >/dev/null
lxc config device add backrest backups disk pool=default source=backups path=/backups >/dev/null
lxc config device add backrest app-data disk pool=default source=app-data path=/backup/app-data readonly=true >/dev/null
demo_wait_cloud_init backrest
}
# What is done in the web UI: repository and plan, here from a configuration
# file, then one snapshot taken as backrest would
demo_backrest_config() {
lxc exec backrest -- sh -c "cat > /etc/backrest/config.json" <<JSON
{"version": 6, "instance": "backrest",
"repos": [{"id": "local", "uri": "/backups/restic", "password": "$DEMO_REPO_PASSWORD", "autoInitialize": true}],
"plans": [{"id": "app-data", "repo": "local", "paths": ["/backup/app-data"],
"schedule": {"cron": "0 3 * * *", "clock": "CLOCK_LOCAL"},
"retention": {"policyTimeBucketed": {"daily": 30, "monthly": 12}}}],
"auth": {"disabled": true}}
JSON
lxc exec backrest -- systemctl restart backrest
until lxc exec backrest -- test -f /backups/restic/config; do sleep 1; done
lxc exec backrest --env RESTIC_PASSWORD="$DEMO_REPO_PASSWORD" -- restic --repo /backups/restic --quiet \
backup /backup/app-data --host backrest --tag plan:app-data --tag created-by:backrest >/dev/null
}
if demo_exists && [ "$1" != restore ]; then
echo "Instance backrest or app, profile $DEMO_PROFILE or volume backups or app-data already exists in LXD: the demo would remove them" >&2
exit 1
fi
case "$1" in
install)
DEMO_CREATED=yes
demo_app
;;
ui)
DEMO_CREATED=yes
demo_app
demo_backrest_instance
;;
restore)
if ! demo_exists; then
DEMO_CREATED=yes
demo_app
demo_backrest_instance
demo_backrest_config
fi
demo_instance_shell backrest
;;
esac
demo_cleanup() {
if [ -n "$DEMO_CREATED" ]; then
lxc delete --force backrest app >/dev/null 2>&1
lxc storage volume delete default backups >/dev/null 2>&1
lxc storage volume delete default app-data >/dev/null 2>&1
lxc profile delete "$DEMO_PROFILE" >/dev/null 2>&1
fi
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

+44
View File
@@ -0,0 +1,44 @@
"""Post-process an autocast recording (asciicast v2), in place.
- Scenarios with an empty autocast prompt rely on the shell's own prompt (PS1):
autocast drops the very first one and the one a !Clear erases, so they are
put back (at the start, and after each screen clear).
- Progress dots (cloud-init status --wait prints one per second) are squeezed,
so that a long wait does not take a minute of the animation.
"""
import json
import re
import sys
DOT_GAP = 0.05
path = sys.argv[1]
with open(path, encoding="utf-8") as f:
header, *events = (json.loads(line) for line in f if line.strip())
ps1 = header.get("env", {}).get("PS1", "")
prompt = ps1.replace("AUTOCAST_PROMPT", "").replace("\\[", "").replace("\\]", "").replace("\\e", "\x1b")
first = next((e for e in events if e[1] == "o"), None)
if prompt and first and not first[2].startswith(prompt):
events.insert(0, [0.0, "o", prompt])
if prompt:
for event in events:
# Only autocast's own !Clear (a clear run in the shell redraws its prompt)
if event[1] == "o" and event[2] == "\r\x1b[H\x1b[2J\x1b[3J":
event[2] += prompt
shift, previous = 0.0, 0.0
for event in events:
time = event[0]
gap = time - previous
previous = time
if event[1] == "o" and re.fullmatch(r"\.+", event[2]) and gap > DOT_GAP:
shift += gap - DOT_GAP
event[0] = round(time - shift, 6)
if events:
header["duration"] = events[-1][0]
with open(path, "w", encoding="utf-8") as f:
for record in (header, *events):
f.write(json.dumps(record, ensure_ascii=False) + "\n")
+359
View File
@@ -0,0 +1,359 @@
# Docker in an LXD container, in a few minutes
🇫🇷 [Lire en français](README.md)
Need a throwaway Docker to try an image, isolate a project or run a few
services without touching your machine? An LXD system container does the job
nicely: it starts in seconds, behaves like a small, complete Ubuntu machine,
and goes away with a single command.
This tutorial starts from scratch: get this repository, install the
`docker-unprivileged` profile in LXD, launch an instance that installs Docker
by itself at first boot, then use it.
![Clone the repository, install the profile, launch the instance and follow cloud-init](install.gif)
<sub>▶ [asciinema recording](install.cast)</sub>
## What you need
- **LXD**, installed and initialized, with a user allowed to use it (member of
the `lxd` group):
```shell
sudo snap install lxd
sudo usermod --append --groups lxd "$USER" # then log in again
sudo lxd init --auto # default storage pool and lxdbr0 bridge
```
`lxc list` must answer without error. The tutorial also works with nested
LXD (LXD itself running in an LXD container): that is how the demos were
recorded.
- **[mise](https://mise.jdx.dev)**, which provides the repository tasks
(`list`, `show`, `install`…) and installs the small tools they use (`bat`,
`delta`, `gum`, `yq`):
```shell
curl https://mise.run | sh
echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc # then reopen the shell
```
mise is optional: the [Without mise](#without-mise) section gives the
equivalent with plain `lxc`.
- **git**, and **internet access** from the instances (Ubuntu packages, the
`get.docker.com` script, Docker Hub).
- About **2 GB of free disk** on the LXD storage pool.
## 1. Get the repository
```shell
git clone https://gitea.cloud.logerais.com/xavier/lxd-profiles.git
mise trust lxd-profiles
cd lxd-profiles
mise install # tools used by the tasks (bat, delta, gum, yq), once
```
`mise trust` allows mise to load the repository configuration (`mise.toml`):
for safety, mise ignores configuration files it has not been explicitly told
to trust. Entering the directory displays a welcome message listing the
available tasks.
## 2. Choose and install the profile
Let's first see what the repository offers around Docker, and what is already
installed in LXD:
```shell
mise run list | grep --extended-regexp 'PROFIL|docker'
```
```
PROFIL DESCRIPTION UTILISÉ FICHIER
⬜ docker A profile that deploy docker in an LXD container - profiles/containerization/docker.profile.yaml
⬜ docker-unprivileged A profile that deploy docker in an unprivileged L… - profiles/containerization/docker-unprivileged.profile.yaml
...
```
⬜ means "in the repository, not installed in LXD yet". Two profiles install
Docker:
- `docker` creates a **privileged** container: root in the container is root
on the host. It is the most permissive one, for the cases that require it.
- `docker-unprivileged` keeps the container **unprivileged** (root in the
container is an unprivileged user on the host). That is the one used here,
and it is enough for the vast majority of images.
Let's look at its content:
```shell
mise run show docker-unprivileged
```
```yaml
name: docker-unprivileged
description: "A profile that deploy docker in an unprivileged LXD container"
config:
linux.kernel_modules: overlay
security.nesting: "true"
# Requis pour les images dont les couches créent des device nodes ou des xattrs
security.syscalls.intercept.mknod: "true"
security.syscalls.intercept.setxattr: "true"
cloud-init.vendor-data: |
#cloud-config
package_update: true
package_upgrade: true
packages:
- curl
runcmd:
- curl https://get.docker.com | sh
timezone: Europe/Paris
locale: fr_FR.UTF-8
```
Nothing magic:
- `security.nesting` allows containers inside the container: Docker needs it
to create its own.
- `linux.kernel_modules: overlay` loads on the host the module of the
filesystem Docker uses for its images.
- the two `security.syscalls.intercept.*` let LXD handle, on behalf of the
container, the system calls some images make when their layers are
extracted, which an unprivileged container is not allowed to make.
- `cloud-init.vendor-data` is the first boot recipe: system update, then
Docker installation with the official script.
Install it in LXD:
```shell
mise run install docker-unprivileged
mise run list | grep --extended-regexp 'PROFIL|docker-unprivileged' # ✅: up to date in LXD
```
## 3. Launch the instance and follow its installation
`ubuntu:lts` is the latest Ubuntu LTS release (26.04 at the time of writing).
A profile is added at launch, after the `default` profile (which brings the
disk and the network):
```shell
lxc launch ubuntu:lts docker --profile default --profile docker-unprivileged
```
The instance starts in seconds, but cloud-init is still working in the
background: package upgrade, then Docker installation, about a minute. To wait
for the end and get the summary, errors included (`errors: []` when all went
well):
```shell
lxc exec docker -- cloud-init status --wait --long
```
To follow the installation live instead, the cloud-init log reads like any
file (Ctrl+C to stop):
```shell
lxc exec docker -- tail --follow /var/log/cloud-init-output.log
```
Once done, Docker is there:
```shell
lxc exec docker -- docker version --format 'Docker {{.Server.Version}}'
lxc list docker
```
The instance has two IPv4 addresses: its `eth0` interface on the LXD bridge,
and the `docker0` bridge Docker just created inside.
## 4. Use Docker
![hello-world with lxc exec, then a shell in the instance: nginx, docker ps, top, stats](usage.gif)
<sub>▶ [asciinema recording](usage.cast)</sub>
### From the host, with `lxc exec`
`lxc exec <instance> -- <command>` runs a command in the instance, without SSH
nor any setup. The classic:
```shell
lxc exec docker -- docker run --rm hello-world
```
### From a shell in the instance
For a real working session, `lxc shell` opens a root shell in the instance,
and Docker is used as on any machine:
```shell
lxc shell docker
```
```shell
docker run --detach --name web --publish 8080:80 nginx:alpine # a web server in the background
docker image ls # downloaded images
docker ps # running containers
docker top web --format pid,user,args # processes of the web container
docker stats --no-stream # CPU, memory, network
curl --silent localhost:8080 | grep title # nginx answers
exit # back to the host
```
## Going further
### Reach the service from the host
Port 8080 is published by Docker inside the instance. An LXD `proxy` device
makes it reachable on the host (and so from your network):
```shell
lxc config device add docker web proxy listen=tcp:0.0.0.0:8080 connect=tcp:127.0.0.1:8080
curl --silent localhost:8080 | grep title
```
If port 8080 is already taken on the host, change the `listen` one. The
repository also has ready-made profiles for that (`proxy-http`,
`proxy-https`).
### Keep Docker data in a volume, with automatic snapshots
By default, Docker images, containers and volumes live in `/var/lib/docker`,
on the instance disk: they go away with it. The `docker-volume-data` profile
mounts a dedicated LXD volume there instead, with a life of its own: it
survives the instance deletion, attaches to a new one, and is backed up
separately.
The volume must exist **before** the profile is installed, LXD checks it.
Create it on the `default` pool, the one the profile expects, and schedule
snapshots for it: one a day, kept for two weeks.
```shell
lxc storage volume create default docker-data size=20GiB
lxc storage volume set default docker-data snapshots.schedule=@daily snapshots.expiry=2w
mise run install docker-volume-data
```
Add the profile **when the instance is created**, so that Docker installs
directly on the volume:
```shell
lxc launch ubuntu:lts docker --profile default --profile docker-unprivileged --profile docker-volume-data
lxc exec docker -- findmnt --target /var/lib/docker # the volume is mounted
```
Volume snapshots are handled with `lxc storage volume`:
```shell
lxc storage volume snapshot default docker-data before-upgrade # manual snapshot
lxc storage volume info default docker-data # list of snapshots
lxc stop docker # instance stopped to restore
lxc storage volume restore default docker-data before-upgrade
lxc start docker
```
The `snapshots-daily` profile is not enough here: it schedules snapshots of
the **instance**, which do not include attached volumes. These are two
separate settings, and both can be combined.
### Adapt an installed profile to your needs
The repository profiles are a starting point. Say you want Docker data on
another, faster pool named `fast`. Copy the volume (with its snapshots and
their schedule), then change the profile installed in LXD directly:
```shell
lxc stop docker
lxc storage volume copy default/docker-data fast/docker-data
lxc profile device set docker-volume-data docker-data pool=fast
lxc start docker
lxc storage volume delete default docker-data # once checked
```
The volume is **copied** rather than moved: LXD refuses to move a volume a
profile refers to. The change applies to every instance using the profile.
The installed profile no longer matches the repository, and the mise tasks
say so:
```shell
mise run list | grep docker-volume-data # 📝: installed but different
mise run diff docker-volume-data
```
```diff
--- lxd:docker-volume-data (installé)
+++ profiles/containerization/docker-volume-data.profile.yaml (dépôt)
@@ -3,7 +3,7 @@
devices:
docker-data:
path: /var/lib/docker
- pool: fast
+ pool: default
source: docker-data
type: disk
```
Two options then:
- **back to the repository version**: `mise run install docker-volume-data`
shows this diff and asks for confirmation before overwriting the profile;
- **keep your version**: `mise run import docker-volume-data` rewrites the
repository file from the installed profile. Review it with `git diff`, then
commit it in your clone (or your fork).
LXD lets several instances attach the same volume, but two Docker daemons must
never share the same `/var/lib/docker`. For a second Docker instance, copy the
profile and give it its own volume:
```shell
lxc storage volume create default docker2-data
lxc profile copy docker-volume-data docker2-volume-data
lxc profile device set docker2-volume-data docker-data source=docker2-data
```
### Combine profiles
Profiles stack at launch: instance size (`size-small`, `size-medium`…),
automatic instance snapshots (`snapshots-daily`), data volume
(`docker-volume-data`)…
```shell
lxc launch ubuntu:lts docker --profile default --profile docker-unprivileged \
--profile docker-volume-data --profile size-medium --profile snapshots-daily
```
### Clean up
The instance goes away with one command, Docker with it. The data volume
stays: delete it explicitly if no longer needed, like the profiles.
```shell
lxc delete --force docker
lxc storage volume delete default docker-data
lxc profile delete docker-volume-data
lxc profile delete docker-unprivileged
```
## Without mise
The repository files are regular LXD profiles: `lxc` is enough.
```shell
lxc profile create docker-unprivileged
lxc profile edit docker-unprivileged < profiles/containerization/docker-unprivileged.profile.yaml
lxc launch ubuntu:lts docker --profile default --profile docker-unprivileged
```
## Replaying the demos
The animations of this page are recorded from the `install.yaml` and
`usage.yaml` scenarios (see [how the demos are made](../README.en.md)):
```shell
MISE_ENV=demo mise run demo docker/install
MISE_ENV=demo mise run demo docker/usage
```
They create the `docker` instance and the `docker-unprivileged` profile, and
remove them at the end; `install` refuses to start if they already exist. In
the animation, the cloud-init wait is sped up.
+361
View File
@@ -0,0 +1,361 @@
# Docker dans un conteneur LXD, en quelques minutes
🇬🇧 [Read in English](README.en.md)
Vous voulez un Docker jetable pour tester une image, isoler un projet ou faire
tourner quelques services sans toucher à votre machine ? Un conteneur système
LXD fait très bien l'affaire : il démarre en quelques secondes, se comporte
comme une petite machine Ubuntu complète, et se supprime d'une commande.
Ce tutoriel part de zéro : on récupère ce dépôt, on installe le profil
`docker-unprivileged` dans LXD, on lance une instance qui installe Docker toute
seule au premier démarrage, puis on s'en sert.
![Clone du dépôt, installation du profil, lancement de l'instance et suivi de cloud-init](install.gif)
<sub>▶ [Enregistrement asciinema](install.cast)</sub>
## Ce qu'il vous faut
- **LXD**, installé et initialisé, avec un utilisateur qui a le droit de
l'utiliser (membre du groupe `lxd`) :
```shell
sudo snap install lxd
sudo usermod --append --groups lxd "$USER" # puis se reconnecter
sudo lxd init --auto # pool de stockage et bridge lxdbr0 par défaut
```
`lxc list` doit répondre sans erreur. Le tutoriel fonctionne aussi dans un
LXD imbriqué (LXD lui-même dans un conteneur LXD), c'est d'ailleurs dans ces
conditions qu'ont été enregistrées les démos.
- **[mise](https://mise.jdx.dev)**, qui fournit les tâches du dépôt (`list`,
`show`, `install`…) et installe les petits outils qu'elles utilisent (`bat`,
`delta`, `gum`, `yq`) :
```shell
curl https://mise.run | sh
echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc # puis rouvrir le shell
```
mise reste optionnel : la section [Sans mise](#sans-mise) donne l'équivalent
avec `lxc` seul.
- **git**, et un **accès à internet** depuis les instances (paquets Ubuntu,
script `get.docker.com`, Docker Hub).
- Environ **2 Go de disque** libres sur le pool de stockage LXD.
## 1. Récupérer le dépôt
```shell
git clone https://gitea.cloud.logerais.com/xavier/lxd-profiles.git
mise trust lxd-profiles
cd lxd-profiles
mise install # outils des tâches (bat, delta, gum, yq), une seule fois
```
`mise trust` autorise mise à charger la configuration du dépôt (`mise.toml`) :
par sécurité, mise ignore les fichiers de configuration qu'on ne lui a pas
explicitement désignés comme fiables. En entrant dans le dossier, un message
d'accueil rappelle les tâches disponibles.
## 2. Choisir et installer le profil
Commençons par voir ce que le dépôt propose autour de Docker, et ce qui est déjà
installé dans LXD :
```shell
mise run list | grep --extended-regexp 'PROFIL|docker'
```
```
PROFIL DESCRIPTION UTILISÉ FICHIER
⬜ docker A profile that deploy docker in an LXD container - profiles/containerization/docker.profile.yaml
⬜ docker-unprivileged A profile that deploy docker in an unprivileged L… - profiles/containerization/docker-unprivileged.profile.yaml
...
```
⬜ signifie « présent dans le dépôt, pas encore installé dans LXD ». Deux profils
installent Docker :
- `docker` crée un conteneur **privilégié** : root dans le conteneur est root
sur l'hôte. C'est le plus permissif, à réserver aux cas qui l'exigent.
- `docker-unprivileged` garde le conteneur **non privilégié** (root dans le
conteneur est un utilisateur sans droits sur l'hôte). C'est celui qu'on
utilise ici, et il suffit pour l'immense majorité des images.
Regardons ce qu'il contient :
```shell
mise run show docker-unprivileged
```
```yaml
name: docker-unprivileged
description: "A profile that deploy docker in an unprivileged LXD container"
config:
linux.kernel_modules: overlay
security.nesting: "true"
# Requis pour les images dont les couches créent des device nodes ou des xattrs
security.syscalls.intercept.mknod: "true"
security.syscalls.intercept.setxattr: "true"
cloud-init.vendor-data: |
#cloud-config
package_update: true
package_upgrade: true
packages:
- curl
runcmd:
- curl https://get.docker.com | sh
timezone: Europe/Paris
locale: fr_FR.UTF-8
```
Rien de magique :
- `security.nesting` autorise les conteneurs dans le conteneur : c'est ce dont
Docker a besoin pour créer les siens.
- `linux.kernel_modules: overlay` charge sur l'hôte le module du système de
fichiers utilisé par Docker pour ses images.
- les deux `security.syscalls.intercept.*` laissent LXD traiter, à la place du
conteneur, les appels système que certaines images utilisent à l'extraction
de leurs couches et qu'un conteneur non privilégié n'a pas le droit de faire.
- `cloud-init.vendor-data` est la recette du premier démarrage : mise à jour
du système, puis installation de Docker avec le script officiel.
On l'installe dans LXD :
```shell
mise run install docker-unprivileged
mise run list | grep --extended-regexp 'PROFIL|docker-unprivileged' # ✅ : à jour dans LXD
```
## 3. Lancer l'instance et suivre son installation
`ubuntu:lts` désigne la dernière version LTS d'Ubuntu (26.04 à l'écriture de ces
lignes). Un profil s'ajoute au lancement, après le profil `default` (qui
apporte le disque et le réseau) :
```shell
lxc launch ubuntu:lts docker --profile default --profile docker-unprivileged
```
L'instance démarre en quelques secondes, mais cloud-init travaille encore en
arrière-plan : mise à jour des paquets puis installation de Docker, environ une
minute. Pour attendre la fin et obtenir le bilan, erreurs éventuelles comprises
(`errors: []` quand tout s'est bien passé) :
```shell
lxc exec docker -- cloud-init status --wait --long
```
Pour suivre plutôt l'installation en direct, le journal de cloud-init se lit
comme n'importe quel fichier (Ctrl+C pour arrêter) :
```shell
lxc exec docker -- tail --follow /var/log/cloud-init-output.log
```
Une fois terminé, Docker est là :
```shell
lxc exec docker -- docker version --format 'Docker {{.Server.Version}}'
lxc list docker
```
L'instance a deux adresses IPv4 : celle de son interface `eth0` sur le bridge
LXD, et celle du bridge `docker0` que Docker vient de créer à l'intérieur.
## 4. Utiliser Docker
![hello-world avec lxc exec, puis un shell dans l'instance : nginx, docker ps, top, stats](usage.gif)
<sub>▶ [Enregistrement asciinema](usage.cast)</sub>
### Depuis l'hôte, avec `lxc exec`
`lxc exec <instance> -- <commande>` exécute une commande dans l'instance, sans
SSH ni configuration. Le grand classique :
```shell
lxc exec docker -- docker run --rm hello-world
```
### Depuis un shell dans l'instance
Pour une vraie session de travail, `lxc shell` ouvre un shell root dans
l'instance, et Docker s'utilise comme sur n'importe quelle machine :
```shell
lxc shell docker
```
```shell
docker run --detach --name web --publish 8080:80 nginx:alpine # un serveur web en arrière-plan
docker image ls # images téléchargées
docker ps # conteneurs en cours
docker top web --format pid,user,args # processus du conteneur web
docker stats --no-stream # CPU, mémoire, réseau
curl --silent localhost:8080 | grep title # nginx répond
exit # retour sur l'hôte
```
## Pour aller plus loin
### Accéder au service depuis l'hôte
Le port 8080 publié par Docker l'est dans l'instance. Un device `proxy` LXD le
rend joignable sur l'hôte (et donc depuis votre réseau) :
```shell
lxc config device add docker web proxy listen=tcp:0.0.0.0:8080 connect=tcp:127.0.0.1:8080
curl --silent localhost:8080 | grep title
```
Si le port 8080 est déjà pris sur l'hôte, changez celui de `listen`. Le dépôt
propose aussi des profils prêts à l'emploi pour ça (`proxy-http`,
`proxy-https`).
### Garder les données Docker dans un volume, avec des snapshots automatiques
Par défaut, images, conteneurs et volumes Docker vivent dans `/var/lib/docker`,
sur le disque de l'instance : ils disparaissent avec elle. Le profil
`docker-volume-data` y monte plutôt un volume LXD dédié, qui a sa propre vie :
il survit à la suppression de l'instance, se rattache à une nouvelle, et se
sauvegarde à part.
Le volume doit exister **avant** l'installation du profil, LXD le vérifie. On
le crée sur le pool `default`, celui qu'attend le profil, et on lui programme
des snapshots : un par jour, gardé deux semaines.
```shell
lxc storage volume create default docker-data size=20GiB
lxc storage volume set default docker-data snapshots.schedule=@daily snapshots.expiry=2w
mise run install docker-volume-data
```
Le profil s'ajoute **à la création** de l'instance, pour que Docker s'installe
directement sur le volume :
```shell
lxc launch ubuntu:lts docker --profile default --profile docker-unprivileged --profile docker-volume-data
lxc exec docker -- findmnt --target /var/lib/docker # le volume est bien monté
```
Les snapshots du volume se gèrent avec `lxc storage volume` :
```shell
lxc storage volume snapshot default docker-data avant-maj # snapshot manuel
lxc storage volume info default docker-data # liste des snapshots
lxc stop docker # instance arrêtée pour restaurer
lxc storage volume restore default docker-data avant-maj
lxc start docker
```
Le profil `snapshots-daily` ne suffit pas ici : il programme les snapshots de
l'**instance**, qui n'incluent pas les volumes attachés. Ce sont deux réglages
distincts, et on peut combiner les deux.
### Adapter un profil installé à son besoin
Les profils du dépôt sont un point de départ. Imaginons que vous vouliez les
données Docker sur un autre pool, plus rapide, nommé `fast`. Le volume se copie
(avec ses snapshots et leur programmation), puis on modifie directement le
profil installé dans LXD :
```shell
lxc stop docker
lxc storage volume copy default/docker-data fast/docker-data
lxc profile device set docker-volume-data docker-data pool=fast
lxc start docker
lxc storage volume delete default docker-data # une fois vérifié
```
Le volume se **copie** plutôt qu'il ne se déplace : LXD refuse de déplacer un
volume auquel un profil fait référence. La modification s'applique à toutes les
instances qui utilisent le profil.
Le profil installé ne correspond plus au dépôt, et les tâches mise le
signalent :
```shell
mise run list | grep docker-volume-data # 📝 : installé mais différent
mise run diff docker-volume-data
```
```diff
--- lxd:docker-volume-data (installé)
+++ profiles/containerization/docker-volume-data.profile.yaml (dépôt)
@@ -3,7 +3,7 @@
devices:
docker-data:
path: /var/lib/docker
- pool: fast
+ pool: default
source: docker-data
type: disk
```
Deux options s'offrent alors à vous :
- **revenir à la version du dépôt** : `mise run install docker-volume-data`
affiche ce diff et demande confirmation avant d'écraser le profil ;
- **garder votre version** : `mise run import docker-volume-data` réécrit le
fichier du dépôt à partir du profil installé. À relire avec `git diff`, puis
à commiter dans votre clone (ou votre fork).
LXD permet d'attacher un même volume à plusieurs instances, mais deux démons
Docker ne doivent jamais partager le même `/var/lib/docker`. Pour une deuxième
instance Docker, copiez le profil et donnez-lui son propre volume :
```shell
lxc storage volume create default docker2-data
lxc profile copy docker-volume-data docker2-volume-data
lxc profile device set docker2-volume-data docker-data source=docker2-data
```
### Combiner les profils
Les profils s'empilent au lancement : taille de l'instance (`size-small`,
`size-medium`…), snapshots automatiques de l'instance (`snapshots-daily`),
volume de données (`docker-volume-data`)…
```shell
lxc launch ubuntu:lts docker --profile default --profile docker-unprivileged \
--profile docker-volume-data --profile size-medium --profile snapshots-daily
```
### Faire le ménage
L'instance se supprime d'une commande, Docker avec. Le volume de données, lui,
reste : à supprimer explicitement s'il ne sert plus, comme les profils.
```shell
lxc delete --force docker
lxc storage volume delete default docker-data
lxc profile delete docker-volume-data
lxc profile delete docker-unprivileged
```
## Sans mise
Les fichiers du dépôt sont des profils LXD ordinaires : `lxc` suffit.
```shell
lxc profile create docker-unprivileged
lxc profile edit docker-unprivileged < profiles/containerization/docker-unprivileged.profile.yaml
lxc launch ubuntu:lts docker --profile default --profile docker-unprivileged
```
## Rejouer les démos
Les animations de cette page sont enregistrées à partir des scénarios
`install.yaml` et `usage.yaml` (voir [comment sont produites les démos](../README.md)) :
```shell
MISE_ENV=demo mise run demo docker/install
MISE_ENV=demo mise run demo docker/usage
```
Ils créent l'instance `docker` et le profil `docker-unprivileged`, puis les
suppriment à la fin ; `install` refuse de démarrer s'ils existent déjà.
Dans l'animation, l'attente de cloud-init est accélérée.
File diff suppressed because it is too large. Load diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 887 KiB

+49
View File
@@ -0,0 +1,49 @@
# Demo: Docker in an LXD container, from the clone of the repository to a ready instance
# (prerequisites: LXD, mise, no instance "docker" nor profile docker-unprivileged; removed at the end)
settings:
width: 156
height: 36
type_speed: 35ms
# Empty: the prompts are the shell's own (PS1), so that the instance's root shell keeps its own prompt
prompt: ""
timeout: 300s
# bash without rc files: the real prompt (PS1) is used to detect the end of commands
shell:
program: bash
args: [--norc, --noprofile]
prompt: AUTOCAST_PROMPT
line_split: " \\"
quit_command: exit
environment:
- {name: PS1, value: "\\[\\e[1;34m\\]lxd\\[\\e[0m\\] > AUTOCAST_PROMPT"}
- {name: PROMPT_COMMAND, value: "bind 'set enable-bracketed-paste off'"}
- {name: TERM, value: xterm-256color}
instructions:
- !Command {command: "source demo/docker/setup.sh install", hidden: true}
- !Marker Clone
- !Command {command: "# Get the repository and trust its mise configuration"}
- !Command {command: "git clone https://gitea.cloud.logerais.com/xavier/lxd-profiles.git"}
- !Command {command: "mise trust lxd-profiles"}
- !Command {command: "cd lxd-profiles"}
- !Wait 4s
- !Clear
- !Marker Profile
- !Command {command: "# Docker profiles available in the repository, not installed in LXD yet"}
- !Command {command: "mise run list | grep --extended-regexp 'PROFIL|docker'"}
- !Wait 3s
- !Command {command: "mise run show docker-unprivileged"}
- !Wait 4s
- !Command {command: "mise run install docker-unprivileged"}
- !Command {command: "mise run list | grep --extended-regexp 'PROFIL|docker-unprivileged'"}
- !Wait 3s
- !Clear
- !Marker Launch
- !Command {command: "# Launch an instance with the profile: cloud-init installs Docker at first boot"}
- !Command {command: "lxc launch ubuntu:lts docker --profile default --profile docker-unprivileged"}
- !Command {command: "lxc exec docker -- cloud-init status --wait --long"}
- !Wait 2s
- !Command {command: "lxc exec docker -- docker version --format 'Docker {{.Server.Version}}'"}
- !Command {command: "lxc list docker"}
- !Wait 6s
- !Command {command: "demo_cleanup", hidden: true}
+44
View File
@@ -0,0 +1,44 @@
# shellcheck shell=bash
# Hidden preamble of the Docker demos (autocast), sourced from the repository root.
# source demo/docker/setup.sh install # nothing in LXD, fresh clone in a temporary directory
# source demo/docker/setup.sh usage # instance "docker" ready (created if missing)
# demo_cleanup (epilogue) removes what the demo created.
eval "$(mise activate bash)"
source demo/lib.sh
DEMO_INSTANCE=docker
DEMO_PROFILE=docker-unprivileged
DEMO_REPO=$PWD
DEMO_CREATED=
case "$1" in
install)
if lxc info "$DEMO_INSTANCE" >/dev/null 2>&1 || lxc profile show "$DEMO_PROFILE" >/dev/null 2>&1; then
echo "Instance $DEMO_INSTANCE or profile $DEMO_PROFILE already exists in LXD: the demo would remove them" >&2
exit 1
fi
DEMO_CREATED=yes
DEMO_TMP=$(mktemp -d)
cd "$DEMO_TMP" || exit 1
;;
usage)
if ! lxc info "$DEMO_INSTANCE" >/dev/null 2>&1; then
DEMO_CREATED=yes
mise run install --yes "$DEMO_PROFILE" >/dev/null
lxc launch ubuntu:lts "$DEMO_INSTANCE" --profile default --profile "$DEMO_PROFILE" >/dev/null
demo_wait_cloud_init "$DEMO_INSTANCE"
fi
demo_instance_shell "$DEMO_INSTANCE"
;;
esac
demo_cleanup() {
cd "$DEMO_REPO" || return
if [ -n "$DEMO_TMP" ]; then
mise trust --untrust "$DEMO_TMP/lxd-profiles" >/dev/null 2>&1
rm -rf "$DEMO_TMP"
fi
if [ -n "$DEMO_CREATED" ]; then
lxc delete --force "$DEMO_INSTANCE" >/dev/null 2>&1
lxc profile delete "$DEMO_PROFILE" >/dev/null 2>&1
fi
}
+500
View File
@@ -0,0 +1,500 @@
{"version": 2, "width": 156, "height": 36, "timestamp": 1795286979, "duration": 38.410937, "env": {"PS1": "\\[\\e[1;34m\\]lxd\\[\\e[0m\\] > AUTOCAST_PROMPT", "PROMPT_COMMAND": "bind 'set enable-bracketed-paste off'", "TERM": "xterm-256color", "SHELL": "/usr/bin/bash"}}
[0.0, "o", "\u001b[1;34mlxd\u001b[0m > "]
[0.0, "o", ""]
[0.0, "m", "Exec"]
[0.035, "o", "#"]
[0.07, "o", " "]
[0.105, "o", "R"]
[0.14, "o", "u"]
[0.175, "o", "n"]
[0.21, "o", " "]
[0.245, "o", "a"]
[0.28, "o", " "]
[0.315, "o", "c"]
[0.35, "o", "o"]
[0.385, "o", "m"]
[0.42, "o", "m"]
[0.455, "o", "a"]
[0.49, "o", "n"]
[0.525, "o", "d"]
[0.56, "o", " "]
[0.595, "o", "i"]
[0.63, "o", "n"]
[0.665, "o", " "]
[0.7, "o", "t"]
[0.735, "o", "h"]
[0.77, "o", "e"]
[0.805, "o", " "]
[0.84, "o", "i"]
[0.875, "o", "n"]
[0.91, "o", "s"]
[0.945, "o", "t"]
[0.98, "o", "a"]
[1.015, "o", "n"]
[1.05, "o", "c"]
[1.085, "o", "e"]
[1.12, "o", " "]
[1.155, "o", "f"]
[1.19, "o", "r"]
[1.225, "o", "o"]
[1.26, "o", "m"]
[1.295, "o", " "]
[1.33, "o", "t"]
[1.365, "o", "h"]
[1.4, "o", "e"]
[1.435, "o", " "]
[1.47, "o", "h"]
[1.505, "o", "o"]
[1.54, "o", "s"]
[1.575, "o", "t"]
[1.61, "o", "\r\n"]
[1.613552, "o", "\u001b[1;34mlxd\u001b[0m > "]
[1.613553, "o", ""]
[1.648553, "o", "l"]
[1.683553, "o", "x"]
[1.718553, "o", "c"]
[1.753553, "o", " "]
[1.788553, "o", "e"]
[1.823553, "o", "x"]
[1.858553, "o", "e"]
[1.893553, "o", "c"]
[1.928553, "o", " "]
[1.963553, "o", "d"]
[1.998553, "o", "o"]
[2.033553, "o", "c"]
[2.068553, "o", "k"]
[2.103553, "o", "e"]
[2.138553, "o", "r"]
[2.173553, "o", " "]
[2.208553, "o", "-"]
[2.243553, "o", "-"]
[2.278553, "o", " "]
[2.313553, "o", "d"]
[2.348553, "o", "o"]
[2.383553, "o", "c"]
[2.418553, "o", "k"]
[2.453553, "o", "e"]
[2.488553, "o", "r"]
[2.523553, "o", " "]
[2.558553, "o", "r"]
[2.593553, "o", "u"]
[2.628553, "o", "n"]
[2.663553, "o", " "]
[2.698553, "o", "-"]
[2.733553, "o", "-"]
[2.768553, "o", "r"]
[2.803553, "o", "m"]
[2.838553, "o", " "]
[2.873553, "o", "h"]
[2.908553, "o", "e"]
[2.943553, "o", "l"]
[2.978553, "o", "l"]
[3.013553, "o", "o"]
[3.048553, "o", "-"]
[3.083553, "o", "w"]
[3.118553, "o", "o"]
[3.153553, "o", "r"]
[3.188553, "o", "l"]
[3.223553, "o", "d"]
[3.258553, "o", "\r\n"]
[3.389595, "o", "Unable to find image 'hello-world:latest' locally\r\n"]
[4.179716, "o", "latest: Pulling from library/hello-world\r\n"]
[4.587887, "o", "\r\n\u001b[1A\u001b[2K\r4f55086f7dd0: Pulling fs layer \r\u001b[1B"]
[4.800305, "o", "\u001b[1A\u001b[2K\r4f55086f7dd0: Download complete \r\u001b[1B"]
[4.800585, "o", "\u001b[1A\u001b[2K\r4f55086f7dd0: Extracting 1 s\r\u001b[1B"]
[4.90106, "o", "\u001b[1A\u001b[2K\r4f55086f7dd0: Pull complete \r\u001b[1B"]
[4.999717, "o", "\r\n\u001b[1A\u001b[2K\rd5e71e642bf5: Download complete \r\u001b[1B"]
[5.031106, "o", "Digest: sha256:1e4c05b897a751332ce85c7e9449da2d93514ea2dea6dbb0e2753c9e949b2bfa\r\nStatus: Downloaded newer image for hello-world:latest\r\n"]
[5.431539, "o", "\r\nHello from Docker!\r\nThis message shows that your installation appears to be working correctly.\r\n\r\nTo generate this message, Docker took the following steps:\r\n 1. The Docker client contacted the Docker daemon.\r\n 2. The Docker daemon pulled the \"hello-world\" image from the Docker Hub.\r\n (amd64)\r\n 3. The Docker daemon created a new container from that image which runs the\r\n executable that produces the output you are currently reading.\r\n 4. The Docker daemon streamed that output to the Docker client, which sent it\r\n to your terminal.\r\n\r\nTo try something more ambitious, you can run an Ubuntu container with:\r\n $ docker run -it ubuntu bash\r\n\r\nShare images, automate workflows, and more with a free Docker ID:\r\n https://hub.docker.com/\r\n\r\nFor more examples and ideas, visit:\r\n https://docs.docker.com/get-started/\r\n\r\n"]
[5.650193, "o", "\u001b[1;34mlxd\u001b[0m > "]
[5.650194, "o", ""]
[9.685194, "o", "\r\u001b[H\u001b[2J\u001b[3J\u001b[1;34mlxd\u001b[0m > "]
[9.720194, "o", ""]
[9.720194, "m", "Shell"]
[9.755194, "o", "#"]
[9.790194, "o", " "]
[9.825194, "o", "O"]
[9.860194, "o", "r"]
[9.895194, "o", " "]
[9.930194, "o", "o"]
[9.965194, "o", "p"]
[10.000194, "o", "e"]
[10.035194, "o", "n"]
[10.070194, "o", " "]
[10.105194, "o", "a"]
[10.140194, "o", " "]
[10.175194, "o", "s"]
[10.210194, "o", "h"]
[10.245194, "o", "e"]
[10.280194, "o", "l"]
[10.315194, "o", "l"]
[10.350194, "o", " "]
[10.385194, "o", "i"]
[10.420194, "o", "n"]
[10.455194, "o", " "]
[10.490194, "o", "t"]
[10.525194, "o", "h"]
[10.560194, "o", "e"]
[10.595194, "o", " "]
[10.630194, "o", "i"]
[10.665194, "o", "n"]
[10.700194, "o", "s"]
[10.735194, "o", "t"]
[10.770194, "o", "a"]
[10.805194, "o", "n"]
[10.840194, "o", "c"]
[10.875194, "o", "e"]
[10.910194, "o", " "]
[10.945194, "o", "a"]
[10.980194, "o", "n"]
[11.015194, "o", "d"]
[11.050194, "o", " "]
[11.085194, "o", "u"]
[11.120194, "o", "s"]
[11.155194, "o", "e"]
[11.190194, "o", " "]
[11.225194, "o", "D"]
[11.260194, "o", "o"]
[11.295194, "o", "c"]
[11.330194, "o", "k"]
[11.365194, "o", "e"]
[11.400194, "o", "r"]
[11.435194, "o", " "]
[11.470194, "o", "a"]
[11.505194, "o", "s"]
[11.540194, "o", " "]
[11.575194, "o", "o"]
[11.610194, "o", "n"]
[11.645194, "o", " "]
[11.680194, "o", "a"]
[11.715194, "o", "n"]
[11.750194, "o", "y"]
[11.785194, "o", " "]
[11.820194, "o", "m"]
[11.855194, "o", "a"]
[11.890194, "o", "c"]
[11.925194, "o", "h"]
[11.960194, "o", "i"]
[11.995194, "o", "n"]
[12.030194, "o", "e"]
[12.065194, "o", "\r\n"]
[12.068484, "o", "\u001b[1;34mlxd\u001b[0m > "]
[12.068484, "o", ""]
[12.103484, "o", "l"]
[12.138484, "o", "x"]
[12.173484, "o", "c"]
[12.208484, "o", " "]
[12.243484, "o", "s"]
[12.278484, "o", "h"]
[12.313484, "o", "e"]
[12.348484, "o", "l"]
[12.383484, "o", "l"]
[12.418484, "o", " "]
[12.453484, "o", "d"]
[12.488484, "o", "o"]
[12.523484, "o", "c"]
[12.558484, "o", "k"]
[12.593484, "o", "e"]
[12.628484, "o", "r"]
[12.663484, "o", "\r\n"]
[12.925736, "o", "\u001b]3008;start=f47dd143b8174c44aef0e85845074248;user=root;hostname=docker;machineid=fee09faa07ad4b838265ae23070d7d35;bootid=d0c476175ddf4367869c1347fa57e1bf;pid=4855;pidfdid=476481;comm=su;targetuser=root;sessionid=c1;type=session\u001b\\"]
[12.958744, "o", "\u001b]3008;start=67e73a71-aa8c-4553-9b2c-f6b84ded2924;type=shell;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\"]
[12.958801, "o", "\u001b[1;32mroot@docker\u001b[0m:~# "]
[12.958802, "o", ""]
[12.993802, "o", "d"]
[13.028802, "o", "o"]
[13.063802, "o", "c"]
[13.098802, "o", "k"]
[13.133802, "o", "e"]
[13.168802, "o", "r"]
[13.203802, "o", " "]
[13.238802, "o", "r"]
[13.273802, "o", "u"]
[13.308802, "o", "n"]
[13.343802, "o", " "]
[13.378802, "o", "-"]
[13.413802, "o", "-"]
[13.448802, "o", "d"]
[13.483802, "o", "e"]
[13.518802, "o", "t"]
[13.553802, "o", "a"]
[13.588802, "o", "c"]
[13.623802, "o", "h"]
[13.658802, "o", " "]
[13.693802, "o", "-"]
[13.728802, "o", "-"]
[13.763802, "o", "n"]
[13.798802, "o", "a"]
[13.833802, "o", "m"]
[13.868802, "o", "e"]
[13.903802, "o", " "]
[13.938802, "o", "w"]
[13.973802, "o", "e"]
[14.008802, "o", "b"]
[14.043802, "o", " "]
[14.078802, "o", "-"]
[14.113802, "o", "-"]
[14.148802, "o", "p"]
[14.183802, "o", "u"]
[14.218802, "o", "b"]
[14.253802, "o", "l"]
[14.288802, "o", "i"]
[14.323802, "o", "s"]
[14.358802, "o", "h"]
[14.393802, "o", " "]
[14.428802, "o", "8"]
[14.463802, "o", "0"]
[14.498802, "o", "8"]
[14.533802, "o", "0"]
[14.568802, "o", ":"]
[14.603802, "o", "8"]
[14.638802, "o", "0"]
[14.673802, "o", " "]
[14.708802, "o", "n"]
[14.743802, "o", "g"]
[14.778802, "o", "i"]
[14.813802, "o", "n"]
[14.848802, "o", "x"]
[14.883802, "o", ":"]
[14.918802, "o", "a"]
[14.953802, "o", "l"]
[14.988802, "o", "p"]
[15.023802, "o", "i"]
[15.058802, "o", "n"]
[15.093802, "o", "e"]
[15.128802, "o", "\r\n"]
[15.131429, "o", "\u001b]3008;start=e9896e4b-9153-4d0f-9036-87dcf1fc25b5;type=command;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\"]
[15.150233, "o", "Unable to find image 'nginx:alpine' locally\r\n"]
[15.941977, "o", "alpine: Pulling from library/nginx\r\n"]
[16.316446, "o", "\r\n\u001b[1A"]
[16.316513, "o", "\u001b[2K\rc4f3d97811f6: Pulling fs layer \r\u001b[1B\r\n\u001b[1A\u001b[2K\r4c8c172c6586: Pulling fs layer \r\u001b[1B\r\n\u001b[1A\u001b[2K\r1dc588c89da1: Pulling fs layer \r\u001b[1B\r\n\u001b[1A\u001b[2K\r04c3905a997c: Pulling fs layer \r"]
[16.316611, "o", "\u001b[1B\r\n\u001b[1A\u001b[2K\r881fc932939e: Pulling fs layer \r\u001b[1B\r\n\u001b[1A\u001b[2K\r77a3bfea78f5: Pulling fs layer \r"]
[16.316651, "o", "\u001b[1B\r\n"]
[16.31674, "o", "\u001b[1A\u001b[2K\r7cb374baf968: Pulling fs layer \r\u001b[1B\r\n\u001b[1A\u001b[2K\r61d8f4c85a74: Pulling fs layer \r\u001b[1B"]
[16.473039, "o", "\u001b[6A\u001b[2K\r1dc588c89da1: Downloading [==================================================>] 1.211kB/1.211kB\r\u001b[6B"]
[16.574533, "o", "\u001b[8A\u001b[2K\rc4f3d97811f6: Downloading [=======> ] 3.146MB/20.54MB\r\u001b[8B"]
[16.574952, "o", "\u001b[6A\u001b[2K\r1dc588c89da1: Download complete \r\u001b[6B"]
[16.673185, "o", "\u001b[8A\u001b[2K\rc4f3d97811f6: Downloading [===================================> ] 14.68MB/20.54MB\r\u001b[8B"]
[16.673215, "o", "\u001b[7A\u001b[2K\r4c8c172c6586: Download complete \r\u001b[7B"]
[16.772966, "o", "\u001b[8A\u001b[2K\rc4f3d97811f6: Downloading [==================================================>] 20.54MB/20.54MB\r\u001b[8B"]
[16.773287, "o", "\u001b[5A\u001b[2K\r04c3905a997c: Download complete \r\u001b[5B"]
[16.873596, "o", "\u001b[4A\u001b[2K\r881fc932939e: Downloading [==================================================>] 3.854MB/3.854MB\r\u001b[4B\u001b[3A\u001b[2K\r77a3bfea78f5: Download complete \r\u001b[3B"]
[16.874183, "o", "\u001b[8A\u001b[2K\rc4f3d97811f6: Download complete \r\u001b[8B"]
[16.97324, "o", "\u001b[4A\u001b[2K\r881fc932939e: Download complete \r\u001b[4B"]
[16.97344, "o", "\u001b[2A\u001b[2K\r7cb374baf968: Download complete \r\u001b[2B"]
[16.975038, "o", "\u001b[1A\u001b[2K\r61d8f4c85a74: Download complete \r\u001b[1B"]
[16.975102, "o", "\u001b[4A\u001b[2K\r881fc932939e: Extracting 1 s\r\u001b[4B"]
[17.077256, "o", "\u001b[4A\u001b[2K\r881fc932939e: Extracting 1 s\r\u001b[4B"]
[17.17391, "o", "\r\n\u001b[1A\u001b[2K\r79979b969278: Download complete \r\u001b[1B\r\n\u001b[1A\u001b[2K\r33247e384332: Download complete \r\u001b[1B"]
[17.174943, "o", "\u001b[5A\u001b[2K\r77a3bfea78f5: Extracting 1 s\r\u001b[5B"]
[17.175715, "o", "\u001b[6A\u001b[2K\r881fc932939e: Pull complete \r\u001b[6B"]
[17.273773, "o", "\u001b[5A\u001b[2K\r77a3bfea78f5: Extracting 1 s\r\u001b[5B"]
[17.373839, "o", "\u001b[5A\u001b[2K\r77a3bfea78f5: Extracting 1 s\r\u001b[5B"]
[17.473053, "o", "\u001b[7A\u001b[2K\r04c3905a997c: Pull complete \r\u001b[7B"]
[17.473286, "o", "\u001b[5A\u001b[2K\r77a3bfea78f5: Pull complete \r\u001b[5B"]
[17.573198, "o", "\u001b[9A\u001b[2K\r4c8c172c6586: "]
[17.573314, "o", "Extracting 1 s\r\u001b[9B"]
[17.576072, "o", "\u001b[4A\u001b[2K\r7cb374baf968: Pull complete \r\u001b[4B"]
[17.673476, "o", "\u001b[9A\u001b[2K\r4c8c172c6586: Pull complete \r\u001b[9B"]
[17.774558, "o", "\u001b[8A\u001b[2K\r1dc588c89da1: Pull complete \r\u001b[8B"]
[17.775077, "o", "\u001b[3A\u001b[2K\r61d8f4c85a74: Pull complete \r\u001b[3B"]
[17.872955, "o", "\u001b[10A\u001b[2K\rc4f3d97811f6: Extracting 1 s\r\u001b[10B"]
[17.972908, "o", "\u001b[10A\u001b[2K\rc4f3d97811f6: Extracting 1 s\r\u001b[10B"]
[18.073757, "o", "\u001b[10A\u001b[2K\rc4f3d97811f6: Extracting 1 s\r\u001b[10B"]
[18.173261, "o", "\u001b[10A\u001b[2K\r"]
[18.173287, "o", "c4f3d97811f6: Extracting 1 s\r\u001b[10B"]
[18.275577, "o", "\u001b[10A\u001b[2K\rc4f3d97811f6: Extracting 1 s\r\u001b[10B"]
[18.374885, "o", "\u001b[10A\u001b[2K\rc4f3d97811f6: Extracting 1 s\r\u001b[10B"]
[18.5277, "o", "\u001b[10A\u001b[2K\rc4f3d97811f6: Pull complete \r\u001b[10BDigest: sha256:fb4658584bd9a916ffb6f6e365f97c25cfdb2923801f551ea08356e695f14ff7\r\nStatus: Downloaded newer image for nginx:alpine\r\n"]
[18.731387, "o", "ab8f9a702c7bffc0c25dee09bb104432756d3d5a6ee427d223346d4756dab06f\r\n"]
[19.004927, "o", "\u001b]3008;end=e9896e4b-9153-4d0f-9036-87dcf1fc25b5;exit=success\u001b\\"]
[19.005922, "o", "\u001b]3008;start=67e73a71-aa8c-4553-9b2c-f6b84ded2924;type=shell;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\"]
[19.006125, "o", "\u001b[1;32mroot@docker\u001b[0m:~# "]
[19.006126, "o", ""]
[21.041126, "o", "c"]
[21.076126, "o", "l"]
[21.111126, "o", "e"]
[21.146126, "o", "a"]
[21.181126, "o", "r"]
[21.216126, "o", "\r\n"]
[21.21896, "o", "\u001b]3008;start=da689da0-870f-4a43-9823-65b02972ad2f;type=command;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\"]
[21.219711, "o", "\u001b[H\u001b[2J\u001b[3J"]
[21.219934, "o", "\u001b]3008;end=da689da0-870f-4a43-9823-65b02972ad2f;exit=success\u001b\\"]
[21.220987, "o", "\u001b]3008;start=67e73a71-aa8c-4553-9b2c-f6b84ded2924;type=shell;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\"]
[21.221082, "o", "\u001b[1;32mroot@docker\u001b[0m:~# "]
[21.221084, "o", ""]
[21.256084, "o", "d"]
[21.291084, "o", "o"]
[21.326084, "o", "c"]
[21.361084, "o", "k"]
[21.396084, "o", "e"]
[21.431084, "o", "r"]
[21.466084, "o", " "]
[21.501084, "o", "i"]
[21.536084, "o", "m"]
[21.571084, "o", "a"]
[21.606084, "o", "g"]
[21.641084, "o", "e"]
[21.676084, "o", " "]
[21.711084, "o", "l"]
[21.746084, "o", "s"]
[21.781084, "o", "\r\n"]
[21.783106, "o", "\u001b]3008;start=b5588bea-23dc-4b85-b8b6-2cc3e5b5be09;type=command;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\"]
[21.84173, "o", " \u001b[1m\u001b[106m\u001b[30mi\u001b[0m\u001b[0m \u001b[96mInfo → \u001b[0m\u001b[0m \u001b[38;5;0m\u001b[48;5;14m U \u001b[0m In Use\r\n\u001b[39m\u001b[1mIMAGE\u001b[0m \u001b[39m\u001b[1mID\u001b[0m \u001b[39m\u001b[1mDISK USAGE\u001b[0m \u001b[39m\u001b[1mCONTENT SIZE\u001b[0m \u001b[39m\u001b[1mEXTRA\u001b[0m\r\n\u001b[34m\u001b[1mhello-world:latest\u001b[0m \u001b[39m1e4c05b897a7\u001b[0m \u001b[39m21.8kB\u001b[0m \u001b[39m9.49kB\u001b[0m "]
[21.84178, "o", " \r\n\u001b[34m\u001b[1mnginx:alpine\u001b[0m \u001b[39mfb4658584bd9\u001b[0m \u001b[39m95.7MB\u001b[0m"]
[21.841786, "o", " "]
[21.841826, "o", " \u001b[39m27.2MB\u001b[0m \u001b[38;5;0m\u001b[48;5;14m U \u001b[0m \r\n"]
[21.843327, "o", "\u001b]3008;end=b5588bea-23dc-4b85-b8b6-2cc3e5b5be09;exit=success\u001b\\"]
[21.844612, "o", "\u001b]3008;start=67e73a71-aa8c-4553-9b2c-f6b84ded2924;type=shell;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\"]
[21.844725, "o", "\u001b[1;32mroot@docker\u001b[0m:~# "]
[21.844726, "o", ""]
[21.879726, "o", "d"]
[21.914726, "o", "o"]
[21.949726, "o", "c"]
[21.984726, "o", "k"]
[22.019726, "o", "e"]
[22.054726, "o", "r"]
[22.089726, "o", " "]
[22.124726, "o", "p"]
[22.159726, "o", "s"]
[22.194726, "o", "\r\n"]
[22.196199, "o", "\u001b]3008;start=d666be6e-1560-4e8b-97a3-3df5b8c6a43a;type=command;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\"]
[22.344064, "o", "CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\r\nab8f9a702c7b nginx:alpine \"/docker-entrypoint.…\" 1 second ago Up Less than a second 0.0.0.0:8080->80/tcp, [::]:8080->80/tcp web"]
[22.344275, "o", "\r\n"]
[22.347778, "o", "\u001b]3008;end=d666be6e-1560-4e8b-97a3-3df5b8c6a43a;exit=success\u001b\\"]
[22.349015, "o", "\u001b]3008;start=67e73a71-aa8c-4553-9b2c-f6b84ded2924;type=shell;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\\u001b[1;32mroot@docker\u001b[0m:~# "]
[22.349017, "o", ""]
[25.384017, "o", "d"]
[25.419017, "o", "o"]
[25.454017, "o", "c"]
[25.489017, "o", "k"]
[25.524017, "o", "e"]
[25.559017, "o", "r"]
[25.594017, "o", " "]
[25.629017, "o", "t"]
[25.664017, "o", "o"]
[25.699017, "o", "p"]
[25.734017, "o", " "]
[25.769017, "o", "w"]
[25.804017, "o", "e"]
[25.839017, "o", "b"]
[25.874017, "o", " "]
[25.909017, "o", "-"]
[25.944017, "o", "-"]
[25.979017, "o", "f"]
[26.014017, "o", "o"]
[26.049017, "o", "r"]
[26.084017, "o", "m"]
[26.119017, "o", "a"]
[26.154017, "o", "t"]
[26.189017, "o", " "]
[26.224017, "o", "p"]
[26.259017, "o", "i"]
[26.294017, "o", "d"]
[26.329017, "o", ","]
[26.364017, "o", "u"]
[26.399017, "o", "s"]
[26.434017, "o", "e"]
[26.469017, "o", "r"]
[26.504017, "o", ","]
[26.539017, "o", "a"]
[26.574017, "o", "r"]
[26.609017, "o", "g"]
[26.644017, "o", "s"]
[26.679017, "o", "\r\n"]
[26.683916, "o", "\u001b]3008;start=af83704b-8810-40b6-9fcd-82d7b305ce33;type=command;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\"]
[26.732146, "o", "PID "]
[26.732493, "o", " USER COMMAND\r\n4972 root nginx: master process nginx -g daemon off;\r\n5069 uuidd nginx: worker process\r\n5070 uuidd nginx: worker process\r\n5071 uuidd nginx: worker process\r\n5072 uuidd nginx: worker process\r\n5073 uuidd nginx: worker process\r\n5074 uuidd nginx: worker process\r\n5075 uuidd nginx: worker process\r\n5076 uuidd nginx: worker process\r\n"]
[26.737186, "o", "\u001b]3008;end=af83704b-8810-40b6-9fcd-82d7b305ce33;exit=success\u001b\\"]
[26.742742, "o", "\u001b]3008;start=67e73a71-aa8c-4553-9b2c-f6b84ded2924;type=shell;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\"]
[26.742874, "o", "\u001b[1;32mroot@docker\u001b[0m:~# "]
[26.742874, "o", ""]
[26.777874, "o", "d"]
[26.812874, "o", "o"]
[26.847874, "o", "c"]
[26.882874, "o", "k"]
[26.917874, "o", "e"]
[26.952874, "o", "r"]
[26.987874, "o", " "]
[27.022874, "o", "s"]
[27.057874, "o", "t"]
[27.092874, "o", "a"]
[27.127874, "o", "t"]
[27.162874, "o", "s"]
[27.197874, "o", " "]
[27.232874, "o", "-"]
[27.267874, "o", "-"]
[27.302874, "o", "n"]
[27.337874, "o", "o"]
[27.372874, "o", "-"]
[27.407874, "o", "s"]
[27.442874, "o", "t"]
[27.477874, "o", "r"]
[27.512874, "o", "e"]
[27.547874, "o", "a"]
[27.582874, "o", "m"]
[27.617874, "o", "\r\n"]
[27.620797, "o", "\u001b]3008;start=9c1b1896-28e7-4939-97fc-b22e7276d14c;type=command;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\"]
[28.684325, "o", "CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS\r\nab8f9a702c7b web 0.00% 7.492MiB / 30.26GiB 0.02% 486B / 84B 0B / 0B 9\r\n"]
[28.685855, "o", "\u001b]3008;end=9c1b1896-28e7-4939-97fc-b22e7276d14c;exit=success\u001b\\"]
[28.686694, "o", "\u001b]3008;start=67e73a71-aa8c-4553-9b2c-f6b84ded2924;type=shell;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\"]
[28.686793, "o", "\u001b[1;32mroot@docker\u001b[0m:~# "]
[28.686794, "o", ""]
[31.721794, "o", "c"]
[31.756794, "o", "u"]
[31.791794, "o", "r"]
[31.826794, "o", "l"]
[31.861794, "o", " "]
[31.896794, "o", "-"]
[31.931794, "o", "-"]
[31.966794, "o", "s"]
[32.001794, "o", "i"]
[32.036794, "o", "l"]
[32.071794, "o", "e"]
[32.106794, "o", "n"]
[32.141794, "o", "t"]
[32.176794, "o", " "]
[32.211794, "o", "l"]
[32.246794, "o", "o"]
[32.281794, "o", "c"]
[32.316794, "o", "a"]
[32.351794, "o", "l"]
[32.386794, "o", "h"]
[32.421794, "o", "o"]
[32.456794, "o", "s"]
[32.491794, "o", "t"]
[32.526794, "o", ":"]
[32.561794, "o", "8"]
[32.596794, "o", "0"]
[32.631794, "o", "8"]
[32.666794, "o", "0"]
[32.701794, "o", " "]
[32.736794, "o", "|"]
[32.771794, "o", " "]
[32.806794, "o", "g"]
[32.841794, "o", "r"]
[32.876794, "o", "e"]
[32.911794, "o", "p"]
[32.946794, "o", " "]
[32.981794, "o", "t"]
[33.016794, "o", "i"]
[33.051794, "o", "t"]
[33.086794, "o", "l"]
[33.121794, "o", "e"]
[33.156794, "o", "\r\n"]
[33.158312, "o", "\u001b]3008;start=a50685b3-5a5e-400b-a458-eb5e7c2a9c9c;type=command;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\"]
[33.16577, "o", "<\u001b[01;31m\u001b[Ktitle\u001b[m\u001b[K>Welcome to nginx!</\u001b[01;31m\u001b[Ktitle\u001b[m\u001b[K>\r\n"]
[33.174303, "o", "\u001b]3008;end=a50685b3-5a5e-400b-a458-eb5e7c2a9c9c;exit=success\u001b\\"]
[33.185051, "o", "\u001b]3008;start=67e73a71-aa8c-4553-9b2c-f6b84ded2924;type=shell;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\"]
[33.185188, "o", "\u001b[1;32mroot@docker\u001b[0m:~# "]
[33.185189, "o", ""]
[33.220189, "o", "e"]
[33.255189, "o", "x"]
[33.290189, "o", "i"]
[33.325189, "o", "t"]
[33.360189, "o", "\r\n"]
[33.36201, "o", "\u001b]3008;start=ed6629cc-3a7a-40c1-8634-070845bf7603;type=command;machineid=fee09faa07ad4b838265ae23070d7d35;user=root;hostname=docker;bootid=d0c47617-5ddf-4367-869c-1347fa57e1bf;pid=4879;cwd=/root\u001b\\logout\r\n"]
[33.362538, "o", "\u001b]3008;end=f47dd143b8174c44aef0e85845074248\u001b\\"]
[33.375937, "o", "\u001b[1;34mlxd\u001b[0m > "]
[33.375937, "o", ""]
[38.410937, "o", "\r\n"]
Binary file not shown.

After

Width:  |  Height:  |  Size: 389 KiB

+44
View File
@@ -0,0 +1,44 @@
# Demo: using Docker in the LXD instance, with lxc exec then from a shell in the instance
# (prerequisites: LXD, mise; instance "docker" created with its profile if missing, then removed at the end)
settings:
width: 156
height: 36
type_speed: 35ms
# Empty: the prompts are the shell's own (PS1), so that the instance's root shell keeps its own prompt
prompt: ""
timeout: 300s
# bash without rc files: the real prompt (PS1) is used to detect the end of commands
shell:
program: bash
args: [--norc, --noprofile]
prompt: AUTOCAST_PROMPT
line_split: " \\"
quit_command: exit
environment:
- {name: PS1, value: "\\[\\e[1;34m\\]lxd\\[\\e[0m\\] > AUTOCAST_PROMPT"}
- {name: PROMPT_COMMAND, value: "bind 'set enable-bracketed-paste off'"}
- {name: TERM, value: xterm-256color}
instructions:
- !Command {command: "source demo/docker/setup.sh usage", hidden: true}
- !Marker Exec
- !Command {command: "# Run a command in the instance from the host"}
- !Command {command: "lxc exec docker -- docker run --rm hello-world"}
- !Wait 4s
- !Clear
- !Marker Shell
- !Command {command: "# Or open a shell in the instance and use Docker as on any machine"}
- !Command {command: "lxc shell docker"}
- !Command {command: "docker run --detach --name web --publish 8080:80 nginx:alpine"}
- !Wait 2s
- !Command {command: "clear"}
- !Command {command: "docker image ls"}
- !Command {command: "docker ps"}
- !Wait 3s
- !Command {command: "docker top web --format pid,user,args"}
- !Command {command: "docker stats --no-stream"}
- !Wait 3s
- !Command {command: "curl --silent localhost:8080 | grep title"}
- !Command {command: "exit"}
- !Wait 5s
- !Command {command: "demo_cleanup", hidden: true}
+545
View File
@@ -0,0 +1,545 @@
{"version": 2, "width": 156, "height": 52, "timestamp": 1795271490, "duration": 46.337861, "env": {"PS1": "AUTOCAST_PROMPT", "TERM": "xterm-256color", "PROMPT_COMMAND": "bind 'set enable-bracketed-paste off'", "SHELL": "/usr/bin/bash"}}
[0.000000, "o", "\u001b[1;34mlxd\u001b[0m > "]
[0.000000, "m", "Install"]
[0.035000, "o", "#"]
[0.070000, "o", " "]
[0.105000, "o", "I"]
[0.140000, "o", "n"]
[0.175000, "o", "s"]
[0.210000, "o", "t"]
[0.245000, "o", "a"]
[0.280000, "o", "l"]
[0.315000, "o", "l"]
[0.350000, "o", " "]
[0.385000, "o", "a"]
[0.420000, "o", " "]
[0.455000, "o", "p"]
[0.490000, "o", "r"]
[0.525000, "o", "o"]
[0.560000, "o", "f"]
[0.595000, "o", "i"]
[0.630000, "o", "l"]
[0.665000, "o", "e"]
[0.700000, "o", " "]
[0.735000, "o", "f"]
[0.770000, "o", "r"]
[0.805000, "o", "o"]
[0.840000, "o", "m"]
[0.875000, "o", " "]
[0.910000, "o", "t"]
[0.945000, "o", "h"]
[0.980000, "o", "e"]
[1.015000, "o", " "]
[1.050000, "o", "r"]
[1.085000, "o", "e"]
[1.120000, "o", "p"]
[1.155000, "o", "o"]
[1.190000, "o", "s"]
[1.225000, "o", "i"]
[1.260000, "o", "t"]
[1.295000, "o", "o"]
[1.330000, "o", "r"]
[1.365000, "o", "y"]
[1.400000, "o", "\r\n"]
[1.403817, "o", "\u001b[1;34mlxd\u001b[0m > "]
[1.438817, "o", "m"]
[1.473817, "o", "i"]
[1.508817, "o", "s"]
[1.543817, "o", "e"]
[1.578817, "o", " "]
[1.613817, "o", "r"]
[1.648817, "o", "u"]
[1.683817, "o", "n"]
[1.718817, "o", " "]
[1.753817, "o", "i"]
[1.788817, "o", "n"]
[1.823817, "o", "s"]
[1.858817, "o", "t"]
[1.893817, "o", "a"]
[1.928817, "o", "l"]
[1.963817, "o", "l"]
[1.998817, "o", " "]
[2.033817, "o", "u"]
[2.068817, "o", "n"]
[2.103817, "o", "a"]
[2.138817, "o", "t"]
[2.173817, "o", "t"]
[2.208817, "o", "e"]
[2.243817, "o", "n"]
[2.278817, "o", "d"]
[2.313817, "o", "e"]
[2.348817, "o", "d"]
[2.383817, "o", "-"]
[2.418817, "o", "u"]
[2.453817, "o", "p"]
[2.488817, "o", "g"]
[2.523817, "o", "r"]
[2.558817, "o", "a"]
[2.593817, "o", "d"]
[2.628817, "o", "e"]
[2.663817, "o", "s"]
[2.698817, "o", "\r\n"]
[3.262009, "o", "\u001b[36m▸\u001b[0m \u001b[1munattended-upgrades\u001b[0m : création\r\n"]
[3.444878, "o", "Profile unattended-upgrades created\r\n"]
[3.786532, "o", "\u001b[32m✔\u001b[0m \u001b[1munattended-upgrades\u001b[0m : à jour (depuis profiles/system/unattended-upgrades.profile.yaml)\r\n"]
[3.797000, "o", "\u001b[1;34mlxd\u001b[0m > "]
[6.832000, "o", "\r\u001b[H\u001b[2J\u001b[3J"]
[6.867000, "o", "\u001b[1;34mlxd\u001b[0m > "]
[6.867000, "m", "Update"]
[6.902000, "o", "#"]
[6.937000, "o", " "]
[6.972000, "o", "S"]
[7.007000, "o", "o"]
[7.042000, "o", "m"]
[7.077000, "o", "e"]
[7.112000, "o", "o"]
[7.147000, "o", "n"]
[7.182000, "o", "e"]
[7.217000, "o", " "]
[7.252000, "o", "c"]
[7.287000, "o", "h"]
[7.322000, "o", "a"]
[7.357000, "o", "n"]
[7.392000, "o", "g"]
[7.427000, "o", "e"]
[7.462000, "o", "s"]
[7.497000, "o", " "]
[7.532000, "o", "t"]
[7.567000, "o", "h"]
[7.602000, "o", "e"]
[7.637000, "o", " "]
[7.672000, "o", "p"]
[7.707000, "o", "r"]
[7.742000, "o", "o"]
[7.777000, "o", "f"]
[7.812000, "o", "i"]
[7.847000, "o", "l"]
[7.882000, "o", "e"]
[7.917000, "o", " "]
[7.952000, "o", "d"]
[7.987000, "o", "i"]
[8.022000, "o", "r"]
[8.057000, "o", "e"]
[8.092000, "o", "c"]
[8.127000, "o", "t"]
[8.162000, "o", "l"]
[8.197000, "o", "y"]
[8.232000, "o", " "]
[8.267000, "o", "i"]
[8.302000, "o", "n"]
[8.337000, "o", " "]
[8.372000, "o", "L"]
[8.407000, "o", "X"]
[8.442000, "o", "D"]
[8.477000, "o", "."]
[8.512000, "o", "."]
[8.547000, "o", "."]
[8.582000, "o", "\r\n"]
[8.585870, "o", "\u001b[1;34mlxd\u001b[0m > "]
[8.620870, "o", "l"]
[8.655870, "o", "x"]
[8.690870, "o", "c"]
[8.725870, "o", " "]
[8.760870, "o", "p"]
[8.795870, "o", "r"]
[8.830870, "o", "o"]
[8.865870, "o", "f"]
[8.900870, "o", "i"]
[8.935870, "o", "l"]
[8.970870, "o", "e"]
[9.005870, "o", " "]
[9.040870, "o", "s"]
[9.075870, "o", "e"]
[9.110870, "o", "t"]
[9.145870, "o", " "]
[9.180870, "o", "u"]
[9.215870, "o", "n"]
[9.250870, "o", "a"]
[9.285870, "o", "t"]
[9.320870, "o", "t"]
[9.355870, "o", "e"]
[9.390870, "o", "n"]
[9.425870, "o", "d"]
[9.460870, "o", "e"]
[9.495870, "o", "d"]
[9.530870, "o", "-"]
[9.565870, "o", "u"]
[9.600870, "o", "p"]
[9.635870, "o", "g"]
[9.670870, "o", "r"]
[9.705870, "o", "a"]
[9.740870, "o", "d"]
[9.775870, "o", "e"]
[9.810870, "o", "s"]
[9.845870, "o", " "]
[9.880870, "o", "s"]
[9.915870, "o", "n"]
[9.950870, "o", "a"]
[9.985870, "o", "p"]
[10.020870, "o", "s"]
[10.055870, "o", "h"]
[10.090870, "o", "o"]
[10.125870, "o", "t"]
[10.160870, "o", "s"]
[10.195870, "o", "."]
[10.230870, "o", "s"]
[10.265870, "o", "c"]
[10.300870, "o", "h"]
[10.335870, "o", "e"]
[10.370870, "o", "d"]
[10.405870, "o", "u"]
[10.440870, "o", "l"]
[10.475870, "o", "e"]
[10.510870, "o", " "]
[10.545870, "o", "@"]
[10.580870, "o", "d"]
[10.615870, "o", "a"]
[10.650870, "o", "i"]
[10.685870, "o", "l"]
[10.720870, "o", "y"]
[10.755870, "o", "\r\n"]
[11.173733, "o", "\u001b[1;34mlxd\u001b[0m > "]
[11.208733, "o", "m"]
[11.243733, "o", "i"]
[11.278733, "o", "s"]
[11.313733, "o", "e"]
[11.348733, "o", " "]
[11.383733, "o", "r"]
[11.418733, "o", "u"]
[11.453733, "o", "n"]
[11.488733, "o", " "]
[11.523733, "o", "l"]
[11.558733, "o", "i"]
[11.593733, "o", "s"]
[11.628733, "o", "t"]
[11.663733, "o", " "]
[11.698733, "o", "|"]
[11.733733, "o", " "]
[11.768733, "o", "g"]
[11.803733, "o", "r"]
[11.838733, "o", "e"]
[11.873733, "o", "p"]
[11.908733, "o", " "]
[11.943733, "o", "u"]
[11.978733, "o", "n"]
[12.013733, "o", "a"]
[12.048733, "o", "t"]
[12.083733, "o", "t"]
[12.118733, "o", "e"]
[12.153733, "o", "n"]
[12.188733, "o", "d"]
[12.223733, "o", "e"]
[12.258733, "o", "d"]
[12.293733, "o", "\r\n"]
[16.660985, "o", " 📝 unattended-upgrades Profil pour activer les unattended upgrades sur U… 0 profiles/system/unattended-upgrades.profile.yaml\r\n"]
[17.280133, "o", "\u001b[1;34mlxd\u001b[0m > "]
[20.315133, "o", "#"]
[20.350133, "o", " "]
[20.385133, "o", "I"]
[20.420133, "o", "n"]
[20.455133, "o", "s"]
[20.490133, "o", "t"]
[20.525133, "o", "a"]
[20.560133, "o", "l"]
[20.595133, "o", "l"]
[20.630133, "o", "i"]
[20.665133, "o", "n"]
[20.700133, "o", "g"]
[20.735133, "o", " "]
[20.770133, "o", "a"]
[20.805133, "o", "g"]
[20.840133, "o", "a"]
[20.875133, "o", "i"]
[20.910133, "o", "n"]
[20.945133, "o", " "]
[20.980133, "o", "s"]
[21.015133, "o", "h"]
[21.050133, "o", "o"]
[21.085133, "o", "w"]
[21.120133, "o", "s"]
[21.155133, "o", " "]
[21.190133, "o", "t"]
[21.225133, "o", "h"]
[21.260133, "o", "e"]
[21.295133, "o", " "]
[21.330133, "o", "d"]
[21.365133, "o", "i"]
[21.400133, "o", "f"]
[21.435133, "o", "f"]
[21.470133, "o", " "]
[21.505133, "o", "a"]
[21.540133, "o", "n"]
[21.575133, "o", "d"]
[21.610133, "o", " "]
[21.645133, "o", "a"]
[21.680133, "o", "s"]
[21.715133, "o", "k"]
[21.750133, "o", "s"]
[21.785133, "o", " "]
[21.820133, "o", "f"]
[21.855133, "o", "o"]
[21.890133, "o", "r"]
[21.925133, "o", " "]
[21.960133, "o", "c"]
[21.995133, "o", "o"]
[22.030133, "o", "n"]
[22.065133, "o", "f"]
[22.100133, "o", "i"]
[22.135133, "o", "r"]
[22.170133, "o", "m"]
[22.205133, "o", "a"]
[22.240133, "o", "t"]
[22.275133, "o", "i"]
[22.310133, "o", "o"]
[22.345133, "o", "n"]
[22.380133, "o", "\r\n"]
[22.383820, "o", "\u001b[1;34mlxd\u001b[0m > "]
[22.418820, "o", "m"]
[22.453820, "o", "i"]
[22.488820, "o", "s"]
[22.523820, "o", "e"]
[22.558820, "o", " "]
[22.593820, "o", "r"]
[22.628820, "o", "u"]
[22.663820, "o", "n"]
[22.698820, "o", " "]
[22.733820, "o", "i"]
[22.768820, "o", "n"]
[22.803820, "o", "s"]
[22.838820, "o", "t"]
[22.873820, "o", "a"]
[22.908820, "o", "l"]
[22.943820, "o", "l"]
[22.978820, "o", " "]
[23.013820, "o", "u"]
[23.048820, "o", "n"]
[23.083820, "o", "a"]
[23.118820, "o", "t"]
[23.153820, "o", "t"]
[23.188820, "o", "e"]
[23.223820, "o", "n"]
[23.258820, "o", "d"]
[23.293820, "o", "e"]
[23.328820, "o", "d"]
[23.363820, "o", "-"]
[23.398820, "o", "u"]
[23.433820, "o", "p"]
[23.468820, "o", "g"]
[23.503820, "o", "r"]
[23.538820, "o", "a"]
[23.573820, "o", "d"]
[23.608820, "o", "e"]
[23.643820, "o", "s"]
[23.678820, "o", "\r\n"]
[24.390501, "o", "\u001b[33m⚠\u001b[0m \u001b[1munattended-upgrades\u001b[0m existe déjà et diffère du dépôt :\r\n"]
[24.506694, "o", "\r\n\u001b[34mΔ lxd:unattended-upgrades (installé) ⟶ profiles/system/unattended-upgrades.profile.yaml (dépôt)\u001b[0m\r\n\u001b[34m────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\r\n"]
[24.507023, "o", "\r\n\u001b[34m──────\u001b[0m\u001b[34m┐\u001b[0m\r\n\u001b[34m•\u001b[0m \u001b[34m27\u001b[0m: \u001b[34m│\u001b[0m\r\n\u001b[34m──────\u001b[0m\u001b[34m┘\u001b[0m\r\n"]
[24.507100, "o", "\u001b[34m│\u001b[38;2;68;68;68m 27 \u001b[34m│\u001b[0m \u001b[34m│\u001b[38;2;68;68;68m 27 \u001b[34m│\u001b[0m\r\n\u001b[34m│\u001b[38;2;68;68;68m 28 \u001b[34m│\u001b[38;2;227;234;242m runcmd:\u001b[0m \u001b[34m│\u001b[38;2;68;68;68m 28 \u001b[34m│\u001b[38;2;227;234;242m runcmd:\u001b[0m\r\n"]
[24.507124, "o", "\u001b[34m│\u001b[38;2;68;68;68m 29 \u001b[34m│\u001b[38;2;227;234;242m - [ systemctl, enable, --now, unattended-upgrades ]\u001b[0m \u001b[34m│\u001b[38;2;68;68;68m 29 \u001b[34m│\u001b[38;2;227;234;242m - [ systemctl, enable, --now, unattended-upgrades ]\u001b[0m\r\n"]
[24.507153, "o", "\u001b[34m│\u001b[38;5;88m 30 \u001b[34m│\u001b[48;2;63;0;1;38;2;227;234;242m snapshots.schedule: '@daily'\u001b[0m\u001b[48;2;63;0;1m \u001b[0m\u001b[34m│\u001b[38;2;68;68;68m \u001b[34m│\u001b[0m\r\n\u001b[34m│\u001b[38;2;68;68;68m 31 \u001b[34m│\u001b[38;2;227;234;242mdescription: Profil pour activer les unattended upgrades sur Ubuntu\u001b[0m \u001b[34m│\u001b[38;2;68;68;68m 30 \u001b[34m│\u001b[38;2;227;234;242mdescription: Profil pour activer les unattended upgrades sur Ubuntu\u001b[0m\r\n"]
[24.507167, "o", "\u001b[34m│\u001b[38;2;68;68;68m 32 \u001b[34m│\u001b[38;2;227;234;242mdevices: {}\u001b[0m \u001b[34m│\u001b[38;2;68;68;68m 31 \u001b[34m│\u001b[38;2;227;234;242mdevices: {}\u001b[0m\r\n"]
[24.507181, "o", "\u001b[34m│\u001b[38;2;68;68;68m 33 \u001b[34m│\u001b[38;2;227;234;242mname: unattended-upgrades\u001b[0m \u001b[34m│\u001b[38;2;68;68;68m 32 \u001b[34m│\u001b[38;2;227;234;242mname: unattended-upgrades\u001b[0m\r\n"]
[24.587449, "o", "\u001b[?25l\u001b[?5W\u001b[?2004h\u001b[>4;2m\u001b[>1u\u001b[?u\r\u001b[J \u001b[38;2;117;113;249;1mMettre à jour le profil unattended-upgrades ?\u001b[m\r\n\n \u001b[48;5;235m \u001b[38;5;254mOui\u001b[39m \u001b[m \u001b[48;5;212m \u001b[38;5;230mNon\u001b[39m \u001b[m\r\n\n\u001b[38;2;98;98;98m←→\u001b[m \u001b[38;2;74;74;74mtoggle\u001b[38;2;60;60;60m • \u001b[38;2;98;98;98menter\u001b[m \u001b[38;2;74;74;74msubmit\u001b[38;2;60;60;60m • \u001b[38;2;98;98;98my\u001b[m \u001b[38;2;74;74;74mOui\u001b[38;2;60;60;60m • \u001b[38;2;98;98;98mn\u001b[m \u001b[38;2;74;74;74mNon\u001b[m"]
[27.749395, "o", "\r\u001b[4A\u001b[J\u001b[>4m\u001b[<1u\u001b[J\u001b[?25h\u001b[?2004l"]
[27.938198, "o", "\u001b[32m✔\u001b[0m \u001b[1munattended-upgrades\u001b[0m : à jour (depuis profiles/system/unattended-upgrades.profile.yaml)\r\n"]
[27.962168, "o", "\u001b[1;34mlxd\u001b[0m > "]
[30.997168, "o", "\r\u001b[H\u001b[2J\u001b[3J"]
[31.032168, "o", "\u001b[1;34mlxd\u001b[0m > "]
[31.032168, "m", "Import"]
[31.067168, "o", "#"]
[31.102168, "o", " "]
[31.137168, "o", "O"]
[31.172168, "o", "r"]
[31.207168, "o", " "]
[31.242168, "o", "k"]
[31.277168, "o", "e"]
[31.312168, "o", "e"]
[31.347168, "o", "p"]
[31.382168, "o", " "]
[31.417168, "o", "t"]
[31.452168, "o", "h"]
[31.487168, "o", "e"]
[31.522168, "o", " "]
[31.557168, "o", "L"]
[31.592168, "o", "X"]
[31.627168, "o", "D"]
[31.662168, "o", " "]
[31.697168, "o", "c"]
[31.732168, "o", "h"]
[31.767168, "o", "a"]
[31.802168, "o", "n"]
[31.837168, "o", "g"]
[31.872168, "o", "e"]
[31.907168, "o", ":"]
[31.942168, "o", " "]
[31.977168, "o", "i"]
[32.012168, "o", "m"]
[32.047168, "o", "p"]
[32.082168, "o", "o"]
[32.117168, "o", "r"]
[32.152168, "o", "t"]
[32.187168, "o", " "]
[32.222168, "o", "t"]
[32.257168, "o", "h"]
[32.292168, "o", "e"]
[32.327168, "o", " "]
[32.362168, "o", "p"]
[32.397168, "o", "r"]
[32.432168, "o", "o"]
[32.467168, "o", "f"]
[32.502168, "o", "i"]
[32.537168, "o", "l"]
[32.572168, "o", "e"]
[32.607168, "o", " "]
[32.642168, "o", "i"]
[32.677168, "o", "n"]
[32.712168, "o", "t"]
[32.747168, "o", "o"]
[32.782168, "o", " "]
[32.817168, "o", "t"]
[32.852168, "o", "h"]
[32.887168, "o", "e"]
[32.922168, "o", " "]
[32.957168, "o", "r"]
[32.992168, "o", "e"]
[33.027168, "o", "p"]
[33.062168, "o", "o"]
[33.097168, "o", "s"]
[33.132168, "o", "i"]
[33.167168, "o", "t"]
[33.202168, "o", "o"]
[33.237168, "o", "r"]
[33.272168, "o", "y"]
[33.307168, "o", "\r\n"]
[33.310876, "o", "\u001b[1;34mlxd\u001b[0m > "]
[33.345876, "o", "l"]
[33.380876, "o", "x"]
[33.415876, "o", "c"]
[33.450876, "o", " "]
[33.485876, "o", "p"]
[33.520876, "o", "r"]
[33.555876, "o", "o"]
[33.590876, "o", "f"]
[33.625876, "o", "i"]
[33.660876, "o", "l"]
[33.695876, "o", "e"]
[33.730876, "o", " "]
[33.765876, "o", "s"]
[33.800876, "o", "e"]
[33.835876, "o", "t"]
[33.870876, "o", " "]
[33.905876, "o", "u"]
[33.940876, "o", "n"]
[33.975876, "o", "a"]
[34.010876, "o", "t"]
[34.045876, "o", "t"]
[34.080876, "o", "e"]
[34.115876, "o", "n"]
[34.150876, "o", "d"]
[34.185876, "o", "e"]
[34.220876, "o", "d"]
[34.255876, "o", "-"]
[34.290876, "o", "u"]
[34.325876, "o", "p"]
[34.360876, "o", "g"]
[34.395876, "o", "r"]
[34.430876, "o", "a"]
[34.465876, "o", "d"]
[34.500876, "o", "e"]
[34.535876, "o", "s"]
[34.570876, "o", " "]
[34.605876, "o", "s"]
[34.640876, "o", "n"]
[34.675876, "o", "a"]
[34.710876, "o", "p"]
[34.745876, "o", "s"]
[34.780876, "o", "h"]
[34.815876, "o", "o"]
[34.850876, "o", "t"]
[34.885876, "o", "s"]
[34.920876, "o", "."]
[34.955876, "o", "s"]
[34.990876, "o", "c"]
[35.025876, "o", "h"]
[35.060876, "o", "e"]
[35.095876, "o", "d"]
[35.130876, "o", "u"]
[35.165876, "o", "l"]
[35.200876, "o", "e"]
[35.235876, "o", " "]
[35.270876, "o", "@"]
[35.305876, "o", "d"]
[35.340876, "o", "a"]
[35.375876, "o", "i"]
[35.410876, "o", "l"]
[35.445876, "o", "y"]
[35.480876, "o", "\r\n"]
[35.682416, "o", "\u001b[1;34mlxd\u001b[0m > "]
[35.717416, "o", "m"]
[35.752416, "o", "i"]
[35.787416, "o", "s"]
[35.822416, "o", "e"]
[35.857416, "o", " "]
[35.892416, "o", "r"]
[35.927416, "o", "u"]
[35.962416, "o", "n"]
[35.997416, "o", " "]
[36.032416, "o", "i"]
[36.067416, "o", "m"]
[36.102416, "o", "p"]
[36.137416, "o", "o"]
[36.172416, "o", "r"]
[36.207416, "o", "t"]
[36.242416, "o", " "]
[36.277416, "o", "u"]
[36.312416, "o", "n"]
[36.347416, "o", "a"]
[36.382416, "o", "t"]
[36.417416, "o", "t"]
[36.452416, "o", "e"]
[36.487416, "o", "n"]
[36.522416, "o", "d"]
[36.557416, "o", "e"]
[36.592416, "o", "d"]
[36.627416, "o", "-"]
[36.662416, "o", "u"]
[36.697416, "o", "p"]
[36.732416, "o", "g"]
[36.767416, "o", "r"]
[36.802416, "o", "a"]
[36.837416, "o", "d"]
[36.872416, "o", "e"]
[36.907416, "o", "s"]
[36.942416, "o", "\r\n"]
[37.603667, "o", "\u001b[32m✔\u001b[0m \u001b[1munattended-upgrades\u001b[0m → profiles/system/unattended-upgrades.profile.yaml\r\n"]
[37.607784, "o", " profiles/system/unattended-upgrades.profile.yaml | 1 \u001b[32m+\u001b[m\r\n 1 file changed, 1 insertion(+)\r\n"]
[37.608085, "o", " \u001b[2mgit diff -- profiles/system/unattended-upgrades.profile.yaml pour le détail\u001b[0m\r\n"]
[37.620274, "o", "\u001b[1;34mlxd\u001b[0m > "]
[39.655274, "o", "g"]
[39.690274, "o", "i"]
[39.725274, "o", "t"]
[39.760274, "o", " "]
[39.795274, "o", "d"]
[39.830274, "o", "i"]
[39.865274, "o", "f"]
[39.900274, "o", "f"]
[39.935274, "o", " "]
[39.970274, "o", "p"]
[40.005274, "o", "r"]
[40.040274, "o", "o"]
[40.075274, "o", "f"]
[40.110274, "o", "i"]
[40.145274, "o", "l"]
[40.180274, "o", "e"]
[40.215274, "o", "s"]
[40.250274, "o", "/"]
[40.285274, "o", "\r\n"]
[40.295886, "o", "\r\n\u001b[34mΔ profiles/system/unattended-upgrades.profile.yaml\u001b[0m\r\n\u001b[34m────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\r\n"]
[40.296434, "o", "\r\n"]
[40.296961, "o", "\u001b[34m──────────────\u001b[0m\u001b[34m┐\u001b[0m\r\n\u001b[34m•\u001b[0m \u001b[34m29\u001b[0m:\u001b[38;2;227;234;242m \u001b[38;2;108;184;230mconfig\u001b[38;2;227;234;242m: \u001b[0m\u001b[34m│\u001b[0m\r\n\u001b[34m──────────────\u001b[0m\u001b[34m┘\u001b[0m\r\n"]
[40.297007, "o", "\u001b[34m│\u001b[38;2;68;68;68m 29 \u001b[34m│\u001b[0m \u001b[34m│\u001b[38;2;68;68;68m 29 \u001b[34m│\u001b[0m\r\n"]
[40.297083, "o", "\u001b[34m│\u001b[38;2;68;68;68m 30 \u001b[34m│\u001b[38;2;227;234;242m \u001b[38;2;108;184;230mruncmd\u001b[38;2;227;234;242m:\u001b[0m \u001b[34m│\u001b[38;2;68;68;68m 30 \u001b[34m│\u001b[38;2;227;234;242m \u001b[38;2;108;184;230mruncmd\u001b[38;2;227;234;242m:\u001b[0m\r\n"]
[40.297304, "o", "\u001b[34m│\u001b[38;2;68;68;68m 31 \u001b[34m│\u001b[38;2;227;234;242m - [ \u001b[38;2;145;208;118msystemctl\u001b[38;2;227;234;242m, \u001b[38;2;145;208;118menable\u001b[38;2;227;234;242m, \u001b[38;2;145;208;118m--now\u001b[38;2;227;234;242m, \u001b[38;2;145;208;118munattended-upgrades\u001b[38;2;227;234;242m ]\u001b[0m \u001b[34m│\u001b[38;2;68;68;68m 31 \u001b[34m│\u001b[38;2;227;234;242m - [ \u001b[38;2;145;208;118msystemctl\u001b[38;2;227;234;242m, \u001b[38;2;145;208;118menable\u001b[38;2;227;234;242m, \u001b[38;2;145;208;118m--now\u001b[38;2;227;234;242m, \u001b[38;2;145;208;118munattended-upgrades\u001b[38;2;227;234;242m ]\u001b[0m\r\n"]
[40.297394, "o", "\u001b[34m│\u001b[38;2;68;68;68m \u001b[34m│\u001b[0m \u001b[34m│\u001b[38;5;28m 32 \u001b[34m│\u001b[48;2;0;40;0;38;2;227;234;242m \u001b[38;2;108;184;230msnapshots.schedule\u001b[38;2;227;234;242m: \u001b[38;2;145;208;118m'@daily'\u001b[0m\u001b[48;2;0;40;0m\u001b[0K\u001b[0m\r\n"]
[40.302861, "o", "\u001b[1;34mlxd\u001b[0m > "]
[46.337861, "o", "\r\n"]
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 363 KiB

+45
View File
@@ -0,0 +1,45 @@
# Demo: install a profile, update it after a change in LXD, import it back
# (prerequisites: LXD, profile unattended-upgrades not installed; removed at the end)
settings:
width: 156
height: 52
type_speed: 35ms
prompt: "\e[1;34mlxd\e[0m > "
timeout: 120s
# bash without rc files: the real prompt (PS1) is used to detect the end of commands
shell:
program: bash
args: [--norc, --noprofile]
prompt: AUTOCAST_PROMPT
line_split: " \\"
quit_command: exit
environment:
- {name: PS1, value: AUTOCAST_PROMPT}
- {name: PROMPT_COMMAND, value: "bind 'set enable-bracketed-paste off'"}
instructions:
- !Command {command: "source demo/setup.sh", hidden: true}
- !Marker Install
- !Command {command: "# Install a profile from the repository"}
- !Command {command: "mise run install unattended-upgrades"}
- !Wait 3s
- !Clear
- !Marker Update
- !Command {command: "# Someone changes the profile directly in LXD..."}
- !Command {command: "lxc profile set unattended-upgrades snapshots.schedule @daily"}
- !Command {command: "mise run list | grep unattended"}
- !Wait 3s
- !Command {command: "# Installing again shows the diff and asks for confirmation"}
- !Interactive
command: "mise run install unattended-upgrades"
keys: [4s, y]
- !Wait 3s
- !Clear
- !Marker Import
- !Command {command: "# Or keep the LXD change: import the profile into the repository"}
- !Command {command: "lxc profile set unattended-upgrades snapshots.schedule @daily"}
- !Command {command: "mise run import unattended-upgrades"}
- !Wait 2s
- !Command {command: "git diff profiles/"}
- !Wait 6s
- !Command {command: "demo_cleanup", hidden: true}
+17
View File
@@ -0,0 +1,17 @@
# shellcheck shell=bash
# Helpers shared by the hidden preambles of the tutorial demos (demo/*/setup.sh).
# Root shell of an instance, made recordable: its prompt (root@<instance>) ends
# with the marker autocast waits for, and its input is not echoed twice (no
# readline, no tty echo). Only for instances created by the demo.
demo_instance_shell() {
lxc exec "$1" -- sh -c "cat >> /root/.bashrc" <<RC
PS1='\[\e[1;32m\]root@$1\[\e[0m\]:\w# AUTOCAST_PROMPT'
set +o emacs; stty -echo
RC
}
# Wait for the end of cloud-init in an instance (quietly)
demo_wait_cloud_init() {
lxc exec "$1" -- cloud-init status --wait >/dev/null
}
+412
View File
@@ -0,0 +1,412 @@
{"version": 2, "width": 156, "height": 22, "timestamp": 1795271578, "duration": 25.708726, "env": {"TERM": "xterm-256color", "PS1": "AUTOCAST_PROMPT", "SHELL": "/usr/bin/bash", "PROMPT_COMMAND": "bind 'set enable-bracketed-paste off'"}}
[0.000000, "o", "\u001b[1;34mlxd\u001b[0m > "]
[0.000000, "m", "Create"]
[0.035000, "o", "#"]
[0.070000, "o", " "]
[0.105000, "o", "N"]
[0.140000, "o", "o"]
[0.175000, "o", " "]
[0.210000, "o", "m"]
[0.245000, "o", "i"]
[0.280000, "o", "s"]
[0.315000, "o", "e"]
[0.350000, "o", " "]
[0.385000, "o", "n"]
[0.420000, "o", "e"]
[0.455000, "o", "e"]
[0.490000, "o", "d"]
[0.525000, "o", "e"]
[0.560000, "o", "d"]
[0.595000, "o", ":"]
[0.630000, "o", " "]
[0.665000, "o", "t"]
[0.700000, "o", "h"]
[0.735000, "o", "e"]
[0.770000, "o", " "]
[0.805000, "o", "Y"]
[0.840000, "o", "A"]
[0.875000, "o", "M"]
[0.910000, "o", "L"]
[0.945000, "o", " "]
[0.980000, "o", "f"]
[1.015000, "o", "i"]
[1.050000, "o", "l"]
[1.085000, "o", "e"]
[1.120000, "o", "s"]
[1.155000, "o", " "]
[1.190000, "o", "a"]
[1.225000, "o", "r"]
[1.260000, "o", "e"]
[1.295000, "o", " "]
[1.330000, "o", "r"]
[1.365000, "o", "e"]
[1.400000, "o", "g"]
[1.435000, "o", "u"]
[1.470000, "o", "l"]
[1.505000, "o", "a"]
[1.540000, "o", "r"]
[1.575000, "o", " "]
[1.610000, "o", "L"]
[1.645000, "o", "X"]
[1.680000, "o", "D"]
[1.715000, "o", " "]
[1.750000, "o", "p"]
[1.785000, "o", "r"]
[1.820000, "o", "o"]
[1.855000, "o", "f"]
[1.890000, "o", "i"]
[1.925000, "o", "l"]
[1.960000, "o", "e"]
[1.995000, "o", "s"]
[2.030000, "o", "\r\n"]
[2.034666, "o", "\u001b[1;34mlxd\u001b[0m > "]
[2.069666, "o", "l"]
[2.104666, "o", "x"]
[2.139666, "o", "c"]
[2.174666, "o", " "]
[2.209666, "o", "p"]
[2.244666, "o", "r"]
[2.279666, "o", "o"]
[2.314666, "o", "f"]
[2.349666, "o", "i"]
[2.384666, "o", "l"]
[2.419666, "o", "e"]
[2.454666, "o", " "]
[2.489666, "o", "c"]
[2.524666, "o", "r"]
[2.559666, "o", "e"]
[2.594666, "o", "a"]
[2.629666, "o", "t"]
[2.664666, "o", "e"]
[2.699666, "o", " "]
[2.734666, "o", "u"]
[2.769666, "o", "n"]
[2.804666, "o", "a"]
[2.839666, "o", "t"]
[2.874666, "o", "t"]
[2.909666, "o", "e"]
[2.944666, "o", "n"]
[2.979666, "o", "d"]
[3.014666, "o", "e"]
[3.049666, "o", "d"]
[3.084666, "o", "-"]
[3.119666, "o", "u"]
[3.154666, "o", "p"]
[3.189666, "o", "g"]
[3.224666, "o", "r"]
[3.259666, "o", "a"]
[3.294666, "o", "d"]
[3.329666, "o", "e"]
[3.364666, "o", "s"]
[3.399666, "o", "\r\n"]
[3.625039, "o", "Profile unattended-upgrades created\r\n"]
[3.630299, "o", "\u001b[1;34mlxd\u001b[0m > "]
[3.665299, "o", "l"]
[3.700299, "o", "x"]
[3.735299, "o", "c"]
[3.770299, "o", " "]
[3.805299, "o", "p"]
[3.840299, "o", "r"]
[3.875299, "o", "o"]
[3.910299, "o", "f"]
[3.945299, "o", "i"]
[3.980299, "o", "l"]
[4.015299, "o", "e"]
[4.050299, "o", " "]
[4.085299, "o", "e"]
[4.120299, "o", "d"]
[4.155299, "o", "i"]
[4.190299, "o", "t"]
[4.225299, "o", " "]
[4.260299, "o", "u"]
[4.295299, "o", "n"]
[4.330299, "o", "a"]
[4.365299, "o", "t"]
[4.400299, "o", "t"]
[4.435299, "o", "e"]
[4.470299, "o", "n"]
[4.505299, "o", "d"]
[4.540299, "o", "e"]
[4.575299, "o", "d"]
[4.610299, "o", "-"]
[4.645299, "o", "u"]
[4.680299, "o", "p"]
[4.715299, "o", "g"]
[4.750299, "o", "r"]
[4.785299, "o", "a"]
[4.820299, "o", "d"]
[4.855299, "o", "e"]
[4.890299, "o", "s"]
[4.925299, "o", " "]
[4.960299, "o", "<"]
[4.995299, "o", " "]
[5.030299, "o", "p"]
[5.065299, "o", "r"]
[5.100299, "o", "o"]
[5.135299, "o", "f"]
[5.170299, "o", "i"]
[5.205299, "o", "l"]
[5.240299, "o", "e"]
[5.275299, "o", "s"]
[5.310299, "o", "/"]
[5.345299, "o", "s"]
[5.380299, "o", "y"]
[5.415299, "o", "s"]
[5.450299, "o", "t"]
[5.485299, "o", "e"]
[5.520299, "o", "m"]
[5.555299, "o", "/"]
[5.590299, "o", "u"]
[5.625299, "o", "n"]
[5.660299, "o", "a"]
[5.695299, "o", "t"]
[5.730299, "o", "t"]
[5.765299, "o", "e"]
[5.800299, "o", "n"]
[5.835299, "o", "d"]
[5.870299, "o", "e"]
[5.905299, "o", "d"]
[5.940299, "o", "-"]
[5.975299, "o", "u"]
[6.010299, "o", "p"]
[6.045299, "o", "g"]
[6.080299, "o", "r"]
[6.115299, "o", "a"]
[6.150299, "o", "d"]
[6.185299, "o", "e"]
[6.220299, "o", "s"]
[6.255299, "o", "."]
[6.290299, "o", "p"]
[6.325299, "o", "r"]
[6.360299, "o", "o"]
[6.395299, "o", "f"]
[6.430299, "o", "i"]
[6.465299, "o", "l"]
[6.500299, "o", "e"]
[6.535299, "o", "."]
[6.570299, "o", "y"]
[6.605299, "o", "a"]
[6.640299, "o", "m"]
[6.675299, "o", "l"]
[6.710299, "o", "\r\n"]
[7.019507, "o", "\u001b[1;34mlxd\u001b[0m > "]
[9.054507, "o", "l"]
[9.089507, "o", "x"]
[9.124507, "o", "c"]
[9.159507, "o", " "]
[9.194507, "o", "p"]
[9.229507, "o", "r"]
[9.264507, "o", "o"]
[9.299507, "o", "f"]
[9.334507, "o", "i"]
[9.369507, "o", "l"]
[9.404507, "o", "e"]
[9.439507, "o", " "]
[9.474507, "o", "s"]
[9.509507, "o", "h"]
[9.544507, "o", "o"]
[9.579507, "o", "w"]
[9.614507, "o", " "]
[9.649507, "o", "u"]
[9.684507, "o", "n"]
[9.719507, "o", "a"]
[9.754507, "o", "t"]
[9.789507, "o", "t"]
[9.824507, "o", "e"]
[9.859507, "o", "n"]
[9.894507, "o", "d"]
[9.929507, "o", "e"]
[9.964507, "o", "d"]
[9.999507, "o", "-"]
[10.034507, "o", "u"]
[10.069507, "o", "p"]
[10.104507, "o", "g"]
[10.139507, "o", "r"]
[10.174507, "o", "a"]
[10.209507, "o", "d"]
[10.244507, "o", "e"]
[10.279507, "o", "s"]
[10.314507, "o", " "]
[10.349507, "o", "|"]
[10.384507, "o", " "]
[10.419507, "o", "h"]
[10.454507, "o", "e"]
[10.489507, "o", "a"]
[10.524507, "o", "d"]
[10.559507, "o", " "]
[10.594507, "o", "-"]
[10.629507, "o", "1"]
[10.664507, "o", "2"]
[10.699507, "o", "\r\n"]
[10.829040, "o", "name: unattended-upgrades\r\ndescription: Profil pour activer les unattended upgrades sur Ubuntu\r\nconfig:\r\n cloud-init.vendor-data: |\r\n #cloud-config\r\n package_update: true\r\n package_upgrade: true\r\n packages:\r\n - unattended-upgrades\r\n - apt-listchanges\r\n\r\n write_files:\r\n"]
[10.834268, "o", "\u001b[1;34mlxd\u001b[0m > "]
[14.869268, "o", "\r\u001b[H\u001b[2J\u001b[3J"]
[14.904268, "o", "\u001b[1;34mlxd\u001b[0m > "]
[14.904268, "m", "Use"]
[14.939268, "o", "#"]
[14.974268, "o", " "]
[15.009268, "o", "T"]
[15.044268, "o", "h"]
[15.079268, "o", "e"]
[15.114268, "o", "n"]
[15.149268, "o", " "]
[15.184268, "o", "u"]
[15.219268, "o", "s"]
[15.254268, "o", "e"]
[15.289268, "o", " "]
[15.324268, "o", "i"]
[15.359268, "o", "t"]
[15.394268, "o", " "]
[15.429268, "o", "w"]
[15.464268, "o", "h"]
[15.499268, "o", "e"]
[15.534268, "o", "n"]
[15.569268, "o", " "]
[15.604268, "o", "l"]
[15.639268, "o", "a"]
[15.674268, "o", "u"]
[15.709268, "o", "n"]
[15.744268, "o", "c"]
[15.779268, "o", "h"]
[15.814268, "o", "i"]
[15.849268, "o", "n"]
[15.884268, "o", "g"]
[15.919268, "o", " "]
[15.954268, "o", "a"]
[15.989268, "o", "n"]
[16.024268, "o", " "]
[16.059268, "o", "i"]
[16.094268, "o", "n"]
[16.129268, "o", "s"]
[16.164268, "o", "t"]
[16.199268, "o", "a"]
[16.234268, "o", "n"]
[16.269268, "o", "c"]
[16.304268, "o", "e"]
[16.339268, "o", "\r\n"]
[16.342817, "o", "\u001b[1;34mlxd\u001b[0m > "]
[16.377817, "o", "#"]
[16.412817, "o", " "]
[16.447817, "o", "l"]
[16.482817, "o", "x"]
[16.517817, "o", "c"]
[16.552817, "o", " "]
[16.587817, "o", "l"]
[16.622817, "o", "a"]
[16.657817, "o", "u"]
[16.692817, "o", "n"]
[16.727817, "o", "c"]
[16.762817, "o", "h"]
[16.797817, "o", " "]
[16.832817, "o", "u"]
[16.867817, "o", "b"]
[16.902817, "o", "u"]
[16.937817, "o", "n"]
[16.972817, "o", "t"]
[17.007817, "o", "u"]
[17.042817, "o", ":"]
[17.077817, "o", "2"]
[17.112817, "o", "4"]
[17.147817, "o", "."]
[17.182817, "o", "0"]
[17.217817, "o", "4"]
[17.252817, "o", " "]
[17.287817, "o", "w"]
[17.322817, "o", "e"]
[17.357817, "o", "b"]
[17.392817, "o", " "]
[17.427817, "o", "-"]
[17.462817, "o", "p"]
[17.497817, "o", " "]
[17.532817, "o", "d"]
[17.567817, "o", "e"]
[17.602817, "o", "f"]
[17.637817, "o", "a"]
[17.672817, "o", "u"]
[17.707817, "o", "l"]
[17.742817, "o", "t"]
[17.777817, "o", " "]
[17.812817, "o", "-"]
[17.847817, "o", "p"]
[17.882817, "o", " "]
[17.917817, "o", "u"]
[17.952817, "o", "n"]
[17.987817, "o", "a"]
[18.022817, "o", "t"]
[18.057817, "o", "t"]
[18.092817, "o", "e"]
[18.127817, "o", "n"]
[18.162817, "o", "d"]
[18.197817, "o", "e"]
[18.232817, "o", "d"]
[18.267817, "o", "-"]
[18.302817, "o", "u"]
[18.337817, "o", "p"]
[18.372817, "o", "g"]
[18.407817, "o", "r"]
[18.442817, "o", "a"]
[18.477817, "o", "d"]
[18.512817, "o", "e"]
[18.547817, "o", "s"]
[18.582817, "o", "\r\n"]
[18.586214, "o", "\u001b[1;34mlxd\u001b[0m > "]
[18.621214, "o", "l"]
[18.656214, "o", "x"]
[18.691214, "o", "c"]
[18.726214, "o", " "]
[18.761214, "o", "p"]
[18.796214, "o", "r"]
[18.831214, "o", "o"]
[18.866214, "o", "f"]
[18.901214, "o", "i"]
[18.936214, "o", "l"]
[18.971214, "o", "e"]
[19.006214, "o", " "]
[19.041214, "o", "l"]
[19.076214, "o", "i"]
[19.111214, "o", "s"]
[19.146214, "o", "t"]
[19.181214, "o", " "]
[19.216214, "o", "-"]
[19.251214, "o", "f"]
[19.286214, "o", " "]
[19.321214, "o", "c"]
[19.356214, "o", "o"]
[19.391214, "o", "m"]
[19.426214, "o", "p"]
[19.461214, "o", "a"]
[19.496214, "o", "c"]
[19.531214, "o", "t"]
[19.566214, "o", " "]
[19.601214, "o", "|"]
[19.636214, "o", " "]
[19.671214, "o", "g"]
[19.706214, "o", "r"]
[19.741214, "o", "e"]
[19.776214, "o", "p"]
[19.811214, "o", " "]
[19.846214, "o", "-"]
[19.881214, "o", "E"]
[19.916214, "o", " "]
[19.951214, "o", "'"]
[19.986214, "o", "N"]
[20.021214, "o", "A"]
[20.056214, "o", "M"]
[20.091214, "o", "E"]
[20.126214, "o", "|"]
[20.161214, "o", "u"]
[20.196214, "o", "n"]
[20.231214, "o", "a"]
[20.266214, "o", "t"]
[20.301214, "o", "t"]
[20.336214, "o", "e"]
[20.371214, "o", "n"]
[20.406214, "o", "d"]
[20.441214, "o", "e"]
[20.476214, "o", "d"]
[20.511214, "o", "'"]
[20.546214, "o", "\r\n"]
[20.665429, "o", " NAME DESCRIPTION USED BY \r\n"]
[20.666336, "o", " unattended-upgrades Profil pour activer les unattended upgrades sur Ubuntu 0 \r\n"]
[20.673726, "o", "\u001b[1;34mlxd\u001b[0m > "]
[25.708726, "o", "\r\n"]
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

+35
View File
@@ -0,0 +1,35 @@
# Demo: plain lxc, without mise (the YAML files are regular LXD profiles)
# (prerequisites: LXD, profile unattended-upgrades not installed; removed at the end)
settings:
width: 156
height: 22
type_speed: 35ms
prompt: "\e[1;34mlxd\e[0m > "
timeout: 120s
# bash without rc files: the real prompt (PS1) is used to detect the end of commands
shell:
program: bash
args: [--norc, --noprofile]
prompt: AUTOCAST_PROMPT
line_split: " \\"
quit_command: exit
environment:
- {name: PS1, value: AUTOCAST_PROMPT}
- {name: PROMPT_COMMAND, value: "bind 'set enable-bracketed-paste off'"}
instructions:
- !Command {command: "source demo/setup.sh", hidden: true}
- !Marker Create
- !Command {command: "# No mise needed: the YAML files are regular LXD profiles"}
- !Command {command: "lxc profile create unattended-upgrades"}
- !Command {command: "lxc profile edit unattended-upgrades < profiles/system/unattended-upgrades.profile.yaml"}
- !Wait 2s
- !Command {command: "lxc profile show unattended-upgrades | head -12"}
- !Wait 4s
- !Clear
- !Marker Use
- !Command {command: "# Then use it when launching an instance"}
- !Command {command: "# lxc launch ubuntu:24.04 web -p default -p unattended-upgrades"}
- !Command {command: "lxc profile list -f compact | grep -E 'NAME|unattended'"}
- !Wait 5s
- !Command {command: "demo_cleanup", hidden: true}
+19
View File
@@ -0,0 +1,19 @@
# shellcheck shell=bash
# Hidden preamble of the demos (autocast), sourced from the repository root:
# mise activated, delta as git pager, demo profile absent from LXD.
eval "$(mise activate bash)"
export GIT_PAGER="delta --paging=never"
DEMO_PROFILE=unattended-upgrades
DEMO_FILE=profiles/system/unattended-upgrades.profile.yaml
if lxc profile show "$DEMO_PROFILE" >/dev/null 2>&1; then
echo "Profile $DEMO_PROFILE is already installed in LXD: the demo would modify it" >&2
exit 1
fi
# Demo epilogue: restore the repository file as it was before the demo
# (uncommitted changes included) and remove the demo profile
DEMO_BACKUP=$(mktemp)
cp "$DEMO_FILE" "$DEMO_BACKUP"
demo_cleanup() {
cp "$DEMO_BACKUP" "$DEMO_FILE" && rm -f "$DEMO_BACKUP"
lxc profile delete "$DEMO_PROFILE" >/dev/null 2>&1 </dev/null
}
+361
View File
@@ -0,0 +1,361 @@
{"version": 2, "width": 156, "height": 56, "timestamp": 1795272924, "duration": 38.523938, "env": {"PROMPT_COMMAND": "bind 'set enable-bracketed-paste off'", "TERM": "xterm-256color", "SHELL": "/usr/bin/bash", "PS1": "AUTOCAST_PROMPT"}}
[0.000000, "o", "\u001b[1;34mlxd\u001b[0m > "]
[0.000000, "m", "Welcome"]
[0.035000, "o", "#"]
[0.070000, "o", " "]
[0.105000, "o", "E"]
[0.140000, "o", "n"]
[0.175000, "o", "t"]
[0.210000, "o", "e"]
[0.245000, "o", "r"]
[0.280000, "o", "i"]
[0.315000, "o", "n"]
[0.350000, "o", "g"]
[0.385000, "o", " "]
[0.420000, "o", "t"]
[0.455000, "o", "h"]
[0.490000, "o", "e"]
[0.525000, "o", " "]
[0.560000, "o", "r"]
[0.595000, "o", "e"]
[0.630000, "o", "p"]
[0.665000, "o", "o"]
[0.700000, "o", "s"]
[0.735000, "o", "i"]
[0.770000, "o", "t"]
[0.805000, "o", "o"]
[0.840000, "o", "r"]
[0.875000, "o", "y"]
[0.910000, "o", " "]
[0.945000, "o", "d"]
[0.980000, "o", "i"]
[1.015000, "o", "s"]
[1.050000, "o", "p"]
[1.085000, "o", "l"]
[1.120000, "o", "a"]
[1.155000, "o", "y"]
[1.190000, "o", "s"]
[1.225000, "o", " "]
[1.260000, "o", "a"]
[1.295000, "o", " "]
[1.330000, "o", "s"]
[1.365000, "o", "h"]
[1.400000, "o", "o"]
[1.435000, "o", "r"]
[1.470000, "o", "t"]
[1.505000, "o", " "]
[1.540000, "o", "h"]
[1.575000, "o", "e"]
[1.610000, "o", "l"]
[1.645000, "o", "p"]
[1.680000, "o", " "]
[1.715000, "o", "("]
[1.750000, "o", "m"]
[1.785000, "o", "i"]
[1.820000, "o", "s"]
[1.855000, "o", "e"]
[1.890000, "o", " "]
[1.925000, "o", "e"]
[1.960000, "o", "n"]
[1.995000, "o", "t"]
[2.030000, "o", "e"]
[2.065000, "o", "r"]
[2.100000, "o", " "]
[2.135000, "o", "h"]
[2.170000, "o", "o"]
[2.205000, "o", "o"]
[2.240000, "o", "k"]
[2.275000, "o", ")"]
[2.310000, "o", "\r\n"]
[2.313790, "o", "\u001b[1;34mlxd\u001b[0m > "]
[2.348790, "o", "c"]
[2.383790, "o", "d"]
[2.418790, "o", " "]
[2.453790, "o", "l"]
[2.488790, "o", "x"]
[2.523790, "o", "d"]
[2.558790, "o", "\r\n"]
[2.793241, "o", "\r\n \u001b[36m╭────────────────────────────────────────────────────────╮\u001b[0m\r\n \u001b[36m│\u001b[0m 📦 \u001b[1mlxd-profiles\u001b[0m · profils et réseaux LXD \u001b[36m│\u001b[0m\r\n \u001b[36m╰────────────────────────────────────────────────────────╯\u001b[0m\r\n\r\n 🗂️ \u001b[1mProfils\u001b[0m\r\n ▸ mise run list [--all] \u001b[2mprofils du dépôt et état dans LXD\u001b[0m\r\n ▸ mise run show [profil] [--lxd] \u001b[2mcontenu d'un profil (dépôt ou LXD)\u001b[0m\r\n ▸ mise run diff [profil...] \u001b[2mdiff installé (LXD) → dépôt\u001b[0m\r\n ▸ mise run install [profil...] \u001b[2mcrée / met à jour (diff + confirmation, --all, --yes)\u001b[0m\r\n ▸ mise run import [profil] [f] \u001b[2mexporte un profil LXD vers le dépôt (puis git diff)\u001b[0m\r\n\r\n \u001b[2mprofil = nom (ex. docker) ou fichier (ex. profiles/containerization/docker.profile.yaml)\u001b[0m\r\n 💡 \u001b[2mmise tasks pour lister toutes les tâches\u001b[0m\r\n\r\n"]
[2.843314, "o", "\u001b[1;34mlxd\u001b[0m > "]
[7.878314, "o", "\r\u001b[H\u001b[2J\u001b[3J"]
[7.913314, "o", "\u001b[1;34mlxd\u001b[0m > "]
[7.913314, "m", "List"]
[7.948314, "o", "#"]
[7.983314, "o", " "]
[8.018314, "o", "R"]
[8.053314, "o", "e"]
[8.088314, "o", "p"]
[8.123314, "o", "o"]
[8.158314, "o", "s"]
[8.193314, "o", "i"]
[8.228314, "o", "t"]
[8.263314, "o", "o"]
[8.298314, "o", "r"]
[8.333314, "o", "y"]
[8.368314, "o", " "]
[8.403314, "o", "p"]
[8.438314, "o", "r"]
[8.473314, "o", "o"]
[8.508314, "o", "f"]
[8.543314, "o", "i"]
[8.578314, "o", "l"]
[8.613314, "o", "e"]
[8.648314, "o", "s"]
[8.683314, "o", " "]
[8.718314, "o", "a"]
[8.753314, "o", "n"]
[8.788314, "o", "d"]
[8.823314, "o", " "]
[8.858314, "o", "t"]
[8.893314, "o", "h"]
[8.928314, "o", "e"]
[8.963314, "o", "i"]
[8.998314, "o", "r"]
[9.033314, "o", " "]
[9.068314, "o", "s"]
[9.103314, "o", "t"]
[9.138314, "o", "a"]
[9.173314, "o", "t"]
[9.208314, "o", "e"]
[9.243314, "o", " "]
[9.278314, "o", "i"]
[9.313314, "o", "n"]
[9.348314, "o", " "]
[9.383314, "o", "L"]
[9.418314, "o", "X"]
[9.453314, "o", "D"]
[9.488314, "o", "\r\n"]
[9.492068, "o", "\u001b[1;34mlxd\u001b[0m > "]
[9.527068, "o", "m"]
[9.562068, "o", "i"]
[9.597068, "o", "s"]
[9.632068, "o", "e"]
[9.667068, "o", " "]
[9.702068, "o", "r"]
[9.737068, "o", "u"]
[9.772068, "o", "n"]
[9.807068, "o", " "]
[9.842068, "o", "l"]
[9.877068, "o", "i"]
[9.912068, "o", "s"]
[9.947068, "o", "t"]
[9.982068, "o", "\r\n"]
[10.570224, "o", " \u001b[1m PROFIL DESCRIPTION UTILISÉ FICHIER\u001b[0m\r\n"]
[10.690727, "o", " ✅ \u001b[32mapp-backrest \u001b[0m \u001b[2mInstall backrest and its restic (web UI on port 9898)\u001b[0m 1 \u001b[2mprofiles/applications/app-backrest.profile.yaml\u001b[0m\r\n"]
[10.807666, "o", " ✅ \u001b[32mapp-gitea \u001b[0m \u001b[2mInstall gitea\u001b[0m 1 \u001b[2mprofiles/applications/app-gitea.profile.yaml\u001b[0m\r\n"]
[10.815662, "o", " ⬜ \u001b[2mapp-mariadb \u001b[0m \u001b[2mInstall mariadb\u001b[0m - \u001b[2mprofiles/applications/app-mariadb.profile.yaml\u001b[0m\r\n"]
[10.941512, "o", " ✅ \u001b[32mapp-nextcloud \u001b[0m \u001b[2mInstall Nextcloud\u001b[0m 1 \u001b[2mprofiles/applications/app-nextcloud.profile.yaml\u001b[0m\r\n"]
[10.948740, "o", " ⬜ \u001b[2mapp-ollama \u001b[0m \u001b[2mLXD Profile to launch a private ollama instance\u001b[0m - \u001b[2mprofiles/applications/app-ollama.profile.yaml\u001b[0m\r\n"]
[10.955610, "o", " ⬜ \u001b[2mapp-pydio \u001b[0m \u001b[2mInstall pydio cells\u001b[0m - \u001b[2mprofiles/applications/app-pydio.profile.yaml\u001b[0m\r\n"]
[10.963121, "o", " ⬜ \u001b[2mapp-streamrip \u001b[0m \u001b[2mInstall streamrip (https://github.com/nathom/streamrip)\u001b[0m - \u001b[2mprofiles/applications/app-streamrip.profile.yaml\u001b[0m\r\n"]
[10.969672, "o", " ⬜ \u001b[2mcoolify \u001b[0m \u001b[2mA profile that deploy Coolify in an LXD container\u001b[0m - \u001b[2mprofiles/containerization/coolify.profile.yaml\u001b[0m\r\n"]
[11.083539, "o", " ✅ \u001b[32mdocker \u001b[0m \u001b[2mA profile that deploy docker in an LXD container\u001b[0m 1 \u001b[2mprofiles/containerization/docker.profile.yaml\u001b[0m\r\n"]
[11.090413, "o", " ⬜ \u001b[2mdocker-unprivileged \u001b[0m \u001b[2mA profile that deploy docker in an unprivileged LXD co…\u001b[0m - \u001b[2mprofiles/containerization/docker-unprivileged.profile.yaml\u001b[0m\r\n"]
[11.220435, "o", " ✅ \u001b[32mdocker-volume-data \u001b[0m \u001b[2mA profile that add a volume for docker data\u001b[0m 1 \u001b[2mprofiles/containerization/docker-volume-data.profile.yaml\u001b[0m\r\n"]
[11.338150, "o", " ✅ \u001b[32mdocker-volume-manifests \u001b[0m \u001b[2mA profile that mount a manifests directory from the ho…\u001b[0m 1 \u001b[2mprofiles/containerization/docker-volume-manifests.profile.yaml\u001b[0m\r\n"]
[11.454809, "o", " ✅ \u001b[32mdokploy \u001b[0m \u001b[2mA profile that deploy Dokploy in an LXD container\u001b[0m 1 \u001b[2mprofiles/containerization/dokploy.profile.yaml\u001b[0m\r\n"]
[11.462070, "o", " ⬜ \u001b[2mfrontback \u001b[0m \u001b[2mProfile that provide a network interface attached to t…\u001b[0m - \u001b[2mprofiles/networking/frontback.profile.yaml\u001b[0m\r\n"]
[11.468830, "o", " ⬜ \u001b[2mlxd-host-socket \u001b[0m \u001b[2mPermet à un container d'accéder au démon LXD de l'hôte…\u001b[0m - \u001b[2mprofiles/containerization/lxd-host-socket.profile.yaml\u001b[0m\r\n"]
[11.584975, "o", " ✅ \u001b[32mmicrok8s \u001b[0m \u001b[2mA profile that deploy microk8s in an LXD container\u001b[0m 1 \u001b[2mprofiles/containerization/microk8s.profile.yaml\u001b[0m\r\n"]
[11.712929, "o", " ✅ \u001b[32mmicrok8s-config \u001b[0m \u001b[2mA profile that add cloud-init user data to bootstrap m…\u001b[0m 1 \u001b[2mprofiles/containerization/microk8s-config.profile.yaml\u001b[0m\r\n"]
[11.825955, "o", " ✅ \u001b[32mnet-back \u001b[0m \u001b[2mProfile that provide a network interface attached to t…\u001b[0m 1 \u001b[2mprofiles/networking/net-back.profile.yaml\u001b[0m\r\n"]
[11.941493, "o", " ✅ \u001b[32mnet-front \u001b[0m \u001b[2mProfile that provide a network interface attached to t…\u001b[0m 7 \u001b[2mprofiles/networking/net-front.profile.yaml\u001b[0m\r\n"]
[11.950072, "o", " ⬜ \u001b[2mnet-home \u001b[0m \u001b[2mProfile that provide a network interface attached to t…\u001b[0m - \u001b[2mprofiles/networking/net-home.profile.yaml\u001b[0m\r\n"]
[12.069224, "o", " ✅ \u001b[32mnet-public \u001b[0m \u001b[2mProfile that provide a network interface attached to t…\u001b[0m 0 \u001b[2mprofiles/networking/net-public.profile.yaml\u001b[0m\r\n"]
[12.227539, "o", " ✅ \u001b[32mpostgresql \u001b[0m \u001b[2mInstall postgresql\u001b[0m 1 \u001b[2mprofiles/applications/postgresql.profile.yaml\u001b[0m\r\n"]
[12.340897, "o", " 📝 \u001b[33mpostgresql-snap \u001b[0m \u001b[2mInstall postgresql (snap)\u001b[0m 0 \u001b[2mprofiles/applications/postgresql-snap.profile.yaml\u001b[0m\r\n"]
[12.457314, "o", " ✅ \u001b[32mproxy-docker \u001b[0m \u001b[2mExpose private docker sock via tcp on the host\u001b[0m 0 \u001b[2mprofiles/proxy/proxy-docker.profile.yaml\u001b[0m\r\n"]
[12.464038, "o", " ⬜ \u001b[2mproxy-docker-unix \u001b[0m \u001b[2mExpose the Docker socket as a Unix socket\u001b[0m - \u001b[2mprofiles/proxy/proxy-docker-unix.profile.yaml\u001b[0m\r\n"]
[12.579675, "o", " 📝 \u001b[33mproxy-http \u001b[0m \u001b[2mProxify http traffic to the instance\u001b[0m 1 \u001b[2mprofiles/proxy/proxy-http.profile.yaml\u001b[0m\r\n"]
[12.698534, "o", " 📝 \u001b[33mproxy-https \u001b[0m \u001b[2mProxify https traffic to the instance\u001b[0m 1 \u001b[2mprofiles/proxy/proxy-https.profile.yaml\u001b[0m\r\n"]
[12.833841, "o", " ✅ \u001b[32mproxy-stun-turn \u001b[0m \u001b[2mProxify STUN /TURN\u001b[0m 1 \u001b[2mprofiles/proxy/proxy-stun-turn.profile.yaml\u001b[0m\r\n"]
[12.951245, "o", " ✅ \u001b[32mproxy-taskwarrior \u001b[0m \u001b[2mProxify taskwarrior server tcp traffic to the instance\u001b[0m 1 \u001b[2mprofiles/proxy/proxy-taskwarrior.profile.yaml\u001b[0m\r\n"]
[12.958812, "o", " ⬜ \u001b[2mpublic-gateway \u001b[0m \u001b[2mNetwork configuration for public gateway (attached to …\u001b[0m - \u001b[2mprofiles/networking/public-gateway.profile.yaml\u001b[0m\r\n"]
[13.077776, "o", " ✅ \u001b[32msize-large \u001b[0m \u001b[2mLarge sized instance limits (4 CPU, 8GB RAM)\u001b[0m 2 \u001b[2mprofiles/limits/size-large.profile.yaml\u001b[0m\r\n"]
[13.202077, "o", " ✅ \u001b[32msize-medium \u001b[0m \u001b[2mMedium sized instance limits (2 CPU, 4GB RAM)\u001b[0m 2 \u001b[2mprofiles/limits/size-medium.profile.yaml\u001b[0m\r\n"]
[13.325238, "o", " ✅ \u001b[32msize-small \u001b[0m \u001b[2mSmall sized instance limits (1 CPU, 2GB RAM)\u001b[0m 3 \u001b[2mprofiles/limits/size-small.profile.yaml\u001b[0m\r\n"]
[13.467740, "o", " ✅ \u001b[32msnapshots-daily \u001b[0m \u001b[2mTake an automatic snapshot daily and keep it for 2 wee…\u001b[0m 4 \u001b[2mprofiles/snapshots/snapshots-daily.profile.yaml\u001b[0m\r\n"]
[13.620051, "o", " ✅ \u001b[32msnapshots-weekly \u001b[0m \u001b[2mTake an automatic snapshot weekly and keep it for 1 mo…\u001b[0m 0 \u001b[2mprofiles/snapshots/snapshots-weekly.profile.yaml\u001b[0m\r\n"]
[13.740307, "o", " ✅ \u001b[32mstorage-btrfs \u001b[0m \u001b[2mroot device on btrfs pool\u001b[0m 1 \u001b[2mprofiles/storage/storage-btrfs.profile.yaml\u001b[0m\r\n"]
[13.856794, "o", " ✅ \u001b[32mstorage-zfs \u001b[0m \u001b[2mroot device on zfs pool\u001b[0m 9 \u001b[2mprofiles/storage/storage-zfs.profile.yaml\u001b[0m\r\n"]
[13.973987, "o", " ✅ \u001b[32mtraefik \u001b[0m \u001b[2mInstall traefik\u001b[0m 1 \u001b[2mprofiles/applications/traefik.profile.yaml\u001b[0m\r\n"]
[14.090277, "o", " ✅ \u001b[32mtraefik-volume-config \u001b[0m \u001b[2mVolume to mount traefik config dir from host\u001b[0m 1 \u001b[2mprofiles/applications/traefik-volume-config.profile.yaml\u001b[0m\r\n"]
[14.097386, "o", " ⬜ \u001b[2munattended-upgrades \u001b[0m \u001b[2mProfil pour activer les unattended upgrades sur Ubuntu\u001b[0m - \u001b[2mprofiles/system/unattended-upgrades.profile.yaml\u001b[0m\r\n"]
[14.104536, "o", " ⬜ \u001b[2muser-xavier \u001b[0m \u001b[2mPersonnal environment for Xavier\u001b[0m - \u001b[2mprofiles/users/xavier.profile.yaml\u001b[0m\r\n"]
[14.235154, "o", " ✅ \u001b[32mvolume-gitea-data \u001b[0m \u001b[2mVolume des données Gitea (snapshots quotidiens portés …\u001b[0m 1 \u001b[2mprofiles/volumes/volume-gitea-data.profile.yaml\u001b[0m\r\n"]
[14.361021, "o", " ✅ \u001b[32mvolume-gitea-data-ro \u001b[0m \u001b[2mVolume des données Gitea en lecture seule (instance de…\u001b[0m 1 \u001b[2mprofiles/volumes/volume-gitea-data-ro.profile.yaml\u001b[0m\r\n"]
[14.479082, "o", " ✅ \u001b[32mvolume-letsencrypt \u001b[0m \u001b[2mVolume contenant les certificats letsencrypt du host\u001b[0m 3 \u001b[2mprofiles/volumes/volume-letsencrypt.profile.yaml\u001b[0m\r\n"]
[14.604249, "o", " ✅ \u001b[32mvolume-nextcloud-data \u001b[0m \u001b[2mVolume des données Nextcloud (snapshots quotidiens por…\u001b[0m 1 \u001b[2mprofiles/volumes/volume-nextcloud-data.profile.yaml\u001b[0m\r\n"]
[14.724219, "o", " ✅ \u001b[32mvolume-nextcloud-data-ro\u001b[0m \u001b[2mVolume des données Nextcloud en lecture seule (instanc…\u001b[0m 1 \u001b[2mprofiles/volumes/volume-nextcloud-data-ro.profile.yaml\u001b[0m\r\n"]
[14.724650, "o", "\r\n"]
[14.724673, "o", " \u001b[1mLégende :\u001b[0m\r\n"]
[14.724693, "o", " • ✅ à jour (30)\r\n"]
[14.724725, "o", " • 📝 installé, différent du dépôt (3) \u001b[2m→ mise run diff\u001b[0m\r\n"]
[14.724752, "o", " • ⬜ non installé (13)\r\n"]
[14.724775, "o", " • 🔹 installé, absent du dépôt (3) \u001b[2m(--all)\u001b[0m\r\n"]
[14.750162, "o", "\u001b[1;34mlxd\u001b[0m > "]
[20.785162, "o", "\r\u001b[H\u001b[2J\u001b[3J"]
[20.820162, "o", "\u001b[1;34mlxd\u001b[0m > "]
[20.820162, "m", "Show"]
[20.855162, "o", "#"]
[20.890162, "o", " "]
[20.925162, "o", "C"]
[20.960162, "o", "o"]
[20.995162, "o", "n"]
[21.030162, "o", "t"]
[21.065162, "o", "e"]
[21.100162, "o", "n"]
[21.135162, "o", "t"]
[21.170162, "o", " "]
[21.205162, "o", "o"]
[21.240162, "o", "f"]
[21.275162, "o", " "]
[21.310162, "o", "a"]
[21.345162, "o", " "]
[21.380162, "o", "r"]
[21.415162, "o", "e"]
[21.450162, "o", "p"]
[21.485162, "o", "o"]
[21.520162, "o", "s"]
[21.555162, "o", "i"]
[21.590162, "o", "t"]
[21.625162, "o", "o"]
[21.660162, "o", "r"]
[21.695162, "o", "y"]
[21.730162, "o", " "]
[21.765162, "o", "p"]
[21.800162, "o", "r"]
[21.835162, "o", "o"]
[21.870162, "o", "f"]
[21.905162, "o", "i"]
[21.940162, "o", "l"]
[21.975162, "o", "e"]
[22.010162, "o", "\r\n"]
[22.013834, "o", "\u001b[1;34mlxd\u001b[0m > "]
[22.048834, "o", "m"]
[22.083834, "o", "i"]
[22.118834, "o", "s"]
[22.153834, "o", "e"]
[22.188834, "o", " "]
[22.223834, "o", "r"]
[22.258834, "o", "u"]
[22.293834, "o", "n"]
[22.328834, "o", " "]
[22.363834, "o", "s"]
[22.398834, "o", "h"]
[22.433834, "o", "o"]
[22.468834, "o", "w"]
[22.503834, "o", " "]
[22.538834, "o", "s"]
[22.573834, "o", "i"]
[22.608834, "o", "z"]
[22.643834, "o", "e"]
[22.678834, "o", "-"]
[22.713834, "o", "s"]
[22.748834, "o", "m"]
[22.783834, "o", "a"]
[22.818834, "o", "l"]
[22.853834, "o", "l"]
[22.888834, "o", "\r\n"]
[23.345439, "o", "\u001b]10;?\u0007\u001b]11;?\u0007\u001b[c"]
[24.352194, "o", "\u001b[38;2;131;148;150m─────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\r\n \u001b[38;2;131;148;150m│ \u001b[0mFile: \u001b[1mprofiles/limits/size-small.profile.yaml\u001b[0m\r\n\u001b[38;2;131;148;150m─────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\r\n"]
[24.353240, "o", "\u001b[38;2;131;148;150m 1\u001b[0m \u001b[38;2;131;148;150m│\u001b[0m \u001b[38;2;249;38;114mname\u001b[0m\u001b[38;2;248;248;242m:\u001b[0m\u001b[38;2;248;248;242m \u001b[0m\u001b[38;2;230;219;116msize-small\u001b[0m\r\n"]
[24.353391, "o", "\u001b[38;2;131;148;150m 2\u001b[0m \u001b[38;2;131;148;150m│\u001b[0m \u001b[38;2;249;38;114mdescription\u001b[0m\u001b[38;2;248;248;242m:\u001b[0m\u001b[38;2;248;248;242m \u001b[0m\u001b[38;2;230;219;116mSmall sized instance limits (1 CPU, 2GB RAM)\u001b[0m\r\n"]
[24.353422, "o", "\u001b[38;2;131;148;150m 3\u001b[0m \u001b[38;2;131;148;150m│\u001b[0m \u001b[38;2;249;38;114mconfig\u001b[0m\u001b[38;2;248;248;242m:\u001b[0m\r\n"]
[24.353600, "o", "\u001b[38;2;131;148;150m 4\u001b[0m \u001b[38;2;131;148;150m│\u001b[0m \u001b[38;2;248;248;242m \u001b[0m\u001b[38;2;249;38;114mlimits.cpu\u001b[0m\u001b[38;2;248;248;242m:\u001b[0m\u001b[38;2;248;248;242m \u001b[0m\u001b[38;2;230;219;116m\"\u001b[0m\u001b[38;2;230;219;116m1\u001b[0m\u001b[38;2;230;219;116m\"\u001b[0m\r\n"]
[24.353715, "o", "\u001b[38;2;131;148;150m 5\u001b[0m \u001b[38;2;131;148;150m│\u001b[0m \u001b[38;2;248;248;242m \u001b[0m\u001b[38;2;249;38;114mlimits.memory\u001b[0m\u001b[38;2;248;248;242m:\u001b[0m\u001b[38;2;248;248;242m \u001b[0m\u001b[38;2;230;219;116m2GB\u001b[0m\r\n\u001b[38;2;131;148;150m─────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\r\n"]
[24.817642, "o", "\u001b[1;34mlxd\u001b[0m > "]
[28.852642, "o", "\r\u001b[H\u001b[2J\u001b[3J"]
[28.887642, "o", "\u001b[1;34mlxd\u001b[0m > "]
[28.887642, "m", "Diff"]
[28.922642, "o", "#"]
[28.957642, "o", " "]
[28.992642, "o", "W"]
[29.027642, "o", "h"]
[29.062642, "o", "a"]
[29.097642, "o", "t"]
[29.132642, "o", " "]
[29.167642, "o", "d"]
[29.202642, "o", "i"]
[29.237642, "o", "f"]
[29.272642, "o", "f"]
[29.307642, "o", "e"]
[29.342642, "o", "r"]
[29.377642, "o", "s"]
[29.412642, "o", " "]
[29.447642, "o", "b"]
[29.482642, "o", "e"]
[29.517642, "o", "t"]
[29.552642, "o", "w"]
[29.587642, "o", "e"]
[29.622642, "o", "e"]
[29.657642, "o", "n"]
[29.692642, "o", " "]
[29.727642, "o", "L"]
[29.762642, "o", "X"]
[29.797642, "o", "D"]
[29.832642, "o", " "]
[29.867642, "o", "("]
[29.902642, "o", "i"]
[29.937642, "o", "n"]
[29.972642, "o", "s"]
[30.007642, "o", "t"]
[30.042642, "o", "a"]
[30.077642, "o", "l"]
[30.112642, "o", "l"]
[30.147642, "o", "e"]
[30.182642, "o", "d"]
[30.217642, "o", ")"]
[30.252642, "o", " "]
[30.287642, "o", "a"]
[30.322642, "o", "n"]
[30.357642, "o", "d"]
[30.392642, "o", " "]
[30.427642, "o", "t"]
[30.462642, "o", "h"]
[30.497642, "o", "e"]
[30.532642, "o", " "]
[30.567642, "o", "r"]
[30.602642, "o", "e"]
[30.637642, "o", "p"]
[30.672642, "o", "o"]
[30.707642, "o", "s"]
[30.742642, "o", "i"]
[30.777642, "o", "t"]
[30.812642, "o", "o"]
[30.847642, "o", "r"]
[30.882642, "o", "y"]
[30.917642, "o", "\r\n"]
[30.921619, "o", "\u001b[1;34mlxd\u001b[0m > "]
[30.956619, "o", "m"]
[30.991619, "o", "i"]
[31.026619, "o", "s"]
[31.061619, "o", "e"]
[31.096619, "o", " "]
[31.131619, "o", "r"]
[31.166619, "o", "u"]
[31.201619, "o", "n"]
[31.236619, "o", " "]
[31.271619, "o", "d"]
[31.306619, "o", "i"]
[31.341619, "o", "f"]
[31.376619, "o", "f"]
[31.411619, "o", " "]
[31.446619, "o", "p"]
[31.481619, "o", "r"]
[31.516619, "o", "o"]
[31.551619, "o", "x"]
[31.586619, "o", "y"]
[31.621619, "o", "-"]
[31.656619, "o", "h"]
[31.691619, "o", "t"]
[31.726619, "o", "t"]
[31.761619, "o", "p"]
[31.796619, "o", "\r\n"]
[32.478848, "o", "\r\n\u001b[34mΔ lxd:proxy-http (installé) ⟶ profiles/proxy/proxy-http.profile.yaml (dépôt)\u001b[0m\r\n\u001b[34m────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\r\n"]
[32.479166, "o", "\r\n\u001b[34m─────\u001b[0m\u001b[34m┐\u001b[0m\r\n\u001b[34m•\u001b[0m \u001b[34m4\u001b[0m: \u001b[34m│\u001b[0m\r\n\u001b[34m─────\u001b[0m\u001b[34m┘\u001b[0m\r\n"]
[32.479232, "o", "\u001b[34m│\u001b[38;2;68;68;68m 4 \u001b[34m│\u001b[38;2;227;234;242m hostport80:\u001b[0m \u001b[34m│\u001b[38;2;68;68;68m 4 \u001b[34m│\u001b[38;2;227;234;242m hostport80:\u001b[0m\r\n"]
[32.479268, "o", "\u001b[34m│\u001b[38;2;68;68;68m 5 \u001b[34m│\u001b[38;2;227;234;242m connect: tcp:127.0.0.1:80\u001b[0m \u001b[34m│\u001b[38;2;68;68;68m 5 \u001b[34m│\u001b[38;2;227;234;242m connect: tcp:127.0.0.1:80\u001b[0m\r\n\u001b[34m│\u001b[38;2;68;68;68m 6 \u001b[34m│\u001b[38;2;227;234;242m listen: tcp:0.0.0.0:80\u001b[0m \u001b[34m│\u001b[38;2;68;68;68m 6 \u001b[34m│\u001b[38;2;227;234;242m listen: tcp:0.0.0.0:80\u001b[0m\r\n"]
[32.479331, "o", "\u001b[34m│\u001b[38;5;88m 7 \u001b[34m│\u001b[48;2;63;0;1;38;2;227;234;242m proxy_protocol: \"true\"\u001b[0m\u001b[48;2;63;0;1m \u001b[0m\u001b[34m│\u001b[38;2;68;68;68m \u001b[34m│\u001b[0m\r\n\u001b[34m│\u001b[38;2;68;68;68m 8 \u001b[34m│\u001b[38;2;227;234;242m type: proxy\u001b[0m \u001b[34m│\u001b[38;2;68;68;68m 7 \u001b[34m│\u001b[38;2;227;234;242m type: proxy\u001b[0m\r\n\u001b[34m│\u001b[38;2;68;68;68m 9 \u001b[34m│\u001b[38;2;227;234;242mname: proxy-http\u001b[0m \u001b[34m│\u001b[38;2;68;68;68m 8 \u001b[34m│\u001b[38;2;227;234;242mname: proxy-http\u001b[0m\r\n"]
[32.488938, "o", "\u001b[1;34mlxd\u001b[0m > "]
[38.523938, "o", "\r\n"]
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 562 KiB

+40
View File
@@ -0,0 +1,40 @@
# Demo: welcome message, profile list, profile content and diff (read only)
settings:
width: 156
height: 56
type_speed: 35ms
prompt: "\e[1;34mlxd\e[0m > "
timeout: 120s
# bash without rc files: the real prompt (PS1) is used to detect the end of commands
shell:
program: bash
args: [--norc, --noprofile]
prompt: AUTOCAST_PROMPT
line_split: " \\"
quit_command: exit
environment:
- {name: PS1, value: AUTOCAST_PROMPT}
- {name: PROMPT_COMMAND, value: "bind 'set enable-bracketed-paste off'"}
instructions:
# From the parent directory, to trigger the mise enter hook
- !Command {command: "source demo/setup.sh && cd ..", hidden: true}
- !Marker Welcome
- !Command {command: "# Entering the repository displays a short help (mise enter hook)"}
- !Command {command: "cd lxd"}
- !Wait 5s
- !Clear
- !Marker List
- !Command {command: "# Repository profiles and their state in LXD"}
- !Command {command: "mise run list"}
- !Wait 6s
- !Clear
- !Marker Show
- !Command {command: "# Content of a repository profile"}
- !Command {command: "mise run show size-small"}
- !Wait 4s
- !Clear
- !Marker Diff
- !Command {command: "# What differs between LXD (installed) and the repository"}
- !Command {command: "mise run diff proxy-http"}
- !Wait 6s
+2 -2
View File
@@ -6,13 +6,13 @@ Install the docker profile :
```bash
lxc profile create docker
curl https://gitea.cloud.logerais.com/cloud.logerais.com/lxd-profiles/raw/branch/main/profiles/containerization/docker.profile.yaml | lxc profile edit docker
curl https://gitea.cloud.logerais.com/xavier/lxd-profiles/raw/branch/main/profiles/containerization/docker.profile.yaml | lxc profile edit docker
```
Or use the local profile:
```bash
./install.bash profiles/containerization/docker.profile.yaml
mise run install profiles/containerization/docker.profile.yaml
```
## Launch Container
+2 -2
View File
@@ -6,13 +6,13 @@ Install the lxd-host-socket profile :
```bash
lxc profile create lxd-host-socket
curl https://gitea.cloud.logerais.com/cloud.logerais.com/lxd-profiles/raw/branch/main/profiles/containerization/lxd-host-socket.profile.yaml | lxc profile edit lxd-host-socket
curl https://gitea.cloud.logerais.com/xavier/lxd-profiles/raw/branch/main/profiles/containerization/lxd-host-socket.profile.yaml | lxc profile edit lxd-host-socket
```
Or use the local profile:
```bash
./install.bash profiles/containerization/lxd-host-socket.profile.yaml
mise run install profiles/containerization/lxd-host-socket.profile.yaml
```
## Launch Container
+2 -2
View File
@@ -6,13 +6,13 @@ Install the microk8s profile :
```bash
lxc profile create microk8s
curl https://gitea.cloud.logerais.com/cloud.logerais.com/lxd-profiles/raw/branch/main/profiles/containerization/microk8s.profile.yaml | lxc profile edit microk8s
curl https://gitea.cloud.logerais.com/xavier/lxd-profiles/raw/branch/main/profiles/containerization/microk8s.profile.yaml | lxc profile edit microk8s
```
Or use the local profile:
```bash
./install.bash profiles/containerization/microk8s.profile.yaml
mise run install profiles/containerization/microk8s.profile.yaml
```
## Launch Container
+3 -3
View File
@@ -6,13 +6,13 @@ Install the traefik profile :
```bash
lxc profile create traefik
curl https://gitea.cloud.logerais.com/cloud.logerais.com/lxd-profiles/raw/branch/main/profiles/applications/traefik.profile.yaml | lxc profile edit traefik
curl https://gitea.cloud.logerais.com/xavier/lxd-profiles/raw/branch/main/profiles/applications/traefik.profile.yaml | lxc profile edit traefik
```
Or use the local profile:
```bash
./install.bash profiles/applications/traefik.profile.yaml
mise run install profiles/applications/traefik.profile.yaml
```
## Launch Container
@@ -24,7 +24,7 @@ Create the container with required profiles:
lxc init ubuntu:lts -p default -p traefik traefik-container
# Or with additional profiles for production use:
# lxc init ubuntu:lts -p default -p zfs -p net-front -p traefik -p traefik-volume-config traefik-container
# lxc init ubuntu:lts -p default -p storage-zfs -p net-front -p traefik -p traefik-volume-config traefik-container
```
### Fix IP Address (Optional)
+1 -1
View File
@@ -5,7 +5,7 @@ CONTAINER_NAME="${1:-docker-container}"
echo "Creating Docker container: $CONTAINER_NAME"
# Install the profile using the helper script
./install.bash profiles/containerization/docker.profile.yaml
mise run install profiles/containerization/docker.profile.yaml
# Launch the container
lxc launch ubuntu:lts -p default -p docker "$CONTAINER_NAME"
+1 -1
View File
@@ -5,7 +5,7 @@ CONTAINER_NAME="${1:-lxd-manager}"
echo "Creating LXD manager container: $CONTAINER_NAME"
# Install the profile using the helper script
./install.bash profiles/containerization/lxd-host-socket.profile.yaml
mise run install profiles/containerization/lxd-host-socket.profile.yaml
# Launch the container
lxc launch ubuntu:lts -p default -p lxd-host-socket "$CONTAINER_NAME"
+1 -1
View File
@@ -5,7 +5,7 @@ CONTAINER_NAME="${1:-microk8s-container}"
echo "Creating microk8s container: $CONTAINER_NAME"
# Install the profile using the helper script
./install.bash profiles/containerization/microk8s.profile.yaml
mise run install profiles/containerization/microk8s.profile.yaml
# Launch the container
lxc launch ubuntu:lts -p default -p microk8s "$CONTAINER_NAME"
+1 -1
View File
@@ -5,7 +5,7 @@ CONTAINER_NAME="${1:-traefik-container}"
echo "Creating Traefik container: $CONTAINER_NAME"
# Install the profile using the helper script
./install.bash profiles/applications/traefik.profile.yaml
mise run install profiles/applications/traefik.profile.yaml
# Launch the container
lxc launch ubuntu:lts -p default -p traefik "$CONTAINER_NAME"
-57
View File
@@ -1,57 +0,0 @@
#!/bin/bash
BASEDIR=$(cd "$(dirname "$0")" && pwd)
echo "BASEDIR=$BASEDIR"
check_prerequisites() {
# Prerequisite check for yq
if ! command -v yq &> /dev/null
then
echo "Error: yq is not installed."
echo "Please install yq to use this script. Refer to https://github.com/mikefarah/yq#install for installation methods."
exit 1
fi
}
update_profile() {
local profile_file="$1"
local profile_name
profile_name=$(yq --expression '.name' "$profile_file")
if [ -z "$profile_name" ]; then
echo "Error: Could not extract profile name from $profile_file. Skipping."
return 1
fi
echo "--- Profile ${profile_name} (from ${profile_file}) ---"
if lxc profile show "${profile_name}" &> /dev/null; then
echo "Profile ${profile_name} already exists. Skipping creation."
else
echo "Profile ${profile_name} does not exist. Creating..."
lxc profile create "${profile_name}"
fi
echo "Updating profile..."
lxc profile edit "${profile_name}" < "${profile_file}"
}
cd "$BASEDIR" || exit
check_prerequisites
if [ "$#" -eq 0 ]; then
# No arguments, update all profiles
echo "No profile specified, updating all profiles..."
find profiles -type f -name "*.profile.yaml" -print0 | while IFS= read -r -d '' file; do
update_profile "$file"
done
else
# Arguments provided, treat them as file paths
for file_path in "$@"; do
if [ -f "$file_path" ]; then
update_profile "$file_path"
else
echo "Error: Profile file '$file_path' not found. Skipping."
fi
done
fi
+28
View File
@@ -0,0 +1,28 @@
# Environnement de production des démos (MISE_ENV=demo), en plus de mise.toml :
# ces outils ne sont installés que pour lui.
# MISE_ENV=demo mise run demo <scénario>
[tools]
"github:k9withabone/autocast" = "latest"
"github:asciinema/agg" = "latest"
# Polices pour agg (--font-dir) : rien n'est installé sur le système
"github:ryanoasis/nerd-fonts" = { version = "latest", asset_pattern = "Inconsolata.tar.xz", no_app = true }
"http:noto-color-emoji" = { version = "2026-09-24", url = "https://github.com/googlefonts/noto-emoji/raw/v2026-09-24-unicode18_0/2D/fonts/NotoColorEmoji.ttf" }
[tasks.demo]
description = "Enregistre une démo (demo/<nom>.cast avec autocast, retouché par demo/castfix.py, puis demo/<nom>.gif avec agg)"
usage = '''
arg "<name>" help="Scénario (demo/<name>.yaml)" {
choices "tour" "install" "lxc" "docker/install" "docker/usage" "backrest/install" "backrest/restore"
}
'''
run = '''
autocast --overwrite "demo/${usage_name}.yaml" "demo/${usage_name}.cast"
python3 -I demo/castfix.py "demo/${usage_name}.cast"
agg --quiet --theme monokai \
--font-dir "$(mise where github:ryanoasis/nerd-fonts)" \
--font-dir "$(mise where http:noto-color-emoji)" \
--text-font-family "Inconsolata Nerd Font Mono" \
--emoji-font-family "Noto Color Emoji" \
"demo/${usage_name}.cast" "demo/${usage_name}.gif"
'''
+37
View File
@@ -0,0 +1,37 @@
[settings]
# Nécessaire pour les hooks (enter)
experimental = true
[hooks]
enter = "mise run --quiet welcome"
# Les autres tâches (list, diff, install, import) sont dans .mise/tasks/
[tasks.welcome]
description = "Affiche un message d'usage basique"
quiet = true
run = '''
b=$(printf '\033[1m'); d=$(printf '\033[2m'); c=$(printf '\033[36m'); r=$(printf '\033[0m')
cat <<MSG
${c}╭────────────────────────────────────────────────────────╮${r}
${c}│${r} 📦 ${b}lxd-profiles${r} · profils et réseaux LXD ${c}│${r}
${c}╰────────────────────────────────────────────────────────╯${r}
🗂️ ${b}Profils${r}
▸ mise run list [--all] ${d}profils du dépôt et état dans LXD${r}
▸ mise run show [profil] [--lxd] ${d}contenu d'un profil (dépôt ou LXD)${r}
▸ mise run diff [profil...] ${d}diff installé (LXD) → dépôt${r}
▸ mise run install [profil...] ${d}crée / met à jour (diff + confirmation, --all, --yes)${r}
▸ mise run import [profil] [f] ${d}exporte un profil LXD vers le dépôt (puis git diff)${r}
${d}profil = nom (ex. docker) ou fichier (ex. profiles/containerization/docker.profile.yaml)${r}
💡 ${d}mise tasks pour lister toutes les tâches${r}
MSG
'''
[tools]
bat = "latest"
delta = "latest"
gum = "latest"
yq = "latest"
@@ -0,0 +1,40 @@
name: app-backrest
description: Install backrest and its restic (web UI on port 9898)
config:
cloud-init.vendor-data: |
#cloud-config
package_update: true
package_upgrade: true
timezone: Europe/Paris
locale: fr_FR.UTF-8
packages:
- curl
write_files:
- path: /etc/systemd/system/backrest.service
permissions: "0644"
content: |
[Unit]
Description=Backrest (restic web UI)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
# root : lecture de tous les fichiers des volumes montés en lecture seule
User=root
ExecStart=/usr/local/bin/backrest
Environment="BACKREST_PORT=0.0.0.0:9898"
Environment="BACKREST_CONFIG=/etc/backrest/config.json"
Environment="BACKREST_DATA=/var/lib/backrest"
Restart=on-failure
[Install]
WantedBy=multi-user.target
runcmd:
- mkdir -p /etc/backrest /var/lib/backrest
- curl -fsSL https://github.com/garethgeorge/backrest/releases/latest/download/backrest_Linux_x86_64.tar.gz | tar xz -C /usr/local/bin backrest
- systemctl daemon-reload
- systemctl enable --now backrest
# restic en CLI (restauration, tests) : celui que backrest télécharge et
# maintient à la version requise (celui d'Ubuntu est trop ancien pour backrest)
- ln -sf /var/lib/backrest/restic /usr/local/bin/restic
@@ -0,0 +1,60 @@
name: app-gitea
description: Install gitea
config:
cloud-init.vendor-data: |
#cloud-config
timezone: Europe/Paris
locale: fr_FR.UTF-8
# Packages
package_update: true
package_upgrade: true
packages:
- unzip
# users:
# - default
# - name: gitea
# groups: sudo
# shell: /bin/bash
# sudo: ['ALL=(ALL) NOPASSWD:ALL']
write_files:
- path: /usr/local/bin/gitea-db-dump.sh
permissions: '0755'
content: |
#!/bin/sh
set -eu
DIRECTORY=/var/snap/gitea/common/dump
mkdir -p "${DIRECTORY}"
FILE="${DIRECTORY}/gitea-db-$(date +%Y%m%d-%H%M).tar"
/snap/bin/gitea dump --skip-repository --skip-lfs-data --skip-attachment-data --skip-package-data --skip-log --skip-custom-dir --skip-index --type tar --file "${FILE}.tmp"
mv "${FILE}.tmp" "${FILE}"
ls -1t "${DIRECTORY}"/gitea-db-*.tar | tail -n +25 | xargs -r rm -f --
- path: /etc/systemd/system/gitea-db-dump.service
content: |
[Unit]
Description=Dump de la base Gitea
[Service]
Type=oneshot
ExecStart=/usr/local/bin/gitea-db-dump.sh
- path: /etc/systemd/system/gitea-db-dump.timer
content: |
[Unit]
Description=Dump horaire de la base Gitea
[Timer]
OnCalendar=*:50
Persistent=true
[Install]
WantedBy=timers.target
runcmd:
# Install gitea
- [ snap, install, gitea ]
# Enable the DB dump timer once gitea is installed
- systemctl daemon-reload
- systemctl enable --now gitea-db-dump.timer
@@ -1,4 +1,4 @@
name: mariadb
name: app-mariadb
description: Install mariadb
config:
cloud-init.vendor-data: |
@@ -0,0 +1,66 @@
name: app-nextcloud
description: Install Nextcloud
config:
cloud-init.vendor-data: |
#cloud-config
# Regional settings
timezone: Europe/Paris
locale: fr_FR.UTF-8
# Packages
package_update: true
package_upgrade: true
packages: []
# Users
users:
- default
- name: nextcloud
groups: sudo
shell: /bin/bash
sudo: ['ALL=(ALL) NOPASSWD:ALL']
write_files:
# The dump goes through a pipe: the snap's AppArmor profile prevents
# nextcloud.mysqldump from writing to a redirected file (empty dump).
# Plain SQL, not gzipped, so that restic deduplicates between dumps
# (a gzipped dump is uploaded in full each time).
# Every 4 hours, the last 24 hours are kept here.
- path: /usr/local/bin/nextcloud-db-dump.sh
permissions: '0755'
content: |
#!/bin/bash
set -euo pipefail
DIRECTORY=/var/snap/nextcloud/common/dump
mkdir -p "${DIRECTORY}"
FILE="${DIRECTORY}/nextcloud-db-$(date +%Y%m%d-%H%M).sql"
/snap/bin/nextcloud.mysqldump --single-transaction --skip-lock-tables | cat > "${FILE}.tmp"
mv "${FILE}.tmp" "${FILE}"
ls -1t "${DIRECTORY}"/nextcloud-db-*.sql | tail -n +7 | xargs -r rm -f --
- path: /etc/systemd/system/nextcloud-db-dump.service
content: |
[Unit]
Description=Dump de la base Nextcloud
[Service]
Type=oneshot
ExecStart=/usr/local/bin/nextcloud-db-dump.sh
- path: /etc/systemd/system/nextcloud-db-dump.timer
content: |
[Unit]
Description=Dump de la base Nextcloud toutes les 4 heures
[Timer]
OnCalendar=*-*-* 00/4:30
Persistent=true
[Install]
WantedBy=timers.target
runcmd:
# Install Nextcloud
- [ snap, install, nextcloud ]
# Enable the DB dump timer once Nextcloud is installed
- systemctl daemon-reload
- systemctl enable --now nextcloud-db-dump.timer
@@ -1,11 +1,11 @@
---
name: ollama
name: app-ollama
description: LXD Profile to launch a private ollama instance
config:
linux.kernel_modules: overlay
raw.lxc: |-
lxc.apparmor.profile = unconfined
lxc.cgroup.devices.allow = a
lxc.cgroup2.devices.allow = a
lxc.mount.auto=proc:rw sys:rw
lxc.cap.drop =
security.nesting: "true"
@@ -0,0 +1,55 @@
name: app-streamrip
description: Install streamrip (https://github.com/nathom/streamrip)
config:
cloud-init.vendor-data: |
#cloud-config
# Packages
package_update: true
package_upgrade: true
packages:
- curl
- python3-venv
- build-essential
- zlib1g-dev
- libjpeg-dev
users:
- name: rip
# uid 1000 : correspond au raw.idmap de volume-homedir-Musique
uid: 1000
groups: sudo
shell: /bin/bash
sudo: ['ALL=(ALL) NOPASSWD:ALL']
write_files:
- path: /tmp/setup-mise.bash
permissions: '0755'
owner: root:root
content: |
#!/bin/bash
echo "This script runs as the user" $(whoami) > /tmp/setup-mise.log
exec 2>&1 >> /tmp/setup-mise.log
# Install mise
curl https://mise.run | sh
echo 'test -x ~/.local/bin/mise && source <(~/.local/bin/mise activate bash)' >> ~/.bashrc
# Activate mise
test -x ~/.local/bin/mise && source <(~/.local/bin/mise activate bash)
# Configure mise
mise settings set experimental true
mise use -g usage # for completion
# Install streamrip
mise use -g python
mise use -g pipx
mise use -g pipx:streamrip
runcmd:
# Si un volume est monté sous /home/rip (volume-homedir-Musique), LXD crée
# /home/rip en root avant cloud-init : on le rend à rip et on copie le skel
- chown rip:rip /home/rip
- sudo -u rip cp -rn /etc/skel/. /home/rip/
- sudo -u rip /tmp/setup-mise.bash
-26
View File
@@ -1,26 +0,0 @@
name: gitea
description: Install gitea
config:
cloud-init.vendor-data: |
#cloud-config
timezone: Europe/Paris
locale: fr_FR.UTF-8
# Packages
package_update: true
package_upgrade: true
packages:
- unzip
# users:
# - default
# - name: gitea
# groups: sudo
# shell: /bin/bash
# sudo: ['ALL=(ALL) NOPASSWD:ALL']
runcmd:
# Install gitea
- [ snap, install, gitea ]
@@ -1,33 +0,0 @@
name: nextcloud
description: Install Nextcloud
config:
cloud-init.vendor-data: |
#cloud-config
# Regional settings
timezone: Europe/Paris
locale: fr_FR.UTF-8
# Packages
package_update: true
package_upgrade: true
packages: []
# Users
users:
- default
- name: nextcloud
groups: sudo
shell: /bin/bash
sudo: ['ALL=(ALL) NOPASSWD:ALL']
runcmd:
# Install Nextcloud
- [ snap, install, nextcloud ]
devices:
nextcloud-data:
type: disk
pool: zfs
source: nextcloud-data
path: /var/snap/nextcloud
@@ -1,5 +1,5 @@
name: postgresql
description: Install postgresql
name: postgresql-snap
description: Install postgresql (snap)
config:
cloud-init.vendor-data: |
#cloud-config
@@ -1,8 +1,8 @@
name: traefik-config
description: "Volume to mount traefik config dir from host"
name: traefik-volume-config
description: Volume to mount traefik config dir from host
devices:
config:
type: disk
source: /home/ubuntu/infra/new/traefik/config
path: /etc/traefik
shift: "true"
source: /home/ubuntu/infra/new/traefik/config
type: disk
@@ -0,0 +1,18 @@
name: coolify
description: A profile that deploy Coolify in an LXD container
config:
cloud-init.vendor-data: |
#cloud-config
package_update: true
package_upgrade: true
packages:
- avahi-daemon
- curl
runcmd:
- curl -fsSL https://cdn.coollabs.io/coolify/install.sh | sudo bash
timezone: Europe/Paris
locale: fr_FR.UTF-8
linux.kernel_modules: overlay
security.nesting: "true"
security.privileged: "true"
devices: {}
@@ -0,0 +1,18 @@
name: docker-unprivileged
description: "A profile that deploy docker in an unprivileged LXD container"
config:
linux.kernel_modules: overlay
security.nesting: "true"
# Requis pour les images dont les couches créent des device nodes ou des xattrs
security.syscalls.intercept.mknod: "true"
security.syscalls.intercept.setxattr: "true"
cloud-init.vendor-data: |
#cloud-config
package_update: true
package_upgrade: true
packages:
- curl
runcmd:
- curl https://get.docker.com | sh
timezone: Europe/Paris
locale: fr_FR.UTF-8
@@ -1,8 +1,10 @@
name: docker-volume-data
description: "A profile that add a volume for docker data"
# Le volume doit exister avant l'installation du profil (LXD le vérifie) :
# lxc storage volume create default docker-data
devices:
docker-data:
type: disk
pool: btrfs
pool: default
source: docker-data
path: /var/lib/docker
@@ -2,11 +2,6 @@ name: docker
description: "A profile that deploy docker in an LXD container"
config:
linux.kernel_modules: overlay
raw.lxc: |-
lxc.apparmor.profile = unconfined
lxc.cgroup.devices.allow = a
lxc.mount.auto=proc:rw sys:rw
lxc.cap.drop =
security.nesting: "true"
security.privileged: "true"
cloud-init.vendor-data: |
@@ -0,0 +1,18 @@
name: dokploy
description: A profile that deploy Dokploy in an LXD container
config:
cloud-init.vendor-data: |
#cloud-config
package_update: true
package_upgrade: true
packages:
- curl
- avahi-daemon
runcmd:
- curl -sSL https://dokploy.com/install.sh | sh
timezone: Europe/Paris
locale: fr_FR.UTF-8
linux.kernel_modules: overlay
security.nesting: "true"
security.privileged: "true"
devices: {}
@@ -0,0 +1,35 @@
name: microk8s-config
description: "A profile that add cloud-init user data to bootstrap microk8s with some config"
devices: {}
config:
cloud-init.user-data: |
#cloud-config
#
# Creates a launch file for microk8s
#
write_files:
- path: "/var/snap/microk8s/common/.microk8s.yaml"
owner: root:root
permissions: "0644"
content: |
---
version: 0.1.0
addons:
- name: rbac
- name: dns
- name: ingress
disable: true
- name: cert-manager
- name: hostpath-storage
- name: metrics-server
- name: dashboard
# The extra arguments listed here are not required, as they would be set by the 'rbac' and the 'dns'
# addons respectively. However, we set them to save time by not having to restart the Kubernetes
# services a few times during cluster bootstrap.
# extraKubeAPIServerArgs:
# --authorization-mode: RBAC,Node
# extraKubeletArgs:
# --cluster-dns: 10.152.183.10
# --cluster-domain: cluster.local
+30 -30
View File
@@ -1,35 +1,6 @@
name: microk8s
description: "A profile that deploy microk8s in an LXD container"
devices:
aadisable:
path: /sys/module/nf_conntrack/parameters/hashsize
source: /sys/module/nf_conntrack/parameters/hashsize
type: disk
aadisable2:
path: /dev/zfs
source: /dev/zfs
type: disk
aadisable3:
path: /dev/kmsg
source: /dev/kmsg
type: unix-char
aadisable4:
path: /sys/fs/bpf
source: /sys/fs/bpf
type: disk
aadisable5:
path: /proc/sys/net/netfilter/nf_conntrack_max
source: /proc/sys/net/netfilter/nf_conntrack_max
type: disk
description: A profile that deploy microk8s in an LXD container
config:
linux.kernel_modules: ip_vs,ip_vs_rr,ip_vs_wrr,ip_vs_sh,ip_tables,ip6_tables,netlink_diag,nf_nat,overlay,br_netfilter
raw.lxc: |
lxc.apparmor.profile=unconfined
lxc.mount.auto=proc:rw sys:rw cgroup:rw
lxc.cgroup.devices.allow=a
lxc.cap.drop=
security.nesting: "true"
security.privileged: "true"
cloud-init.vendor-data: |
#cloud-config
package_update: true
@@ -38,3 +9,32 @@ config:
- [ 'snap', 'install', 'microk8s', '--classic' ]
timezone: Europe/Paris
locale: fr_FR.UTF-8
linux.kernel_modules: ip_vs,ip_vs_rr,ip_vs_wrr,ip_vs_sh,ip_tables,ip6_tables,netlink_diag,nf_nat,overlay,br_netfilter
raw.lxc: |
lxc.apparmor.profile=unconfined
lxc.mount.auto=proc:rw sys:rw cgroup:rw
lxc.cgroup2.devices.allow=a
lxc.cap.drop=
security.nesting: "true"
security.privileged: "true"
devices:
aadisable:
path: /sys/module/nf_conntrack/parameters/hashsize
source: /sys/module/nf_conntrack/parameters/hashsize
type: disk
aadisable2:
path: /dev/kmsg
source: /dev/kmsg
type: unix-char
aadisable3:
path: /sys/fs/bpf
source: /sys/fs/bpf
type: disk
aadisable4:
path: /proc/sys/net/netfilter/nf_conntrack_max
source: /proc/sys/net/netfilter/nf_conntrack_max
type: disk
aadisable5:
path: /dev/zfs
source: /dev/zfs
type: disk
+4 -4
View File
@@ -1,5 +1,5 @@
name: size-large
description: "Large sized instance limits"
limits:
cpu: 4
memory: 8GB
description: Large sized instance limits (4 CPU, 8GB RAM)
config:
limits.cpu: "4"
limits.memory: 8GB
+4 -4
View File
@@ -1,5 +1,5 @@
name: size-medium
description: "Medium sized instance limits"
limits:
cpu: 2
memory: 4GB
description: Medium sized instance limits (2 CPU, 4GB RAM)
config:
limits.cpu: "2"
limits.memory: 4GB
+4 -4
View File
@@ -1,5 +1,5 @@
name: size-small
description: "Small sized instance limits"
limits:
cpu: 1
memory: 2GB
description: Small sized instance limits (1 CPU, 2GB RAM)
config:
limits.cpu: "1"
limits.memory: 2GB
@@ -1,7 +1,7 @@
name: proxy-docker-tcp
name: proxy-docker
description: Expose private docker sock via tcp on the host
devices:
docker:
type: proxy
listen: tcp:0.0.0.0:2375
dockersock:
connect: unix:/run/docker.sock
listen: tcp:10.112.16.1:2375
type: proxy
@@ -0,0 +1,11 @@
name: proxy-stun-turn
description: Proxify STUN /TURN
devices:
hostport3478udp:
type: proxy
listen: udp:0.0.0.0:3478
connect: udp:127.0.0.1:3478
hostport3478tcp:
type: proxy
listen: tcp:0.0.0.0:3478
connect: tcp:127.0.0.1:3478
@@ -1,7 +1,7 @@
name: btrfs
description: "root device on btrfs pool"
name: storage-btrfs
description: root device on btrfs pool
devices:
root:
type: disk
pool: btrfs
path: /
pool: btrfs
type: disk
@@ -1,7 +1,7 @@
name: zfs
description: "root device on zfs pool"
name: storage-zfs
description: root device on zfs pool
devices:
root:
type: disk
pool: zfs
path: /
pool: zfs
type: disk
@@ -0,0 +1,31 @@
name: unattended-upgrades
description: Profil pour activer les unattended upgrades sur Ubuntu
config:
cloud-init.vendor-data: |
#cloud-config
package_update: true
package_upgrade: true
packages:
- unattended-upgrades
- apt-listchanges
write_files:
- path: /etc/apt/apt.conf.d/20auto-upgrades
content: |
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::AutocleanInterval "7";
- path: /etc/apt/apt.conf.d/50unattended-upgrades
content: |
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}";
"${distro_id}:${distro_codename}-security";
"${distro_id}ESM:${distro_codename}";
};
Unattended-Upgrade::Automatic-Reboot "false";
Unattended-Upgrade::Automatic-Reboot-Time "02:00";
Unattended-Upgrade::Remove-Unused-Dependencies "true";
runcmd:
- [ systemctl, enable, --now, unattended-upgrades ]
+7 -3
View File
@@ -1,4 +1,3 @@
---
name: user-xavier
description: Personnal environment for Xavier
config:
@@ -12,8 +11,13 @@ config:
package_update: true
package_upgrade: true
packages:
- unattended-upgrades
- apt-listchanges
- curl
- git
- avahi-daemon
# Utilisateurs
users:
- name: xavier
groups: sudo
@@ -23,6 +27,6 @@ config:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBlon0OAAt/wQmuP/BDY/m4qJgUgNY1a7xXUgPpfCXe4 xavier@intel-nuc-hades-canyon
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMi/CnrkifO0e78Oj1tdLTILc4yuJ18em4W/2fDte9Kq ubuntu@cloud.logerais.com
# Bootstrap de l'environnement
runcmd:
- su - xavier -c "git clone https://gitea.cloud.logerais.com/xavier/config-bootstrap.git ~/.bootstrap"
- su - xavier -c "bash ~/.bootstrap/bootstrap.bash"
- [ su, -, xavier, -c, 'sh -c "$(curl -fsLS get.chezmoi.io/lb)" -- init --apply https://gitea.cloud.logerais.com/xavier/config-chezmoi.git' ]
@@ -1,8 +0,0 @@
name: certificates
description: "Volume to mount letsencrypt certificates from host"
devices:
certificates:
path: /certificates
shift: "true"
source: /etc/letsencrypt/live
type: disk
@@ -0,0 +1,9 @@
name: volume-gitea-data-ro
description: Volume des données Gitea en lecture seule (instance de backup)
devices:
gitea-data:
path: /backup/gitea-data
pool: zfs
source: gitea-data
readonly: "true"
type: disk
@@ -0,0 +1,8 @@
name: volume-gitea-data
description: Volume des données Gitea (snapshots quotidiens portés par le volume)
devices:
gitea-data:
path: /var/snap/gitea/common
pool: zfs
source: gitea-data
type: disk
@@ -0,0 +1,9 @@
name: volume-homedir-Musique
description: Volume montant le dossier Musique du homedir du host (à utiliser avec app-streamrip)
config:
raw.idmap: both 1000 1000
devices:
musique:
type: disk
source: /home/xavier/Musique
path: /home/rip/Musique
@@ -0,0 +1,9 @@
name: volume-homedir
description: Volume montant le homedir du host (/home/xavier)
config:
raw.idmap: both 1000 1000
devices:
homedir:
type: disk
source: /home/xavier
path: /home/xavier
@@ -0,0 +1,9 @@
name: volume-letsencrypt
description: Volume contenant les certificats letsencrypt du host
devices:
certificates:
path: /etc/letsencrypt
readonly: "true"
shift: "true"
source: /etc/letsencrypt
type: disk
@@ -0,0 +1,9 @@
name: volume-nextcloud-data-ro
description: Volume des données Nextcloud en lecture seule (instance de backup)
devices:
nextcloud-data:
path: /backup/nextcloud-data
pool: zfs
source: nextcloud-data
readonly: "true"
type: disk
@@ -0,0 +1,8 @@
name: volume-nextcloud-data
description: Volume des données Nextcloud (snapshots quotidiens portés par le volume)
devices:
nextcloud-data:
path: /var/snap/nextcloud
pool: zfs
source: nextcloud-data
type: disk