1# A backup keeps which repos are private and who reads them: restoring one2# (forge restore --from, as .forge/ci does) brings back a private repo still3# private, with its readers, and builds no pages or sites for it.4. "$(dirname "$0")/../lib.sh"5user dami6user ana7repo --private dami/secret8repo dami/open9for r in secret open; do10 clone dami "dami/$r" "$T/w/$r"11 at "$T/w/$r" commit "first"12 ok push_as dami "$T/w/$r" origin main "$(site_commit "$T/w/$r" docs):refs/sites/docs"13done14ok ssh_as dami readers dami/secret add ana1516ok forge backup --dry-run17st=$FORGE_ROOT/.forge/backup/stage18missing "$st/dami/secret.git/git-daemon-export-ok"19exists "$st/dami/open.git/git-daemon-export-ok"20eq "$(cat "$st/dami/secret.git/forge/readers")" ana2122r=$T/restored23ok restore_into "$r" --from "$st"24missing "$r/dami/secret.git/git-daemon-export-ok"25exists "$r/dami/open.git/git-daemon-export-ok"26eq "$(cat "$r/dami/secret.git/forge/readers")" ana27exists "$r/dami/secret.git/hooks/pre-receive"28missing "$r/.forge/www/dami/secret"29lacks "$r/.forge/www/repos.json" 'dami/secret'30missing "$r/.forge/www/sites/dami/secret/docs"31exists "$r/.forge/www/dami/open/index.html"32exists "$r/.forge/www/sites/dami/open/docs/index.html"33# And it is still private there: init again (every boot) changes nothing.34ok env FORGE_ROOT="$r" FORGE_WWW="$r/.forge/www" "$FORGE" server init35missing "$r/dami/secret.git/git-daemon-export-ok"