PubliraGitHub

Platform defaults and policies

Published Updated

An install runs on a handful of settings that no tenant owns: the language, time zone, and currency new tenants start from, the limits that keep one reader or one address from overwhelming the platform, and how long expiring records are kept. This page says what each group protects against, how to change it, and which parts a tenant's administrators can change for their own tenant.

Every policy and retention value has a built-in default, and an install that saves none runs on those. So do the default time zone, which is UTC until one is saved, and the default currency, which is the one publiractl setup was given, USD when it was given none, and JPY on an install that was running before this release. The default language has none: publiractl setup saved one, and the Platform Console's setup screen replaced it with the language its first operator chose. The range and the built-in default of each value are in the publiractl reference, under policy and Retention periods; this page does not repeat them.

Where the settings are

Each group can be set from the Platform Console or from publiractl, run the way The Platform Console and publiractl describes:

GroupPlatform Consolepubliractl
The default language, time zone, and currencyGeneral, under Platformplatform set, platform show
Two-step verification, whether tenants may issue coins, the sign-in, password, purchase, ticket, mail, reader action, page view, API key, and anonymous read limits, and the disposable email domain listSecurity, under Policiespolicy set, policy show
The comment, report, rating, contact, viewer, and notification settings limitsCommunity, under Policiespolicy set, policy show
How long expiring records are keptRetention, under Policiesretention set, retention show

The Platform Console's sidebar: General under Platform, Email, Storage, Search, and Web Push under Services, and Security, Community, and Retention under Policies.

Both write through the same code. A set command changes only the values its flags name and keeps the rest, and a page in the Platform Console saves every value on it at once. A save that changes nothing is not recorded; any other save is recorded in Audit logs as Updated platform settings, Updated the platform policy, or Updated the retention defaults. The Security, Community, and Retention pages do not overwrite a save they have not seen: if someone saved that page after you opened it, the Platform Console refuses with "Another operator changed these settings, so nothing was saved. Reload and try again." Security and Community are saved as one policy, so a save of either one refuses a stale copy of the other too. The three forms on General settings do not check this: each saves its own value over whatever is stored, and keeps the other values as stored. publiractl reads the stored values just before it writes them, and if another save lands between the two, it exits 1, after which running the same command again applies its flags over that save.

An Operator or a Super admin can save these pages. An Auditor sees the same forms and has the save refused.

Until a policy is saved, the Setup status card on the Platform Console's dashboard reads "The built-in sign-in, abuse-control, and data retention limits apply." That is a working install, not an unfinished one: change a value only when the built-in one does not suit the platform.

Platform defaults

General settings holds three values, each with its own save button.

General settings: Default language with Save default language, Default time zone with Save default time zone, and Default currency, read-only because a tenant that sells in it has a purchase, with Save default currency.

Default language is the language the Platform Console is shown in to an operator who has not chosen one, its sign-in screen included, and the language of the mail the Platform Console sends its operators, such as a password reset. It does not decide any tenant's language: every tenant is given its own default language when it is created, as Tenants describes. The first operator chose this value on the setup screen.

Default time zone is the time zone a new tenant starts on when it is created without one, and the one the Platform Console shows and counts dates in. A tenant keeps the time zone it was created on, so changing the default moves only tenants created afterwards. A tenant's administrators change its time zone from the tenant console. The first operator chose this value on the setup screen, which offered the time zone of their browser.

Default currency is the currency every tenant whose administrators have not saved Payment settings sells in, so it is the currency that tenant's prices are entered and shown in. A tenant that saves its payment settings keeps the currency saved there, and the default no longer reaches it. Find it in the list by its name or by its ISO 4217 code, such as EUR. It cannot change once a tenant that sells in it has sold anything: the field is then read-only and says why, and publiractl refuses the change too, until each such tenant has saved its payment settings with a currency of its own. publiractl setup and the Platform Console's setup screen ask for it when the install is set up, which is the time to choose it.

From the command line:

publiractl platform set --default-locale en --default-timezone America/New_York --default-currency USD

Security

Security policy holds the values that apply to every tenant alike, and that no tenant can change. Each one guards an account, an operation that sends mail, one that touches money, the counts a tenant's rankings are built from, or the tenant console's API.

Two-step verification for tenant administrators

Require multi-factor authentication for tenant administrators (--mfa-required-for-tenant-admin) stops a tenant administrator from signing in to the tenant console with a password alone. An administrator who has not set up an authenticator app is not turned away: after the password, the console shows Set up two-step verification, and signing in finishes only once they have registered one. The screen tells them the tenant requires it, although the requirement is the platform's and a tenant cannot turn it off.

The Require multi-factor authentication for tenant administrators checkbox on Security.

It applies to every tenant at once and only to the Admin role; editors and auditors are never asked. It takes effect at each administrator's next sign-in, not on sessions already open. An administrator cannot turn their authenticator off while it is their last second factor: they add a passkey in the tenant console first. The tenant's site does not turn it off for them at all, since it cannot see their passkeys, so they turn it off in the console.

The Platform Console's own operators are not covered by this setting; the next one is theirs.

Two-step verification for platform operators

Require two-step verification for every Platform Console operator (--mfa-required-for-platform-operator) stops an operator from signing in to the Platform Console with a password alone. An operator who has not set up an authenticator app is not turned away: after the password, the console shows Set up two-step verification, and signing in finishes only once they have registered one and been shown their recovery codes.

The Require two-step verification for every Platform Console operator checkbox on Security.

It covers every role, Auditor included, since every operator can read every tenant's data. It takes effect at each operator's next sign-in, not on sessions already open. While it is on, an operator cannot turn their authenticator off from Account settings. One who has to replace it waits until the setting is turned off, or has theirs removed with publiractl operator reset-mfa and sets a new one up at the next sign-in. It is off until someone turns it on. An install whose publira server has no PUBLIRA_SECRET_ENCRYPTION_KEYS refuses to turn it on, since no operator could set up an authenticator there and nobody could sign in to turn it off again.

Coins issued by tenants

Allow tenants to issue coins (--tenant-coins-allowed) lets tenants issue coins: a balance a tenant's readers buy in advance and spend on that tenant's episodes. It is off until someone turns it on, both on a new install and on one upgraded from a release that did not have it.

The Allow tenants to issue coins checkbox on Security, with the line under it.

Coins are a stored-value instrument, so laws on prepaid payment instruments, electronic money, money transmission, or gift cards may reach them, depending on where you and each tenant are. In some jurisdictions the platform that runs the install, rather than the tenant that sells the coins, is the party those laws look at. Leave it off unless you have established that letting tenants issue coins does not make you the issuer, or have done what being one requires.

Turning it on changes nothing a reader sees: a tenant still has to turn coins on for itself, under Payments › Coins in its console, as Coins describes. Turning it off, by clearing the checkbox or with --tenant-coins-allowed=false, stops every tenant at once, whatever its own setting: no tenant sells coins and no reader spends them, and every reader keeps their balance. Turning it on again gives each tenant back the setting it had saved.

Rate limits

Each limit is a count per minute or per hour, with a second count per day, and the daily count is never lower than the shorter one. A request over a limit is refused until its window has passed. The windows are fixed on the clock, not started by a reader's first request, so a count starts again at the turn of each minute or hour, and a daily count at midnight UTC.

On the Security pageWhat it guards
Password verifications per minute and per dayA reader typing their current password to change it, to change their email address, to delete their account, to add or remove a passkey, or to unlink an Apple or Google account, and a member of staff or an operator typing theirs to change their email address in the tenant console or the Platform Console. Each counts per account, where the tenant's site and its tenant console share one count, and a correct password clears the count, so it slows someone guessing the password of a session they hold, not a person who mistyped once
Email requests per address per hour and per dayMail sent to one address by the forms that send it: reader sign-up and email verification, password resets and email changes in all three apps, staff invitations, administrator invitations and added operators from the Platform Console, and replies to contact messages. An address counts within its own tenant, or within the Platform Console, and an address with a +tag counts as the address without it
Email requests per source per hour and per dayThe same mail counted by the client address that asked for it, across every address and every tenant, so one client cannot mail a long list of strangers
In-app purchase confirmations per reader per minute and per dayStore transactions one reader hands the server to verify with Apple or Google
Wait-for-free ticket uses per reader per minute and per dayOne reader's requests to spend a wait-for-free ticket. A spent ticket is already limited by its series' recharge time; this bounds the refused attempts
Terms agreements per reader per minute and per dayThe agreements one reader sends to their tenant's terms of service and privacy policy when asked to agree to a revised version
Account link requests per reader per minute and per dayOne reader's requests to link an Apple or Google account to their account
Icon changes per reader per minute and per dayThe times one reader uploads, picks, or removes their icon
Passkey actions per reader per minute and per dayThe times one reader begins registering a passkey or confirming a request with one, or renames or removes one
Push notification registrations and removals per reader per minute and per dayThe times one reader turns notifications on or off in a browser or in the tenant's app, or signs out of the app, counted together. A reader keeps at most 20 browsers and devices registered, and one more replaces the one registered longest ago, so this bounds how fast one account can replace them
Checkouts of the rest of a series per reader per minute and per dayThe checkouts of the rest of a series one reader starts
Subscriptions started per reader per minute and per dayThe subscriptions one reader starts, through a checkout on the site or through the store in the tenant's app, counted together
Coin payments per reader per minute and per dayThe episodes one reader pays for with coins
Purchases started per reader per minute and per dayThe purchases of an episode, a volume, or a coin pack one reader starts, on the web or through the app's store, counted together
Promotion code lookups per reader per minute and per dayThe promotion codes one reader has looked up, by a quote or by a purchase started with one, counted together. Each lookup counts before the code is read, so this bounds how fast one account can guess at a tenant's codes
Data download requests per reader per hour and per dayThe copies of their data one reader asks for, as Reader accounts describes. Each one reads every record the install keeps about the reader
Page views recorded per client per minute and per dayThe series and episode pages one client address has opened and had counted, signed in or not. Each view counts toward a tenant's rankings, so this bounds how far one client can move them; a view past the limit is not counted, and the page itself opens as usual
Unsigned payment notifications per client per minute and per dayThe notifications one client address sends one tenant's webhook for a payment provider that does not sign its notifications, as PayPay and Paidy do not, counted for each tenant apart. The install reads each one back from the provider with the tenant's credentials, so this bounds how much of the tenant's allowance at the provider someone else can spend. A notification past the limit is answered 429, which the provider can send again later, and the payment it names is not lost: the install reads every PayPay checkout back by itself, and Paidy's payment page hands its payment over. A notification that names no checkout or payment of the tenant's is refused without asking the provider, whatever the limit
API key requests per key per minute and per dayThe requests one of a tenant's API keys makes to the tenant console's API, counted per key. A key belongs to a system rather than a person, so the limit leaves room for a job reading a catalog page by page, and what it bounds is what one leaked key can cost the database

The rate limits on Security: password verifications, email requests per address and per source, in-app purchase confirmations, wait-for-free ticket uses, and what one reader does, from agreeing to the terms to asking for a copy of their data, the page views one client has recorded, and the requests one API key makes, each per minute or per hour and per day.

Each invitation counts as one request, including every Initial admin emails address on Create tenant, which are all counted before the tenant is created: if one is over a limit, no tenant is created and no mail is sent. publiractl sends through no form and counts against none of these limits.

The client address is the one publira server finds in Forwarded or X-Forwarded-For by stepping over the proxies it trusts, as The proxies Publira trusts describes. Readers behind one shared address, such as an office or a mobile carrier's gateway, share its per-source and per-client counts.

Sign-in attempts

Two more limits guard signing in itself, with a password, to a tenant's site, its tenant console, or the Platform Console. They follow the rate limits on the Security page, and are counted the same way:

On the Security pageFlagsWhat it guards
Sign-in attempts per address per minute and per day--login-attempts-per-account-per-minute and --login-attempts-per-account-per-dayPasswords tried for one address from one client address, or from one browser or app that has signed in to it before. An address counts within its own tenant, where the tenant's site and its tenant console share one count, or within the Platform Console. A sign-in with the right password clears the count where it was made, so it slows someone guessing one account's password, not a person who mistyped
Failed sign-ins per source per hour and per day--login-attempts-per-source-per-hour and --login-attempts-per-source-per-dayFailed sign-ins from one client address, across every address, every tenant, and the Platform Console, so one client cannot try a password against a long list of addresses. A sign-in with the right password does not count against it

The sign-in attempt limits on Security: sign-in attempts per address per minute and per day, and failed sign-ins per source per hour and per day.

An attempt over either limit is refused before the password is checked, and refused the same way whether or not the address has an account, so the refusal tells a guesser nothing about which addresses are registered. The sign-in screen then says "Too many requests in a short time. Please wait a moment and try again." rather than that the email address or password is incorrect, since the password may well have been right. Two-step verification is a separate check after the password, and these limits do not count its codes.

The per-address limit is counted so that someone else's wrong passwords cannot keep the owner out:

  • A browser or app that signs in with the right password is remembered for 90 days, and each sign-in from it starts that again. Its attempts at that address count on their own, so nobody else's guesses use them up.
  • Attempts from anywhere else count per client address, so a script guessing from one client address uses up that client address's count and no other.
  • Every browser and app that has not signed in to the address before also shares one count at that address, ten times the per-address limit, so a script spread over many client addresses is still stopped. Once that count is used up, the owner can still sign in from a browser or app they signed in from before, but not from a new one, until the window passes.

An operator can clear every count of one address at once, with publiractl operator unlock-sign-in for the Platform Console or publiractl tenant member unlock-sign-in for a tenant's site and console, as Unlocking a sign-in describes. These commands need the Redis the servers count in. On an install without one, each server keeps its own counts until it restarts. Sign-in with Apple or Google and a password reset are not affected by any of these limits.

Anonymous reads

Three more limits bound how fast one client address may read a tenant's site without being signed in: calls of the public API that the mobile app makes, calls of its catalog search, and the images of a tenant's domain and image host. The images limit also bounds the images of a tenant's console host, counted apart from those of its site, since an editing screen there loads every page of an episode at once, as a reader opening one does. Each is a count over a window of 10 seconds, with no daily count, and is kept behind the limits the edge in front of the install keeps on the same requests, for an edge that limits nothing. A call a web app makes as itself, on behalf of all of its readers at once, is not counted.

They follow the sign-in attempt limits on the Security page, under Anonymous reads:

On the Security pageFlag
Public API calls per client per 10 seconds--anonymous-read-public-api-per-10-seconds
Catalog searches per client per 10 seconds--anonymous-read-search-per-10-seconds
Images per client per 10 seconds--anonymous-read-images-per-10-seconds

Anonymous reads on Security: public API calls, catalog searches, and images per client per 10 seconds, under the line that explains them.

Each is refused below what the sample edge configurations admit from one client in 10 seconds, so that the edge stays the first to refuse a reader: the page names the least value in its message and saves nothing. When readers share one address, such as a mobile carrier's gateway, raise them along with the edge's allowances, since an edge allowance raised past the server's admits requests the server then refuses. What publira server limits itself gives the built-in values, the least each may be, and what the edge admits.

Where the counts are kept

The limits are counted by publira server, in the Valkey or Redis server named by its PUBLIRA_REDIS_URL, which Installing has you provision. Every instance of publira server shares those counts, so a limit holds across the install whatever number of instances you run.

Without that variable, each instance counts in its own memory, with nothing in its log to say so. A reader whose requests are spread across three instances then gets three times the limit, and a restart starts every count from zero. The same happens while the instances cannot reach Redis: a server that cannot connect at startup logs an error and counts on its own, and one that loses the connection later logs a warning, counts on its own until the connection comes back, and logs again when it does. If you run more than one instance of publira server, set PUBLIRA_REDIS_URL on every one.

A saved change reaches every running instance within ten seconds, without a restart.

The disposable email domain list

Disposable email domain list URL (--disposable-email-domains-url) is where publira server reads a list of domains made for throwaway mail. No list ships with Publira, so until you give a URL there is none.

Disposable email domain list URL on Security, with the line under it.

The list is a plain-text file of one domain per line; blank lines and lines starting with # are ignored, which is the format of the disposable-email-domains project's blocklist. A listed domain also covers its subdomains. Each instance reads the list when it is first needed and again an hour later. If a read fails, or the file has a line that is not a domain, the instance keeps using the last list it read and logs a warning; with no earlier list, it refuses nothing and tries again an hour later. A new URL is read on the next lookup after it is saved.

Saving a list refuses nothing on its own. A tenant that wants disposable addresses refused turns on Refuse disposable email domains under Refused email addresses in its console's Settings, and from then on a reader cannot sign up with, or change their address to, an address on a listed domain, and a first sign-in with Apple or Google cannot create an account with one. When the platform has no list, that switch says it has no effect.

Community

Community limits are the limits on what readers do in a tenant's community. Each value here is the starting point for every tenant and also the loosest value a tenant may choose: a tenant can make a limit stricter for itself, never looser.

Community limits: comment posts, comment reports, contact messages per account and per client, episode ratings, viewer preference updates, and notification settings updates, each per minute or per hour and per day, Duplicate comment window (minutes), and Save community limits.

On the Community pageWhat it limits
Comment posts per minute and per dayComments one reader posts
Comment reports per minute and per dayComments one reader reports
Contact messages per account per hour and per dayMessages one signed-in reader sends through the tenant's contact form
Contact messages per client per hour and per dayMessages sent through the contact form from one client address, signed in or not, counted across every tenant
Episode ratings per minute and per dayPresses of the episode rating one reader makes
Viewer preference updates per minute and per dayTimes one reader saves the viewer's layout
Notification settings updates per minute and per dayTimes one reader saves their notification settings
Duplicate comment window (minutes)How long a reader is refused when posting the same comment on the same episode again, from 1 minute to one week. The comparison is exact after trimming surrounding spaces

These are counted in the same place as the security limits, so Where the counts are kept applies to them too.

Retention

Retention defaults sets how long four kinds of record are kept for every tenant that has set no period of its own. Each period is a whole number of days. publira worker deletes what has passed its period on its own schedule; nothing has to be set up to run it, and publiractl job runs the same purge by hand.

Retention defaults: Withdrawn comments, Content events, Daily ranking snapshots, and Weekly ranking snapshots, in days, and Save retention defaults.

RecordWhat it isDeleted byHow often
Withdrawn commentsComments their authors deleted, kept so staff can still read them while a report or dispute about them is open. The reports filed on a comment go with itpurge-withdrawn-commentsEvery hour
Content eventsEach view, finished read, purchase, favourite, rating, and comment, as it happenedpurge-content-eventsEvery 24 hours
Daily ranking snapshotsEach day's leaderboardspurge-ranking-snapshotsEvery 24 hours
Weekly ranking snapshotsEach week's leaderboardspurge-ranking-snapshotsEvery 24 hours

Each purge reads the periods when it starts, so a saved change applies from its next run. Each also runs when publira worker starts if it has not run in its current interval, and its first pass after downtime deletes everything that expired in the meantime.

Some records outlive their period by design:

  • A comment hidden by staff, or by the report threshold, is never deleted, whatever its age: it is the record of a moderation decision. Only comments their authors withdrew are purged.
  • The newest leaderboard a tenant has of each kind is always kept, so a ranking never goes blank.

Choosing a period:

  • Content events feed two things after they are recorded: each day's statistics, built once the day ends, and the recommendations, which are built from the last 28 days the tenant has finished in its own time zone. The statistics outlive the events, so a short period does not shrink a tenant's reports. So do the records of which days each signed-in reader was active on, which the console follows the readers who signed up in a week by for twelve weeks after it, so a period shorter than that still leaves those weeks to count. A period under 30 days, the 28 plus the day the recommendations are built on and one for a day that a clock change makes longer, would leave the recommendations working from fewer days, and could delete a day's events before its statistics are built, so it is refused, for the platform's default and for a tenant's own period alike. A shorter period saved before Publira refused one is kept as 30 days.
  • Ranking snapshots are kept for comparison over time; only the newest is ever shown to readers. A shorter period only shortens how far back that comparison reaches.
  • Withdrawn comments should cover how long your tenants take to settle a report or a dispute about a comment. The tenant console shows staff when each withdrawn comment is due to be deleted.

From the command line:

publiractl retention set --content-event-days 120

What a tenant can change

A tenant's administrators change some of these for their own tenant from Settings → Limits and retention in the tenant console, as Settings describes for them. Editors and auditors see that page without being able to save it.

GroupWhat a tenant can do
General: default language and time zoneNothing here; each tenant has its own language and time zone from the moment it is created, and changes them from Settings in its console
General: default currencyChoose a currency of its own in Payment settings, after which the default no longer reaches it
Security: every valueNothing. The one related choice a tenant makes is whether to refuse disposable email domains, and the list it refuses with is the platform's
Community: every valueMake any of them stricter: lower limits, or a longer duplicate comment window. A value looser than the platform's is refused
Retention: every periodSet any of them longer or shorter than the platform's default, from 1 to 36500 days, and from 30 days for Content events

On that page each group starts with Use the platform default ticked, and shows the platform's value beside it. Clearing the box lets an administrator enter the tenant's own values, which Save the community limits or Save the retention periods keeps; ticking it again and saving returns the group to the platform's. A tenant on the platform default follows every later change you make to it.

A tenant's own value stays when the platform's changes, with one exception. A tenant's community limits are compared with the platform's on every request, and the stricter of the two applies, so lowering a platform limit below a tenant's own value tightens that tenant too. Raising it again does not loosen a tenant that chose a stricter value. Retention periods have no such comparison: a tenant's own period is used as it is.

A tenant's changes are recorded in its console's audit log, as Community limits updated and Retention periods updated.