Skip to content

At a glance

Audience
Operators
Type
How-to and reference
Before you start
A running Stratos service and a service DID for the feed generator
Status
current

At a glance

Audience
Operators
Type
How-to and reference
Before you start
A running Stratos service and a service DID for the feed generator
Status
current

Run the feed generator ​

The feed generator turns boundaries into feeds. It copies each new post into a local projection as the post arrives. When a viewer asks for a feed, it checks the viewer's enrollment first.

The feed generator is a separate service. It follows one Stratos service, keeps a bounded copy of recent posts, and serves that copy as feeds.

The current implementation is the Rust stratos-feedgen-ng package. The older TypeScript stratos-feedgen package stays in the repository for rollback only. Its settings and its storage layout do not apply here.

This page is for operators. For the design, read Feed generator design. For attachment downloads from a client, read Private feed attachments.

What it serves ​

RouteAuthPurpose
GET /xrpc/zone.stratos.feedgen.getFeedService-auth JWTPosts from one feed, newest first
GET /xrpc/zone.stratos.feedgen.getBlobService-auth JWTOne attachment of one indexed post
GET /xrpc/zone.stratos.feedgen.describeFeedNoneThe service DID and the feed list
GET /.well-known/did.jsonNoneThe feed generator's DID document
GET /healthNoneReadiness and sync status

describeFeed is public. It returns every feed ID with its boundary identifier, display name, and description. Do not put anything secret in a feed definition.

The service listens on 0.0.0.0 at FEEDGEN_PORT. There is no /ready route and no /metrics route.

How posts get in ​

Posts arrive on two paths. The path depends on custody: who holds the author's records.

1How posts get in
1 · 2345StratosauthorityMember's PDSkeeps its own postsFeed generatorreads and verifiesLocal copyencrypted, bounded

Stratos-custody authors ​

The feed generator opens one service-level zone.stratos.sync.subscribeRecords stream. That stream reports who enrolls, who leaves, and whose boundaries change. The feed generator stores that list.

A pool of connections then reads each enrolled author's own stream. The pool holds 8 connections by default. Authors take turns on a connection, so the pool can cover more authors than it has connections.

The feed generator keeps only zone.stratos.feed.post records. It keeps a boundary on a post only when the post names that boundary and the author is currently enrolled in it. A post left with no boundary is deleted.

Stratos sends each commit as one frame of up to 200 writes. The feed generator stores all of a frame's posts and moves the author's cursor in one step, or does neither. A frame is at most 2,359,296 bytes, the most Stratos sends. Each connection holds one frame at a time: up to 18 MiB of frames at the default 8 connections, and 144 MiB at 64.

A larger frame ends the connection. The cursor does not move, so the next connection meets the same frame and that author's posts stop arriving. The feed generator logs actor_frame_too_large and counts stratos.feedgen.subscription.oversized_frames each time. Stratos refuses to write a commit that large, so the event means that Stratos and the feed generator disagree on the limit. Run versions that agree.

PDS-custody authors ​

Some members keep their records on their own PDS. Every 30 seconds the feed generator does this for each boundary in the feed list:

  1. Get a space credential from Stratos.
  2. Ask Stratos for the members of the space with zone.stratos.space.listRepos.
  3. For each member with pds custody, read com.atproto.space.listRepoOps from the host that Stratos names, or read the whole repo with com.atproto.space.getRepo when that is not possible.

Up to four members sync at once. Each member's state is checked before it becomes readable. See Verified sync of PDS members.

A post from a PDS gets the boundary of the space it was read from. A boundary written inside the post is ignored.

Verified sync of PDS members ​

The feed generator keeps a verified state for each member and space. The state is the last verified revision, a set-hash state, and the CID at every record path. A member's posts are readable only from a state that was verified.

What one cycle does ​

Each member's cycle runs in this order. The whole cycle, including the wait for the member's lock, has a deadline of 60 seconds.

  1. Get a space credential for the boundary, or reuse the one held.
  2. Read the verified state. If the member has none, or the stored host or membership generation is not the current one, go to step 6.
  3. Read listRepoOps pages with since set to the verified revision. Each page is its own request with its own one-time key. Every response is authenticated by a MAC. The MAC key comes from HPKE (export only), a one-time key and the member's #atproto_kem key. A MAC mismatch makes the feed generator read the member's #atproto_kem key again and send the request once more. If the key is unchanged, or the second request also fails the check, the member fails. The poll ends at the first page that carries no cursor.
  4. Apply the ops of all pages in memory to the verified state, and compute the set hash.
  5. Promote only when the set hash equals the data of the last page's commit. The write is one transaction. A poll that changes nothing and ends at the stored revision writes nothing. Nothing is staged: a failed check leaves the stored state as it was.
  6. Read the whole repo as an archive (getRepo, authenticated the same way) and replace the member's state, again only when the set hash equals the commit's data.

The feed generator reads the whole repo when:

  • the member has no verified state yet;
  • the stored host or membership generation is not the current one;
  • the last commit's revision is below the verified revision;
  • the ops do not follow the stored records, or the set hash does not equal the commit's data;
  • the host answers InvalidCursor with status 400 to a page request;
  • a poll passes a limit in the table below;
  • a post, like or repost changed with no value in the op.

Only one whole-repo read runs at a time across all members. After a failed whole-repo read, that member has no whole-repo read for 10 minutes (SPACE_REPLACEMENT_COOLDOWN). The cooldown is in memory. Incremental polls continue during it.

A RepoNotFound answer with status 400 from the member's host clears that member's records in that space, and nothing else. The answer carries no MAC. The pinned TLS connection to the host that Stratos named is its only protection, so one answer is not enough. The host must give the same answer for one hour (SPACE_REPO_NOT_FOUND_CONFIRMATION). Until then the member fails as repo_not_found and nothing is changed. When the answer came to a whole-repo read, the passes in the cooldown after it fail as replacement_cooldown instead. The first pass that gets the answer an hour or more after the first one clears the member and counts it as cleared. Any other end of that member's cycle, a good poll or another failure, starts the hour again. A pass that the cooldown turns away before it asks the host does not. The hour also starts again when the answer comes from another host than the one before, when the member left the space and joined again, or when the answer comes more than 20 minutes (SPACE_REPO_NOT_FOUND_MAX_GAP) after the one before it, for example after passes that could not list the members. With the cooldown, answers to whole-repo reads come about 10 minutes and a pass apart, inside that wait. The hour is kept in memory, so a restart starts it again. Any other failure leaves the stored rows as they were.

A host answer of RepoTakendown, RepoSuspended or RepoDeactivated fails the member and deletes nothing. The cached posts of that member stay served.

Limits ​

LimitValueConstant
Ops in one poll, and ops in one page request1,000MAX_POLL_OPS, MAX_SPACE_PAGE_OPS
Pages in one poll1,000MAX_POLL_PAGES
Page bodies in one poll, and one page response16 MiBMAX_SPACE_POLL_BODY_BYTES
Records of one member in one space20,000MAX_SPACE_REPO_RECORDS
Record paths in the store, all members and spaces500,000MAX_SPACE_VERIFICATION_ROWS
Whole archive16 MiBMAX_SPACE_ARCHIVE_BYTES
One record in an archive1 MiBMAX_SPACE_ARCHIVE_VALUE_BYTES
Archive metadata, and one archive key64 KiB, 4 KiBMAX_SPACE_ARCHIVE_META_BYTES, MAX_SPACE_ARCHIVE_KEY_BYTES
Decoded JSON values one member's cycle may hold2,000,000MAX_SPACE_CYCLE_VALUES
One serialized projected record64 KiB. A larger one is removed.MAX_SPACE_RECORD_BYTES
One member's whole cycle60 secondsSPACE_TARGET_DEADLINE
One page request, and one archive request10 seconds, 60 secondsREQUEST_TIMEOUT, ARCHIVE_REQUEST_TIMEOUT
No whole-repo read after a failed one10 minutesSPACE_REPLACEMENT_COOLDOWN
Members held in the lock list and in the cooldown list4,096 eachMAX_TARGET_LOCKS
Members syncing at once4MAX_TARGET_CONCURRENCY
Time between passes30 secondsDEFAULT_INTERVAL

A poll that passes the ops, pages or body limit recovers from the whole repo. A member that passes any other limit is a failed target. The store is never left truncated. The path rows do not count against the projection budget, and retention never deletes them.

The size budget and the write reserve ​

FEEDGEN_PROJECTION_MAX_BYTES is the budget for published posts and interactions. Each compaction pass brings published bytes to that maximum less FEEDGEN_SPACE_WRITE_RESERVE_BYTES, or under. That leaves the reserve free for verified space writes. A space write that would push the projection over the whole maximum is refused with the reason repo_over_budget. It changes nothing and evicts nothing.

FEEDGEN_SPACE_WRITE_RESERVE_BYTES is optional. It defaults to half of FEEDGEN_PROJECTION_MAX_BYTES. It must be a whole number above zero and below the maximum, or the feed generator does not start. The ephemeral profile has a fixed 16 MiB maximum, so its default reserve is 8 MiB.

The four settings FEEDGEN_STAGE_TARGET_MAX_ROWS, FEEDGEN_STAGE_GLOBAL_MAX_ROWS, FEEDGEN_STAGE_TARGET_MAX_BYTES and FEEDGEN_STAGE_GLOBAL_MAX_BYTES are not read. A set one is ignored.

The database file ​

The store is at schema version 12. Migration 10 deletes every post and suppression marker whose URI is not a Stratos-custody URI, every interaction whose URI or subject is not one, and the record takedown subjects of those URIs. It empties the four staged-page tables and the space cursor table. It resets the label cursor, so the feed generator reads the label log again from the start, and it creates the tables of verified state. Migration 11 drops the four staged-page tables, the space cursor table and the triggers on the staged-page tables. Migration 12 records with the label cursor the boundaries it was read under, and keeps a row for every lifted takedown. An existing cursor has no record, so the first poll after the upgrade reads the label log again from the start, once. An older binary refuses a migrated file, so the only way back is the copy made before the upgrade. The effects and the steps are in November upgrade and rollback.

Pass output and reasons ​

GET /health reports pdsSpaceSyncLastPass with the counts of the last pass. The same counts are logged as event=pds_space_sync_pass. The members are boundaries, membershipFailures, targets, promoted, unchanged, replaced, cleared, deferred and targetFailures.

MemberCounts
boundariesBoundaries the pass handled
membershipFailuresBoundaries whose member list failed
targetsMembers the pass started a cycle for
promotedMembers whose ops were proven and written
unchangedMembers already at the revision the host reports
replacedMembers whose state a whole-repo read replaced
clearedMembers whose records were cleared because their host answered RepoNotFound for an hour
deferredMembers whose DID document lookup did not complete, or answered an error other than not found; no failure is counted
targetFailuresMembers that failed

A member whose cycle a membership change or a moved base interrupted starts again in the next pass. It counts only in targets. It is not a failure.

A failed member logs event=pds_space_target_failed kind=<reason>. A failure with the reason member_generation logs no line of its own, and it is not counted in targets. A pass with failed members logs one event=pds_space_target_failures line with <reason>=<count> pairs, which counts every reason. The reason is one of 27 fixed words. No host text reaches a log line.

ReasonMeaning
invalid_space_mac, invalid_space_uri, invalid_credential, bad_space_audienceThe host answered with that error name
repo_not_foundThe host answered RepoNotFound with a status other than 400, or with status 400 not yet for an hour
repo_takendown, repo_suspended, repo_deactivatedThe host answered that account status. Nothing is deleted
invalid_cursorThe host answered InvalidCursor other than as a status 400 to a page
macA response failed the MAC check, after the one retry
kem_keyThe member's DID document has no usable #atproto_kem key, or is not found. No request is sent to the host
record_refusedA record value could not be admitted or held to its CID
archiveThe archive was malformed, out of order, or had the wrong metadata
repo_over_budgetA record, row, archive, value or projection budget would be passed
digestThe set hash of a whole-repo read did not equal the commit's data
deadlineThe 60-second deadline passed
replacement_cooldownA whole-repo read was refused because one failed in the last 10 minutes
credentialNo space credential could be obtained
transportThe request did not complete
pageA page could not be read, or an op's revision was out of range
cursor_stalledThe host repeated a page cursor
storeThe store refused the write for another reason
target_capacity, cooldown_capacityThe lock list or the cooldown list is full (4,096)
member_generationThe membership pass gave no generation for the member
taskThe member's task did not finish
otherThe host answered an error name that is not one of the nine it tells apart

The words host, target, stage, page_limit and operation_limit are not reasons of a failed member, and the outcome label of the space sync metric has no member_rejected value. An alert keyed on one of the five as a member's reason, or on member_rejected, never fires. page_limit remains a kind of pds_space_membership_failed, for a membership listing that ran out of pages.

Who can read ​

A client does not hold a token for the feed generator. It asks its own PDS and sets the atproto-proxy header to <feed generator DID>#stratos_feedgen. The PDS forwards the request with a service-auth JWT.

The feed generator accepts the token only when every row holds:

Claim or partRequirement
HeaderAuthorization: Bearer <jwt>
algES256 or ES256K
issThe viewer's DID
audExactly FEEDGEN_SERVICE_DID, with no fragment
expIn the future
lxmThe method the client calls
SignatureVerifies against the #atproto key in the viewer's DID document

Next the feed generator asks Stratos for the viewer's boundaries with zone.stratos.identity.resolveEnrollments. It keeps the answer in memory for 300 seconds. This value is fixed. An enrollment event for the viewer drops the stored answer at once.

The viewer reads a feed only when they hold that feed's boundary. Each returned post lists only the boundaries the viewer also holds.

Storage profiles ​

The default profile keeps nothing

FEEDGEN_STORAGE_PROFILE defaults to ephemeral. That profile is an in-memory database. A restart loses every post and every cursor. Set encrypted-volume for any deployment that must survive a restart.

ProfileWhere data livesKept on restartLimitsUse for
ephemeral (default)Memory onlyNothingFixed: 16 MiB and 1 hourTests
encrypted-volumeSQLCipher file on a diskThe whole projectionYou set them. Both limits are required.Any deployment that must survive a restart

The ephemeral profile uses a fixed all-zero database key. Use it for tests.

The encrypted-volume profile needs all of these:

  • FEEDGEN_SQLITE_PATH: an absolute path for the SQLCipher database.
  • FEEDGEN_STORAGE_KEY_PATH: an absolute path to the storage key file. The key file must not be in the same directory as the database.
  • FEEDGEN_PROJECTION_MAX_AGE_MS: how long a post stays. Use whole seconds.
  • FEEDGEN_PROJECTION_MAX_BYTES: how much the projection can hold.

The feed generator takes a writer lock before it opens the database. The lock stops a second process from writing to the same file. A clean exit releases the lock. A killed process leaves the lock behind. Confirm that no process uses the database, then remove the lock by hand.

A compactor runs at startup and then every 60 seconds. It removes posts past the age limit. It removes the oldest posts when the projection passes the byte limit.

The projection holds posts, their boundaries, the enrollment list, the member list, and sync cursors. It is a copy. You can delete it and let it rebuild. It never grants access by itself. Put it on an encrypted volume and keep it out of backups unless you have approved that.

Key files ​

The storage key file holds 64 hexadecimal characters. A trailing newline is allowed. The feed generator refuses a secret file unless all of these hold:

  • The path is absolute.
  • No part of the path is a symlink.
  • The file is a regular file owned by the user that runs the process.
  • Group and other have no permissions on it. Use mode 0600 or 0400.

The same rules apply to FEEDGEN_SIGNING_KEY_FILE.

Feeds ​

Give the feed list with exactly one of FEEDGEN_FEEDS_FILE, FEEDGEN_FEEDS_JSON, or FEEDGEN_FEEDS_YAML. Zero sources stops startup. Two sources stop startup. A file must end in .json, .yaml, or .yml.

yaml
feeds:
  - id: general
    boundary: did:web:stratos.example.com/general
    displayName: General
    description: Everyone in the service

id and boundary are required. Feed IDs must be unique.

Write the boundary in full: {Stratos service DID}/{name}. The feed generator does not check this at startup. A bare name such as general loads without error. It then matches no viewer, and every request for that feed fails with BoundaryMismatch.

The feed list is read once at startup. Restart the feed generator after you change it. Keep feed IDs stable, because clients send them.

A feed in the list grants nothing. Stratos enrollment decides who reads.

Identity ​

Three settings describe who the feed generator is.

VariableRole
FEEDGEN_SERVICE_DIDThe feed generator's DID
FEEDGEN_PUBLIC_URLThe public base URL clients and PDSs reach
FEEDGEN_PUBLIC_KEY_MULTIBASEThe public half of the signing key

The feed generator serves this DID document at /.well-known/did.json:

json
{
  "@context": [
    "https://www.w3.org/ns/did/v1",
    "https://w3id.org/security/multikey/v1"
  ],
  "id": "did:web:feeds.stratos.example.com",
  "verificationMethod": [
    {
      "id": "did:web:feeds.stratos.example.com#atproto",
      "type": "Multikey",
      "controller": "did:web:feeds.stratos.example.com",
      "publicKeyMultibase": "zQ3sh..."
    }
  ],
  "service": [
    {
      "id": "#stratos_feedgen",
      "type": "NorthskyStratosFeedGen",
      "serviceEndpoint": "https://feeds.stratos.example.com"
    }
  ]
}

Route the DID's host to the feed generator over HTTPS, so that the document resolves.

The published key must match the signing key

The feed generator signs with FEEDGEN_SIGNING_KEY. It publishes FEEDGEN_PUBLIC_KEY_MULTIBASE. Nothing checks that the two belong together. If they differ, the process starts and Stratos rejects every token it signs. Derive the multibase value from the signing key and set both together.

The signing key is a secp256k1 private key written as 64 hexadecimal characters. Give it inline with FEEDGEN_SIGNING_KEY or from a file with FEEDGEN_SIGNING_KEY_FILE. Setting both stops startup. Prefer the file.

FEEDGEN_PUBLIC_URL also forms the attachment URLs in feed responses.

What Stratos needs ​

The feed generator makes five kinds of call to Stratos. Each one carries a token that the feed generator signs with its own key.

CallToken
zone.stratos.sync.subscribeRecordsService-auth JWT, 60 seconds
zone.stratos.identity.resolveEnrollmentsService-auth JWT, 60 seconds
com.atproto.sync.getBlobService-auth JWT, 60 seconds
zone.stratos.space.getSpaceCredentialDelegation JWT, 60 seconds
zone.stratos.space.listReposSpace credential with an HTTP signature

Set up two things on the Stratos service.

A service enrollment for the feed generator. Add the feed generator's DID to the Stratos service enrollments. Grant it every boundary in the feed list. Stratos rejects the sync streams of a service with no boundaries. It sends only records from boundaries the service holds. It issues a space credential only for a boundary the service holds. See Service enrollments.

A Valkey cache. Set STRATOS_VALKEY_URL on the Stratos service. Stratos uses it as the replay store for space credentials. Without it, a Stratos service outside dev mode refuses to issue any space credential. PDS-custody sync then fails on every pass. See Valkey and the replay store.

Space credentials ​

A space credential is a short-lived pass for one space. The feed generator needs one to list members and to read a member's PDS.

The feed generator signs a delegation JWT and sends it to zone.stratos.space.getSpaceCredential. It signs the request with a fresh P-256 key. Stratos returns a credential bound to that key.

The feed generator then presents the credential with three parts: the Authorization: Atproto-Space-Credential header, the Atproto-Space-Audience header, and an HTTP signature over both. The signature carries tag="atproto-space-credential" and covers ("authorization" "atproto-space-audience"). The audience is the Stratos DID for a member list. It is the member's DID for a read from that member's PDS. The delegation names the audience <Stratos DID>#atproto_pds.

The feed generator keeps credentials and their keys in memory only. It holds at most 128. It refreshes a credential five minutes before expiry, or a tenth of its remaining lifetime before expiry when that is shorter. With the default 600-second lifetime that is 60 seconds. It rejects a credential that lasts longer than one hour. The Stratos side of this exchange is described in Permissioned spaces.

Readiness ​

Stream connectsEvery answer appliesStream drops, or a feed read over 2 sAn answer fails; reconnectClosed503 FeedNotReadyRe-checkingevery stored authorOpen/health 200

Feed readiness

  • Closed to Re-checking: Stream connects
  • Re-checking to Open: Every answer applies
  • Open to Closed: Stream drops, or a feed read over 2 s
  • Re-checking to Closed: An answer fails; reconnect

Feeds start closed. They open only after two things happen in order:

  1. The service-level stream to Stratos connects.
  2. The feed generator asks Stratos again about every author in its stored enrollment list, and every answer applies without error.

A dropped stream closes feeds at once. The feed generator reconnects with a delay that doubles from 1 second up to 60 seconds. Every reconnect repeats the check in step 2 before feeds open again. A failed check or a failed author stream also ends the session and forces a reconnect.

A feed read that takes longer than 2 seconds also closes feeds. They stay closed until the service-level stream next reconnects and the check passes. /health then shows feedReady: false and serviceStreamConnected: false.

Feeds also close while the label log is read again from the start. That happens when a boundary joins the label scope: a new feed, or a wider service enrollment of the feed generator DID. It also happens once after the upgrade to store version 12. Feeds reopen when the read reaches the head. The moderation labels section of stratos-feedgen-ng/README.md has the details.

While feeds are closed, getFeed and getBlob return 503 FeedNotReady. The feed generator does not serve from a projection it cannot vouch for.

The health route ​

GET /health returns 200 when feeds are open and 503 when they are closed.

json
{
  "ok": true,
  "feedReady": true,
  "version": "0.1.0",
  "serviceStreamConnected": true,
  "actorPoolSize": 0,
  "pdsSpaceSyncHealthy": true,
  "pdsSpaceSyncLastPass": {
    "boundaries": 3,
    "membershipFailures": 0,
    "targets": 12,
    "promoted": 2,
    "unchanged": 10,
    "replaced": 0,
    "cleared": 0,
    "deferred": 0,
    "targetFailures": 0
  }
}
FieldMeaning
ok, feedReadyFeeds are open. Both fields carry the same value.
serviceStreamConnectedThe service-level stream to Stratos is up.
actorPoolSizeAlways 0. The field is kept for compatibility.
pdsSpaceSyncHealthyThe last PDS pass ended under 90 seconds ago with no failures.
pdsSpaceSyncLastPassCounts from the last PDS pass. Absent before the first pass.

The status code follows feedReady only. A failing PDS sync does not turn /health to 503. Watch pdsSpaceSyncHealthy separately.

/health tells you the gate is open. It does not tell you that a viewer can read. Make an authenticated feed request before you route users to a new instance.

Request limits and errors ​

The feed generator handles four getFeed and getBlob requests at a time, counted together. A fifth request gets 503 FeedNotReady straight away. Token checks, boundary lookups, and feed reads each have a 2 second limit.

getFeed takes feed (required), limit (1 to 100, default 50), and cursor. The query string can be up to 8 KiB. feed can be up to 256 bytes. cursor can be up to 4 KiB.

StatusErrorCause
401AuthMissingNo Authorization header
401InvalidTokenNot a Bearer token, malformed JWT, or unsupported algorithm
401BadJwtTypeAn access, DPoP, or refresh token was sent
401ExpiredTokenexp has passed
401BadJwtAudienceaud is not FEEDGEN_SERVICE_DID
401BadJwtLexiconMethodlxm is missing or not a feed generator method
401CouldNotResolveIssuerThe viewer's DID document did not resolve
401BadJwtSignatureThe signature does not match the viewer's key
400InvalidRequestA parameter is missing, too long, or out of range
400UnknownFeedThe feed ID is not in the feed list
400BoundaryMismatchThe viewer is enrolled but does not hold this feed's boundary
503FeedNotReadyFeeds are closed, the request limit is reached, or a time limit passed
503FeedNotReadyThe viewer has no enrollment, or Stratos did not answer the lookup

Note the last row. A viewer who is not enrolled at all gets 503 FeedNotReady, not an authorization error. The response does not reveal whether the viewer is unknown or Stratos is unreachable.

Every response carries Cache-Control: private, no-store and Vary: Authorization. Attachment errors are listed in Private feed attachments.

Private networks ​

Identity lookups use https://plc.directory by default. Set PLC_DIRECTORY to the HTTPS origin of another PLC directory. For a PLC directory on a private network, also set PLC_DIRECTORY_PRIVATE_CIDRS.

To poll a PDS on a private network, set both FEEDGEN_SPACE_SYNC_PRIVATE_HOST_ORIGIN and FEEDGEN_SPACE_SYNC_PRIVATE_HOST_CIDRS. The first is the exact HTTPS origin of that PDS. The second lists the private ranges it can resolve to. This grant covers that one origin. It is separate from the PLC grant.

The feed generator rejects mixed public and private DNS answers, private addresses outside the listed ranges, and redirects.

Metrics and logs ​

Metrics are off by default. Set FEEDGEN_OTLP_METRICS_ENDPOINT to push them to an OpenTelemetry Collector over OTLP/HTTP. The feed generator does not expose a metrics route to scrape.

The endpoint must be a private IP address or the host name collector. Its path must be /v1/metrics. A public host, credentials, or a query string stops startup. Metric names and their meaning are listed in stratos-feedgen-ng/README.md.

Logs go to standard error as event=<name> key=value lines. There is no log level setting. Useful events:

EventMeaning
service_reconciliation_completedThe readiness check ran. Check errors.
service_stream_connect_failedThe stream to Stratos did not connect.
service_stream_session_endedThe stream dropped. kind gives the reason.
actor_frame_too_largeAn author's frame was over the frame limit.
pds_space_sync_passOne PDS pass ended. Check healthy.
pds_space_membership_failedA member list failed. kind gives the stage.
pds_space_target_failedOne member's sync failed. kind is a reason.
pds_space_target_failuresThe failed members of a pass, by reason.

Configuration reference ​

Every variable the feed generator reads is in this table.

VariableRequiredDefaultNotes
FEEDGEN_SERVICE_DIDYesThe feed generator's DID
FEEDGEN_PUBLIC_URLYesPublic base URL
FEEDGEN_PUBLIC_KEY_MULTIBASEYesMust match the signing key
FEEDGEN_SIGNING_KEYOne of the two64 hexadecimal characters, secp256k1
FEEDGEN_SIGNING_KEY_FILEOne of the twoPath to a file with the same value
STRATOS_SERVICE_URLYesURL the feed generator uses to reach Stratos
STRATOS_SERVICE_DIDYesDID of the Stratos service
STRATOS_PUBLIC_URLNoSTRATOS_SERVICE_URLPublic URL of Stratos, when it differs
FEEDGEN_FEEDS_FILEOne of the threePath to a .json, .yaml, or .yml feed list
FEEDGEN_FEEDS_JSONOne of the threeInline JSON feed list
FEEDGEN_FEEDS_YAMLOne of the threeInline YAML feed list
FEEDGEN_PORTNo3000Listening port
FEEDGEN_STORAGE_BACKENDNosqlitesqlite is the only accepted value
FEEDGEN_STORAGE_PROFILENoephemeralephemeral or encrypted-volume
FEEDGEN_SQLITE_PATHWith encrypted-volumeAbsolute database path
FEEDGEN_STORAGE_KEY_PATHWith encrypted-volumeAbsolute key path, outside the database directory
FEEDGEN_WRITER_LOCK_PATHNo<database path>.writer-lockAbsolute lock path
FEEDGEN_PROJECTION_MAX_AGE_MSWith encrypted-volumeWhole seconds, at least 1000
FEEDGEN_PROJECTION_MAX_BYTESWith encrypted-volumePositive number of bytes
FEEDGEN_SPACE_WRITE_RESERVE_BYTESNoHalf of the byte limitBytes kept free for space writes. Above 0, below the limit.
FEEDGEN_ACTOR_SYNC_MAX_CONNECTIONSNo8Author stream connections, 1 to 64
FEEDGEN_OTLP_METRICS_ENDPOINTNoOffPrivate OTLP/HTTP endpoint ending in /v1/metrics
PLC_DIRECTORYNohttps://plc.directoryPLC directory origin
PLC_DIRECTORY_PRIVATE_CIDRSNoPrivate ranges allowed for the PLC directory
FEEDGEN_SPACE_SYNC_PRIVATE_HOST_ORIGINNo, set with the next oneExact HTTPS origin of one private PDS
FEEDGEN_SPACE_SYNC_PRIVATE_HOST_CIDRSNo, set with the previousPrivate ranges allowed for that PDS

The ephemeral profile ignores the age and byte variables and uses its fixed limits. FEEDGEN_STAGE_TARGET_MAX_ROWS, FEEDGEN_STAGE_GLOBAL_MAX_ROWS, FEEDGEN_STAGE_TARGET_MAX_BYTES and FEEDGEN_STAGE_GLOBAL_MAX_BYTES are not read. A set one is ignored.

The rehearsal compose file also reads FEEDGEN_STATE_DIR and FEEDGEN_STORAGE_KEY_FILE. Those are host paths for bind mounts. The feed generator binary does not read them.

Settings from the TypeScript package have no effect here. That includes FEEDGEN_BOUNDARY_CACHE_*, FEEDGEN_BOUNDARY_CATALOG_*, FEEDGEN_BLOB_CACHE_*, FEEDGEN_POSTGRES_*, FEEDGEN_SUBSCRIBE_ENROLLMENTS, and FEEDGEN_MEMBERSHIP_SQLITE_PATH.

Run it ​

The rehearsal compose file is stratos-feedgen-ng/compose.rehearsal.yml. It runs the container with 1 vCPU, 512 MiB, a read-only root filesystem, and no Linux capabilities. It uses the encrypted-volume profile. See Deployment examples for the commands.

Before you route users to an instance:

  1. Fetch /.well-known/did.json through the public URL.
  2. Check that /health returns 200 and pdsSpaceSyncHealthy is true. With members who have pds custody it is false until their hosts accept the at:space/ spelling. See What cannot work yet.
  3. Make an authenticated getFeed request as an enrolled test viewer.

See stratos-feedgen-ng/README.md for the space credential transport, the space sync limits, and the metric list. See stratos-feedgen-ng/CUTOVER.md for a test switch and rollback, and November upgrade and rollback for the upgrade. Do not reuse the TypeScript service's database or writer lock.