Skip to content

feat: Reddit channel#103

Open
paulocastellano wants to merge 34 commits into
mainfrom
feat/reddit-channel
Open

feat: Reddit channel#103
paulocastellano wants to merge 34 commits into
mainfrom
feat/reddit-channel

Conversation

@paulocastellano

Copy link
Copy Markdown
Contributor

Reddit channel

Adds Reddit as a publishing channel. Users connect their own Reddit account via OAuth and submit to one or more subreddits per post — following the existing channel architecture (Discord as the reference).

What it does

  • OAuth connect/callback — custom Socialite provider (Basic-auth token exchange, duration=permanent, mandatory User-Agent), token verify + refresh in ConnectionVerifier.
  • Self + link posts to one or many subreddits in a single post (meta.subreddits[]), paced for Reddit's rate limit, with per-subreddit partial-failure handling (succeeded submissions are persisted; the failing subreddit is surfaced).
  • Single-image posts via Reddit's asset-lease flow (/api/media/asset → S3 → <Location> from XML).
  • Live subreddit search + per-subreddit restrictions (submission type, image allowance) and flair (including required-flair enforcement) via authenticated, workspace-scoped lookup endpoints.
  • Post metrics — upvotes + comments per post (summed across subreddits) and account karma. (Postiz does not expose Reddit metrics.)
  • Composer UI — a multi-subreddit settings panel (search, title, type, URL, flair, NSFW/spoiler) + a Reddit post preview, plus the connectable-channel registration and logo.
  • Validation lives only in PostPlatformMetaRules (web + public API + MCP all spread it), including required-on-publish (≥1 subreddit, title, URL for link posts, required flair).
  • i18n in en / es / pt-BR.

Deferred (follow-up)

  • Video & gallery posts. Reddit video requires a video_poster_url, and there is no frame-extraction/poster pipeline in the app (no ffmpeg). The UI and validation only offer self/link/image, so there's no confusing publish-time failure — video/gallery simply aren't advertised yet.

Testing

  • Full suite green: 2145 passed, 2 skipped.
  • 47 Reddit-specific tests across enums, Socialite provider, OAuth, token refresh, client (search/restrictions/flair/info), publisher (self/link/multi-subreddit/partial-failure/image), metrics, lookup endpoints, and per-platform meta (API + MCP).

Notes

  • Reddit posts use the connected user's own OAuth token (not a shared bot), so a user can only post where their account can; lookup endpoints enforce workspace ownership.
  • All third-party hosts come from config/trypost.php (platforms.reddit); nothing hardcoded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant