Mitra joins the pasture (peers/mitra.sh) on the shared Postgres; scenarios/mitra.sh drives its Mastodon API through follows, posts, replies, likes, reposts, a reaction, a poll, edits, deletions, direct messages, the unfollow and statistics: 28 checks, with no change to PrivaPub. Mitra carries FEP-8b32 proofs made with Ed25519, which PrivaPub does not verify yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
44 lines
2.0 KiB
Bash
44 lines
2.0 KiB
Bash
# Mitra 5.9.1 (silverpill): a microblog in Rust with Ed25519 keys beside RSA (FEP-521a), integrity proofs (FEP-8b32),
|
|
# nomadic identity (FEP-ef61) and account moves. On the shared Postgres (database mitra), as mitra.test; its TLS client
|
|
# reads the system's roots, over which the pasture's bundle goes. mitrauser is made by its CLI, and its Mastodon API
|
|
# takes a password grant.
|
|
MITRA_IMAGE=${MITRA_IMAGE:-codeberg.org/silverpill/mitra:5.9.1}
|
|
MITRA_PASSWORD=Mitra-Pasture-Pass-1
|
|
. "$here/peers/shared.sh"
|
|
|
|
mitra_up() {
|
|
shared_postgres_up
|
|
pg_db mitra
|
|
local st="$here/.state/mitra"
|
|
mkdir -p "$st"
|
|
cat > "$st/config.yaml" <<-EOF2
|
|
database_url: postgres://pasture:pasture@postgres:5432/mitra
|
|
storage_dir: /var/lib/mitra
|
|
web_client_dir: /usr/share/mitra/www
|
|
http_host: '0.0.0.0'
|
|
http_port: 8383
|
|
instance_url: https://mitra.test
|
|
instance_title: Mitra pasture
|
|
instance_short_description: the pasture's Mitra
|
|
instance_description: The pasture's Mitra
|
|
instance_staff_public: true
|
|
instance_timeline_public: true
|
|
registration:
|
|
type: open
|
|
default_role: user
|
|
EOF2
|
|
podman volume exists pasture-mitra || podman volume create --label pasture=1 pasture-mitra >/dev/null
|
|
podman run -d --replace --name pasture-mitra --label pasture=1 --network $net -v pasture-mitra:/var/lib/mitra:U \
|
|
-v "$st/config.yaml:/etc/mitra/config.yaml:Z,ro" -v "$ca/bundle.pem:/etc/ssl/certs/ca-certificates.crt:z,ro" \
|
|
$MITRA_IMAGE >/dev/null
|
|
for _ in $(seq 1 60); do
|
|
site mitra.test -s -o /dev/null -w '%{http_code}' https://mitra.test:6443/api/v1/instance 2>/dev/null | grep -q 200 && break
|
|
sleep 1
|
|
done
|
|
podman exec pasture-mitra mitra create-account mitrauser "$MITRA_PASSWORD" user >/dev/null 2>&1 || true
|
|
site mitra.test -s -X POST https://mitra.test:6443/oauth/token -H 'Content-Type: application/json' \
|
|
-d "{\"grant_type\":\"password\",\"username\":\"mitrauser\",\"password\":\"$MITRA_PASSWORD\"}" \
|
|
| python3 -c 'import json, sys; print(json.load(sys.stdin).get("access_token", ""))' > "$st/mitrauser.token"
|
|
echo "mitra: https://mitra.test:6443"
|
|
}
|