import env from '#start/env' /** * Who may use the catalog and the Newznab API. * * `open` (the default): as before, one key for Newznab (NEWZNAB_API_KEY, or * none) and an open web catalog, no limits. `accounts`: every request names a * user (a Newznab `apikey`, or the web interface's token), whose tier sets what * they may do per UTC day and how far back they see. */ export const ACCESS = env.get('ACCESS', 'open') /** Who may sign up: anyone, with an unused invite code, or no one. With accounts, invites unless set. */ export const SIGNUP = env.get('SIGNUP', ACCESS === 'accounts' ? 'invite' : 'open') export interface TierLimits { /** Searches and release details per day (Newznab t=search & co., the catalog); null: no limit. */ apiHits: number | null /** NZBs per day; null: no limit. */ grabs: number | null /** How many days back releases are found and fetched; null: everything. */ retentionDays: number | null } /** A tier that runs out (users.tier_until) falls back to `free`. */ export const TIERS: Record = { free: { apiHits: 100, grabs: 10, retentionDays: 365 }, vip: { apiHits: 10_000, grabs: 1_000, retentionDays: null }, // Staff and friends. unlimited: { apiHits: null, grabs: null, retentionDays: null }, }