Administrators#
This chapter is for whoever installs the tracker, configures it, moves a MantisBT installation into it, backs it up and upgrades it. It assumes a Unix system, PostgreSQL, and a reverse proxy in front of the tracker.
locust is one binary. It keeps everything in PostgreSQL, the contents of attachments included. It serves its pages itself, and the reverse proxy in front of it terminates TLS.
Requirements#
PostgreSQL 15 or newer. The database user needs
CREATEon the database, for thecitextextension, which is a trusted extension.Rust 1.88 or newer to build from source; the Debian package needs no Rust.
pg_dumponPATHforlocust backupand forlocust migrate --backup-dir, andpg_restoreforlocust restore. The Debian package’s own scripts also usepsql.A mail relay, if the tracker is to send notifications.
No PHP and no web server modules. The tracker files periodic tasks and sends mail from inside
locust serve. One command should run every day:locust garbage-collection, which deletes what the tracker no longer keeps (see Keeping data no longer than needed). The Debian package runs it from a timer. Whether you runlocust backup(see Backups) andlocust retainfrom a timer as well is your own choice.
Hardware: a tracker of the size of bugs.taler.net (ten thousand issues, fifty thousand notes) runs comfortably on two cores and a gigabyte of memory. See Capacity for numbers measured on a larger machine.
Installing#
From source#
$ ./bootstrap # from a git checkout; a tarball has ./configure
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
./configure --help lists the directory options that it honours
(--prefix, --exec-prefix, --bindir, --datarootdir,
--datadir, --docdir, --mandir, --sysconfdir). The rest of the autoconf vocabulary is accepted and
ignored, so a packaging driver can run it unchanged. It looks for
cargo and rustc, and a missing one is an error. It also looks
for sphinx-build, pg_dump, pg_restore and psql, and a
missing one is a warning that says what will not work.
make install installs:
|
the binary |
|
the scripts of extended reporting |
|
the configuration defaults |
|
the manual page |
|
the configuration format |
|
this manual, served under |
make install-conf also writes $SYSCONFDIR/locust/locust.conf if
there is none; it never overwrites one. Without Sphinx the manual is
skipped and everything else is installed as usual, and ./configure
--disable-manual skips it deliberately.
The Debian package#
make deb builds the package and writes it into the directory above
the source tree; run apt install ./locust_*.deb there to install it.
The package creates the system user and /etc/locust/locust.conf,
with a generated SECRET and OTP_KEY and the public URL. The URL is
http://<this host's name>/ unless you answer the question for it,
which debconf asks only at priority medium or lower;
dpkg-reconfigure locust asks it later. If a local PostgreSQL
cluster is reachable as the postgres user, the package also creates
a PostgreSQL role and a database owned by it. It ships site files for
nginx and Apache in /etc/{nginx,apache2}/sites-available/.
The package stops there. It creates no schema and no administrator, and it asks nothing about them, because an unattended installation cannot know how the tracker is to start: new, or imported from MantisBT. You run:
$ sudo -u locust locust migrate # the schema
$ sudo -u locust locust create-admin # or: locust import ...
$ sudo systemctl start locust
locust create-admin makes an account called administrator with
the address root@localhost and prints a generated password.
--username, --email and --password-stdin (which reads the
password from the first line of standard input) change that, and
--if-no-users makes it do nothing on a database that already has
accounts.
An upgrade migrates by itself: the package runs locust migrate
--if-initialized, which brings an existing schema up to the package’s
version and changes nothing when there is no schema yet. To have the
package dump the database before each such upgrade, run
dpkg-reconfigure -plow locust and say yes to the backup: the dumps
go to /var/backups/locust unless you name another directory, and
when a dump fails, nothing is migrated. An upgrade also renames a
configuration section [locust-mantis] from an older version to
[locust].
Starting the service#
The package ships locust.service, which is enabled but does not start
until there is a schema; locust-garbage-collection.timer, which is
enabled and started, runs locust garbage-collection --if-initialized
every day and does nothing until there is a schema (see Keeping data no
longer than needed); and locust-backup.timer, which is shipped
disabled, because where backups go and how long they are kept is your
decision. When you install from source, a unit of three lines is
enough: ExecStart=/usr/local/bin/locust serve as an unprivileged
user, with Restart=on-failure; the garbage collection needs a
Type=oneshot service and a timer with OnCalendar=daily, or a
line in the locust user’s crontab.
locust serve refuses to start while migrations are pending, so a
service that comes up is a service whose schema matches its binary.
The reverse proxy#
Put nginx or Apache in front for TLS. locust builds every absolute URL
from [locust] BASE_URL and does not read the Host header. Three
things matter:
Set
X-Forwarded-For(nginx:$proxy_add_x_forwarded_for) and name the proxy’s address in[locust-rate-limits] TRUSTED_PROXIES. Otherwise every request looks as if it came from the proxy.Allow request bodies as large as
MAX_FILE_SIZEtimesFILE_UPLOAD_MAX_NUM, plus a mebibyte for the form, or uploads fail at the proxy and the form is lost. The shipped site files allow 51 MiB, which is what locust itself accepts with the defaults (ten files of 5 MiB). If you raise either option, raise the proxy’s limit with it.Give the response header room, because a page that lists issues names each of them in a cookie. nginx reads the header into one
proxy_buffer_size(4k by default) and answers 502 when it does not fit; the shipped site sets16k.
Over a UNIX socket (SERVE = unix) there is no peer address at all.
The peer is a process on this host and is trusted, and the client is
taken from X-Forwarded-For.
Configuring#
locust.conf is a GNU Taler configuration file: [sections] of
OPTION = VALUE, case-insensitive names, case-sensitive values,
YES/NO booleans, # and % comments, $VAR and
${VAR:-default} in options that name a file, and @INLINE@ to
read another file. locust.conf(5) and taler.conf(5) document
it.
Files are read in this order, and an option in a later file overrides the same option in an earlier one:
everything in
$PREFIX/share/locust/config.d/: the shipped defaults, which upgrades replace and which are not to be edited;the file given with
-c, or else the first of$XDG_CONFIG_HOME/locust.conf,$HOME/.config/locust.conf,/etc/locust.confand/etc/locust/locust.conf.
Every option has a built-in default, so a tracker with no configuration
file at all serves on 127.0.0.1:8080 against postgres:///locust.
locust config prints the configuration as it was read, every section
and option of the defaults and of your file together, with the values as
they are written (${DOCDIR} is not expanded). It then checks the
configuration as every other command would, and exits with 78 and the
reason when they would refuse it, so it is the check to run before you
restart the service. locust config -d also says which file and line
each value came from. The options that are stored in the database
(Configuration in the database) are not shown.
The sections#
[locust]BASE_URL, the absolute public URL with its trailing slash. This is MantisBT’s$g_path: every absolute link and every mail is built from it.SECRET, a fixed random string for form tokens; if it is unset, it changes at every start, and forms that were left open stop working.OTP_KEYandOTP_PREVIOUS_KEY, the key the users’ OTP secrets are sealed with in the database and, while it changes, the one it replaces.locust rotate-keysmakesSECRETandOTP_KEYanew, or where they are unset, and seals the OTP secrets with the new key (The key of the one-time codes).MANUAL_DIR, where this manual is installed (${DOCDIR}by default).ATTACHMENTS_DIR, where locust 0.6 kept the contents of attachments as<dir>/<aa>/<sha256>: locust keeps them in its database now, and onlylocust migratereads this option, to move the files of an older installation in (Upgrading).RETENTION_PERIOD(Keeping data no longer than needed). These are locust’s own, and they are read at startup only. Everything else in the section is one of MantisBT’s options (below).[locust-httpd]SERVE = tcpwithPORTandBIND_TO,unixwithUNIXPATHandUNIXPATH_MODE(a stale socket file is replaced), orsystemdfor a socket that the service manager hands over.[locustdb-postgres]CONFIG, the connection URI:postgres:///locustfor the local socket,postgresql://user:password@host/dbnamefor a server. libpq’s key/value form is understood as well.MAX_CONNECTIONSis the size of the pool (16). No TLS is configured here: run PostgreSQL on the same host or on a private network.[locust-policy]The thresholds that decide visibility.
ANONYMOUS_LEVELlets visitors browse at that level without logging in; it is unset by default, so every page needs a login. Setting it switches on MantisBT’sALLOW_ANONYMOUS_LOGINwith an account calledanonymous, whichlocust servecreates. The other options stand for MantisBT’s thresholds, with MantisBT’s defaults:PRIVATE_PROJECT_THRESHOLD(MantisBT’s option of the same name),VIEW_ISSUE_THRESHOLD(VIEW_BUG_THRESHOLD),PRIVATE_ISSUE_THRESHOLD(PRIVATE_BUG_THRESHOLD),PRIVATE_NOTE_THRESHOLD(PRIVATE_BUGNOTE_THRESHOLD) andSHOW_MONITORS_THRESHOLD(SHOW_MONITOR_LIST_THRESHOLD). Levels areviewer,reporter,updater,developer,managerandadministrator. Where[locust]sets the same thing under MantisBT’s name,[locust]wins, and a row in the database wins over both.PUBLIC_NAMESis locust’s own:shown(the default) shows every name on a public issue to everybody who may read it, as MantisBT;consentshows a viewer below the issue’sPRIVATE_ISSUE_THRESHOLD– the public, a reporter – only the names of those who tickedShow my name on public issueson their account page, and everybody else’s function:Reporter, the role the issue gives them, else their level (developer), with no link, address or account id, and a mention of them reads[developer]. The viewer’s own name is always theirs; a name typed into a text is left as it is. The rule holds wherever such a viewer reads an issue: its pages and the lists, the issue’s JSON and Markdown, the REST API and/api/ai(a person is then{"name": "developer"}, with no id to follow them by), RSS, the CSV, Excel and Word exports, and the mails, each recipient reading what their own level shows them. Where such a viewer may open the summary and the graphs, a person who consented keeps a row of their own there, and everybody else is counted under their level – one row for all developers who did not – with no link that would filter on one person.[locust-mail]TRANSPORT:smtp://host:25,smtp://host:587?tls=required,smtps://user:password@host:465orsendmail. Without it, mail is queued and not sent (see Mail).[locust-rate-limits]ENABLED,TRUSTED_PROXIES, and for each class of request a sustained rate and a burst, as<CLASS>_PER_MINUTEand<CLASS>_BURST. The classes areLOGIN,ACCOUNT(signup, lost password, verification links),WRITE(anything that is not a GET or HEAD),REST(per address),REST_TOKEN(per token) andEXPORT(CSV, Excel, Word, print, RSS, search). A rate of 0 switches a class off.ENABLEDalso switches MantisBT’s anti-spam check (see Rate limits and abuse).[locust-ai]The options for language models:
ENABLED,BOT_SIGNUP, the limits on one filed tree (TREE_MAX_ISSUES,TREE_MAX_DEPTH,TREE_MAX_BYTES),CONFIRM_EXPIRY_DAYS,REQUEST_ID_RETENTION_DAYS, andPATCH_TAG, the tag that the agents’ guide asks for on a report with a patch (patchby default; empty for no such rule).BOT_SIGNUPfollows MantisBT’sALLOW_SIGNUPunless you set it.ENABLED = NOremoves the discovery documents and the JSON and Markdown answers of the issue page, makes everything under/api/aianswer 404, and changes nothing else. See Integrators.[locust-ui]What a page shows where locust departs from MantisBT. Each option has MantisBT’s own behaviour as its other value, so one line gets MantisBT’s page back.
PERM_LOGIN_DEFAULT(YES): the login form’s “Keep me logged in” starts ticked, where MantisBT leaves it clear. A request that carriesperm_loginis obeyed either way.VERSION_SORT(date): the three version columns sort by the day that the release is scheduled for, undated releases last in both directions, where MantisBT (name) sorts by the version’s name.GROUP_RESOLVE(NO): the issue list does not offer MantisBT’s “Resolve” among the actions for a selection. Resolving an issue needs a resolution, a fixed-in version and usually a note, and the mass action asks for none of them. “Update status” is still offered, and an issue’s own page resolves it properly.MAX_PER_PAGE(250): the most issues that one page of a list shows, whatever the filter’s “Show” asks for. MantisBT has no such limit and reads “all” as all of them. A page of several hundred issues names each of them in a cookie, and that response header grows larger than the buffer that the proxy reads it into. The page then answers 502, and so does its filter form, which is where you would set the number back.0is MantisBT’s behaviour, and needsproxy_buffer_sizeraised with it. The print view and the CSV and Excel exports are not paged and are not affected.SUMMARY_CACHE_SECONDS(86400): how long the process keeps the result of the summary query, which both the Summary and the Graphs tab are drawn from and which is the most expensive query on the tracker. Every write discards the whole cache as it finishes, so the day only matters for what changes with the date alone, such as the periods that the charts count in. Two servers against one database, however, see each other’s writes only when the day is up; a tracker that wants the charts exact sets this to 0. At most 64 results are kept at once, one for each viewer, filter, project and range, and the oldest goes first, so the memory that the cache costs has a limit whatever the setting.[locust-extended-reporting]The deadlines of a category that requires extended reporting (see Managers).
CURRENCY(EUR) is the currency that the economic impact of an incident is written in. DORA counts an incident’s costs against EUR 100 000, so a tracker in another currency setsECONOMIC_THRESHOLDto that amount in its own, and does not start without it.DEADLINE_CRITICALandDEADLINE_HIGH(7 days),DEADLINE_MEDIUM(30 days),DEADLINE_LOW(90 days) andDEADLINE_INFORMATIONAL(none) are the resolution deadline of each technical severity, counted from the detection.DEADLINE_<LEVEL>_CRITICAL_FUNCTIONholds instead where it is shorter and the affected asset supports a critical or important function, andDEADLINE_ACTIVELY_EXPLOITEDfor an issue that is actively exploited. These are unset: DORA leaves the periods to the institution’s own policy, and the comments inlocust.confshow example values. A period is written as GNU Taler writes one, in minutes, hours, days, weeks, months or years, added up (1 week 2 days); a month and a year are calendar ones.RECIPIENTSis one line of JSON: the authorities and the other parties that an issue may owe reports, each with its reports (initial,intermediate,finalandwithdrawal; every recipient has afinalone) and what each counts from and how long it has. The default inlocust.conf, with a comment on what each recipient is for and which article it comes from, covers DORA, the CRA and the GDPR. Its targets are only a start: the law says “without undue delay”, and the hours are for the institution to choose. A mistake is refused at startup, naming the recipient and the report it is in. A recipient’s key is what the database stores, so renaming one leaves the issues that name the old key showing it without deadlines; thelabelmay change freely.A recipient’s
regime–dora,gdpr,craorinternal– is the law it reports under: it is offered only on an issue whose category ticks that law. Without one, the key’s first word decides (DORA-clientsis DORA’s), and a recipient whose key names no law, such as an insurer, is offered on every extended issue.A recipient’s
auto-suggest-aboveis a list of conditions, any of which suggests it to the issue’s managers.field:valueholds where the field is at or above the value, for the fields whose values are ordered –severity:major(MantisBT’s severity, by the names ofSEVERITY_ENUM_STRING),technical-severity:high,exploitability:actively-exploited,cvss:7.0,gdpr-risk:risk– and where it equals it otherwise;field:setholds where the field is filled in. A field is named with hyphens, and a regime’s field without its prefix where the name is not taken (member-states:DE).dora:majoris DORA’s own test of a major incident,cra:severe-incidentthe CRA’s of a severe one, andrecipient:KEYholds once that recipient is owed. A condition the tracker cannot ask is refused at startup.ENTITYis one line of JSON with the institution that reports:submitting_name,submitting_code,kind,affected_name,affected_lei,contact_name,contact_email,contact_phone, thesecond_contact_*fields,parent_name,parent_lei,member_state, the data protection officer’sdpo_name,dpo_emailanddpo_phone, andmain_establishmentfor the CRA.locust configsays which of them the configured recipients’ reports need and the line lacks. DORA’s reports need the institution and both contacts (ITS 2025/302 fields 1.2 to 1.12), the telephone numbers with+and the country’s code;kindis the kind of financial entity of DORA Art. 2(1) as Annex II names it (“credit institution”), several separated by semicolons.A recipient that is an authority other than DORA’s own says which with
authority–police_law_enforcement,csirt,data_protection_authority,national_cybersecurity_agencyorother–, and DORA’s intermediate and final reports name it among the other authorities informed (fields 3.31 and 3.32) once a report to it is filed. The default marks the GDPR’s authority and the CRA’s two chains to the CSIRT; clients, users, data subjects, the public and a maintainer are no authorities.A recipient’s
command, or a report’s own, which wins, submits its reports when a manager presses the report’s button, and sends a delay notice about one of them. It runs assh -cin/, as the server’s user, with the issue’s record as JSON on standard input (described in Integrators) and in its environmentLOCUST_ISSUE,LOCUST_ISSUE_URL(the issue in the tracker),LOCUST_RECIPIENT,LOCUST_REPORT(the report’s key, several separated by spaces for a combined submission, ordelayfor a delay notice) andLOCUST_REPORT_LABEL. Exit status 0 files the reports, and what it prints, at most 64 KiB, becomes a private note, its first line the reference; anything else files nothing, and the manager sees the first 4 KiB of its standard error.COMMAND_TIMEOUT(60 s by default) is how long it may run before its process group is killed. The defaults namelocust-reportfor every recipient reached by mail, which sends nothing until it is given an address: Extended reporting: DORA, the CRA and the GDPR shows the whole process configured.A recipient’s
upload, or a report’s own, makes the file an authority’s portal takes by upload, from the same input: what it prints, up to 16 MiB, with exit status 0 or 3, is offered as a download, and nothing is filed. It is used where an administrator has switched the recipient’s channel to it onReporting channels(manage_reporting_page): through its command, as an upload file, or recorded by hand. A recipient nobody switched sends through its command where it has one, and is recorded by hand where it has none; every switch is recorded on that page.A recipient’s
status, or a report’s own, asks the authority whether it accepted a filing that went through the command. Such a filing is pending, and a worker oflocust serveruns the status command everySTATUS_INTERVAL(5 minutes by default) with the filing as JSON on standard input (issue,recipient,reports,reference,filed_at) and its reference inLOCUST_REFERENCEbesides the variables above. Exit status 0 with the authority’s code for the incident on the first line accepts it: the code becomes the filing’s reference and the decision’s. 1 rejects it, with the reason as what it prints: the report is owed again. 4 is not yet; anything else, or a timeout, is a question that went wrong, logged and asked again. AfterSTATUS_GIVE_UP(7 days) the worker stops asking. The project’s managers are mailed each answer and the giving up, and every sending whose command failed, which the report’s row shows until a later filing.A recipient’s
"login": "typed"("stored"by default) asks the person who presses its buttons for the portal’s user name and password, which the command finds in its standard input aslogin(user,password) and nowhere else; locust keeps neither (Appendix: DORA’s reports to BaFin, “The login”). Such a recipient takes nostatus, since nothing could ask with the login later.A CRA recipient that is a CSIRT (
"authority": "csirt") and is recorded by hand offers the filing assistant for ENISA’s single reporting platform instead of a button that sends; itsreference-pattern, a regular expression, finds the Notification ID in the confirmation pasted back (by defaultSRP-[A-Z]{2}-[A-Z]-[0-9]{4}-[0-9]+, the form ENISA’s manual shows).A recipient’s
notify, an address or a list of them, gets a copy of each of its filings – by its command, the filing assistant or the record form –, with the report as locust generates it (the Markdown a command is given) and the filing’s files attached. The subject begins with[locust-mail] ENCRYPTED_SUBJECT_TAG([encrypted], say), which the mail server’s rule is to encrypt to each address’s key or refuse; the copy is the one mail of locust’s that carries an issue’s private details, and only with the tag. Unset, no copy is queued, the issue says the copies wait for it, andlocust configwarns. A copy the outbox gives up on (EMAIL_RETRY_IN_DAYS) is shown on the issue and mailed to the project’s managers without its content.locust-extended-reports, installed besidelocust, keeps a folder of the records of closed extended issues in step – the archive that outlives the retention period, kept in Git, where a changed file is an issue that changed (RTS 2024/1774 Art. 22(d) and 23(3), GDPR Art. 33(5)):LOCUST_API_TOKEN=... locust-extended-reports --url https://bugs.example.org/ \ --dir /srv/incidents --download-missing
It prints
missing Nfor each record the folder lacks andchanged Nfor each whose file differs from what the tracker serves now; with--download-missingit fetches the missing ones with their attachments intoN/<sha256>-<name>, checks each against the hash the record lists, and putsN.mdin place last, so a record never stands without its evidence. It exits 1 while a record is still missing, for a timer to raise the alarm. The token comes from--token-fileorLOCUST_API_TOKEN, never from an argument, and belongs to an account that sees the extended fields of the projects to archive.--category NAME(repeatable) keeps only those categories’ records – the incidents, say, and not the vulnerabilities. With--git WORKTREEthe folder (--dir, inside the worktree) is a document repository’s: each record new on--base(the worktree’s current branch by default) goes on a draft branch of its own,--branch-prefix(record/by default) and its number, committed with the worktree’s configured identity and pushed to--remote(origin); a record that changed after it was filed gets a branch with its closing date as well, and a record whose branch is already there is reportedpending. Whoever approves the branch in the repository is then not its author. Before each commit, and after each download without--git, the record and its text attachments are scanned for a third party’s data: e-mail addresses outside--allow-domain(repeatable; the institution’s own), IBANs that pass their check digits, telephone numbers,payto:URIs and 52-character Crockford base32 strings, which is what a GNU Taler account or reserve key looks like. The findings go into the commit message andN.findings.txtbeside the record, the branch is pushed all the same for the approver to read them with it, and the run exits 2. The exit status is 0 with nothing to say, 1 while a record is still missing, 2 when something was flagged and 3 when the tracker or the repository could not be used:LOCUST_API_TOKEN=... locust-extended-reports --url https://bugs.example.org/ \ --category Incident --git /srv/documents --dir vorfaelle \ --branch-prefix vorfall/ --allow-domain example.org
WARN_BEFORE(an hour by default; minutes, hours or days) is how long before a deadline of an open extended issue its project’s management is mailed.locust serveruns the watch itself, beside the mail worker and the spawner: it wakes when the next warning falls due and at least every five minutes, one statement a wake, and several servers against one database send each warning once.WARN_AT_FRACTION(50 %by default) warns the same people, and the issue’s handler, a first time once that share of a deadline’s period has passed, so that a month to a final report is warned about after a fortnight and not only an hour before its end. The period runs from what the deadline counts from – the detection, the decision that the report is owed, the earlier filing.0 %sends no such warning; where the half-time and the hour before fall in the same minute, one mail goes.WARN_MISSED(YESby default) mails the same people again when a deadline they were warned about passes while it is still owed. Set toNO, the watch still records each deadline that passes, without a mail, so turning it back on mails only the deadlines that pass from then on.The same watch mails about the due date of every other issue when it passes while the issue is not resolved: to everyone at
DUE_DATE_MISSED_RECEIVE_THRESHOLDin the issue’s project, one of locust’s own options in[locust]beside MantisBT’s: 70, a manager, by default, and 100, nobody, turns the mail off. The same people are warnedDUE_DATE_WARN_BEFOREseconds before such a due date, 3600 by default, the hour of the extended deadlines; 0 sends no warning, only the mail at the passing.DUE_DATE_WARN_AT_FRACTION(50 by default) warns them a first time once that share of the time from when the due date was last set has passed; 0 sends no such warning. Like MantisBT’s own options, a project can set each on the configuration page.- MantisBT’s options, in
[locust] MantisBT’s own options, the ones that
config_inc.phpholds, are written in[locust]too, beside locust’s own, under MantisBT’s names without the$g_prefix. No MantisBT option has the name of one of locust’s own. A boolean isYESorNO, a number is a number, a string is itself, and a list or a map is JSON. JSON is also how a threshold takes a set of levels:ADD_BUGNOTE_THRESHOLD = [25, 90]. A name that is neither one of locust’s own options nor a MantisBT option that locust reads is an error, and so is a value that is not a number in an option that takes one: locust refuses to start where PHP would have used 0. MantisBT’s own names for what locust’s own options do (PATH,CRYPTO_MASTER_SALT,ABSOLUTE_PATH_DEFAULT_UPLOAD_FOLDERandMANUAL_URL) are refused, and the error says what locust uses instead.[locust] BASE_URL = https://bugs.example.org/ FROM_EMAIL = noreply@example.org WINDOW_TITLE = Example bug tracker MAX_FILE_SIZE = 5000000
locust never ignores an option in one of its own sections without saying
so. A section whose name begins with locust has to be one of those
above, and every option in it has to be one that the section knows.
Anything else is refused at startup, and the error names the option and
the section it stood in. That catches a typing error
([locust-mial], BIND_T0). More usefully, it catches a real
option in the wrong one of locust’s sections, such as one of MantisBT’s
options or one of locust’s own outside [locust], and then the
error says where the option belongs:
$ locust -c locust.conf serve
Error: reading the configuration
Caused by:
FROM_EMAIL in [locust-mail] is no option of that section; FROM_EMAIL
is one of MantisBT's own options and belongs in [locust]
Sections that are not locust’s are left alone, since a Taler
configuration file carries [paths] and may carry more.
Where locust’s defaults differ from MantisBT’s#
Besides the options of [locust-ui], some of MantisBT’s own defaults
are deliberately not kept:
The due date. MantisBT hides it from everybody (
due_date_view_thresholdanddue_date_update_thresholdare bothnobody). locust shows it to anybody who may see the issue and lets a developer set it, because that field is what its deadlines are made of. Setting both options back tonobody–100in the file – hides the field again, as MantisBT does.The summary. MantisBT keeps it for managers (
view_summary_threshold = MANAGER). locust gives it to developers, and with it the wholeSummarytab bar (the counts, the graphs, the plan, the resource view and the priorities), because people who do the work cannot argue with a plan that they may not read.VIEW_SUMMARY_THRESHOLD = 70(a manager) restores MantisBT’s default.The reauthentication window.
REAUTHENTICATION_EXPIRYin[locust]is four hours in locust, where MantisBT’s default is five minutes. Five minutes suits a password, but with a second factor, a manager who edits a project, adds a category and dates a release types three one-time codes and waits for each. Each guarded page that you open while the window is still open extends it, so continuous work never runs into it. The window guards the account pages, among them the password page, as well as the administration pages, so four hours are four hours in which somebody at an unlocked screen can change a password. If you want it tighter, set it lower.The anti-spam check. MantisBT refuses an account’s next change once it has made too many in a window (
ANTISPAM_MAX_EVENT_COUNTandANTISPAM_TIME_WINDOW_IN_SECONDSin[locust]). In locust this is a rate limit like the others, so it applies only while[locust-rate-limits] ENABLED = YES, and that is off by default.
Configuration in the database#
MantisBT keeps the options that its own administration pages set in a
database table, not in a file, and locust does the same. Those rows
apply on top of locust.conf, per project and per user where MantisBT
resolves them that way.
Figure 33 Manage → Configuration: the options stored in the database, with
where each value comes from.#
So an option can be set in the file, in a row for all projects or in a
row for one project, and the later of these wins; where MantisBT has a
row for one user, that comes on top. The page says where each value
comes from. This page is also where a project’s
bug_report_page_fields is set: the list that decides which optional
fields the report form shows, and the way to give one project a short
form (Managers).
Figure 34 Manage → Site Information, the first tab: versions, paths and
what this installation is made of.#
Users and access#
Figure 35 Manage → Users: accounts, their level, and when each was last
seen.#
An account has a global access level and, per project, a membership that overrides it for that project. Membership applies to exactly one project and is not inherited by its subprojects. That is MantisBT’s rule, and so imported permissions behave exactly as they did in MantisBT.
Deleting a user leaves a disabled placeholder behind, so that their issues and notes keep an author. The name becomes free again.
Dormant accounts: the box under the user list deletes accounts that have not been seen for a given number of years and that nothing refers to: no issue, no note, nothing. It shows the list before it deletes anything.
Two-factor authentication: a project can require it from a level upwards (Managers). The user page names a user’s devices, each with a
Deletebutton that deletes that device alone, for instance one its owner reported lost: the others keep logging in. When somebody has lost all of them,Deactivate OTPthere deletes every device. After the last device, whichever way it went, every project’s requirement is applied to the user again, so their level in those projects is lowered. A manager can raise it again once they have set up a new device. The owner of the account gets a mail at every change to their devices: what was added or deleted, by whom, and from which address. This holds whether the change was made on their ownOTPtab, by an administrator, or on the command line. The requirement holds for administrators as well: once any project has one, an administrator without a device is lowered to the level below administrator, and no account without a device can be made an administrator. Set up a device on your ownOTPtab before you set a requirement; the project page refuses one while no administrator has a device.Signup follows MantisBT’s
allow_signup. Addresses at providers of throwaway addresses are always refused, from a list that is built into locust, and failed logins lock an account as MantisBT’s lockout does.
locust create-admin makes an administrator from the command line
(see The Debian package for its options). While a project requires
two-factor authentication it needs --otp-device LABEL, which gives
the new account a device and prints its otpauth:// URL after the
account.
locust add-otp-device gives an account another device for its
one-time codes, in force at once. It is the way back in for somebody
who has lost every device – an administrator included, who cannot
reach the user pages without one:
$ sudo -u locust locust add-otp-device --user alice --device Spare | qrencode -t ansiutf8
Without --uri it makes a fresh secret and prints its
otpauth:// URL, here drawn as a QR code for the user’s new device
to scan. With --uri it takes the secret of a URL that another
application or a hardware token’s maker gave (--uri - reads it
from standard input); only time-based codes of six digits over SHA1
every thirty seconds are accepted. The user can then log in, and
delete the lost devices on their OTP tab. A level that a project’s
requirement took from them is not given back by the new device: a
manager of that project does that.
locust remove-otp-device deletes one device of an account by its
name, whatever its case, and keeps the others:
$ sudo -u locust locust remove-otp-device --user alice --device Telephone
A name the account does not have is refused, and the message lists the
devices it has. After the last device the projects’ requirements are
applied to the account, as after Deactivate OTP.
Keeping data no longer than needed#
RETENTION_PERIOD in [locust] says how long the tracker keeps a
closed issue and an account that nobody uses. The value is days, weeks
or years, as GNU Taler writes a relative time – 5 years, 18
weeks, 1 year 30 days – or forever, which keeps them all and
is the default: no issue and no account is deleted until you set a
period. Before you
set one on a tracker with a long history, write it into a copy of the
configuration and run the dry run below with -c and the copy: once
the period is in the configuration, the next run deletes what the dry
run lists.
$ locust garbage-collection --dry-run
$ locust garbage-collection
deletes, in one transaction and in this order:
every issue whose status is at or past its project’s
BUG_CLOSED_STATUS_THRESHOLD(closed, unless a project says otherwise) and that has not changed for the retention period. An issue that was on the agenda of a meeting, or was found by one, within the period is kept, and so is an issue with a timer whose hours are not confirmed yet. The issue goes with everything that is its own – notes, attachments, tags, history, and the notifications about it – as deleting it on its page does, but nobody is mailed. An issue that was related to it keeps a “relationship deleted” line in its history, and is not otherwise changed. Hours recorded on it stay with their work package;every account that has not been seen for the retention period and that nothing refers to – no issue, no note, nothing, as the dormant box on the user list decides. An account whose last issue went in step 1 goes in the same run. Administrators, protected accounts and the anonymous account are kept;
the contents of deleted attachments (Deleted attachments), the deleted issues’ among them;
the queued mail older than
EMAIL_RETRY_IN_DAYS, which is never sent (Mail).locust servedeletes that mail itself when it has aTRANSPORT. This step is for a tracker that has none.
A project can keep its closed issues for a period of its own: its
Retention period on the project page, written as RETENTION_PERIOD
is, which only an administrator sets and which the project’s history
records. Empty means the installation’s period; forever keeps every
issue of the project whatever the installation says, and a period
deletes there while the installation keeps forever. A subproject
starts with its parent’s period. An issue counts by the project it is
in, and moving it is a change, so its period starts again from the
move. Accounts go only under the installation’s own period.
HOLD_TAG in [locust] names a tag that suspends the deletion of an
issue for as long as the issue carries it, for a legal hold. Only a
manager of the issue’s project can attach or remove it, on every page and
over the API, and doing so does not count as a change of the issue: once
the hold is lifted, an issue whose period ran out during it goes in the
next run. The tag pages refuse to rename or delete the hold tag while the
configuration names it.
--dry-run names what would go – the issues under their project with
its period, the day each last changed, the accounts with their address
and last visit, the contents – and deletes nothing. --project
NAME (or its id) deletes that project’s closed issues past its period
and nothing else; the accounts, the contents and the mail are left to
the daily run. Without it, the command prints and logs only the
counts, one line per project, so that the log of a timer does not keep
the names of the people it deleted; the audit log keeps the numbers of
the issues that went, one line per project. With RETENTION_PERIOD
at forever and no project with a period of its own it deletes only
the contents of deleted attachments and the mail that is given up. The Debian package runs it every day
from locust-garbage-collection.timer, whose log journalctl -u
locust-garbage-collection shows. Backups taken before a run still
hold what it deleted.
Two more commands delete what is no longer needed, each with
--dry-run to list what would go without deleting anything:
locust prune-dormant --years Ndoes from the command line what the dormant box does from the page (Nis 1 by default). Administrators, protected accounts and the anonymous account are never deleted.locust retaindeletes the recorded hours that belong to no work package, once their month is older than the time for which the project keeps them (Keep unclassified hours foron the project page). Those are issue work that was taken up before it was classified, and activities that were started without a work package. No contract says how long they must be kept, so the tracker must not keep them for ever. Hours that stand on a work package are never touched: deleting those is an administrator’s decision, package by package (Managers). What the command deleted goes into the audit log.
Nothing runs either of these two by itself. Run locust retain
from a timer if the tracker records time; prune-dormant is for a
shorter period than RETENTION_PERIOD for accounts alone.
Mail#
A change that causes a notification writes it into the notifications
table, in the same transaction as the change. A worker inside locust
serve turns each notification into mail in email_outbox and, with
a TRANSPORT configured, sends it. So nothing is lost when the relay
is down, and nothing is sent twice when a request fails.
The queue keeps a mail only until it goes. A mail that was delivered is deleted at once: the tracker keeps no copy of what it mailed, and the relay’s log is the record that it went. A mail that is given up is deleted too. So a password-reset link, or a note that was deleted since, does not stay in the database because it was once mailed.
Without
[locust-mail] TRANSPORT,locust servestill queues every mail, sends none and logs nothing about it. Once a transport is configured, the queue is sent, except the mail that is older thanEMAIL_RETRY_IN_DAYS(below).locust send-mailsends the mail that is due, once, through the configured transport, for example from a timer or to flush the queue after a relay outage. It needs aTRANSPORTas well.A mail that does not go out is tried again, with the wait doubling each time from a minute to about seventeen hours, for
EMAIL_RETRY_IN_DAYSdays (seven) from the time it was queued. Each failure is logged with its error. After that the mail is deleted, as MantisBT deletes it, and the log says how many mails went. The sender deletes it, and without aTRANSPORTlocust garbage-collectiondoes (Keeping data no longer than needed).0tries again for ever and deletes nothing that was not sent.Who is mailed about what is decided by MantisBT’s
notify_flagsand by each user’s preferences.SELECT count(*) FROM email_outboxcounts the mail that has not been sent yet, which is the queue to watch after a cutover.SELECT recipient, attempts, last_error FROM email_outbox WHERE attempts > 0shows the mail that failed, and why.
The tracker’s own address#
[locust-mail] says how mail leaves. Who the mail is from is part
of MantisBT’s own configuration, so it is written in [locust] under
MantisBT’s names, not in [locust-mail], where it is refused
(an option in the wrong section). The addresses
default to example.com addresses, as in MantisBT, and the name to
“Mantis Bug Tracker”, so an installation that sends mail sets them:
[locust]
FROM_EMAIL = noreply@example.org
FROM_NAME = Example Bug Tracker
RETURN_PATH_EMAIL = admin@example.org
WEBMASTER_EMAIL = webmaster@example.org
FROM_EMAIL is the sender of every notification, and the organiser of
the invitation that a meeting sends. FROM_NAME is the name beside
it. RETURN_PATH_EMAIL is the envelope sender, where a bounce goes.
WEBMASTER_EMAIL is the address that the footer of every page but
the login page offers for help. All four are read again for each mail
and each page, so a configuration page that overrides one takes effect
without a restart.
DEBUG_EMAIL sends every mail to one address instead of the person it
was addressed to, with To: <the real recipient> at the top of the
body. It is for trying out a tracker’s notifications without writing to
anybody.
locust does not sign its mail. DKIM is the job of the mail server: the
signature is made where the mail leaves your domain, at the server that
TRANSPORT hands it to, which holds the key. MantisBT’s
EMAIL_DKIM_* options are refused with a message that says so, rather
than accepted and ignored.
Webhooks#
A project can call a webhook, so that a service or an agent that
follows the tracker need not poll it. An administrator sets the URL in
the project’s Webhook field (Manage, Projects, the project). Only
an administrator may, because the tracker sends requests to wherever it
points, internal addresses included. A manager of the project sees
only the host it calls, because a receiver’s URL often carries a token
of its own. An empty field removes the webhook.
The webhook is called with a POST whenever an issue of the project
is filed or changes status, or a note is added to one, private issues
and notes included. Every way of making such a change calls it: the
pages, the REST and agent APIs, the mass actions, and a release that
moves its children. A migration calls it for nothing. The body is
JSON with the event, the ids and two links, and nothing else:
{"event": "note", "issue": 42, "note": 117,
"url": "https://bugs.example.org/view?id=42#c117",
"api": "https://bugs.example.org/api/rest/issues/42"}
event is created, status or note, and note appears
only for a note. There is no status, summary, author or text: the
receiver fetches what it may see with an account of its own, so a
private issue gives away only that something happened to it. The call
is not signed. A receiver should therefore treat it as a reason to go
and look and never as a fact, and should fetch only links under the
tracker’s own BASE_URL, which keeps a forged call from making it
fetch another address with its credentials.
A call succeeds when the receiver answers with any 2xx status. Anything
else is a failure: another status, a redirect (which is not followed),
no answer within ten seconds, a refused connection or a TLS error. A
failed call is tried again after a minute, then after two, four and so
on, up to once an hour, until it succeeds or is cleared. Calls are
kept per link, not per event: while a call for an issue is pending,
another status change of that issue adds no call, but makes the pending
one due at once. A note is a link of its own. The backlog of a
receiver that is down therefore grows with the issues and notes that
change, not with the number of changes.
locust serve makes the calls, and logs each one that it delivers or
that fails. A changed URL takes the pending calls with it, and a
removed one drops them.
Two commands manage the calls that are still owed:
locust webhook list [--project NAME]One line per call: its id, project, link, event, when it was queued, how many attempts it has had, the last one, and that attempt’s HTTP status or error (“never tried” for a new call).
locust webhook clear ID... | --all [--project NAME]Gives up the calls named, or all of them (of one project), and writes what was cleared to the audit log. If an id names no pending call, nothing is cleared and the command exits with 65. Both commands are safe to run beside a running server.
Rate limits and abuse#
[locust-rate-limits] ENABLED = YES switches on token buckets per
client and class. A request over a limit gets 429 with
Retry-After instead of the page. Behind a proxy, TRUSTED_PROXIES
must name the proxy, or every client shares one bucket. The same switch
applies MantisBT’s anti-spam check (see Where locust’s defaults differ
from MantisBT’s); with ENABLED = NO, none of these limits applies.
Besides these, locust reproduces MantisBT’s own protections, which apply
whatever ENABLED says: the failed-login lockout, the limit on open
lost-password requests, and the check for throwaway addresses at
signup. In the lockout, a wrong password counts, also for a disabled
account, and a locked account is refused without counting.
Extended reporting: DORA, the CRA and the GDPR#
A category that requires extended reporting (Managers) files its issues as security vulnerabilities, ICT incidents and breaches of personal data, with the deadlines and the reports that DORA (Regulation (EU) 2022/2554), the Cyber Resilience Act (Regulation (EU) 2024/2847) and the GDPR (Regulation (EU) 2016/679) attach to them, each law on the categories that tick it. The defaults hold the whole process: ten recipients, the deadlines the law sets and a target where it says only “without undue delay”, and, for every recipient reached by mail, the command that sends its reports. What an installation adds is the institution and the addresses; what it does not need, it deletes.
Tick, under Requires extended reporting, the laws that the categories taking vulnerabilities, incidents and breaches are reported under, in any project.
Describe the institution in
[locust-extended-reporting] ENTITY, one line of JSON.contact_emailis also the sender of every report:ENTITY = {"submitting_name": "Example Bank AG", "submitting_code": "<the LEI of the entity that submits>", "kind": "credit institution", "affected_name": "Example Bank AG", "affected_lei": "<the institution's LEI>", "contact_name": "Information Security Office", "contact_email": "security@institution.invalid", "contact_phone": "+49 30 0000000", "second_contact_name": "IT Operations", "second_contact_email": "it-operations@institution.invalid", "second_contact_phone": "+49 30 0000001", "member_state": "DE", "dpo_name": "Data Protection Officer", "dpo_email": "dpo@institution.invalid", "dpo_phone": "+49 30 0000002", "main_establishment": "DE"}
Give each command its addresses. The Debian package writes
RECIPIENTSinto/etc/locust/locust.confwhen it creates the file, commented out, with an address under.invalidwherever one is needed; an older file can take the line from/usr/share/locust/locust.conf.in. From source, copy the line from$PREFIX/share/locust/config.d/locust.conf.locust-reportrefuses an.invalidaddress, so a line uncommented and not filled in sends nothing. Delete the recipients that do not apply (an institution outside DORA’s scope deletes the threeDORAones), and a"command"where the report goes some other way.Put the authorities’ OpenPGP public keys where
--encryptnames them –/etc/locust/keys/in the example – readable by thelocustuser.locust-reportsends over SMTP tolocalhost:25unless a command says--smtp, in thesmtp://andsmtps://forms that[locust-mail] TRANSPORTtakes; the service’s sandbox forbids the set-group-IDsendmail.Run
locust config, which names the fields ofENTITYthat the recipients’ reports still lack, and restart.Keep the records of the closed issues for as long as the law keeps them, apart from the tracker, with
locust-extended-reportsfrom a timer of your own ([locust-extended-reporting]in The sections).
Until a command has its address, pressing its button is refused with a message that says what to add, and nothing is filed. A manager can still record a report filed another way, and, with “already sent another way”, a delay notice sent another way.
Who is sent what, and how:
Recipient |
Law |
Command, and what it needs |
|---|---|---|
|
DORA Art. 19, RTS 2025/301, ITS 2025/302 |
|
|
DORA Art. 19(3) |
|
|
DORA Art. 17(3)(e) |
|
|
CRA Art. 14 |
No command. The early warning, the notification and the final report go through ENISA’s single reporting platform (Art. 14(7), 16), a portal, and are recorded by hand with its reference. |
|
CRA Art. 14(8) |
|
|
CRA Annex I Part II(4) |
|
|
CRA Art. 13(6) |
|
|
GDPR Art. 33 |
|
|
GDPR Art. 34 |
|
The whole of RECIPIENTS as the Debian package writes it, spread out
here to be read – in the file it is one line:
{"DORA": {
"label": "DORA: competent authority",
"command": "locust-report --form dora --to incident-reports@authority.invalid --encrypt /etc/locust/keys/authority.asc --bcc compliance-archive@institution.invalid",
"auto-suggest-above": ["dora:major", "severity:major"],
"reports": {
"initial": {
"label": "Initial notification",
"within": "4 hours",
"after": "required",
"at-latest": {"within": "24 hours", "after": "detection"}},
"intermediate": {
"label": "Intermediate report",
"within": "72 hours",
"after": "initial",
"repeat": {"label": "Updated intermediate report", "within": "4 hours", "after": "restored", "target": true}},
"final": {
"label": "Final report",
"within": "1 month",
"after": "intermediate"},
"withdrawal": {
"label": "Reclassified as non-major",
"within": "24 hours",
"after": "withdrawn",
"target": true}}},
"DORA-clients": {
"label": "DORA: clients (Art. 19(3))",
"command": "locust-report --form notice --to clients@lists.institution.invalid",
"auto-suggest-above": ["recipient:DORA"],
"reports": {
"final": {
"label": "Clients informed",
"within": "24 hours",
"after": "required",
"target": true}}},
"DORA-management": {
"label": "DORA: management body (Art. 17(3)(e))",
"command": "locust-report --form record --to management-board@institution.invalid --cc ciso@institution.invalid",
"auto-suggest-above": ["recipient:DORA"],
"reports": {
"initial": {
"label": "Senior management notified",
"within": "4 hours",
"after": "required",
"target": true},
"final": {
"label": "Management body informed",
"within": "1 month",
"after": "resolved",
"target": true}}},
"CRA-vulnerability": {
"label": "CRA: actively exploited vulnerability (CSIRT, ENISA)",
"authority": "csirt",
"auto-suggest-above": ["exploitability:actively-exploited"],
"reports": {
"initial": {"label": "Early warning", "within": "24 hours"},
"intermediate": {
"label": "Vulnerability notification",
"within": "72 hours",
"repeat": {"label": "Intermediate report on request"}},
"final": {
"label": "Final report",
"within": "14 days",
"after": ["containment", "root-cause-resolved"]}}},
"CRA-incident": {
"label": "CRA: severe incident (CSIRT, ENISA)",
"authority": "csirt",
"auto-suggest-above": ["cra:severe-incident"],
"reports": {
"initial": {"label": "Early warning", "within": "24 hours"},
"intermediate": {
"label": "Incident notification",
"within": "72 hours",
"repeat": {"label": "Intermediate report on request"}},
"final": {
"label": "Final report",
"within": "1 month",
"after": "intermediate"}}},
"CRA-users": {
"label": "CRA: affected users (Art. 14(8))",
"command": "locust-report --form notice --attach csaf --to product-users@lists.institution.invalid",
"auto-suggest-above": ["recipient:CRA-vulnerability", "recipient:CRA-incident"],
"reports": {
"final": {
"label": "Users informed",
"within": "24 hours",
"after": "required",
"target": true}}},
"CRA-advisory": {
"label": "CRA: public advisory (Annex I, Part II(4))",
"command": "locust-report --form notice --attach csaf --public --to security-announce@lists.institution.invalid",
"auto-suggest-above": ["technical-severity:low"],
"reports": {
"final": {
"label": "Advisory published",
"within": "7 days",
"after": "root-cause-resolved",
"target": true}}},
"CRA-upstream": {
"label": "CRA: maintainer of the affected component (Art. 13(6))",
"command": "locust-report --form vulnerability --to-maintainer --bcc psirt@institution.invalid",
"auto-suggest-above": ["upstream-component:set"],
"reports": {
"final": {
"label": "Maintainer informed",
"within": "72 hours",
"target": true}}},
"GDPR": {
"label": "GDPR: data protection authority (Art. 33)",
"authority": "data_protection_authority",
"command": "locust-report --form gdpr --to breach-notification@dpa.invalid --encrypt /etc/locust/keys/dpa.asc --cc dpo@institution.invalid",
"auto-suggest-above": ["gdpr-risk:risk"],
"reports": {
"final": {
"label": "Notification",
"within": "72 hours",
"repeat": {"label": "Further information (Art. 33(4))"}}}},
"GDPR-subjects": {
"label": "GDPR: data subjects (Art. 34)",
"command": "locust-report --form notice --to affected-customers@lists.institution.invalid",
"auto-suggest-above": ["gdpr-risk:high"],
"reports": {
"final": {
"label": "Data subjects informed",
"within": "72 hours",
"after": "required",
"target": true}}}}
locust-report (locust-report(1)) reads the record locust sends
with jq, mails it with curl, and encrypts it with gpg for
--encrypt. What it prints, and so the note on the issue, is the
mail’s Message-ID, whom it went to, what the mail server answered, and
the text sent; the Message-ID is the filing’s reference. The authority’s
own reference – ITS field 3.1 – is the manager’s to enter on the
recipient’s line when the authority answers, and until then DORA’s form
leaves 3.1 empty rather than send a Message-ID back. What clients, users,
data subjects and the public are told is drawn from the fields written
for the authorities, the measures, the products and the fix, never from
the issue’s own description, which is often a reporter’s raw text; only
the maintainer of a component is sent that, and the management body,
which is sent the whole record. --dry-run prints a
message instead of sending it, and with --recipient, --report
and --from it takes the JSON of a closed issue’s record (GET
/api/rest/issues/{id}/extended_report with Accept:
application/json), to see what a form says before anybody presses a
button. That record carries none of ENTITY’s data, which only a
command is sent: hence --from, and the preview says “The
institution” where the message names yours. Any other program does as well as a command, on the same terms;
locust-report is the shell script to start from.
An institution that BaFin supervises sends DORA’s reports to BaFin’s
MVP portal with locust-dora-bafin (locust-dora-bafin(1)), the
DORA recipient’s command in place of locust-report’s. It takes the
report as the ESAs’ JSON that locust writes, refuses one that lacks
what BaFin requires and says what to fill in, and hands it to
locust-bafin-sender (locust-bafin-sender(8)), a service of its
own that alone holds the MVP login, sends the report and waits for
BaFin’s protocol to accept it; Appendix: DORA’s reports to BaFin describes BaFin’s
requirements field by field. The login is that of a person registered
for the DORA procedure, with the ID of the reporting entity the portal
shows. Give it to the sender, encrypted, and enable the sender’s
socket, which the package ships disabled:
# systemd-creds encrypt --name=locust-bafin-mvp - /etc/credstore.encrypted/locust-bafin-mvp
machine portal.mvp.bafin.de
login karl.meier1234#hg_05_1234567890
password ...
^D
# systemctl enable --now locust-bafin-sender.socket
and the command, in DORA’s recipient:
"command": "locust-dora-bafin --delay-command 'locust-report --form dora --to <the address BaFin agreed>'"
The tracker never holds the login: a tracker taken over could still
submit a report, but not read the login, which opens BaFin’s messages
and other procedures too. --test sends to BaFin’s test procedure
and files nothing: press a button with it once, then take it out.
Appendix: DORA’s reports to BaFin weighs the other ways to hand the login over, and why a
set-user-ID helper is not one of them.
Importing from MantisBT#
$ createdb locust
$ locust migrate
$ locust import --from "host=/var/run/postgresql dbname=mantis" \
--crypto-master-salt '<the $g_crypto_master_salt of config_inc.php>'
The import reads a MantisBT 2.0–2.28 database on PostgreSQL. Convert a MySQL installation first, with pgloader, and import the converted copy. The import writes everything in one transaction, the contents of the attachments included (wherever MantisBT kept them), and then compares the result with the source, record by record, and prints the comparison. Issue ids are preserved.
Options worth knowing:
--crypto-master-saltMantisBT’s
$g_crypto_master_salt. With it, every user’s RSS feed URL stays valid. Without it, they all change.--mantis-upload-dirWhere the files are, if MantisBT was configured with
$g_file_upload_method = DISKand the files have moved since. Without it, each file is read from the folder that MantisBT recorded for it. The directory must be readable by the user who runs the import.--table-prefix/--table-suffixWhat MantisBT’s table names begin and end with, if not
mantis_and_table:$g_db_table_prefixfollowed by_, and$g_db_table_suffix.--verify-onlyCompares an already imported database with the source again.
What the importer refuses rather than guesses:
Usernames that differ only in case. locust’s names are unique regardless of case. The importer stops and lists them, so that you can rename one first.
Access levels that MantisBT does not ship. Levels are a PostgreSQL enum, and a tracker that invented one must map it first.
A project with several parents, which MantisBT allows, is not refused:
locust keeps the parent with the lowest id, and reports the others as
warnings and as skipped.
Read the report before you continue: skipped, unsupported and
warnings must be empty or understood, and every verification line
must read ok.
Some things do not come over. Sessions do not, so everybody logs in
once more. Plugins do not: locust has none and shows no trace of one.
MantisBT’s signup_use_captcha is ignored. The importer counts as
unsupported what it leaves behind of MantisBT’s data: sponsorships,
news items, project documents, per-project user preferences,
time-tracking entries, queued mail and plugins other than
MantisCoreFormatting. Queued mail means that mail
which MantisBT had not sent yet at the cutover is not sent. Passwords,
API tokens and RSS keys do come over, and MD5 password hashes are
upgraded to Argon2id at each user’s first login.
The cutover#
The checklist below was rehearsed from end to end (compat/rehearse.py
in the source tree), and it is the one that bugs.taler.net and
bugs.gnunet.org follow.
The cutover is smaller than it looks. locust serves MantisBT’s pages at
MantisBT’s page names without the .php. Every old URL, such as
view.php?id=N, index.php or a form posting to
bug_update.php, is answered with a permanent redirect (308) to its
new one, while api/rest/... stays exactly as it is. Links in commit
messages, mails and other trackers keep working, scripts keep working,
and the switch is a change of where the reverse proxy forwards to.
MantisBT stays installed, frozen, for the rollback.
Before the day#
Rehearse on a copy of the real data. Restore last night’s dump, import it into a scratch database, and read the report (above). Time it: the import takes time in proportion to the data.
Configuration ready and reviewed, in particular:
[locust] BASE_URLandSECRET, and a database on a disk with room for the attachments, which are stored in it (each content once).[locust]again, for the options from MantisBT’sconfig_inc.php. The options that MantisBT’s web pages set are rows in its database and come over with the import. In particular,MAX_FILE_SIZEmust be MantisBT’s effective limit, which is$g_max_file_sizecapped by PHP’supload_max_filesizeandpost_max_size. In the rehearsal, leaving it at MantisBT’s own default made every issue page differ from MantisBT’s.[locust-mail] TRANSPORT, and[locust-rate-limits]withTRUSTED_PROXIES.
Reverse proxy: the site for locust prepared and not yet enabled.
Backups scheduled, and one restore tried.
Announcement: the time, the window in which the tracker can only be read, and that everybody logs in once more afterwards.
The day#
Step |
What |
Rehearsed |
|---|---|---|
1 |
Freeze MantisBT: the proxy answers 503 to everything that is not a GET or HEAD, except the login and logout pages. Reading and logging in keep working. |
0.5 s |
2 |
Dump: |
0.7 s |
3 |
Frozen copy: |
0.6 s |
4 |
locust database: |
0.3 s |
5 |
Import and verify: |
4.5 s |
6 |
Attachments: |
< 0.1 s |
7 |
Start locust and check |
|
8 |
Switch the proxy to locust, still frozen, and check as a reporter, a developer and an administrator: an issue, the issue list, My View, and the REST API with a token. |
0.6 s |
9 |
Lift the freeze. From here on, changes exist only in locust. |
|
10 |
Backup: |
0.7 s |
The times are for a synthetic database at the scale of bugs.taler.net (10,095 issues, 50,100 notes, 98,994 history rows, 2,019 attachments, 1,015 users; 71 MB in MantisBT) on a 24-core host with a local PostgreSQL 17. At five times that size, the import and its verification take 21.4 s and 277 MB of memory.
Rollback#
Until step 9, the rollback is only the proxy: point it back at MantisBT and lift the freeze. No change has been made that MantisBT lacks.
After step 9, locust holds changes that MantisBT does not have, and there is no way back that keeps them. Decide within the time you set aside for the checks in step 8. Keep MantisBT’s frozen database and the dump until the new installation has run for a while.
After the switch#
The count of mail that is still being tried falls to zero (see Mail), and the relay’s log shows deliveries.
Scripts that use the REST API work unchanged: both
api/rest/<route>andapi/rest/index.php/<route>are served.RSS readers still get their feeds, if you passed the master salt.
The log shows no rate-limit lines in ordinary use; raise a class if it does.
The first scheduled backup ran, and
locust check-attachmentsis clean.After a quiet period, retire MantisBT, and keep the last dump.
Backups#
$ locust backup --out /backup/locust
writes /backup/locust/locust-<UTC time>.dump (pg_dump
--format=custom). The attachments are in the database, so the dump is
the whole backup, and every dump holds every attachment: each one is
about the size of the whole tracker (the custom format compresses what
compresses). Keep as many as the space allows, and copy them off-site
with any tool.
Backups taken by locust 0.6 are a dump and an attachments/
directory beside it, which held the files of all the dumps in that
directory. Keep that directory for as long as you keep any of those
dumps.
To restore, create an empty database and point [locustdb-postgres]
CONFIG at it first, because locust restore loads the dump into
the configured database, which must be empty:
$ createdb locust_new
$ locust restore --dump /backup/locust/locust-<time>.dump
The command then checks the attachments, recomputing each one’s
SHA-256. A dump written by an older version of locust is loaded, but
the command then stops before the check, because the schema is older
than the binary: run locust migrate and then locust
check-attachments --deep. A dump of locust 0.6 has its attachments
in files beside it: the command copies them into ATTACHMENTS_DIR
from attachments/ beside the dump, or from the directory
--attachments DIR names, and locust migrate moves them into
the database and deletes them from ATTACHMENTS_DIR (never from the
backup).
locust check-attachments verifies that every attachment has its
recorded size, and --deep also recomputes each one’s SHA-256, which
reads them all. An attachment whose content was lost before it could
be moved into the database (The attachments move into the database)
is named, and is no failure.
The Debian package ships locust-backup.timer, disabled, and
locust-garbage-collection.timer, enabled.
The key of the one-time codes#
The secrets of the users’ OTP devices are what their authenticators
compute codes from, so the tracker has to be able to read them, and
cannot hash them as it hashes passwords. OTP_KEY in [locust]
keeps them out of the database’s backups all the same: with it set,
every secret is sealed with it (ChaCha20-Poly1305), and a dump of the
database alone holds no secret that produces a code. The value is any
fixed random string of at least 32 characters:
$ openssl rand -hex 32
The Debian package writes one into /etc/locust/locust.conf when it
creates the file; an installation set up before, or by hand, makes one
with locust rotate-keys OTP_KEY (below). A key set by hand is used
from the next start: locust serve seals every secret that is not yet
sealed with it when it starts, and the log says how many. You can keep
the key out of the main file with @INLINE-SECRET@ locust
/etc/locust/otp-key.conf, a file that holds nothing but a [locust]
section with the key, readable by the locust user alone.
Back the key up, apart from the dumps: a dump restored without it
leaves every device unable to log in, and the server says at its start
how many secrets it cannot read. locust add-otp-device then gives
their owners new devices, and they delete the old ones.
To change the key, or to make the first one, run locust rotate-keys
OTP_KEY as root:
# locust rotate-keys OTP_KEY --keep-old-key /root/otp-key-2026-11.conf
stopped locust.service
kept the old OTP key in /root/otp-key-2026-11.conf
sealed 37 OTP secrets with the new OTP_KEY
OTP_KEY replaced at /etc/locust/locust.conf:22
started locust.service
The command stops the server, writes a new random key where OTP_KEY
is set – in a file of its own, if @INLINE-SECRET@ keeps it there
– seals every secret in the database with it, and starts the server
again. Nothing else in the file changes, and the keys are never
printed. Meanwhile the old key stands beside the new one as
OTP_PREVIOUS_KEY, so that the configuration opens every secret at
every moment: if the run is cut short, even by a power cut, the server
starts with what it finds, and locust rotate-keys --finish completes
the rotation. Root may write the configuration, but only the
locust user may open the package’s database; the command does its
part in the database as that user (--db-user, by default the
service’s). Without systemd, or not run as root, it changes nothing
about the service: it refuses, exiting with status 75, while a server
runs – every server holds a lock in the database that says so, on
whatever host – and asks you to start it afterwards.
Database dumps taken before the rotation hold secrets sealed with the
old key. --keep-old-key writes it into a new file, readable by
root alone. To restore such a dump, copy that file’s
OTP_PREVIOUS_KEY line into [locust] and run locust rotate-keys
--finish, which seals the restored secrets with the current key and
removes the line again. Or read the file with @INLINE-SECRET@ locust
/root/otp-key-2026-11.conf – not @INLINE@, which the server,
unable to read a file only root may, would refuse to start with – run
--finish, and remove that line afterwards: locust never changes the
kept file, and makes no new key while the configuration reads it. If
you rotate because the old key leaked, leave --keep-old-key out.
locust rotate-keys without a key renews SECRET as well, which
costs only the forms left open at the restart, and --if-unset makes
only the keys that are missing. --dry-run says where each key
would go and how many secrets would be sealed, and changes nothing; as
the user who can read the database, it also says whether a server is in
the way:
# runuser -u locust -- locust rotate-keys --dry-run OTP_KEY
To stop sealing, move the key to OTP_PREVIOUS_KEY alone and run
locust rotate-keys --finish, which stores the secrets unsealed
again (or restart, whose start does the same and leaves the line).
Deleted attachments#
Deleting an attachment – or the note it came with, the issue it was on, or that issue’s project – deletes the attachment and keeps its content in the database, and so in every later backup.
$ locust garbage-collection --dry-run
$ locust garbage-collection
deletes, after the closed issues and the unused accounts (Keeping data
no longer than needed), every content that no attachment and no file
of a template refers to any more. --dry-run names each content
(its SHA-256, its size or lost, the day it was stored) and deletes
nothing; a run prints the total, records the list in the audit log, and
then vacuums the table so that the space is used again; VACUUM FULL
blobs gives it back to the file system, but holds every page that
reads attachments while it runs. The command is safe beside a running
server: a content being attached at that moment stays for the next
run, and if an attachment arrives just before the deletion, the run
deletes nothing and can be repeated. Backups taken before it still
hold what it deleted.
Upgrading#
Read the release’s entry in
NEWS. It is in the source tree and is installed beside this manual inshare/doc/locust(NEWS.gzin the Debian package, with the package’s own notes inNEWS.Debian.gzbeside it). A change to the configuration file is announced there. locust refuses to start with an option that it no longer reads: every command exceptlocust configthen exits with 1 and an error that names the option and its section (locust configexits with 78). A whole section that locust no longer reads makes every command log an error that names the file, and exit with 78.Back up (
locust backup).Install the new binary.
Run
locust migrate, with the same configuration as the service, because a migration may read it. The package does this itself: it runsmigrate --if-initialized.--backup-dir DIRdumps the database first, and migrates nothing if the dump fails.Restart the service.
locust migrate exits with 78, changing nothing, if the database’s
schema is newer than the program, or if a migration was changed after
it was applied. Migrations are compiled into the binary and checksummed,
so there is no directory of SQL files to keep in step.
Downgrades are not supported: restore the backup.
The attachments move into the database#
Up to locust 0.6, the content of every attachment was a file under
ATTACHMENTS_DIR; from locust 0.7.0 on, it is in the database.
Migration 67 moves the files in, and locust migrate then deletes
them. NEWS has the whole story; in short:
The migration reads every file into the database in one transaction, and PostgreSQL stores each only in the row of its own SHA-256. If a file that an attachment needs is missing or damaged, nothing changes:
locust migrateexits with 65 and names each attachment. Put the files back and run it again, or, if they are gone for good, runlocust migrate --accept-lost-attachments, which keeps those attachments without their content. Such a content comes back when its file is put intoATTACHMENTS_DIRandlocust migrateruns again, or when the same file is uploaded. A file that cannot be read, or anATTACHMENTS_DIRthat does not exist, ends the migration whatever the option says.After the commit,
locust migratedeletes every file ofATTACHMENTS_DIRwhose content it finds in the database, the temporary files of unfinished uploads, and the directory once it is empty. Anything else stays, and is named in the log: it is no attachment of this tracker. Every laterlocust migratetidies the directory again while it exists.--backup-dirwrites, before migration 67, a backup that locust 0.6 can restore: the dump and the files inattachments/beside it. Without it, take one with 0.6’slocust backupfirst.Run the migration against the database the directory belongs to, and rehearse it on copies of both: it deletes the files whose content is in the database it ran on.
For a large tracker, stop the service first: the migration locks the table that holds the attachments while it reads them all, and a locust 0.6 still running cannot serve or take attachments once it has committed. The database’s file system needs room for a second copy of the attachments while it runs.
Monitoring#
GET /healthz200 and
okwhile the database answers, 503 otherwise. It needs no authentication and shows no data; this is what a load balancer should poll.- Logs
RUST_LOGsets the level. When it is unset, locust logs atinfo, which is right for most installations: rate-limit rejections and the decisions oflocust migrateare logged atinfo, and mail failures atwarn, so the levelwarnhides the rate-limit rejections and the decisions oflocust migrate.- Database
The usual PostgreSQL metrics. A page of this tracker costs one or two database round trips, whatever the size of the data, so a rising rate of statements means more traffic and not a slow page.
Capacity#
Measured against MantisBT 2.28.4 (php-fpm behind nginx) on the same synthetic data, with a release build of locust and 16 database connections:
Page |
MantisBT (req/s) |
locust (req/s) |
|---|---|---|
Issue list |
412 |
974 |
One issue |
727 |
890 |
My View |
357 |
436 |
REST, a page of 50 issues |
114 |
353 |
Adding a note (web form) |
240 |
452 |
Adding a note (REST) |
317 |
736 |
The difference is in the statements per request: 49 to 683 in MantisBT, 2 to 8 in locust.
Agents#
[locust-ai] ENABLED decides whether language models can read this
tracker as data at all. With it on, the issue page also answers in JSON
and Markdown when asked, /llms.txt and /.well-known/ai describe
the tracker, and /api/ai takes writes from accounts that are marked
as agents. The following rules are enforced, not advice. An agent’s
account has a name that begins with bot-, no password, and the
address of a human behind it, who had to confirm it. An agent may never
delete anything or rewrite somebody else’s words, and an agent’s account
is marked as one wherever its name appears. BOT_SIGNUP = NO keeps
agents from registering at all, and disabling an agent’s account stops
it like any other.
Integrators describes the endpoints.
This manual#
The manual is built by Sphinx from docs/manual in the source tree,
in English, German and French, and installed as HTML into
$DOCDIR/<language>/<version>/. The version in that path is the
major number of locust’s version, or 0.<minor> while the major
number is 0: locust 0.7.2 installs en/0.7/. The tracker serves
each tree under /manual/<language>/<version>/ from wherever
[locust] MANUAL_DIR points. It costs no database query and needs
no login.
/manual/sends a reader to the language that their browser prefers (itsAccept-Languageheader), or to English if none of them is installed./manual/<language>/sends them on to the version of the locust that is running, or to the newest version installed in that language if that one is not.A link without a version, as the tracker wrote them before the manual had versions (
/manual/en/reporters.html), and a link to a version that is no longer installed, lead to the same page of the version that/manual/<language>/leads to.The footer of the tracker’s pages links to the manual in the reader’s own language, if it is installed, and otherwise to the English one.
To build and install it:
make manualbuilds the HTML of every language, andmake installinstalls it.make manual-html-debuilds one language.make manual-pdf-dewrites the German manual as a PDF, intodocs/_build/pdf/de/<version>/locust.pdf, andmake manual-pdfwrites all of them. They need XeLaTeX, the GNU FreeFont fonts and the hyphenation patterns of the language (on Debianlatexmk,texlive-xetex,fonts-freefont-otf,texlive-lang-germanandtexlive-lang-french), which is why they are not part ofmake install.make install-manual-pdfputs them beside the HTML, where the tracker serves them as/manual/<language>/<version>/locust.pdf.Without
sphinx-buildthere is no manual, and/manual/answers 404; the rest of the tracker is not affected.To add a language, add its code to
MANUAL_LANGUAGESin theMakefileand its name todocs/manual/languages.py, runmake manual-gettext, translate the catalogues and rebuild. For the Debian package, also exclude its directory fromdh_compressindebian/rules(override_dh_compress). The tracker itself needs no change: it serves every language directory that it finds at startup, so a restart is enough.
Installing a new version leaves the trees of an older one in place, and the tracker keeps serving them under their own version. The Debian package replaces them instead, as a package upgrade does.
Troubleshooting#
What you see |
What it usually is |
|---|---|
|
The schema is older than the binary: run |
|
The database is newer than the binary, or an applied migration
was edited: do not force it, use the matching binary. Or the
configuration still has a section that locust no longer reads,
such as |
Every page needs a login, including the public ones |
|
Uploads fail at a size the page allows |
The reverse proxy’s limit on the request body, not locust’s. |
One page answers 502 while the rest of the tracker is fine |
The response header did not fit the proxy’s buffer: raise
|
All requests seem to come from one address, and rate limits refuse ordinary use |
|
Mail is not delivered and the queue grows |
No |
Forms say the token is invalid after a restart |
|
|
No manual is installed, or |
One user gets “Access Denied” for an issue that others can read |
The issue is in a project that the user may not see, or it is
private and the user neither reported it nor has the level of
|