File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ VIEWS_IP_SALT=
3737# Backend base URL for Custom reverse (local or your own deployment).
3838# CUSTOM_REVERSE_SERVICE_URL=http://localhost:3001
3939
40+ # Free tier: Deep Reverse + Manual Control combined runs per calendar month (UTC).
41+ # Set to 0 to block free users entirely (paid subscribers bypass via checkout email header).
42+ # FREE_TIER_CUSTOM_LIMIT=1
43+ # NEXT_PUBLIC_FREE_TIER_CUSTOM_LIMIT=1
44+
4045# --- Stripe checkout (optional: “Get Unlimited” on rate limit) ---
4146# Server-side Checkout Session — success URL is set in code (?session_id={CHECKOUT_SESSION_ID}).
4247# STRIPE_SECRET_KEY=sk_live_... # or sk_test_... for test mode
Original file line number Diff line number Diff line change @@ -18,7 +18,10 @@ const GITREVERSE_HISTORY_MAX = 20;
1818const HISTORY_PROMPT_PREVIEW_LEN = 160 ;
1919
2020const RL_KEY_MONTHLY = "gr_rl_monthly" ;
21- const MONTHLY_CUSTOM_LIMIT = 1 ;
21+ const MONTHLY_CUSTOM_LIMIT = Math . max (
22+ 0 ,
23+ parseInt ( process . env . NEXT_PUBLIC_FREE_TIER_CUSTOM_LIMIT ?? "1" , 10 )
24+ ) ;
2225const SUBSCRIBER_EMAIL_KEY = "gr_subscriber_email" ;
2326const PENDING_REDIRECT_KEY = "gr_pending_redirect" ;
2427const CHECKOUT_NAVIGATION_STATE_KEY = "gr_checkout_navigation_state" ;
@@ -1153,9 +1156,18 @@ export function ReversePromptHome({
11531156 role = "alert"
11541157 >
11551158 < div className = "flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-center sm:justify-between" >
1156- < p className = "text-sm font-semibold text-zinc-900" >
1157- You've hit this month's limit.
1158- </ p >
1159+ < div className = "min-w-0 flex-1" >
1160+ < p className = "text-sm font-semibold text-zinc-900" >
1161+ { MONTHLY_CUSTOM_LIMIT === 0
1162+ ? "Deep Reverse and Manual Control are for paid subscribers only."
1163+ : "You've hit this month's limit." }
1164+ </ p >
1165+ { MONTHLY_CUSTOM_LIMIT === 0 ? (
1166+ < p className = "mt-1 text-xs text-zinc-600" >
1167+ We don't have capacity to offer free runs right now.
1168+ </ p >
1169+ ) : null }
1170+ </ div >
11591171 < div className = "flex flex-wrap items-center gap-2" >
11601172 { PAYMENT_LINK ? (
11611173 < Link
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ import { getSupabase } from "@/lib/supabase";
44import { checkActiveSubscriber } from "@/lib/subscriber" ;
55import { SUBSCRIBER_EMAIL_HEADER } from "@/lib/subscriber-constants" ;
66
7- const MONTHLY_LIMIT = 1 ;
7+ const MONTHLY_LIMIT = Math . max (
8+ 0 ,
9+ parseInt ( process . env . FREE_TIER_CUSTOM_LIMIT ?? "1" , 10 )
10+ ) ;
811const RATE_LIMIT_RPC_TIMEOUT_MS = 2500 ;
912
1013/** Skip DB-backed limits while developing locally or when explicitly opted out. */
You can’t perform that action at this time.
0 commit comments