Pasture: WriteFreely 0.17.2

WriteFreely joins the pasture, built from its release with openssl beside it (it makes each blog's keys with the
command); scenarios/writefreely.sh has alice follow a blog and receive its post as a titled Article, its edit and its
deletion, then unfollow: 13 checks, with no change to PrivaPub.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-06 00:28:11 +02:00
1 parent 5721bfd796
commit 0aea550c6c
7 files changed
+123

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
# WriteFreely 0.17.2: blogs, each an ActivityPub actor whose posts go out as Articles (title, summary, the whole text).
# A blog can be followed, never follow; it takes no replies. Built from its release (images/writefreely), on SQLite in its
# own volume, as writefreely.test; Go trusts the bundle the pasture mounts over the system one. wfuser and its blog
# come from its CLI, and its API takes a login.
WRITEFREELY_IMAGE=${WRITEFREELY_IMAGE:-localhost/pasture-writefreely:0.17.2}
WRITEFREELY_PASSWORD=WriteFreely-Pasture-Pass-1
writefreely_up() {
podman image exists "$WRITEFREELY_IMAGE" || podman build -q -t "$WRITEFREELY_IMAGE" "$here/images/writefreely" >/dev/null
local st="$here/.state/writefreely"
mkdir -p "$st"
cat > "$st/config.ini" <<-EOF2
[server]
port = 8080
bind = 0.0.0.0
keys_parent_dir = /data
[database]
type = sqlite3
filename = /data/writefreely.db
[app]
site_name = WriteFreely pasture
host = https://writefreely.test
single_user = false
open_registration = true
max_blogs = 4
federation = true
public_stats = true
local_timeline = true
EOF2
podman volume exists pasture-writefreely || podman volume create --label pasture=1 pasture-writefreely >/dev/null
local run="podman run --rm -v pasture-writefreely:/data -v $st/config.ini:/opt/writefreely/config.ini:Z,ro $WRITEFREELY_IMAGE"
if ! $run test -s /data/writefreely.db; then
$run sh -c 'mkdir -p /data/keys && ./writefreely keys generate && ./writefreely db init' >/dev/null 2>&1
$run ./writefreely user create --admin "wfuser:$WRITEFREELY_PASSWORD" >/dev/null 2>&1
fi
podman run -d --replace --name pasture-writefreely --label pasture=1 --network $net -v pasture-writefreely:/data \
-v "$st/config.ini:/opt/writefreely/config.ini:Z,ro" -v "$ca/bundle.pem:/etc/ssl/certs/ca-certificates.crt:z,ro" \
$WRITEFREELY_IMAGE ./writefreely serve >/dev/null
for _ in $(seq 1 30); do
site writefreely.test -s -o /dev/null -w '%{http_code}' https://writefreely.test:6443/api/me 2>/dev/null | grep -q -E '200|401' && break
sleep 1
done
site writefreely.test -s -X POST https://writefreely.test:6443/api/auth/login -H 'Content-Type: application/json' \
-d "{\"alias\":\"wfuser\",\"pass\":\"$WRITEFREELY_PASSWORD\"}" \
| python3 -c 'import json, sys; print(json.load(sys.stdin)["data"]["access_token"])' > "$st/wfuser.token"
echo "writefreely: https://writefreely.test:6443"
}