replication.yml
Every setting of replication.yml.
replication.yml connects Identica to Redis, through which proxies share sessions, logins in progress and other live state. Running several proxies explains what is shared and how to set it up.
Without replication, each proxy keeps that state in its own memory: other proxies do not see it, and it is lost when the proxy restarts.
Takestrue or false
Defaultfalse
Affectswhether Identica connects to Redis
With true, Identica connects to Redis on startup. If Redis cannot be reached, the startup fails and the proxy refuses every player until Redis is back and the proxy restarted.
Warning
Takesa string
Defaulta random id, written on the first start
Affectsthe name of this proxy among the proxies of the network
Give every proxy its own name and keep it. A session records the serverId of the proxy that holds its player, so a login through another proxy disconnects exactly that player, and each proxy tells its own events from those of others by it.
Advanced
Takesa duration of at least "3s"
Default"30s"
Affectshow long the records of a proxy that crashed stay visible to the other proxies
A proxy owns the session of every player connected through it and the hold on the username of every player logging in through it. It renews them every third of this time, every 10 seconds with the default, for as long as it owns them, and removes them as soon as it is done with them. When a proxy stops without removing them, for example when it crashes, its records disappear this long after it stopped. Until then the other proxies still list those sessions, REJECT_NEW still refuses those accounts, and a player from another address is still refused under a username that was being logged in.
Each renewal costs Redis three commands, and every tenth renewal of a session two more. For 1000 online players that is about 360 Redis commands per second with the default. A shorter timeout frees a crashed proxy's accounts and usernames sooner and costs proportionally more commands.
A value below "3s" is refused at startup.
redis
Takesa string
Default""
Affectsthe Redis password
A blank value connects without a password. A Redis ACL user for Identica must be allowed the evalsha and script commands; see A player on two proxies at once.
Takesa number of milliseconds
Default0
Affectshow long a connection to Redis or an answer from it may take
0 waits without limit.
channels
AdvancedThe Redis channels through which proxies tell each other about changes. Every proxy of a network uses the same names; change them only to run several networks on one Redis.
| Channel | Default | Carries |
|---|---|---|
accountUpdates | "identica:accounts" | changes to accounts |
sessions | "identica:sessions" | changes to sessions |
conflicts | "identica:conflicts" | username conflicts |
events | "identica:events" | events other proxies react to, such as an account deleted on one proxy; when blank, sessions is used |
cache
AdvancedThe names under which proxies keep shared state in Redis. Every proxy of a network uses the same names; change them only to run several networks on one Redis.
| Name | Default | Holds |
|---|---|---|
reservations | "identica:reservation" | account reservations shared between proxies |
instructions | "identica:handshake-instructions" | providers' decisions to ask a connecting player for their own login |
pipelineState | "identica:pipeline-state" | logins in progress |
attempts | "identica:provider-attempts" | providers already tried for a username and address |
sessions.records | "identica:sessions:records" | sessions |
sessions.accounts | "identica:sessions:accounts" | the sessions of each account |
sessions.subjects | "identica:sessions:subjects" | the sessions of each provider identity |
Passwords that players type are never written to Redis. While a registration waits for the password to be repeated, Redis holds that password's hash.
Features and providers have names of their own in their settings, such as replication.state of the sentinel.
enabled: true
serverId: "proxy-1"
heartbeatTimeout: "30s"
redis:
host: "redis.internal"
port: 6379
credential: ""
ssl: false
timeout: 5000