My-Patreon-Manager

0

Описание

Full LLM driven Patreon space management

Языки

  • Go55,3%
  • HTML38,5%
  • Shell3,3%
  • PowerShell0,6%
  • Dart0,6%
  • PLpgSQL0,5%
  • Остальные1,2%
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
5 дней назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
месяц назад
README.md

My Patreon Manager

Automate tier-gated content creation for Patreon from your Git repositories.

My Patreon Manager scans repositories across GitHub, GitLab, GitFlic, and GitVerse, generates quality-scored content through an LLM pipeline, and publishes tier-gated posts to Patreon. CLI-first, idempotent, and safe to re-run.


Go 1.26.1 Test Coverage Platforms License


Find What You Need (Landing)

Jump directly to the information you're looking for:

Setting up for the first time

Running the pipeline

Migrations and schema

Articles + illustrations

Patreon specifics

Deployment, operations, security

Architecture and development

Project status and future work

  • Known Issues, Unfinished Work & Future Enhancements — the canonical "what's not done and why" document. Covers product non-goals (multi-tenancy, drift auto-merge, article scheduling, separate REVIEWER_KEY), infrastructure gaps (Postgres integration harness, coverage.sh measurement semantics, submodule mirrors), deferred enhancements (
    models.Post.URL
    , illustration cleanup on repo delete, preview UI SPA, webhook-driven sync, multi-node parallelism, migrate-down backups), documentation deferrals (video course scripts, legacy planning artifacts), and environmental caveats (Semgrep auth, COVERAGE_MIN default). Each entry has a workaround and a concrete path to resolution.

Full documentation index with every file: see "Documentation" section below.

Features

  • Multi-platform Git scanning -- GitHub, GitLab, GitFlic, and GitVerse as first-class, interchangeable sources with mirror detection
  • Multi-organization support -- scan repositories across multiple organizations and groups in a single sync run
  • LLM-powered content generation -- quality-scored model selection with automatic fallback chains and configurable quality thresholds
  • Tier-gated Patreon publishing -- maps repository content to Patreon tiers with deduplication via content fingerprinting
  • CLI subcommands --
    process
    (top-level pipeline),
    scan
    ,
    generate
    ,
    validate
    ,
    publish
    with
    --dry-run
    ,
    --schedule
    ,
    --org
    ,
    --repo
    ,
    --pattern
    ,
    --json
    ,
    --log-level
    .
    sync
    is retained as a deprecated alias for
    process
    .
  • HTTP server -- Gin-based server on
    :8080
    with health checks, Prometheus metrics, admin endpoints, and webhook handlers
  • Resilience patterns -- circuit breakers, exponential backoff, per-provider rate limiting
  • Observability -- structured JSON logging, Prometheus metrics, Grafana dashboards
  • Idempotent operations -- content fingerprinting and checkpointing ensure safe re-runs after failures
  • Database flexibility -- SQLite (default) or PostgreSQL for production
  • Security-first -- twelve-factor credential management, HMAC-signed webhooks, credential redaction in all logs

Quick Start

sync
is still accepted as a deprecated alias for
process
and prints a warning to stderr. Prefer
process
for new automation.

Environment Variables Quick Reference

Full reference with mandatory/optional tables by flow: docs/guides/configuration.md § Required / Optional at a Glance Step-by-step signup flows with direct links to every token-issuing service: docs/guides/obtaining-credentials.md

Required

Legend: ❗ mandatory · ○ optional.

Patreon API (all ❗)

VariableDescriptionObtain from
PATREON_CLIENT_ID
OAuth client IDPatreon Platform Portal
PATREON_CLIENT_SECRET
OAuth client secretSame page
PATREON_ACCESS_TOKEN
Access tokenPatreon OAuth flow or Creator's Access Token
PATREON_REFRESH_TOKEN
Refresh tokenReturned alongside access token
PATREON_CAMPAIGN_ID
Campaign ID
GET /api/oauth2/v2/campaigns

Security

VariableRequiredDescriptionObtain from
HMAC_SECRET
Signs download URLsSelf-generated:
openssl rand -hex 32
ADMIN_KEY
❗ (if using preview UI)Gates approve/reject/edit/resolve-drift endpointsSelf-generated:
openssl rand -hex 32
WEBHOOK_HMAC_SECRET
Shared secret for webhook signaturesSelf-generated

Git Provider Tokens (at least one ❗ for multi-org scanning)

VariableDescriptionObtain from
GITHUB_TOKEN
Scopes:
repo
(classic) or
Contents/Metadata: Read
(fine-grained)
GitHub · Personal access tokens
GITLAB_TOKEN
Scopes:
read_api
,
read_repository
GitLab · Personal access tokens
GITFLIC_TOKEN
Repository read scopeGitFlic account settings
GITVERSE_TOKEN
Repository read scopeGitVerse account settings

Each provider also supports a

_SECONDARY
token for failover (e.g.,
GITHUB_TOKEN_SECONDARY
).

Multi-Organization (all ○)

VariableDefaultDescription
GITHUB_ORGS
personal reposComma-separated GitHub organization logins;
*
scans every accessible org
GITLAB_GROUPS
personal reposComma-separated GitLab group paths; subgroups auto-included
GITFLIC_ORGS
personal reposComma-separated GitFlic organization names
GITVERSE_ORGS
personal reposComma-separated GitVerse organization names

Illustration Providers (set at least one ❗ to generate per-article images)

VariableDescriptionObtain from
OPENAI_API_KEY
Enables DALL-E 3 (recommended minimum)OpenAI Platform · API keys (requires paid billing)
STABILITY_AI_API_KEY
Enables Stability AI (SDXL)Stability Platform · API keys
MIDJOURNEY_API_KEY
+
MIDJOURNEY_ENDPOINT
Enables Midjourney proxy (both required; no official API)GoAPI, UseAPI.net, or self-hosted midjourney-api
OPENAI_COMPAT_API_KEY
+
OPENAI_COMPAT_BASE_URL
Enables an OpenAI-compatible endpointVenice, Together, self-hosted LiteLLM;
OPENAI_COMPAT_MODEL
optional

Illustration behavior is controlled by

ILLUSTRATION_ENABLED
(default
true
),
IMAGE_PROVIDER_PRIORITY
(default
dalle,stability,midjourney,openai_compat
),
ILLUSTRATION_DEFAULT_STYLE
,
ILLUSTRATION_DEFAULT_SIZE
,
ILLUSTRATION_DEFAULT_QUALITY
, and
ILLUSTRATION_DIR
. See Illustration Generation and Image Providers for full reference.

LLMsVerifier (required for content generation)

VariableDescription
LLMSVERIFIER_ENDPOINT
LLMsVerifier service URL (default
http://localhost:9099
)
LLMSVERIFIER_API_KEY
LLMsVerifier API key

Optional

Content Generation

VariableDefaultDescription
CONTENT_QUALITY_THRESHOLD
0.75
Minimum quality score for generated content
LLM_DAILY_TOKEN_BUDGET
100000
Daily token budget across all LLM providers
LLM_CONCURRENCY
8
Max concurrent in-flight LLM calls
CONTENT_TIER_MAPPING_STRATEGY
linear
Tier mapping strategy

Database

VariableDefaultDescription
DB_DRIVER
sqlite
Database driver (
sqlite
or
postgres
)
DB_PATH
user/db/patreon_manager.db
SQLite database path
DB_HOST
localhost
PostgreSQL host
DB_PORT
5432
PostgreSQL port
DB_USER
postgres
PostgreSQL user
DB_PASSWORD
password
PostgreSQL password
DB_NAME
my_patreon_manager
PostgreSQL database name

Server

VariableDefaultDescription
PORT
8080
HTTP server port
GIN_MODE
debug
Gin mode (
debug
or
release
)
LOG_LEVEL
info
Log level (ERROR, WARN, INFO, DEBUG, TRACE)
RATE_LIMIT_RPS
100
Per-IP rate limit (requests/second)
RATE_LIMIT_BURST
200
Per-IP burst budget

Multi-Org Configuration

Configure multi-organization scanning to discover repositories across multiple GitHub organizations and GitLab groups in a single sync run:

When unset, each provider scans the token owner's personal repositories. All organizations are iterated with full pagination, and cross-org deduplication is applied through the existing mirror detection pipeline.

See Multi-Org Support for complete documentation.

Documentation

Getting Started

DocumentDescription
Quickstart GuideGetting started in 5 minutes
Configuration ReferenceComplete environment variable and config reference
Obtaining CredentialsHow to obtain Patreon and Git provider tokens
Multi-Org SupportMulti-organization repository scanning setup

Architecture

DocumentDescription
Architecture OverviewSystem design and component interactions
SQL SchemaDatabase schema reference
ADRsArchitecture Decision Records

Guides

DocumentDescription
Git ProvidersProvider-specific setup and configuration
Content GenerationLLM pipeline, quality gates, and tier mapping
Patreon TiersTier configuration and access control
LLMsVerifier SetupLLMsVerifier service integration
Deployment GuideProduction deployment guide
Local Verification15-step pre-publish checklist

API Reference

DocumentDescription
OpenAPI SpecificationHTTP API specification
CLI ReferenceCLI subcommands and flags

Tutorials

TutorialDescription
First SyncZero to first published Patreon post in 12 steps
Server SetupStart the server, configure webhooks, verify endpoints
Security ScanningRun every scanner locally, read findings, fix them
Testing GuideRun and write every test type (unit, fuzz, bench, chaos, leak)
Content PipelineLLM generation, quality gates, tiers, rendering, fingerprints

Manuals

ManualDescription
End-to-End WalkthroughComplete operator walkthrough
Admin ManualWebhooks, monitoring, SLOs, credential rotation
Developer ManualAdding providers, renderers, migrations, tests
CLI: syncFull pipeline subcommand
CLI: scanDiscovery-only subcommand
CLI: generateContent generation subcommand
CLI: validateConfiguration validator
CLI: publishPublish pre-generated content
Deploy: DockerDocker + docker-compose
Deploy: PodmanPodman + systemd integration
Deploy: systemdBare binary + systemd unit
Deploy: KubernetesK8s deployment + CronJob
Deploy: BinaryCross-compile and run

Video Course (11 modules)

ModuleScript
1. Introduction & Core ConceptsScript
2. Installation & First SyncScript
3. Configuration Deep-DiveScript
4. Content Templates & CustomizationScript
5. Filtering & Mirror DetectionScript
6. Advanced Features & IntegrationsScript
7. Deployment & Production ReadinessScript
8. Extending the SystemScript
9. Concurrency PatternsScript
10. ObservabilityScript
11. Multi-Org ScanningScript

See also: Course Outline | Recording Checklist | Distribution Plan

Operations

DocumentDescription
SecuritySecurity policies and baselines
RunbooksOperational procedures
Troubleshooting FAQCommon issues and solutions
Main SpecificationFull system specification

Development

License

See the project license file for terms and conditions.