#!/usr/bin/env bash source $SCENARIO_DIR/../../lib/lib.sh GTS_VERSION="0.20.0" # renovate: datasource=docker depName=data.forgejo.org/oci/gotosocial echo "setting up gotosocial" tmpdir="$(mktemp --tmpdir -d gts.XXXXXXXXXX)" cat << EOF > "$tmpdir/config.yaml" host: "localhost:8080" protocol: http db-type: sqlite db-address: /mount/gts.db3 http-client: allow-ips: ["0.0.0.0/0", "::/0"] insecure-outgoing: true EOF podman unshare \ chown 1000:1000 -R $tmpdir container_id="$( podman run \ -d \ --env "GTS_CONFIG_PATH=/mount/config.yaml" \ -v "$tmpdir:/mount" \ -p "8080:8080" \ --network=host \ "data.forgejo.org/oci/gotosocial:$GTS_VERSION" \ server start )" function wait_gts_ready() { http_status=$(curl -s -w \ "%{http_code}" -o /dev/null \ "http://localhost:8080/" ) [[ "$http_status" == 200 ]] && echo "ready" } retry wait_gts_ready password="verysecurepassword" podman exec -it "$container_id" /gotosocial/gotosocial admin \ account create \ --username "test" \ --email "test@localhost" \ --password "$password" cat << EOF > "$DIR/federation_scenario-gotosocial-env" password="$password" port="8080" container_id="$container_id" EOF