-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
111 lines (103 loc) · 6.53 KB
/
Copy path.env.example
File metadata and controls
111 lines (103 loc) · 6.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# ---- HTTP server ----
FEEDGEN_PORT=3000
FEEDGEN_LISTENHOST="localhost"
# ---- storage ----
# Postgres holds the like graph + lazily-hydrated post metadata.
FEEDGEN_DATABASE_URL="postgres://postgres:postgres@localhost:5432/foryou"
# Redis holds the short-lived per-viewer ranked-list cache.
FEEDGEN_REDIS_URL="redis://localhost:6379"
# ---- ingestion ----
# Jetstream: a lightweight JSON firehose. We subscribe only to app.bsky.feed.like.
# Alternatives: wss://jetstream1.us-east.bsky.network/subscribe
FEEDGEN_JETSTREAM_ENDPOINT="wss://jetstream2.us-west.bsky.network/subscribe"
# Public AppView used to hydrate candidate post metadata (createdAt/likeCount/labels).
FEEDGEN_PUBLIC_APPVIEW_URL="https://public.api.bsky.app"
# Reconnect delay (ms) for the jetstream websocket.
FEEDGEN_SUBSCRIPTION_RECONNECT_DELAY=3000
# Hours of like edges + post metadata to retain before pruning.
FEEDGEN_RETENTION_HOURS=72
# How long (seconds) before re-importing a viewer's like history on first
# request. Makes existing accounts personalized instantly. Default 6h.
FEEDGEN_BACKFILL_TTL_SECONDS=21600
# On a viewer's first request we import a bounded first slice of their recent
# likes INLINE so that first load is already personalized, then top up to the
# full seed (FEEDGEN_SEED_LIMIT) in the background. The inline slice is bounded by
# count (one listRecords page) and wall-clock so it can't exceed the AppView's
# feed-fetch timeout; if the viewer's PDS is slow past the deadline we serve the
# cold-start feed and the backfill lands (personalizing) on the next load.
# Keep the deadline safely below the AppView timeout (~3s for bsky's AppView).
# FEEDGEN_INLINE_BACKFILL_LIMIT=100 # most-recent likes imported inline
# FEEDGEN_INLINE_BACKFILL_DEADLINE_MS=1500 # max wait before serving cold-start
# Background co-liker backfill: on a viewer's first load, import the historical
# likers of their recent seed posts (app.bsky.feed.getLikes) to densify the
# graph beyond what live ingestion has seen. Bounded per viewer (once per
# backfill TTL), per post (skipped once well-covered), and in depth (only likes
# within the retention window). Set to false to disable.
# FEEDGEN_COLIKER_BACKFILL=true
# FEEDGEN_COLIKER_BACKFILL_SEED_POSTS=50 # top-N recent seed posts to densify
# FEEDGEN_COLIKER_BACKFILL_MAX_PAGES=3 # getLikes pages per post (×100 likers)
# ---- identity / publishing ----
# Hostname this service is reachable at over HTTPS (used for did:web).
FEEDGEN_HOSTNAME="example.com"
# DID of the account that publishes the feed generator record.
# Resolve yours at https://bsky.social/xrpc/com.atproto.identity.resolveHandle?handle=${YOUR_HANDLE}
FEEDGEN_PUBLISHER_DID="did:plc:abcde...."
# Only set if you want a service DID other than did:web:${FEEDGEN_HOSTNAME}
# FEEDGEN_SERVICE_DID="did:plc:abcde..."
# rkey of the main published generator record; must match what you publish.
FEEDGEN_FEED_SHORTNAME="for-you"
# Optional content-typed variants (same graph, filtered to images / video).
# Set these to the rkeys you publish for those feeds.
# FEEDGEN_IMAGE_FEED_RKEY="for-you-photos"
# FEEDGEN_VIDEO_FEED_RKEY="for-you-videos"
# DID of the "picker" account hosting the onboarding interest posts. Likes on its
# posts are exempt from the retention sweep so they stay durable seed hubs. Unset
# disables the exemption.
# FEEDGEN_PICKER_DID="did:plc:..."
# ---- interest posts tool (src/tools/createInterestPosts.ts) ----
# Credentials for `npm run createInterestPosts`, which idempotently creates one
# interest post per onboarding interest on the picker account (the social-app
# likes these during onboarding). Env-only in production - the eurosky-infra
# foreu role passes these into the app container; prompts interactively if unset.
# PICKER_HANDLE="picker.example.social"
# PICKER_PASSWORD="<app password>"
# PICKER_SERVICE="https://bsky.social"
# ---- ranker engine ----
# "graph" = in-memory like graph (fast; default). "postgres" = per-request
# Postgres CTE (simpler, slower).
FEEDGEN_RANKER="graph"
# Graph memory layout: "csr" = typed-array CSR + arena interners (default, more
# compact). "arrays" = Map-based (simpler, heavier).
# FEEDGEN_GRAPH_LAYOUT="csr"
# Hours of like history held in RAM (≤ FEEDGEN_RETENTION_HOURS). Defaults to it.
# FEEDGEN_GRAPH_WINDOW_HOURS=72
# Periodic full rebuild from Postgres (refresh + retention + deletes). Default 2h.
# FEEDGEN_GRAPH_REBUILD_INTERVAL_MS=7200000
# Guards: max likers scanned per seed post (viral), and total edge-visit budget.
# FEEDGEN_GRAPH_SEED_LIKER_SCAN_CAP=20000
# FEEDGEN_GRAPH_MAX_EDGE_VISITS=3000000
# ---- ranking knobs (optional; defaults set in src/index.ts) ----
# FEEDGEN_SEED_LIMIT=400 # N most-recent likes used as the seed
# FEEDGEN_MAX_CURATORS=1000 # users who liked your seed posts
# FEEDGEN_MAX_LIKES_PER_CURATOR=100 # top-N recent likes considered per curator
# FEEDGEN_CANDIDATE_WINDOW_HOURS=24 # a candidate's like must be this recent
# FEEDGEN_FRESHNESS_HOURS=24 # drop posts created older than this
# FEEDGEN_HALF_LIFE_HOURS=6 # post-age time-decay half-life
# FEEDGEN_CANDIDATE_RECENCY_HALFLIFE_HOURS=12 # like-recency half-life at candidate selection (0=off)
# FEEDGEN_SMOOTHING=0.5 # path-count exponent (boosts multi-path posts)
# FEEDGEN_POPULARITY_PENALTY=0.3 # score /= likeCount^penalty
# FEEDGEN_CURATOR_BRANCHING_POWER=1 # normalization (0 = off)
# FEEDGEN_ITEM_BRANCHING_POWER=1 # normalization (0 = off)
# FEEDGEN_CORATER_DECAY=0 # discount a curator's older likes (0 = off)
# FEEDGEN_SEED_RECENCY_MIN_WEIGHT=0.1 # down-weight recent likes (1 = uniform)
# FEEDGEN_MIN_ELIGIBLE_RATERS=0 # min distinct curators per candidate
# FEEDGEN_MAX_CANDIDATES=500 # how many top candidates to hydrate
# FEEDGEN_MEDIA_CANDIDATE_MULTIPLIER=8 # image/video feeds over-generate ×N so
# # enough survive the media filter
# FEEDGEN_MAX_FEED_SIZE=1000 # cached ranked-list length
# FEEDGEN_INCLUDE_REPLIES=false # true to include replies
# FEEDGEN_PER_AUTHOR_CAP=3 # diversification: max posts per author
# FEEDGEN_AUTHOR_MIN_GAP=3 # diversification: min slots between an author's posts (0 = off)
# FEEDGEN_CACHE_TTL_SECONDS=600 # per-viewer ranked-list cache TTL
# FEEDGEN_HYDRATION_TTL_HOURS=1 # trust a cached post_meta row this long before re-fetching from the AppView
# FEEDGEN_POPULARITY_CACHE_TTL_SECONDS=120 # cold-start popularity list computed at most this often, shared across viewers (stale-while-revalidate)