Commit Graph
17 Commits
Author SHA1 Message Date
Lauri Ojansivu 0f4d6a1660 Document prefixed cookie sessions and verification progress
Thanks to xet7 !
2026-09-13 15:58:28 +03:00
Lauri Ojansivu 2fd461fa55 Add on-premise OAuth2 email domain restrictions.
Check the provider email before account and membership changes. Document the roadmap export validation and remaining source review.

Thanks to xet7 !
2026-09-12 21:01:40 +03:00
Lauri Ojansivu bbcd98d9d8 Add REST API for attachment soft delete and restore, Admin Panel Problems, OAuth login provider and passwordless settings, card field order and pausing a rule.
Every feature of the recent releases that had a UI but no endpoint, on the
same server-side code the UI uses:

- DELETE /api/boards/:boardId/attachments/:attachmentId soft-deletes,
  POST .../attachments/:attachmentId/restore restores, and
  GET /api/boards/:boardId/attachments/deleted lists what is restorable -
  all through the attachments.softDelete / attachments.restore methods the
  card and the card history use, run as the request's user. No hard delete.
- GET /api/admin/problems (the Problems status overview plus the new-problem
  count per stream), GET /api/admin/problems/:stream (one page, with
  limit/skip/search) and POST /api/admin/problems/:stream/acknowledge,
  through the admin-only eventLog* methods the Admin Panel pages call.
- GET /api/admin/oauth-providers, PUT /api/admin/oauth-providers/:providerKey
  and PUT /api/admin/passwordless, through saveOauthProviderSettings,
  savePasswordlessSettings and getOauthProviderConfigSources. A provider's
  secret is reported only as { source, hasValue }, never its value.
- GET/PUT /api/boards/:boardId/cardFieldOrder, normalised with the same
  applyCardFieldOrder() the card renders with.
- PUT /api/boards/:boardId/rules/:ruleId accepts `enabled` to pause and
  resume a rule, and GET reports it.

The OpenAPI generator is fixed on the way: server/models/boards.js has had a
bare `catch {` since v11.67, the esprima parser cannot read that, and a parse
failure was silently skipped - so public/api/wekan.yml has shipped WITHOUT
the whole Boards API since then. It now downlevels `catch {` and
`for await (`, warns when a file cannot be parsed, and no longer emits an
empty sub-schema for a primitive array-element marker such as
`wipLimitGroups.$.listIds.$`, which made the spec unparseable YAML.
public/api/wekan.yml and wekan.html are regenerated with the release
workflow's own commands: 156 operations, up from 122.

tests/restApiNewFeatureRoutes.test.cjs pins every new route to its method,
path, @operation block and authentication check, that the OAuth endpoints
never mention a secret outside the input whitelist, the generator's two
fixes, that the generated and the committed spec carry the Boards API and the
new operations, and - as the negative sweep - that no route in models/ or
server/models/ lacks an authentication check.

Thanks to xet7 !
2026-09-11 21:18:35 +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 1914720360 Document new board-view charts, Bigboard, Roadmap, Group by Assignee,
Multi Board Calendar, Notification Settings, Two-Factor Authentication
and the My Cards/Due Cards/My Attachments member pages.

Thanks to xet7 !
2026-09-10 21:29:43 +03:00
Lauri Ojansivu 84c7140012 CHANGELOG: link the Star Swimlane/List/Card entry to its commit (#1172). 2026-09-10 21:13:00 +03:00
Lauri Ojansivu 517bee3f0b Add Sign in with Apple support: server-signed JWT client secret for OAuth2.
Apple's Sign in with Apple is OIDC-compatible, so it works through Wekan's
existing generic OAuth2/OIDC client - except its "client secret" is not a
static string: it must be a short-lived JWT the server signs itself (ES256),
using a private key downloaded from Apple's developer portal. Every other
generic OAuth2 provider Wekan supports (Keycloak, Authelia, Nextcloud, ...)
keeps sending its static OAUTH2_SECRET unchanged.

models/lib/oauth2ClientSecretJwt.js mints that JWT using only Node's built-in
crypto module (no new dependency: ES256 signing with IEEE-P1363 signature
encoding has been supported since Node 12). It is opt-in: when
OAUTH2_SECRET_JWT_KEY_PATH is unset (the default, and every existing
provider's configuration), maybeGenerateOauth2ClientSecretJwt() returns null
and packages/wekan-oidc/oidc_server.js falls back to the static OAUTH2_SECRET
exactly as before.

Apple's other quirk - it returns the user's name only on the very first
authorization - needs no special-casing: Accounts.onCreateUser
(server/models/users.js) already copies the OIDC fullname/email claims into
the user's profile only once, at account creation, and never overwrites them
on later logins (Meteor's updateOrCreateUserFromExternalService only touches
services.oidc.* for a returning user, not profile.*).

docs/Features/Login/Apple.md documents Apple's endpoints and the new env
vars, mirroring the Keycloak/Authelia docs pattern.

Thanks to xet7 !

Closes #2458,
2026-09-10 20:42:42 +03:00
Lauri Ojansivu 87c1e82ec7 Add example Authelia OAuth2/OIDC configuration for Wekan login.
Add docs/Features/Login/Authelia.md with Snap and Docker settings mapped
to Authelia's OIDC endpoints (authorization_endpoint, token_endpoint,
userinfo_endpoint under /api/oidc/*, from Authelia's own OIDC docs),
matching the format already used for Keycloak and Zitadel, and note that
Authelia does not yet implement RP-Initiated Logout so OAUTH2_LOGOUT_ENDPOINT
should stay unset for it. Also linked from docs/README.md's Login Auth list,
the OAuth2 providers list in docs/Features/Login/OAuth2.md, and given the
same commented OAUTH2_* example block in docker-compose.yml and every other
docker-compose-*.yml variant that carries the OAuth2 examples.

Thanks to tamaskan and xet7 !

Closes #4210,
2026-09-10 19:49:01 +03:00
Lauri Ojansivu 1218cd281f Add test-menu.sh and checked-in example inputs for docs/Features
test-menu.sh mirrors the docs/Features menu structure and runs the actual
WeKan code for each feature: a dedicated runner for Login (a real REST
username/password round trip) and ImportExport/PDF (create a board, export
it, check the PDF header), and a generic fallback that matches a feature
against this repo's own automated tests by filename. Every feature run
writes output.txt/result.txt/run.log under .tools/test-menu/<timestamp>/,
mirroring the docs/Features path, and never leaves an empty or missing
result.

The example INPUT for a feature is checked into the repository next to its
documentation instead: docs/Features/<path>/example-input.txt, hand-written
for Login and ImportExport/PDF and extracted from the feature's own .md
elsewhere. test-menu.sh only reads these; it never writes into docs/Features.

An earlier version of the matcher also grep'd test file CONTENTS for a
keyword once the filename search failed, which pulled in noise (a word like
"webhook" mentioned in passing in a dozen unrelated tests); it is
filename-only now.

Thanks to xet7.
2026-09-08 17:49:24 +03:00
Lauri Ojansivu 1fe46c6044 Record every group, and give History one table for every scope
Phases 3, 5 and 6 of docs/Features/Reports/History/History.md, and the viewer of
phase 2.

RECORDING EVERYTHING, FROM ONE PLACE. §5 suggests "a thin, central choke point
... avoids sprinkling calls everywhere", and server/models/changeHistoryHooks.js
is that: an after.update hook per collection that diffs the changed fields, plus
insert/remove for the sub-entities. Cards, lists, swimlanes, checklists,
checklist items and comments are covered across every group §3 names.

The advantage over editing twenty setters is not brevity, it is COVERAGE: the
REST API, the CSV and Trello importers and the rules engine all write through
the collection and none of them call the client setters, so a per-setter rollout
would have recorded a description edited in the UI and silently missed the same
edit made over the API.

What a hook must not do is record too much, so models/lib/changeHistoryGroups.js
is a table rather than a rule: modifiedAt and dateLastActivity change on nearly
every write and would bury the changes a person actually made, and the four
fields of a move only mean anything together - reported separately, one drag
becomes four rows and undo puts back a quarter of it. Card.move and the list
soft delete therefore record themselves, as one change each. The description
setter records nothing now: the hook covers it, and recording in both places
would have needed two presses of Ctrl+Z to undo one edit.

ONE TABLE, EVERY SCOPE. §7a: "there is ONE implementation, parametrised by
scope". client/components/history/historyTable is that one - contributor pane,
search, pagination, row selection, Restore, RTL - and the card, list and
swimlane menus each open it with a different scope. Adding History to a menu is
a menu item and a two-line handler, exactly as the design promises.

tests/historyOneTemplate.test.cjs keeps it that way. Six copies of a table
drift: one gets RTL and the others do not, one gets the search fixed and the
others keep the bug. The test walks every .jade under client/ and fails if a
second History table is ever defined.

Two things the UI needed that were nearly wrong. The scope has to travel as
`dataContextIfCurrentDataIsUndefined`, because Popup.open's second argument is
OPTIONS - a bare object there is ignored and the popup opens on the menu's own
data context, showing the wrong history. And the popup needs a title key or it
renders with no header and no close button; it reuses the existing `history`
key rather than adding one.

FOUR NEW WORDS. Removed, Edited, Moved, Restored - the Action column is the one
a reader must understand. 'Added' the app already had, and every other label
reuses the word the card view already uses for that section, so a group is
labelled Description or Labels in the language the card beside it speaks. That
kept this to four keys in 197 locales instead of twenty-six. Low confidence on
the same long tail as before.

NOT VERIFIED LIVE. There is no Meteor runtime here, so none of this has been
opened in a browser. §10 asks for each phase to be verified live before the
next; that has not happened, both documents now say so, and the UI in
particular should be treated as unproven.

Thanks to xet7 !
2026-09-04 23:20:12 +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 dc4110e6fe Record card moves in history, so undo of a drag does something
Ctrl+Z after dragging a card did nothing, and had never done anything.

#6478 found that every trackChange call site guarded on

  typeof UserPositionHistory !== 'undefined'

against a bare identifier no file imported. It is an ES-module default export,
not a global, so the guard was always false and nothing was ever recorded. The
fix - import the collection - was applied to the list path in
server/models/lists.js and NOT to the card path in models/cards.js, which kept
the dead guard. So list moves became undoable, card moves did not, and
docs/Features/Login/Undo/Undo.md said card moves were "already present (now
actually runs)" the whole time.

The import here has to be lazy and has to be inside the call:
models/userPositionHistory.js imports models/cards.js, so a top-level import
would be a cycle and could leave the binding undefined depending on evaluation
order. That is the same shape as the cardMoveModifier require a few lines above,
and is most likely why the file was skipped rather than fixed.

The guard is gone from the list path too. It was harmless there - that file does
import the collection, so it was always true - but it is the shape that turned
recording off, and copying that block into a file without the import silently
turns it off again. Which is exactly how the card path stayed dead.

tests/undoRecordsWhatItClaims.test.cjs is the guard the fix needed more than the
fix itself, because undo FAILS SILENTLY: nothing throws when a change is not
recorded, the user just presses Ctrl+Z and nothing happens. It finds the
recording sites rather than listing them, and fails when one cannot reach the
collection, when one reintroduces the assumed-global guard, when recording is
not wrapped so it can never fail the move it records, and when an entity type is
recorded that undo() has no case for. It also pins the reverse gap - swimlane,
checklist and checklistItem have full undo() cases that nothing records - so
that stays a known follow-up rather than a surprise.

Undo.md no longer claims more than the code does, and now says plainly what is
recorded (list moves, list soft-delete/restore, card moves) and what is not
(everything else - a description, a checklist title, labels, members, dates are
written straight to the document with no previous state kept).

Thanks to xet7 !
2026-09-04 21:43:00 +03:00
Lauri Ojansivu aee94c2637 Resolve absolute and Spring OIDC endpoints
Use one endpoint resolver for authorization, token, Oracle token, and user-info requests so complete HTTP and HTTPS URLs remain intact and relative paths are joined without duplicate slashes. Document Spring Authorization Server's default protocol endpoints and callback configuration, with regression coverage for both valid and malformed combinations.

Thanks to Esther125 and xet7 !

Fixes #5150,
2026-08-25 20:07:43 +03:00
Lauri Ojansivu 1485251958 Exclude LDAP groups from user synchronization
Recognize known Active Directory, OpenLDAP, and POSIX group object classes case-insensitively. Skip them during bulk import, reject them at account creation, preserve custom user schemas, and document user search filters.

Thanks to MiteNy and xet7 !

Fixes #4875,
2026-08-25 20:02:32 +03:00
Lauri Ojansivu 433455e0e8 Fail safely during LDAP background presence sync
Keep repeat profile updates and confirmed removed-user disabling, but abort on missing identifier configuration or ambiguous directory matches. Share and test the exact disable and re-enable decisions and document their authority boundary.

Thanks to RowhamD, q16marvin and xet7 !

Fixes #4654,
2026-08-25 19:59:16 +03:00
Lauri Ojansivu 7fb9ad1d75 Close LDAP encryption configuration ambiguity
Document the preferred LDAPS, STARTTLS, and unencrypted settings, replace the legacy FreeIPA example, and pin the existing normalized runtime wiring and warnings with regression coverage.

Thanks to robertdahlem and xet7 !

Fixes #4158,
2026-08-25 19:39:57 +03:00
Lauri Ojansivu c4cb87345b Reorganize documentation and repair links.
Move feature and webserver documentation into the reorganized hierarchy, update references to their new relative paths, and extend link validation across the complete documentation tree.\n\nThanks to xet7 !
2026-08-17 00:24:38 +03:00