Implement app creation charges, moderation, and user bans#565
Merged
Conversation
App creation via handleCreate was completely free — no wallet charge. Added CheckQuota + ConsumeQuota (1 credit, OpSocialPost). Also added async moderation: flag.CheckContent runs on name + description after creation. If flagged, the author is auto-banned. GetPublicApps now filters out apps from banned users and flagged apps so spam apps disappear from all listings immediately on ban.
…e usernames Middleware-level write gate: chargedWriteOp(r) maps method+path to a wallet operation. The middleware in main.go runs CanPost, CheckPostRate, CheckQuota, and ConsumeQuota ONCE for all matching routes, with a log line on every charge. Per-handler charging has been stripped from social, blog, apps, work, user/status, and builder handlers — they only do domain logic now. Covers UI, API, and MCP uniformly. Invite-only signup (INVITE_ONLY=true): - auth/invite.go: invite code store (invites.json), create/validate/ consume/list functions. Codes are 32-char hex, single-use. - Web signup checks invite code from URL (?invite=xxx) or form field. Without a valid code, shows "invite only" page. Code persists as a hidden form field across validation errors. - MCP signup tool accepts optional invite param, rejects when invite-only is enabled without a valid code. - Admin console: invite <email> generates code + link, invites lists all. /admin/invite page has a form that creates the invite and emails the link (if mail configured). - Home page: admins see "+ Invite user" link top-right when invite-only mode is on. Username profanity filter (auth/username.go): ValidateUsername blocks obscene substrings (penis, cock, femboy, etc.) and reserved names (admin, system, root). Applied to both web signup and MCP signup. App delete fixes: - renderMenu Delete action now sends POST (not DELETE) to match handlers. Was sending DELETE which didn't match the POST route. - Redirect after delete uses URL-pattern-derived paths (/apps for apps, /social for social, /work for work) instead of the broken document.referrer||'/' which fell back to homepage. - Apps: moderation on create (flag.CheckContent + auto-ban), charging (1 credit via middleware), banned-user filtering in GetPublicApps. 24-hour account age requirement: CanPost now requires accounts to be >= 24 hours old before they can post anything (blog, social, status, apps, work), in addition to email verification. PostBlockReason shows remaining time. https://claude.ai/code/session_01GRGLA9yj7BpqKiyi6xFwnm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.