Skip to main content

Bot to boost/reblog posts with specified tags

Reason this release was yanked:

Incorrect version number

Project description

Zhongli

Automatically boost/reblog Fediverse posts. Formerly Fedibooster.

Repo CI Downloads AGPL

Overview

Zhongli consumes pre-filtered posts from FenLiu's queue and automatically reblogs them to your Fediverse account. FenLiu handles the heavy lifting (filtering, spam detection, curation); Zhongli handles the reblogging and duplicate prevention.

FenLiu configuration is required. There is no legacy mode.

Status

Phase Status Notes
1: Infrastructure ✅ Complete FenLiu client, models, tests
2: FenLiu-Only Mode ✅ Complete ReblogService, queue polling, attachments
3: Validation Optimization ✅ Complete MinimalValidator, pre-filtered posts
4: Documentation ✅ Complete FenLiu-only, updated config
5: UX Polish ⏳ Optional Metrics, dry-run, progress indicators

Install

pip install zhongli

Or from source:

git clone https://codeberg.org/marvinsmastodontools/zhongli.git
cd zhongli
uv sync
uv run zhongli

Configuration

Zhongli requires FenLiu and a Fediverse account:

[fediverse]
domain_name = "mastodon.social"
api_token = "your-token"

[fenliu]
base_url = "https://fenliu.example.com"
api_key = "your-api-key"

# Optional
run_continuously = false
delay_between_posts = 300
reblog_sensitive = false
max_reblog = 5
# allow_insecure_http = false  # set true only if FenLiu is on a local network without HTTPS

Configuration explained:

  • [fediverse] - Your Mastodon/Pixelfed/Misskey account
  • [fenliu] - Connection to FenLiu queue service
  • run_continuously - Keep polling or exit after max_reblog posts
  • delay_between_posts - Seconds between reblogs (0 for no delay)
  • reblog_sensitive - Whether to boost sensitive/NSFW posts
  • max_reblog - Stop after boosting N posts (0 for unlimited)
  • fenliu.skip_missing_alt_text - Skip posts where any attachment lacks alt text (default: false)
  • fenliu.allow_insecure_http - Allow an HTTP base_url for private local-network deployments where HTTPS is not feasible. Never enable this in production. http://localhost and http://127.0.0.1 are always exempt and do not require this flag (default: false)

Security: config.toml is created with 0600 permissions (owner read/write only). If you copy or restore the file from another location, re-apply: chmod 600 config.toml. Zhongli will refuse to start if it detects the file is readable by group or world.

fenliu.base_url must use https:// to protect the API key in transit. The only exceptions are http://localhost and http://127.0.0.1 (always permitted for local development), and any URL when allow_insecure_http = true is set explicitly for private-network deployments.

Debug log: When using --logging-config logging-config.toml, debug output is written to ~/.cache/zhongli/zhongli.log. This directory is created automatically and is accessible only by the owner. Never configure /tmp/ as a log destination — it is world-readable.

Usage

zhongli config.toml                 # Run with config file
zhongli config.toml --max-posts 10  # Override max posts
zhongli --help                      # Show all options

How It Works

  1. Poll FenLiu Queue - Get next curated post
  2. Validate - Quick checks (has content, not a reply, respects sensitive setting)
  3. Find on Fediverse - Search for post by URL
  4. Check for Duplicates - Compare attachments (URL, hash, perceptual)
  5. Reblog - Boost to your account with circuit breaker protection
  6. Report Feedback - ACK (success), NACK (transient error), ERROR (permanent)
  7. Repeat - Until configured limit or continuous mode ends

Features

  • FenLiu Integration - Consume pre-curated, pre-filtered posts
  • Duplicate Prevention - Three-layer attachment detection (URL, SHA-256, dHash)
  • Reliable Reblogging - Circuit breaker pattern, retry logic, error classification
  • Smart Feedback - ACK/NACK/ERROR reporting to FenLiu
  • Production Ready - 132 tests, full type checking, comprehensive error handling

Development

uv sync              # Install deps
prek run --all-files # Pre-commit checks
uv run tryke test    # Run tests (132 tests; from repo root: uv run tryke test --root packages/zhongli)
nox                  # Full CI simulation

Recent Work

  • ✅ Phase 3: Validation optimized for FenLiu pre-filtered posts
  • ✅ Phase 2: Full FenLiu-only mode operational
  • ✅ Phase 1: FenLiu infrastructure complete with 132 tests
  • ✅ Attachment deduplication system (URL, content hash, perceptual hash)
  • ✅ Circuit breaker pattern integrated
  • ✅ Complete feedback mechanism (ACK/NACK/ERROR)

Next Steps

Phase 5 - UX polish and observability (metrics, dry-run mode, progress indicators)

License

GNU AGPL v3.0

Support

  • Buy me coffee
  • Monero: 88xtj3hqQEpXrb5KLCigRF1azxDh8r9XvYZPuXwaGaX5fWtgub1gQsn8sZCmEGhReZMww6RRaq5HZ48HjrNqmeccUHcwABg

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zhongli-2026.5.166.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zhongli-2026.5.166-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file zhongli-2026.5.166.tar.gz.

File metadata

  • Download URL: zhongli-2026.5.166.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for zhongli-2026.5.166.tar.gz
Algorithm Hash digest
SHA256 468e5c8f4bf9926b34c1ca4a86d0851ee1066f318fa4ba6ae7c9cc333c952e73
MD5 efeac0a84e67d15742a07b7dc5bc9176
BLAKE2b-256 3840e3f214215747bfe5275788cc11e9cd0798a1221aa0b009bd7917b6e8cca6

See more details on using hashes here.

File details

Details for the file zhongli-2026.5.166-py3-none-any.whl.

File metadata

  • Download URL: zhongli-2026.5.166-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for zhongli-2026.5.166-py3-none-any.whl
Algorithm Hash digest
SHA256 5b43f46eb3f9fdb9c24dd814bdb2380d749c7a86f37b5c1d46ddb260535a03b5
MD5 6afe3e4cdfa4899ff1d43c5a6ec2894c
BLAKE2b-256 834d28e34f7e1a7cd4bcc9bfaeac695475e8b87d46b92255da6d6f3f07e4a0a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page