APIEngineeringInfrastructureUnder The HoodRelease Notes
Under the Hood: Deep-Dive API, Infrastructure, and Security Updates
A comprehensive breakdown of the API extensions, infrastructure refactors, security patches, and database fixes deployed across Omniplex and Popplio from v1.0.0 through v1.3.1.
SLEEPY
5h ago
While our recent platform updates focused on front-end features and staff tools, we’ve also been quietly rebuilding, hardening, and expanding the core engines powering Omniplex and Popplio.
From major version releases (v1.0.0 through v1.3.1) to behind-the-scenes database migrations, here is a complete breakdown of every API extension, infrastructure refactor, and security fix deployed across the platform.
Core API Extensions & Entity System
- Multi-Type Entity Packs (
pack_type): Packs are no longer restricted to bots. We added support forserverandemojipacks backed by a newpack_emojisasset table, giving users durably hosted emoji collections. - Server Certification & Premium Perks: Server listings now feature parity with bots. Servers can apply for certification (
request_server_certification), purchase Premium perks, utilize vote blitz cooldowns, and display custom emojis/stickers directly on listing pages (show_emojis). - Standalone Support Ticket API: Built a native, web-first ticket system running on pure HTTP endpoints (
GET /tickets/topics,POST/GET /users/{id}/tickets,PATCH /tickets/{id}), replacing legacy Discord channel dependencies while generating snowflake-compatible timestamps. - Unified Report System (
popplio/reports): Launched a generic moderation submission endpoint (PUT /users/{uid}/{target_type}/{target_id}/reports) with daily per-user rate limits, anonymous reporting pipelines, and internal RPC management tools. - Trending & Discovery Endpoints: Added
?sort=trendingsupport to/bots/@alland/servers/@all(ranked by 7-day net votes), alongsideGET /servers/@emojisfor bulk emoji browsing. - Expanded Stats & Transparency: Added
GET /list/statsparameters (total_banned_users,total_vote_banned_bots,total_pending_bots,total_denied_bots) and public report statistics (GET /reports/stats).
Infrastructure, Bot Architecture & Performance
- Infernoplex Ported to Go: Merged the standalone Rust server-tracking bot into Popplio’s primary Go codebase (
infernoplex/). It now manages server setup wizards, invite tracking, vote leaderboards, and background synchronization natively. - In-House Proof-of-Work Vote Captcha: Replaced external third-party captcha dependencies with a custom, stateless, HMAC-signed hashcash challenge system (
popplio/captcha) backed by Redis single-use verification. - Concurrent Entity Resolution: Rewrote
ResolveIndexBotandResolveIndexServerto resolve page results concurrently using Goerrgroup, removing sequential database latency across search and index feeds. - Shared Gateway Proxy Routing: Migrated REST traffic across Popplio and Arcadia to route through the parent company proxy (
https://gateway.nodebyte.host/proxy/discord) using distinctX-Upstream-Authorizationheaders. - Atomic Redis Operations: Replaced non-atomic checks with
SetNXfor OAuth2 code redemption and fixed JSON serialization bugs on status caching layers.
Security Patches & Hierarchy Protections
- Bot Account Staff Hard-Gating (
perms.ErrBotAccount): Bot accounts are explicitly blocked from holding staff permissions, rank lookups, or executing staff RPC actions across both database reads and live session checks. - Staff Command Hierarchy Enforcement: Staff bot commands (
/kick,/ban,/timeout,/warn) perform strict rank evaluation viaperms.LoadStaff(...).Rank(), rejecting any attempt to act against equal or higher-ranking staff members. - HMAC Webhook Signatures: Introduced standard
hmac_authpayload signing (X-Webhook-Signature: sha256=<hex>), providing a cleaner verification alternative to double-HMAC Splashtail body encryption. - Sanitized API Errors: Stripped raw internal Go error strings (
error.Error()) from API responses, logging detailed stack traces server-side while presenting clean, sanitized messages to clients.
Database Migrations & Critical Bug Fixes
- Team Removal Safety Check: Corrected an inverted owner check in
DELETE /teams/{tid}/members/{mid}that previously blocked standard member removals while allowing solitary team owners to accidentally abandon teams. - Foreign Key Resync Order: Resolved crash loops in
StaffResyncby enforcing user record existence checks prior to attemptingstaff_memberstable inserts. - Notification Persistence Inversion: Fixed
PushNotificationlogic whereNoSaveinverted storage behavior, restoring persistent in-app notifications for perk redemptions and purchases. - OpenAPI Security Definitions: Registered missing
serverandteamauth schemes in OpenAPI specifications to fix schema generator crashes on developer documentation builds. - Database Schema Alignments: Migrated
servers.extra_linksfromtext[]tojsonb, added foreign key constraints to support data export/deletion tasks, and normalized legacy ticket JSON arrays.