Set up Pop!_OS for a Federated Core, like CoreDesktop's configure
A port of CoreDesktop's configure to Pop!_OS 24.04 with COSMIC, in the shape of connector-macos: its own install.sh, update and configure, installed in ~/.local/share/federated-connector/connector. Every configure item is ported: the Core (email, calendars and contacts through GNOME Online Accounts and Evolution, as COSMIC has no accounts of its own; Superpanel; files over davfs2; Element; Tally; the email watcher), Tailscale, backups, AI agents in the sandbox and their sign-ins, languages with mise, AI servers, printers, network storage and the agent sandbox. Folders go in the COSMIC Files sidebar. Each item installs what it needs from apt, Flathub or the tool's own apt repository when you set it up. smoketest/run checks it in Ubuntu 24.04 containers with Docker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
# shellcheck shell=bash
|
||||
# Scenarios set what the runner and items read
|
||||
# shellcheck disable=SC2034
|
||||
DESCRIPTION="A backup with Ubuntu's restic and rclone to a local WebDAV server standing in for Nextcloud"
|
||||
TIER=quick
|
||||
|
||||
scenario() {
|
||||
local served="$HOME/served" webdav="http://127.0.0.1:8080/remote.php/dav/files/jo"
|
||||
step "Installing restic and rclone"
|
||||
sudo apt-get update > /dev/null && sudo apt-get install -y restic rclone > /dev/null 2>&1
|
||||
check "restic and rclone are installed" pkg_installed restic rclone
|
||||
echo "restic $(restic version | cut -d' ' -f2), $(rclone version | head -n 1)"
|
||||
|
||||
# Nextcloud's WebDAV, and status.php, which the backup waits for
|
||||
mkdir -p "$served/remote.php/dav/files/jo"
|
||||
echo '{"installed":true,"maintenance":false}' > "$served/status.php"
|
||||
rclone serve webdav "$served" --addr 127.0.0.1:8080 --user jo --pass app-password > "$HOME/serve.log" 2>&1 &
|
||||
sleep 2
|
||||
|
||||
step "Setting up, as configure backup does"
|
||||
mkdir -p "$CONF_DIR"
|
||||
printf 'BACKUP_WEBDAV=%q\nBACKUP_USER=jo\nBACKUP_DIR=.backup-smoke\n' "$webdav" > "$CONF_DIR/backup.conf"
|
||||
printf app-password | secret-tool store --label test federated-connector backup item nextcloud url "$webdav"
|
||||
printf 'pass phrase' | secret-tool store --label test federated-connector backup item passphrase url "$webdav/.backup-smoke"
|
||||
source "$CONNECTOR/system/backup-env.sh"
|
||||
check_eq "restic uses rclone's WebDAV" "rclone::webdav:.backup-smoke" "$RESTIC_REPOSITORY"
|
||||
check "the passphrase comes from the keyring" test -n "$RESTIC_PASSWORD_COMMAND"
|
||||
check "rclone reaches the server with the app password" rclone lsf ":webdav:"
|
||||
check "restic init" restic init
|
||||
|
||||
step "A backup"
|
||||
mkdir -p "$HOME/Documents" "$HOME/.cache/big"
|
||||
echo "keep me" > "$HOME/Documents/note.txt"
|
||||
echo "leave me out" > "$HOME/.cache/big/file"
|
||||
check "system/backup" "$CONNECTOR/system/backup"
|
||||
check_eq "there's one snapshot" 1 "$(restic snapshots --json | jq length)"
|
||||
check "a file restores from it" restic restore latest --target "$HOME/restored" --include "$HOME/Documents"
|
||||
check_eq "...as it was" "keep me" "$(cat "$HOME/restored$HOME/Documents/note.txt")"
|
||||
check_not "caches are left out" bash -c "restic ls latest | grep -q '/.cache/big'"
|
||||
check_not "the install is left out" bash -c "restic ls latest | grep -q '/.local/share/federated-connector/'"
|
||||
|
||||
step "Without the passphrase in the keyring"
|
||||
secret-tool clear federated-connector backup item passphrase url "$webdav/.backup-smoke"
|
||||
check_not "system/backup fails" "$CONNECTOR/system/backup"
|
||||
}
|
||||
Reference in New Issue
Block a user