Commit Graph
364 Commits
Author SHA1 Message Date
Lauri Ojansivu fefabbf113 Admin Panel Problems: a Clear button, and resolved problems age out.
The problem streams were append-only and Acknowledge only reset the "new"
count, so a problem fixed long ago stayed in the table and buried the live
ones. Clear, beside Acknowledge, calls the admin-only clearEventLog, which
deletes the checked streams' events up to now and stamps the
acknowledgement; anything that happens after the click shows as new again,
and an unknown stream clears nothing. A daily sweep, claimed once per
installation, deletes events older than EVENTLOG_RETENTION_DAYS (default 90,
0 keeps them forever); a recurring problem's folded row keeps a recent date,
so it stays. The setting is listed on every platform, and clear-problems is
translated to every language.

Thanks to Raymond-Voogt and xet7 !

Fixes #6893,
2026-11-11 22:29:01 +02:00
Lauri Ojansivu c99aa7f845 Admin Panel / Problems / Password length, and a changed password signs every session out.
PASSWORD_MIN_LENGTH (default 8) is now the length below which a sign-in
is REPORTED, in the new Admin Panel / Problems / Password length, and
PASSWORD_MIN_LENGTH_ENFORCE (off by default) is what makes it a rule: a
shorter new password is refused, and an account that signs in with an
older shorter one sees only "Change your password" until it has a long
enough one. Signing in is never refused, enforced or not, so nobody is
locked out by a minimum set after their password. LDAP, OAuth2, OIDC,
SAML, CAS and Sandstorm accounts are neither reported nor asked: their
password is their provider's. An administrator's Set password no longer
applies WeKan's policy to such an account.

Meteor sends a password hashed, so only the browser knows its length: it
notes it on the sign-in form and, after a sign-in that worked, says "it
was short" - never the password or its length.

The page has both settings and a table, one row per account: username,
first and last short-password login, the latest IPv4 and IPv6 address
with the country's flag and city when a CDN says where it is, the count,
and when it was fixed, with the Too short (default) / Fixed / All filter.
Fixed is a changed password not seen short since; a short one seen
again reopens the row.

Changing one's own password - Member Settings, the forced change, a
reset link - now signs EVERY session of the account out, the one that
changed it too, and only the new password signs in again. The browser
goes to the sign-in page as soon as it is signed out, since the server
closes the connection before the answer can arrive.

Documented in docs/Features/Admin-Panel/Problems/Password-length.md, the
settings on every platform. The new strings are in every locale in
English for now. Tests: passwordPolicy, passwordChangeRequired and
shortPasswordLogins (node); password-min-length-signup-login,
password-length-report and password-change-other-sessions (Playwright,
Chromium and WebKit), which change each setting on the page and check
what it does, and that sign-up with no mail server registers and signs
the user in.

Thanks to xet7 !
2026-10-31 14:54:22 +02:00
Lauri Ojansivu 41173f0f6b Sign a browser session out after it has been idle for LOGOUT_IDLE_MINUTES.
LOGOUT_WITH_TIMER ends a login at a deadline however busy its user is;
nothing ended a session somebody walked away from. LOGOUT_IDLE_MINUTES
(Admin Panel / People / Login, every platform; empty or 0 is off) does:
the browser reports a key press, click, touch or scroll at most once a
minute, the server keeps the time per login token in idleSessions, and
once a minute every token idle past the limit is removed, which signs its
connections out. A tab that reconnects and resumes its login by itself -
a laptop waking up - is not activity and does not extend the session.
REST API tokens have no session record and are never removed. The time
is kept beside the user rather than on the token, because updating one
element of the token array needs the positional $ operator, which not
every database WeKan runs on supports.

Thanks to xet7 !
2026-10-31 00:08:20 +02:00
Lauri Ojansivu d7abe9910a Password policy for new passwords, and compulsory two-factor authentication.
New passwords: PASSWORD_MIN_LENGTH (default 8) and PASSWORD_CHECK_PWNED
(off by default), in Admin Panel / People / Login and on every platform.
The browser sends a password to Meteor hashed, so the server checks every
password that reaches it as text - Admin Panel Set password and Add user,
POST /users/register - and the sign-up, Change Password, reset and
enrolment forms check in the browser. Signing in is never checked, so an
existing shorter password keeps working until it is changed. A breached
password is found with Have I Been Pwned's k-anonymity range API: only 5
hex digits of the SHA-1 leave WeKan, and an unreachable service never
refuses a password.

REQUIRE_2FA: off (default), admins or all. It covers accounts that sign in
with a WeKan password; LDAP, OAuth2, SAML, CAS and Sandstorm accounts sign
in through an identity provider and are not asked. Such an account can
still sign in, sees only the 2FA set-up until it has 2FA, and until then
the server refuses every method and publication but signing in and
enrolling, HTTP routes do not accept its login and the REST API gives it
no token. Once required, 2FA cannot be switched off.

The new interface strings are pending translation.

Thanks to xet7 !
2026-10-31 00:07:58 +02:00
Lauri Ojansivu 4993242c5f Strict-Transport-Security on every response of an HTTPS site.
WeKan sent no HSTS header, so a link typed as plain HTTP or a downgrade on
a hostile network could strip TLS from the next visit unless the reverse
proxy added it. It is now sent whenever ROOT_URL is https: 180 days, this
host only. HSTS_MAX_AGE, HSTS_INCLUDE_SUBDOMAINS and HSTS_PRELOAD (Admin
Panel / People / Login, every platform) change it; 0 stops it, and preload
is sent only with includeSubDomains and at least a year. Every response
also carries X-Content-Type-Options: nosniff and
Referrer-Policy: strict-origin-when-cross-origin.

Thanks to xet7 !
2026-10-30 23:50:02 +02:00
Lauri Ojansivu 0b5c855820 Snap backup and restore instructions work on AlmaLinux, Rocky Linux and Fedora.
snapd keeps the snaps in /var/lib/snapd/snap on Fedora, RHEL, AlmaLinux,
Rocky Linux, CentOS Stream and Arch Linux, which have no /snap, so the
instructions that exported /snap/wekan/current/bin and its lib directory
did not find mongodump and mongorestore there. They now pick the directory
with one S= line and the CPU's library directory with $(uname -m), and the
scripts that can be run from a host shell find the snap in either place.

Thanks to Group-Deed and xet7 !
2026-10-30 23:13:50 +02:00
Lauri Ojansivu 718fdb5dac Newest features' settings: on every release platform and in the Admin Panel, and kept that way.
An audit of every environment variable the code reads found 30 that are new
since v12.00. Eleven were already Admin Panel settings and on every platform
the release workflows build. Of the rest:

Now Admin Panel settings, through models/lib/authConfigCatalog.js (a value
there wins, an empty field falls back to the variable):
- Email to card limits, beside its own Admin Panel settings:
  INBOUND_IMAP_POLL_SECONDS, INBOUND_EMAIL_PER_ADDRESS_PER_HOUR,
  INBOUND_EMAIL_MAX_BYTES, INBOUND_EMAIL_MAX_ATTACHMENT_BYTES and
  EMAIL_VIEW_SENDS_PER_HOUR. They were module-level constants, read before
  the Admin Panel values loaded; they are read when used now.
  createRateLimiter takes a limit function, and a changed poll interval
  restarts the IMAP poller.
- ACCOUNTS_COOKIE_REFRESH_RATE_LIMIT in People / Login, like the login
  expiry beside it, applied from the next start.
- Windows SSO (WINDOWS_SSO_ENABLED, _DOMAINS, _ACTIVE_DIRECTORY,
  _MERGE_EXISTING_USERS) in People / Login. It was already read through
  authEnv but had no form. Being Windows-only, its catalog section names
  start-wekan.bat as its one platform.

Listed on every platform (Dockerfile, the docker-compose files, start-wekan.sh
and .bat, the snap config and help), where none of these had been: the
variables above, INBOUND_EMAIL_WEBHOOK_SECRET (its own Admin Panel page
already has it), and the per-process switches that stay environment only -
INBOUND_IMAP_DISABLED (one pod of a multi-pod deployment), WEKAN_DISK_MONITOR,
WEKAN_DISK_WATCH_PATHS, WEKAN_RAM_MONITOR and WEKAN_IMPORT_RUN_STALE_MS.
Left unlisted on purpose: NEXTCLOUD_EXAPP, NEXTCLOUD_URL and
WEKAN_NEXTCLOUD_PROXY_KEY (set by Nextcloud's AppAPI), SANDSTORM_MAILDIR (set
by Sandstorm). DEFAULT_AVATAR_URL keeps no Admin Panel UI, as decided in #824.

tests/envVarCoverage.test.cjs keeps it so. It fails for a variable that is in
no Admin Panel catalog, OWN_PANE or ENV_ONLY with its reason; the variables
read before v12.00 are a frozen LEGACY list that can only shrink. An
environment-only or own-page setting a user sets must be on every platform,
and stale entries fail. tests/authConfigCatalog.test.cjs honours a section's
platform list. tests/adminPanelNewSettings.test.cjs pins the reads and the
forms. tests/cookieRefreshRateLimit.test.cjs's guard now expects the Admin
Panel value, and says why. tests/playwright/specs/admin-new-env-settings.e2e.js
opens the forms.

Thanks to xet7 !
2026-10-20 13:50:10 +03:00
Lauri Ojansivu 06b7ce994a Backup status: every run recorded, failures and overdue backups shown, old local backups pruned - in Admin Panel too.
The result of an Admin Panel backup lived only in the memory of the server
process that ran it. After a restart, or on another pod of a multi-pod
deployment, the Backup pane said "idle", so nobody could see whether last
night's backup had worked. There was no history, no warning when a scheduled
backup failed or did not run, and local backups were never cleaned up.

- Every run, scheduled or "Backup now", is recorded in backupRuns: start and
  end, who or the schedule, scope, storage, status, size, duration and error.
  Records are kept 400 days. A run still "running" after 24 hours counts as
  failed, and a scheduled run skipped for another backup is recorded as failed.
- Admin Panel / Problems / Backup shows the last success (overdue when its
  period has passed), the last failure with its error, the next run and the
  last 30 runs. The same status is above the schedule in Attachments / Backup.
- Problems / Summary lists "Backup failed" and "Backup overdue". /metrics adds
  wekan_backup_last_success_timestamp_seconds,
  wekan_backup_last_run_timestamp_seconds, wekan_backup_last_run_success and
  wekan_backup_overdue for alerting.
- BACKUP_KEEP_DAYS: after a successful backup, local backups of the same scope
  older than N days are deleted. The newest is always kept, and only a
  directory inside the backup root holding a backup.zip is removed.

From the patch by Raymond-Voogt, and in Admin Panel as well:
- BACKUP_KEEP_DAYS is the catalog's backup section
  (models/lib/authConfigCatalog.js), overridable beside the schedule in
  Admin Panel / Attachments / Backup and resolved through authEnv at every
  backup.
- It is listed on every platform: the compose files, start-wekan.sh and .bat,
  the snap config and help, and the Dockerfile, which the patch's version
  had missed. Its platform hunks, written before #6789, were re-applied by
  hand.

tests/backupRuns.test.cjs (21): the run records, overdue and pruning against a
real directory, and the Admin Panel override, including that nothing reads the
variable around it. tests/authConfigCatalog.test.cjs checks every platform.
admin-attachment-retention.e2e.js checks the Backup pane shows the field.

Thanks to Raymond-Voogt and xet7 !

Fixes #6790.
2026-10-20 13:30:00 +03:00
Lauri Ojansivu dcf91e4471 Attachment retention: delete card attachments after N days, purge deleted ones after M days - in Admin Panel too.
Organisations that must not keep files forever (storage limits, GDPR data
minimisation) had only scripts working on MongoDB directly, which leave card
references behind, do not know which storage holds a file, and break on
upgrades. Soft-deleted attachments were also kept forever.

A nightly job (server/attachmentRetention.js, rules in
models/lib/attachmentRetention.js), off unless configured:
- ATTACHMENTS_RETENTION_DAYS soft-deletes card attachments older than N days
  through the card's own Delete (cover unset, activity, card history Restore).
- ATTACHMENTS_RETENTION_MODE: uploaded (default), or card-inactive, which also
  requires the card to have had no activity for as long.
- ATTACHMENTS_PURGE_DELETED_AFTER_DAYS removes attachments soft-deleted at
  least M days ago for good, file included, through Attachments.removeAsync
  so every storage backend is cleaned. The write re-checks deletedAt, so one
  restored meanwhile stays.
- ATTACHMENTS_RETENTION_DRY_RUN only logs; ATTACHMENTS_RETENTION_MAX_PER_RUN
  caps each step per night.
Never touched: attachments without a card, template boards and cards, and
attachments with an unknown upload date.

From the patch by Raymond-Voogt, and in Admin Panel as well:
- The five settings are a section of models/lib/authConfigCatalog.js.
  Admin Panel / Attachments / Retention (/admin/attachments/retention) draws
  the shared override form on it: a value there wins, an empty field falls
  back to the variable, and the source in effect is shown.
- The job resolves them through authEnv on every run, so a change needs no
  restart.
- The new menu label attachment-retention is translated in all 246 locales.
- The catalog's platform test then found that the patch had missed the
  Dockerfile and the snap help; both list all five now, beside
  docker-compose, start-wekan and the snap config.

tests/attachmentRetention.test.cjs (14) covers the rules and the Admin Panel
wiring; negative: the job never reads the environment around the Admin Panel.
tests/authConfigCatalog.test.cjs checks every platform lists each variable.
tests/playwright/specs/admin-attachment-retention.e2e.js opens the pane, and
checks that an ordinary user cannot.

Thanks to Raymond-Voogt and xet7 !

Fixes #6789.
2026-10-20 13:28:17 +03:00
Lauri Ojansivu b933a69cd4 People shows everyone's Last active; inactive users can be disabled; LDAP sync honours its search filter.
Admin Panel / People showed "Last active" as "-" for every user but the
administrator: the people publication did not carry lastConnectionDate.

USERS_DISABLE_INACTIVE_AFTER_DAYS disables, once a night, accounts that have
not used WeKan for that many days, and revokes their logins. Admins are
never disabled. An account with no recorded activity starts its count on the
first run rather than from createdAt, and re-enabling an account restarts it.
The setting is in Admin Panel / People / Login as well as in the
environment, and the job resolves it every night, so a change there needs no
restart. Every platform's settings file lists it.

LDAP background sync looked a user up by id without LDAP_USER_SEARCH_FILTER,
so an account the filter excludes - one disabled in Active Directory - could
not log in but was still "found". It was never disabled, and a manual
disable was undone on the next run. The filter is now ANDed into the lookup.
An account disabled for inactivity is not re-enabled by the sync.

From the patch by Raymond-Voogt, with the setting moved into the Admin
Panel's login settings. Tests: tests/inactiveUsers.test.cjs,
tests/ldapBackgroundSync.test.cjs, tests/ldapUserIdFilter.test.cjs,
tests/authConfigCatalog.test.cjs and
tests/playwright/specs/inactive-users-last-active.e2e.js.

Thanks to Raymond-Voogt and xet7 !

Fixes #6783,
Fixes #6784,
Fixes #6785.
2026-10-19 17:35:51 +03:00
Lauri Ojansivu b7589737f5 File docs/Features the way the WeKan menus are.
A feature's guide now sits under the menu it is used from, read from the
templates rather than from where somebody once put it: Header-Bar,
All-Boards, Pages, Board-Header (search and every Board View), Board-Sidebar
(Board Settings, Filter, Members, Labels, Archive), Rules, Swimlanes, Lists,
Cards, Member-Settings, Admin-Panel and Login-Page. Topics used from several
menus (editor, history, theme, translations, email, troubleshooting) are in
General.

- Each area has a README mapping its menu entries to their guides and to the
  template or server module that implements them. Board-Header/README.md
  lists all 40 Board View entries with the template boardBody.jade renders;
  five views (Table, Calendar Mode, Time, Timeline, Map) have no guide of
  their own yet and say so.
- Board-View.md listed 25 views while BOARD_VIEWS has 40; it now lists all
  of them with their English labels.
- Pages keep their file names. Where a released changelog links an old path,
  a "# Moved" page stays there and points to the new one; test-menu.sh skips
  folders holding only those.
- Undo was filed under Login; it is General/Undo now.
- Every link in docs, code comments, scripts and tests follows the move;
  docsLinksResolve checks them all.

Tests that read a doc follow it to its new place. boardViewSettings now fails
when Board-View.md or Board-Header/README.md differs from BOARD_VIEWS, or
names a template boardBody.jade does not render.

Thanks to xet7 !
2026-10-16 23:45:35 +03:00
Lauri Ojansivu 37d2397603 Caddyfile examples are Caddy 2, and the snap's Caddy proxies to where WeKan listens.
The snap runs Caddy 2, and migrate-caddyfile-v1-to-v2.sh treats a Caddyfile
that `caddy adapt` rejects as Caddy v1: it moves it to Caddyfile.v1.bak-<n>
and, when it cannot convert it, writes the default in its place - on every
start. 19 Caddyfile examples in the docs were Caddy v1 (`proxy / localhost:3001
{ websocket transparent }`, `browse`, `fastcgi`, `tls self_signed`, `ext`,
v1 `log`/`errors`, `root /path`), so a file copied from the snap install page
was renamed each time it was put back. All are now Caddy 2 (reverse_proxy,
file_server browse, php_fastcgi, tls internal, try_files, log output) and pass
`caddy adapt` with Caddy 2.11.7. Also:

- `http://X https://X { tls ... }` became `X {`: Caddy 2 refuses TLS on the
  http address and redirects to https by itself;
- the Windows examples `load` the certs folder - Caddy 2's load takes folders;
- the Docker Meteor3 Caddyfile gave the Let's Encrypt and CloudFlare variants
  of one site the same host, which Caddy 2 refuses as ambiguous; each has its
  own host now;
- Caddy.md's logs example and its systemd unit, installer and setcap are
  Caddy 2 (`caddy run --config`, no getcaddy.com, no -conf/-agree/-email).

The fallback template the migration writes proxied to localhost:3000. With
Caddy enabled the snap runs WeKan on caddy-bind-port (default 3001), so a
migrated site pointed at nothing. Both templates now read the snap settings
from caddy-control's environment - `:{$CADDY_PORT:8080}` and `reverse_proxy
localhost:{$CADDY_BIND_PORT:3001}` - so `snap set wekan port=...` reaches
Caddy on the restart the configure hook already does; that hook's sed lines
only ever matched Caddy v1 lines. The commented TLS example in the template
had `protocols h1` inside a site and a stray `}`, so uncommenting it failed;
it uses `alpn http/1.1` now.

tests/caddyfileExamplesV2.test.cjs finds every Caddyfile in the docs and the
snap, fails on Caddy v1 syntax and on a Caddy 1 command line, checks the
templates' ports, and with a Caddy 2 binary runs `caddy adapt` on all 30.
snapStagePackages.test.cjs pinned the wrong port 3000 and now pins 3001.

Thanks to Group-Deed and xet7 !
2026-10-15 22:05:49 +03:00
Lauri Ojansivu 7dfd942ff6 LDAP: a sync interval in milliseconds no longer stops WeKan.
"[uncaughtException] WeKan is stopping: TypeError: string.toLowerCase is
not a function at later.parse.text ... at Object.schedule
(wekan-ldap/server/sync.js)", in a snap restart loop. The docs give
LDAP_BACKGROUND_SYNC_INTERVAL in milliseconds, settings_get() turns a
numeric value into a Number, and the schedule handed it straight to
later's text parser, which threw from a timer. Text later could not read
did not throw, but made a schedule that never ran - as a quoted
'every 1 mins' from a compose file did, the second report in #2354.

packages/wekan-ldap/server/syncSchedule.js reads the setting and never
throws: milliseconds (a Number or digits) become that interval, later.js
text is read as before, one pair of surrounding quotes is removed, unset
keeps the original default (recur().on(0).minute()), and anything
unreadable logs why and uses the default. The docs, the snap description
and the compose files say both forms work, instead of "leave this unset
so it does not crash".

Tests: tests/ldapSyncSchedule.test.cjs reproduces the crash with the real
later.js from the build, schedules 3600000 ms an hour apart and 10000 ms
ten seconds apart, reads quoted text, keeps the default, never throws on
any value a setting can hold, and fails if any server file hands a setting
to parser.text directly.

Thanks to B2RN and xet7 !

Fixes #2354.
2026-10-15 03:17:49 +03:00
Lauri Ojansivu 1bf7a62cab Serve HTTPS from WeKan itself, when a certificate is configured.
#916 (decided 2026-10-14): HTTPS_PORT with HTTPS_CERT_FILE and
HTTPS_KEY_FILE (a path or the PEM itself) makes WeKan serve HTTPS; without
them nothing changes, and a proxy stays the recommendation for
production. Meteor's HTTP server - pages, DDP, websockets - is not
replaced: a TLS listener hands each decrypted connection to it, so
everything works the same over HTTPS. A renewed certificate is loaded
within a minute without a restart (a broken one keeps the old).
HTTPS_REDIRECT=true redirects plain HTTP to ROOT_URL when that is https,
else the same host on the HTTPS port, keeping only the path. The snap
gets https-port, https-cert-file, https-key-file, https-bind-ip and
https-redirect.

tests/httpsServer.test.cjs makes a real certificate with openssl, serves
a page and a websocket upgrade through the bridge, swaps the certificate
without a restart, and refuses incomplete settings, an untrusted
certificate, an injected host and a scheme-relative redirect.

Thanks to 68040 and xet7 !

Fixes #916.
2026-10-14 08:25:25 +03:00
Lauri Ojansivu 78957e14cb Send outgoing webhooks through an HTTP proxy, with the SSRF checks kept.
HTTP_PROXY, HTTPS_PROXY and NO_PROXY now work for every outgoing request
that goes through the SSRF guard: webhooks, imports, avatar downloads,
list sync. The destination is still resolved once and checked against
the blocked ranges first, and the proxy is handed that checked address,
never the name: an http:// request goes to the proxy in absolute form on
the pinned address with the real Host, an https:// one through a CONNECT
tunnel to the pinned address with TLS still verified against the real
name (and WEBHOOK_TLS_CA_CERT). A name resolving to an internal address
is refused before the proxy is asked anything. Proxy credentials in the
URL become Proxy-Authorization. The snap gets http-proxy, https-proxy and
no-proxy.

tests/outboundProxy.test.cjs runs a real proxy on loopback: the pinned
address, the Host header, the credentials, the CONNECT authority, and
that a refused destination never reaches the proxy.

Thanks to gbarre and xet7 !

Fixes #1455.
2026-10-14 08:20:30 +03:00
Lauri Ojansivu 242c4b097c Sandstorm uses the same Node.js, npm and FerretDB as other platforms.
The .spk now carries the exact Node.js the Dockerfile pins (26.11.1), which
is what https://wekan.fi/version.txt advertises, downloaded and verified
with releases/embed-verified-node.sh like the zip bundles, instead of
Meteor's dev-bundle node or the newest Node 24. FerretDB is fetched by the
release tag version.txt names, and the Sandstorm and Windows workflows
install the Dockerfile's npm with releases/use-release-npm.sh instead of a
hard-coded npm 12.0.2. Comments and docs describing the current runtime
say Node 26.

Thanks to xet7 !
2026-10-11 13:12:21 +03:00
Lauri Ojansivu ad51a03731 Log in by full-page redirect by default with OAuth2/OIDC, Google & co, SAML and CAS.
Every login that chooses between a popup and a redirect opened a popup by
default. Google's sign-in pages, and other identity providers', can send
Cross-Origin-Opener-Policy, which makes Meteor's popup look closed at
once: the login was tried before the provider answered, and the user
was back on the sign-in page with no error. Popups are also blocked in
iframes and on some phones. The full-page redirect has no popup to lose.

- OAUTH2_LOGIN_STYLE (OAuth2/OIDC): redirect unless it says popup, in the
  server, the Admin Panel catalog and the samples.
- OAUTH_PROVIDERS_LOGIN_STYLE (Google, GitHub, Facebook, X, Meteor
  Developer, Weibo, Meetup): redirect by default, in the code, Dockerfile,
  snap, Sandstorm package and samples.
- SAML: both identity-provider profiles log in by redirect;
  SAML_LOGIN_FLOW=popup still chooses the popup, and the client no longer
  falls back to a popup while the configuration loads.
- CAS: redirects unless "popup": true. Its redirect could never finish:
  nothing called Meteor.initCas, which the package now does at startup.
  The sign-in page also passed username and password as loginWithCas's
  options and callback, so its callback never ran, and the CAS redirect
  page echoed the request address into HTML unescaped.

A redirect login's error now reaches the reloaded sign-in page, from
accounts-oauth's page-load hook and the SAML and CAS events, instead of
the page coming back silently.

Verified against a freshly built and prepared bundle with the local
identity-provider suite and no login style set: OIDC, SAML, CAS and all
seven Meteor providers log in by redirect, and each refusal is shown on
the sign-in page (31 of 31 with Chromium). Its LDAP wrong-password case
expected wording that changed in 679a8b3499 and is corrected.

Thanks to xet7 !
2026-10-08 15:18:59 +03:00
Lauri Ojansivu dfcd115ff3 Let accounts created by an OAuth2/OIDC login join a default organization.
Organizations could gain new users automatically by email domain, but users
who register through one identity provider - the reporter's Nextcloud -
often share no domain, so they could not be grouped. OAUTH2_DEFAULT_ORGANIZATION,
or its field under Admin Panel / People / OAuth2, names an existing
organization (by short name, display name or id) that every account created
by an OAuth2/OIDC login joins, beside the domain rule. A name that matches no
organization creates none: the login goes on and the server log says so.

Listed on every platform, with snap help lines for it and for
DEFAULT_AVATAR_URL and OAUTH_PROVIDERS_ALLOWED_EMAIL_DOMAINS, which lacked
them.

Thanks to vasyugan and xet7 !

Fixes #5339.
2026-10-08 11:58:16 +03:00
Lauri Ojansivu b426f9cfa8 Show a default avatar from DEFAULT_AVATAR_URL for users without one.
A user who had not uploaded an avatar was shown with initials only. The
maintainer accepted a general avatar feature configured in environment
variables only, with a URL to an intranet server or a Gravatar-style service
and the username replaced. DEFAULT_AVATAR_URL is that template: {username},
{userId}, {emailMd5} and {emailSha256} are replaced, URL-encoded, and only
an http(s) template is used. /avatar-default/<userId> redirects the browser
there; the server fetches nothing. An uploaded avatar always wins, and when
the default image does not load the initials are shown again. There is no
Admin Panel field. The variable is listed on every platform and documented in
docs/Features/Members/Default-Avatar.md.

Thanks to jLouzado and xet7 !

Fixes #824.
2026-10-08 11:55:42 +03:00
Lauri Ojansivu fe60911408 Restrict OAuth login providers to email domains.
OAuth2/OIDC logins could be limited to email domains with
OAUTH2_ALLOWED_EMAIL_DOMAINS, but the Meteor login providers (Google,
GitHub, Facebook, X, Meteor Developer, Weibo, Meetup) let anyone with an
account there sign in. OAUTH_PROVIDERS_ALLOWED_EMAIL_DOMAINS, or the new
field under Admin Panel / People / OAuth login providers, restricts them
with the same rule and the same policy code. It is checked before an account
is created or merged, and on every later login, so narrowing the list also
applies to existing accounts. A provider that sends no email is refused while
a restriction is set, and a list that is not domain names is refused when
saved instead of locking everyone out.

Listed on every platform. New text is in English, pending Transifex.

Thanks to jakubgs and xet7 !

Fixes #1904.
2026-10-08 11:48:01 +03:00
Lauri Ojansivu 71cd2aed05 Read MONGO_URL_FILE, MAIL_URL_FILE and S3_SECRET_KEY_FILE instead of three dead secret files.
MAIL_SERVICE_PASSWORD_FILE, MONGO_PASSWORD_FILE and S3_SECRET_FILE were
listed on every platform, and nothing read them. Per the maintainer decision
of 2026-10-08:

- MONGO_URL_FILE holds the whole MongoDB URL. Meteor connects before any
  WeKan code runs, so the Docker entrypoint, the snap's wekan-control,
  start-wekan.sh and start-wekan.bat read it and start WeKan with MONGO_URL
  set. An unreadable or empty file stops the start instead of falling back
  to a default database. The snap log now masks a password in MONGO_URL.
- MAIL_URL_FILE and S3_SECRET_KEY_FILE fill MAIL_URL and S3_SECRET_KEY first
  thing in server/main.js (models/lib/envSecretFiles.js). As for the login
  secrets, the variable wins over its file.
- The three dead names are gone from the Dockerfile, every docker-compose
  file, the snap settings and help, the start scripts and the docs. The
  example secret files are renamed to match, and WeKan logs a warning naming
  the replacement when a retired name is still set.

The issue itself was closed earlier, with only part of this done.

Thanks to xet7 !
2026-10-08 11:07:58 +03:00
Lauri Ojansivu c1d1a04790 Implement automatic logout with LOGOUT_WITH_TIMER and the LOGOUT_* settings.
The snap, Docker, docker-compose and start scripts have offered
LOGOUT_WITH_TIMER, LOGOUT_IN, LOGOUT_ON_HOURS and LOGOUT_ON_MINUTES since
2018, but the code that read them was removed with the job queue it ran on,
so they did nothing. Per the maintainer decision of 2026-10-08 they work
again. A login ends LOGOUT_IN days after it was made, or at
LOGOUT_ON_HOURS:LOGOUT_ON_MINUTES server time (the next such time, or on the
day LOGOUT_IN days later). Once a minute the server removes the expired
login tokens in one query, and Meteor signs out the browsers that used them.
The four settings are overridable in Admin Panel / People / Login like the
other login variables, with hours and minutes bounded. An unusable
combination signs nobody out and the server log says why.

tests/logoutTimer.test.cjs checks the one-query cutoff against the
per-login deadline over two years of logins in three time zones, two of them
with daylight saving time.

Thanks to xet7 !
2026-10-08 11:03:50 +03:00
Lauri Ojansivu f927cb3c50 Snap: name an AppArmor-refused database connection at once, and stop the snapctl get errors.
The logs in #6746 show the real cause of "write: permission denied" from
database-restore and of WeKan waiting forever for FerretDB: 1300 kernel
lines of apparmor="DENIED" operation="file_perm" class="net" for
snap.wekan.wekan on 127.0.0.1:27019, with the same denial for snap-store
and standard-notes on that computer. FerretDB was running and accepting
connections; the kernel refused the first write. That is snapd 2.77.1 on a
kernel with an AppArmor socket mediation bug (Launchpad snapd bug 2169038),
fixed by a newer kernel and worked around by `snap revert snapd`.

WeKan cannot lift that denial, so it now says what it is. A new
bin/socket-denied recognises the refusal and prints the denial to look for,
the upstream bug and both ways out. wekan-control's FerretDB and MongoDB
wait loops keep each attempt's error and print it on the first refused
attempt instead of "not ready yet" for two minutes; database-backup and
database-restore stop at once instead of starting an already running
service and waiting 90 seconds.

The same log began with "error: snapctl: get which option?" four times:
SAML_IDP_PROFILE, SAML_WANT_RESPONSE_SIGNED, SAML_WANT_ASSERTIONS_SIGNED
and SAML_LOGIN_FLOW were listed in bin/config without a KEY_ name, so
wekan-read-settings ran a bare `snapctl get` for them and `snap set` could
never reach them. They now have their snap keys, the CORS_EXPOSE_HEADERS
description has its right name, and a key without a snap name falls back
to its default instead of calling snapctl.

Tests: snapSocketDenied, snapSettingsKeys, and extended snapDatabaseRestore
and ferretdbWaitTimeout.

Related to #6746: the reporter still has to update the kernel or revert
snapd, so the issue stays open until that is confirmed.

Thanks to fabiosalles and xet7 !
2026-10-07 15:56:19 +03:00
Lauri Ojansivu fa75d59fd0 Snap: start the database before backup and restore, and say why it does not answer.
wekan.database-restore and wekan.database-backup talked to whatever was
on the database port and nothing else. After `snap stop wekan`, which the
restore steps tell people to run, nothing is there; on a FerretDB snap the
database is its own service that starting WeKan alone does not bring back.
The tools then failed after a 30-second server-selection timeout with a
driver topology dump naming neither the service nor its log.

The new bin/database-ready asks bin/database-role which database holds
the data, starts that service when nothing answers, waits for it, and when
it still does not answer stops with the driver's own error and the
`snap logs` / `snap services` commands that show the reason. A "permission
denied" is explained as a security-policy denial on this system, not the
database, with the journal command that names the rule.

WeKan's own wait for FerretDB discarded the ping error, so its log said only
"FerretDB not ready yet" for every cause. db-eval now prints why a command
failed on stderr, and the wait's one-time hint shows it. The same hint
suggested `snap set wekan database=mongodb`, a setting the configure hook
removes, so that advice did nothing; it is gone.

The backup script also sources its settings and passes the archive path
quoted now, so a path with a space works.

tests/snapDatabaseRestore.test.cjs runs both scripts in a stand-in snap:
FerretDB or MongoDB started by role, a running database left alone, and,
negatively, a database that never answers stopping the tool before it
runs, with the error shown. A source guard requires both tools to wait for
the database first. tests/ferretdbWaitTimeout.test.cjs now requires the
ping error in the hint and rejects the removed setting. Not run inside an
installed snap here.

Thanks to fabiosalles and xet7 !
2026-10-07 15:17:42 +03:00
Lauri Ojansivu 2122214fb6 Snap: default cards-loading to auto, like every other platform.
The snap set CARDS_LOADING=all whenever cards-loading was unset, so every
board on a snap shipped all of its cards, comments, checklists and attachment
records to the browser, while the code's own default is auto (a board with
more than 500 cards loads only the visible cards). The snap default, its
description, wekan-help (which pointed at an Admin Panel toggle that no longer
exists) and server/cards-loading.js now say auto.

Thanks to markusst1982 and xet7 !

Fixes #6745.
2026-10-07 03:08:48 +03:00
Lauri Ojansivu 0314406656 Read login secrets from *_FILE, and let the Admin Panel override DEFAULT_AUTHENTICATION_METHOD.
LDAP_AUTHENTIFICATION_PASSWORD_FILE and OAUTH2_SECRET_FILE were listed in the
Dockerfile, snap, docker-compose and start-wekan since #5724, but no code read
them, so a password could only be an environment variable. WeKan now reads the
file itself, at each login (a rotated secret applies at once), so the password
is never in the environment - the point of Docker / Kubernetes secrets. The
order is the Admin Panel, the variable, then its file; one trailing line break
is dropped. The application code is the same on every platform, so it works in
Docker, the snap (files under /var/snap/wekan/common), bundles, AppImage,
Flatpak, Mac and Windows. Admin Panel / People shows when the password comes
from the file and when the file cannot be read, never the path or content.
The path itself is an environment variable only: settable in the Admin Panel
next to the LDAP host or the OAuth2 token endpoint, it would let the server
read any file and send it there as the password.

DEFAULT_AUTHENTICATION_METHOD is a field of the Login pane's settings form.
Choosing a method overrides the variable; Default gives it back. Before, the
variable rewrote the stored method at every start, so an administrator's
choice was lost on restart. The published method is now the override, else the
variable, else password. On upgrade, a method chosen with the old dropdown
while no variable was set becomes the override, once, so it is not lost. The
old dropdown is removed: two controls for one setting on one page.

The snap key for the LDAP password file was spelled
ldap-authentification-password-file, unlike its siblings and its help text;
it is ldap-authentication-password-file now (it had no effect before).
MAIL_SERVICE_PASSWORD_FILE, MONGO_PASSWORD_FILE and S3_SECRET_FILE are still
not read by WeKan; secrets/README.md says so.

Thanks to Roemer, CrashOverride-lab, ww-daniel-mora and xet7 !
2026-10-05 21:11:12 +03:00
Lauri Ojansivu eb49a4b1b6 Override every login environment variable in Admin Panel / People.
Each login method has its own section: LDAP, OAuth2 (OpenID Connect and
Oracle OIM), CAS and Header login are new or complete, and the Login pane
gets PASSWORD_LOGIN_ENABLED and ACCOUNTS_COMMON_LOGIN_EXPIRATION_IN_DAYS.
models/lib/authConfigCatalog.js lists all 103 variables; server/lib/
authConfig.js resolves each one at run time (Admin Panel value first, then
the environment variable) for the app and, through
globalThis.__wekanAuthEnv, for the wekan-ldap, wekan-oidc and
wekan-accounts-cas packages. OAuth2 and CAS service configurations and LDAP
background sync are reapplied when their settings are saved.

Passwords and client secrets (LDAP_AUTHENTIFICATION_PASSWORD, OAUTH2_SECRET)
never reach the browser: the page learns only whether one is set and where
it comes from. Other values have credentials written inside a URL masked on
the server, and a URL field refuses them.

Fixed on the way:
- The Admin Panel LDAP overrides never applied. The bridge read Settings with
  a server-side findOne(), which Meteor 3 refuses; the error was swallowed and
  the environment used. The settings are now held in an observed cache.
- LDAP Test connection never existed on the server (testConnection.js was not
  imported) and used the synchronous Meteor.user().
- PROPAGATE_OIDC_DATA=false turned the feature on.
- CAS read only the misspelled CASE_VALIDATE_URL; CAS_VALIDATE_URL now works
  and the old name still does.
- snap help named three group-filter keys snap set does not know.

Every catalog variable is now listed in the Dockerfile, the docker-compose
files, snap config and help, and start-wekan.sh/.bat; 14 were missing.
tests/authConfigCatalog.test.cjs pins resolution, secrets, input validation,
platform coverage, and - across the whole tree - that no code reads a login
variable outside the catalog or straight from process.env, and that no
server code calls the synchronous Settings.findOne() or Meteor.user().
tests/playwright/specs/admin-login-env-overrides.e2e.js drives the pages.

Thanks to xet7 !
2026-10-05 19:48:48 +03:00
Lauri Ojansivu dc2e7592a3 Accept nested Active Directory groups in the LDAP group filter.
Since v12.08 (DirectoryGroupBleed) LDAP_USER_AUTHENTICATION=true logins check
LDAP_GROUP_FILTER_ENABLE, which they did not do before. The membership clause
(member=<user DN>) matches direct members only, so in Active Directory, where
access is granted through a team group nested in the access group, legitimate
users were refused, REST clients got 401, and the refusals were listed in
Admin Panel / Problems as ldap.group-denied.

LDAP_GROUP_FILTER_NESTED=true makes both group searches use AD's
LDAP_MATCHING_RULE_IN_CHAIN, (member:1.2.840.113556.1.4.1941:=<user DN>), so
the login filter and admin, role and org/team sync see nested membership. It
is off by default, and an attribute already written as the extensible match
is used as written. The user DN stays escaped, and a user who cannot be named
is still refused without a search.

Documented in LDAP.md with an upgrade note, and added to the Dockerfiles,
docker-compose files, snap config and start-wekan scripts.
tests/ldapNestedGroups.test.cjs drives isUserInGroup and getUserGroups with and
without the setting, and checks that every member clause in ldap.js goes through
groupMemberClause.

Thanks to rmb82 and xet7 !

Fixes #6744.
2026-10-05 18:53:52 +03:00
Lauri Ojansivu 5ef5757c71 Continuous backup: encryption at rest, cloud upload, and a SQLite restore applied on restart.
As decided on 2026-10-03:

- Encryption: with Encrypt on, the built-in engines seal what they store -
  segments, page deltas, bases, blobs and state - with AES-256-GCM from
  Node's crypto. The key is a file the administrator holds outside the
  target and everything the stream reads, never in the database: 64 hex
  characters, or a passphrase stretched with scrypt and the stream's salt.
  stream.json keeps the salt and an HMAC check, so a wrong key is refused
  on save and before a restore; blob names are keyed HMACs; a generation
  records whether it is encrypted and is refused without its key.
- Cloud upload: the target is mirrored to S3/MinIO, Azure or GCS with the
  Attachments storage panes' adapters and credentials. Sealed files go up
  once, and an index or generation file again after the files it names, so
  the remote copy never lists a segment it lacks; retention removals follow,
  a failed upload is retried, and Fetch from cloud fills a lost target.
- SQLite restore on restart: a rebuilt, checked wekan.sqlite is staged in
  <db>/continuous-restore with RESTORE_REQUESTED "continuous". The Docker
  entrypoint, start-wekan.sh and the Snap keep the live database and its WAL
  in continuous-restore/replaced first, then copy the staged one in, before
  FerretDB opens its files. A pending request is never overwritten.

Tests: tests/continuousBackupEncryption.test.cjs, tests/continuousBackupCloud.test.cjs,
tests/continuousBackupRestartRestore.test.cjs (each script's real restore
block in a sandbox), encrypted integration tests on a real replica set and
WAL database, the server methods, and the pane in Chromium and WebKit.

Thanks to xet7 !
2026-10-03 08:52:16 +03:00
Lauri Ojansivu 1173d0a51d Raise Caddy's open-file limit in the snap at every start.
snapcraft has no per-app ulimit key and snapd owns the systemd unit, but
a process may always raise its own soft open-file limit up to the hard
one without privilege. The snap's Caddy service now does that before it
starts Caddy, every time, which is what makes it persist across
restarts and refreshes. CADDY_NOFILE may ask for a lower number; it is
capped at the hard limit, a non-number is ignored, and a failure to
raise is logged without stopping Caddy.

tests/snapCaddyNofile6552.test.cjs runs the helper in bash with a
lowered limit. It has not been run inside an installed snap here.

Thanks to xet7 !

Fixes #6552.
2026-10-02 17:15:23 +03:00
Lauri Ojansivu daf6593adf Verify LDAP server certificates by default.
The Docker image and the snap set LDAP_REJECT_UNAUTHORIZED=false, so an
LDAPS or StartTLS server certificate was not verified unless an admin
changed it, and an empty value disabled verification too. The default is
true everywhere now, and only the exact value false turns it off; a
self-signed or private CA belongs in LDAP_CA_CERT.

Thanks to xet7 !
2026-10-02 14:22:17 +03:00
Lauri Ojansivu d6503b43f5 Choose which SAML signatures are required and log in by full-page redirect.
SAML 2.0 lets an identity provider sign the Response, the Assertion or
both. WeKan always required a signed Response (node-saml's default, never
overridden), so an identity provider that signs only the Assertion was
rejected with "Invalid document signature" before the Assertion was
checked. Admin Panel -> People -> SAML now has SAML_IDP_PROFILE: standard,
which keeps the previous behaviour, or signed-assertion-redirect, which
requires the Assertion signature instead and logs in by full-page redirect.
SAML_WANT_RESPONSE_SIGNED, SAML_WANT_ASSERTIONS_SIGNED and SAML_LOGIN_FLOW
can each be set on their own; left at Default they follow the profile. A
configuration requiring neither signature is refused, and validation
errors now reach the administrator instead of "Internal server error".

In redirect mode the ACS stores the validated profile under the random
credential token and redirects to /sign-in?samlToken=; the page exchanges
it and opens /. The assertion never enters the address. The token is
remembered in the tab that started the login, and a samlToken that tab did
not start is not exchanged, so a link cannot sign a browser into another
account. Errors return as samlError and are shown on the sign-in page.

A test signs responses with a throwaway key and runs them through the
shipped node-saml; browser tests log in through the fixture identity
provider in both flows. The new message is English, pending Transifex.

Thanks to xet7 !
2026-09-29 13:57:51 +03:00
Lauri Ojansivu 05f1f0a032 Add SAML administration, metadata and service-provider logout
Provide shared catalog-driven settings controls with environment fallback, live admin overrides, platform configuration and regression coverage. Document the remaining live identity-provider validation requirement.

Thanks to xet7 !
2026-09-25 12:45:30 +03:00
Lauri Ojansivu 5ed9fc944a Remove obsolete Summernote integration and editor configuration.
Use the Markdown textarea for every editor. Remove the retired environment and Snap options from server settings, all platform launchers, build scripts and current documentation. Keep released and archived changelog entries intact.

Keep notification HTML escaping independent of editor configuration, preserve attachment metadata and mention behavior, and cover Markdown and emoji round trips in browser tests. Also import the translator used by attachment error handlers.

Thanks to xet7 !
2026-09-19 14:32:29 +03:00
Lauri Ojansivu faaa83ed09 Explain and remediate the MongoDB 8.2 crash loop that follows a full disk.
A reported test environment (mongo:8.2.2 in Kubernetes) filled its data
volume: the checkpoint's fdatasync returned ENOSPC, WiredTiger panicked and
mongod aborted - and then it kept failing on every start, with the disk long
since freed. MongoDB 8.2 keeps a throwaway WiredTiger instance under
<dbPath>/_tmp/spilldb for queries that spill to disk and empties it itself on
each start; after the abort that emptying failed ("Failed to clear dbpath of
the internal WiredTiger instance: Directory not empty"), mongod opened the
half-emptied directory, found no version file, reported "Failed to open the
spill WiredTiger instance ... database corruption detected" and fasserted.
Nothing retries, so the pod restarts forever. The data itself is intact;
deleting that one directory is the whole fix.

- snap-src/bin/mongodb-control deletes _tmp/spilldb before every mongod
  start (no mongod is running at that point, and mongod recreates it), and
  its start-failure handler recognises the log line and names the directory.
  The snap ships MongoDB 7 today, so this is a no-op until it does not.
- Admin Panel / Problems: the db.restart row now says what a "No space left
  on device" abort means for a full disk as well as for a network
  filesystem, and both it and db.disk-space name the exact spill directory
  to delete when MongoDB 8.2 will not start afterwards. The probe looks the
  data directory up once and passes it to both rows.
- docs/Databases/MongoDB/Storage-Requirements.md gets the log signature of
  both stages, why the second one never ends, the one command, what must
  not be touched, and that Docker/Kubernetes users run it themselves since
  the database container is MongoDB's own image.
- tests/databaseHealth.test.cjs pins the spill path, both rows' advice, the
  probe wiring, the snap's pre-start deletion (before the first start, after
  the running-instance check, and the only recursive delete apart from the
  existing FerretDB reset) and the documentation.

Thanks to xet7 !
2026-09-11 21:31:10 +03:00
Lauri Ojansivu 61806605fc Add the Meteor accounts login providers and passwordless login to every platform's settings.
OAUTH_GOOGLE_*, OAUTH_GITHUB_*, OAUTH_FACEBOOK_*, OAUTH_TWITTER_*,
OAUTH_METEOR_DEVELOPER_*, OAUTH_WEIBO_*, OAUTH_MEETUP_*,
OAUTH_PROVIDERS_LOGIN_STYLE, OAUTH_PROVIDERS_MERGE_EXISTING_USERS and
PASSWORDLESS_ENABLED are now documented, commented out or defaulted, in
every place the OAUTH2_* and SAML_* settings already are: docker-compose.yml
and its FerretDB v1 / v2 and MongoDB variants, the Dockerfiles' ENV block,
start-wekan.sh, start-wekan.bat, the Snap config (keys list plus
DESCRIPTION_/DEFAULT_/KEY_ triples) and wekan-help, the Sandstorm package
definition, the stacksmith Docker-secrets reader and secrets/README.md.
The comments name the callback URL to register at each provider,
<ROOT_URL>/_oauth/<service>, and say that Admin Panel / People / Login
overrides the environment.

New docs pages docs/Features/Login/OAuth-Providers.md and Passwordless.md,
linked from the docs index. tests/oauthProvidersPlatformEnv.test.cjs pins
that every variable is present on every platform and that the docs exist
and are linked.

Thanks to xet7 !
2026-09-11 11:50:30 +03:00
Lauri Ojansivu 9161c20b39 Document Admin Panel email configuration 2026-09-06 18:35:33 +03:00
Lauri Ojansivu 506c2697a0 Add verified low-load recovery and integrity audits 2026-09-05 23:51:02 +03:00
Lauri Ojansivu 90158d5012 Audit security coverage and recovery failures 2026-09-05 23:51:02 +03:00
Lauri Ojansivu f611ac222f Make three permanently-red suites pass, two of them macOS bugs.
These had been failing on every run, and each turned out to be a different
fault rather than a broken assertion.

autopickReadLeavesNoTrace. snap-src/bin/database-autopick reads MongoDB's
data-file mtimes so that starting mongod to compare the two databases does not
make MongoDB look freshly written. It spelled that with `stat -c %Y` and
`touch -d @EPOCH`, which are GNU. On macOS the stat fails, every file is
skipped by the `|| continue` beside it, MONGO_MTIME_BEFORE stays 0, and the
restore returns having done nothing - silently, and only there. The snap runs
on Linux, but WeKan is developed on macOS and this test runs the real functions
wherever it is run. They now try the GNU spelling and fall back to the BSD one.

provenanceTable. releases/provenance-table.sh opened with
`shopt -s nullglob globstar`, and globstar arrived in bash 4 while macOS still
ships bash 3.2 as /bin/bash: "shopt: globstar: invalid shell option name", and
`set -e` took the script with it. The default file list is a single `find` now,
recursive as `**/` was, with -print0 so a path containing a space survives.
Then the empty case failed too - under `set -u`, bash 3.2 calls an empty array
an unbound variable where 4.4 does not - so the loop uses the
`${files[@]+"${files[@]}"}` form.

sesothoTranslationProgress. Two faults. The script's own `--list` output was
TRUNCATED whenever stdout was a pipe: it prints 128 KB with console.log and
then calls process.exit, which cuts off whatever has not drained, and a pipe
delivered 65,510 bytes - valid-looking JSON stopping mid-key, with status 0.
Redirecting to a file worked, because stdout to a file is synchronous, so this
only bit anything that read the output programmatically. It is written with
fs.writeSync in a loop now, EAGAIN retried, before the exit. The test's other
half asserted an EXACT count of untranslated strings, which went red when
ENGLISH gained the four history-change-* keys - a fact about English, not about
Sesotho. It is a ceiling now: still catches a translation being lost, and does
not demand editing for every new string.

Two of the three guards were updated rather than the code, and both times
because they pinned a spelling rather than a behaviour - the exact globstar
pattern, and an exact count. Both now assert the property that was wanted.

A note for the next one: two of these assertions had to be re-scoped to the
CODE because they matched the COMMENT explaining them. Prose satisfying an
assertion about code is how a guard passes while testing nothing.

Thanks to xet7 !
2026-09-05 04:53:58 +03:00
Lauri Ojansivu 898643eea9 Build the universal change history, and put undo on top of it
Phase 1 of docs/Features/Reports/History/History.md §10, plus the write half of
phase 2. Ctrl+Z is no longer a position-only feature.

THE STORE. models/changeHistory.js is the append-only collection of §4: one row
per change, carrying every container id it sits inside (boardId, swimlaneId,
listId, cardId) so a container scope is a plain equality rather than a join the
database cannot do - which is what makes a swimlane's history include its lists'
and cards' rows.

It imports NO other model, deliberately. Its predecessor imports Cards, Lists,
Swimlanes, Checklists and ChecklistItems so its undo() can write to them, and
that is precisely why models/cards.js could not import it, guarded on an assumed
global instead, and recorded nothing for years. A collection that entities must
import cannot import entities. Applying a change back to a document therefore
lives in server/models/changeHistory.js, which nothing imports and which may
import anything.

THE RULES ARE PURE. models/lib/changeHistoryQuery.js holds the scope-to-selector
translation, the search and the selection normalisation, with no Meteor and no
database, because that is where this feature is either right or quietly wrong:
a scope that resolves to the wrong id column shows one board's history under
another board's menu, and a selection that does not normalise its input restores
the wrong rows. Both are silent. 17 tests, including that an unknown or
half-given scope is REFUSED rather than widened into a selector that matches
everything.

UNDO IS NOW THE WHOLE HISTORY. changeHistory.undoLast/redoLast replace the
position-only methods; the keyboard bindings and the tested pickUndo/pickRedo
rule are unchanged. One rule covers every change type instead of a case per
action: undo applies previousContent, redo applies newContent. Restores go
through the same setters an ordinary edit uses, so validation, hooks and
Activities still run, and each restore is itself recorded twice - once
attributed to whoever made the change being restored, once to whoever pressed
Restore (§8.3).

RECORDED SO FAR: card description edits (§10.2's first content group - the
previous text is read BEFORE the write, since after it the old value is gone),
card moves, list moves, and list soft-delete/restore, which is what makes
"undo a deleted list" work.

changeHistory is in the snap's MERGE_COLLECTIONS, as §9a.4 requires the moment
the collection exists: a history row written on the copy that is not served is
work that would otherwise be stranded in a database nobody opens.

NOT BUILT: every UI in §7, §7a and §8 - the popup, the table, the contributor
avatars, the Restore button, the "History" menu items - and recording for the
remaining groups of §3. The methods those screens need exist and are tested;
nothing calls them yet. Both docs now say which half is which, because the last
time this document claimed more than the code did, the gap survived for months.

Thanks to xet7 !
2026-09-04 22:56:52 +03:00
Lauri Ojansivu cc94828e85 Revert "Auto-detect packaged startup endpoints"
This reverts commit 0bf470c57e.
2026-08-31 04:31:20 +03:00
Lauri Ojansivu d2427bd8b5 Honor disabled Snap database comparison
Skip the database comparison launcher entirely when autopick is false, and initialize FerretDB polling defaults safely when strict shell mode finds the variables unset. Add regressions for both startup failures reported from revision 3872.\n\nThanks to xet7 !
2026-08-31 00:25:49 +03:00
Lauri Ojansivu 4f0d78daf8 Keep Snap startup inside strict confinement
Replace the host timeout command used by automatic database comparison with a bounded shell process monitor. Strictly confined snaps cannot execute /usr/bin/timeout, so that attempt stopped startup before WeKan could bind its web port. Preserve timeout cleanup, status 124 diagnostics, and add malformed-setting and confinement regressions.\n\nThanks to xet7 !
2026-08-31 00:25:49 +03:00
Lauri Ojansivu 830d1f31c5 Recover stale Snap startup network locks 2026-08-30 23:39:23 +03:00
Lauri Ojansivu e1a8ac0018 Use the live Snap database URL in problem reports 2026-08-30 23:32:46 +03:00
Lauri Ojansivu 0bf470c57e Auto-detect packaged startup endpoints
Use the current network IPv4 address and an available web port when ROOT_URL is not configured, preferring port 80 and omitting its URL suffix. Keep bundled FerretDB on a separate loopback-only free port and report both resolved endpoints at startup across bundles, containers, AppImage, Windows and Snap.

Thanks to xet7 !
2026-08-30 18:04:24 +03:00
Lauri Ojansivu cacf4049c9 Enable write-notified FerretDB OpLog reactivity 2026-08-29 06:01:39 +03:00
Lauri Ojansivu d7a225eb05 Make Snap database restore safely replace data
Retain the existing --drop restore behavior that prevents duplicate-key collisions, validate that exactly one real archive was supplied, and preserve paths containing spaces as one mongorestore argument. Add command-level positive and negative regressions with a mocked Snap environment.

Thanks to ram19890 and xet7 !

Fixes #6547,
2026-08-25 20:17:49 +03:00
Lauri Ojansivu 6ec619e438 Bound platform resources and report runtime failures. 2026-08-23 00:16:15 +03:00