- Add Ko-fi webhook (/api/webhooks/kofi) with upsert by (provider, external_user_id) • Computes renews_at = timestamp + 1 calendar month + 1 day • Preserves first started_at; stores raw payload; canonicalizes by email when available - Add Ko-fi claim flow • POST /api/support/kofi/claim/start — sends verification email via SMTP • GET /api/support/kofi/claim/verify — finalizes link (sets app_user), redirects to /portal/account • POST /api/support/kofi/unlink — clears app_user on Ko-fi rows - Add derive-on-read membership logic • /lib/memberships.ts — single source of truth for badges & “active” state • /api/support/badges — thin wrapper that returns per-provider badges - Account UI • components/account/SupporterBadges.tsx — renders provider badges (Ko-fi now; extensible) • components/account/ConnectKofi.tsx — “Link Ko-fi” form (email → verify link) • components/account/LinkStatus.tsx — success/error banner on return • app/portal/account/AccountPanel.tsx — integrates badges, link panel, and banner - Config/env • Requires: DIRECTUS_URL, DIRECTUS_TOKEN_ADMIN_SUPPORTER, KOFI_VERIFY_TOKEN • SMTP: SMTP_HOST, SMTP_PORT, SMTP_SECURE, SMTP_USER, SMTP_PASS, EMAIL_FROM • APP_ORIGIN used to build absolute verify URLs - Misc • Fixed import to use @/lib/memberships • No cron required; UI derives active state via status === active && renews_at >= now Refs: beta readiness for Ko-fi supporters
58 lines
2.9 KiB
Text
58 lines
2.9 KiB
Text
# ─────────────────────────────────────────────
|
|
# Public (used by client-side dropdown fetches)
|
|
# ─────────────────────────────────────────────
|
|
NEXT_PUBLIC_API_BASE_URL=https://forms.lasereverything.net
|
|
APP_ORIGIN=https://beta.makearmy.io
|
|
KOFI_VERIFY_TOKEN=baa0aa53-7269-4119-a94f-e1380383e05e
|
|
BG_BYE_UPSTREAM=http://bgbye:7001/remove_background/
|
|
FILES_ROOT=/files
|
|
|
|
# ─────────────────────────────────────────────
|
|
# Server-side Directus
|
|
# ─────────────────────────────────────────────
|
|
DIRECTUS_URL=https://forms.lasereverything.net
|
|
DIRECTUS_TOKEN_ADMIN_REGISTER=l_QqNXKpi--Dt-hHDncHyBX0eiHNYZr7
|
|
DIRECTUS_TOKEN_ADMIN_SUPPORTER=tvd64Ex5OWLEdH8EEM0rjH-gM1p-ZwfY
|
|
DIRECTUS_DEFAULT_ROLE=296a28bc-60ab-4251-8bef-27f6dfb67948
|
|
DIRECTUS_ROLE_MEMBER_NAME=Users
|
|
|
|
# ─────────────────────────────────────────────
|
|
# Files / Folders (IDs only; no folder browsing)
|
|
# ─────────────────────────────────────────────
|
|
DIRECTUS_AVATAR_FOLDER_ID=b8ddddf8-3ee3-4380-b27e-c7a5f01deef1
|
|
|
|
# Settings — CO₂ Galvo
|
|
DX_FOLDER_GALVO_NOTES=7b04a706-754d-4302-a9a0-6c88cd8faddf
|
|
DX_FOLDER_GALVO_PHOTOS=e5535371-828a-498b-80fc-3891b6220fd4
|
|
DX_FOLDER_GALVO_SCREENS=8201e4c0-c39c-456a-bd55-1beb96642bcb
|
|
|
|
# Settings — CO₂ Gantry
|
|
DX_FOLDER_GANTRY_NOTES=926e2c1a-7907-4ef2-b778-859c6f40ba82
|
|
DX_FOLDER_GANTRY_PHOTOS=d19c4f8d-a42f-422d-b113-b89b736c34e6
|
|
DX_FOLDER_GANTRY_SCREENS=9b7d0b47-c1f4-4749-8876-2e4b52ccded0
|
|
|
|
# Settings — Fiber
|
|
DX_FOLDER_FIBER_NOTES=00eed759-480e-43cc-9de3-854dc59cca79
|
|
DX_FOLDER_FIBER_PHOTOS=54f6a9d2-bc57-41fc-8c7d-7c7d7cb9cadc
|
|
DX_FOLDER_FIBER_SCREENS=5c830975-7926-4e01-911c-2443b62d7f88
|
|
|
|
# Settings — UV
|
|
DX_FOLDER_UV_NOTES=8ca37379-7178-48b2-8670-6b8d8a880677
|
|
DX_FOLDER_UV_PHOTOS=c639360b-3116-4b5d-98da-f8b502089486
|
|
DX_FOLDER_UV_SCREENS=a84f54b1-0e92-4ea6-8fbe-37a3a74bd49c
|
|
|
|
# Projects
|
|
DX_FOLDER_PROJECTS_FILES=f264f066-5b38-4335-bb10-5b014bfa62cb
|
|
DX_FOLDER_PROJECTS_IMAGES=da11b876-2ede-4e19-ad3a-76fc9db449a8
|
|
DX_FOLDER_PROJECTS_INSTRUCTIONS=905a4259-0c8e-489b-b810-c27186a2f266
|
|
|
|
# ─────────────────────────────────────────────
|
|
# Mail Server Settings (SMTP)
|
|
# ─────────────────────────────────────────────
|
|
SMTP_HOST=mail.arrmail.net
|
|
SMTP_PORT=465
|
|
SMTP_USER=noreply@makearmy.io
|
|
SMTP_PASS=TZhXn4yQQ92XEf
|
|
SMTP_SECURE=true
|
|
EMAIL_FROM=MakeArmy Support <noreply@makearmy.io>
|
|
|