308 Commits
Author SHA1 Message Date
Lauri Ojansivu dffe85cce4 Block unauthorized cross-board rule actions
Validate automation destinations before storing a rule and again before executing legacy or imported move, link, and bulk-move actions. Record denied attempts through the bounded RuleBleed canary.\n\nThanks to crypto-nidh and xet7 !
2026-08-29 09:43:23 +03:00
Lauri Ojansivu ca2838ab2f Restore database-independent MongoDB selectors 2026-08-29 06:01:39 +03:00
Lauri Ojansivu 8d427583ef Harden avatar attachment and swimlane boundaries
Serve browser-executable avatar and legacy attachment MIME types as sandboxed opaque downloads, and require board write permission before creating a default swimlane. Summarize rejected swimlane creation attempts in Admin Panel Problems and add positive plus repository-wide negative regression coverage.

Thanks to crypto-nidh and xet7 !
2026-08-29 06:01:38 +03:00
Lauri Ojansivu 29fd503317 Refresh lazy card windows after card changes
Keep FerretDB's bounded card window as a fetched snapshot, but observe the unrestricted indexed selector and diff a fresh window whenever a matching card changes. Publish added, changed and removed DDP messages so remote edits and cross-list moves render without a browser reload. Cover additions, edits, removals, unchanged cards, cleared fields and a forced-lazy browser scenario.

Thanks to hmeunier95 and xet7 !

Fixes #6645,
2026-08-28 17:40:10 +03:00
Lauri Ojansivu 18bcbdd0d4 Bind search pagination sessions to their users
Require both pagination publications to authenticate the subscriber and load only a search session owned by that same user. Record attributable logged-out probes as SessionBleed without letting logging affect the denial.

Thanks to crypto-nidh and xet7 !
2026-08-27 10:19:56 +03:00
Lauri Ojansivu 12f2fddc2c Fix OIDC and account metadata security boundaries.
Thanks to crypto-nidh and xet7 !
2026-08-26 22:41:44 +03:00
Lauri Ojansivu b552af1606 Import legacy boards privately by default
Treat only an explicit supported public permission as public during WeKan board import. Missing Sandstorm-era fields, malformed values, and lookalikes now fail closed to private while explicit private and public exports retain their intended visibility. Add focused and browser regressions.

Thanks to xet7 !

Fixes #1991,
2026-08-25 18:15:26 +03:00
Lauri Ojansivu 8dff96d7b3 Preserve copied comment history
Keep each copied comment's original author and timestamps, re-home it without mutating the cached source, and avoid generating false new-comment activity. Add positive, negative, wiring, and REST browser regressions.

Thanks to ocdtrekkie, 2martens, frmwrk123 and xet7 !

Fixes #1213,
2026-08-25 17:57:13 +03:00
Lauri Ojansivu 7d67f80df5 Return mobile Search directly to the board
Close the full-screen Search sidebar when its Back control is used on a mini screen, while preserving desktop and other sidebar transitions. Add positive, negative, wiring, and mobile browser regressions.

Thanks to 1ubuntuuser and xet7 !

Fixes #3576,
2026-08-25 17:52:23 +03:00
Lauri Ojansivu 951b072b58 Close card details after remote removal
Observe the card that opened each details view and clear desktop, mobile route, and popup state when another client removes it or moves it to a different board. Add positive, negative, wiring, and mobile browser regressions.\n\nThanks to rptl and xet7 !\n\nFixes #3114,
2026-08-25 17:45:40 +03:00
Lauri Ojansivu 0847af8ec6 Add optional swimlane grouping to Table view
Keep the flat table as the default and let each user persist an optional grouped mode. Group cards in board swimlane order, preserve the selected column sort inside each lane, and insert section rows after pagination so headers never consume card slots.

Add user-isolation, empty-state, section-boundary and browser persistence coverage.

Thanks to rmb82 and xet7 !

Fixes #6634,
2026-08-25 17:39:23 +03:00
Lauri Ojansivu 828cb5e534 Restore sorting to board Table view
Make text, member, label and date headers toggle a shared client-side ascending or descending comparator. Keep empty date values last and use card title as a deterministic tie-breaker.

Add comparator boundary coverage and a browser header-toggle regression.

Thanks to rmb82 and xet7 !

Fixes #6633,
2026-08-25 17:32:57 +03:00
Lauri Ojansivu ad6a7b7c8c Make board Table view responsive
Use the available browser width and default card titles to a compact single line with an escaped native tooltip. Add a per-user wrap preference that persists locally.

Cover default, toggled and user-isolated preference behavior plus the rendered browser layout.

Thanks to rmb82 and xet7 !

Fixes #6632,
2026-08-25 17:31:29 +03:00
Lauri Ojansivu 6c9ba47456 Prevent fast touch drags from opening cards
Suppress only the synchronous click that touch-punch emits after a jQuery UI sortable drag. Ordinary taps and later clicks retain their normal behavior.

Add positive and negative unit coverage plus a real fast-touch drag browser regression.

Thanks to xator91 and xet7 !

Fixes #5421,
2026-08-25 17:27:33 +03:00
Lauri Ojansivu c69bf503c3 Bound high-volume database queries
Scope attachment and checklist discovery to authorized boards, project only fields consumed by filename search, retain only the requested text-ranking window in memory, page Due Cards without truncating the result set, and add compound indexes for lazy and due-card query shapes.\n\nThanks to xet7 !
2026-08-25 15:40:39 +03:00
Lauri Ojansivu 00026ff231 Reduce FerretDB board publication polling
Default FerretDB launchers to adaptive card loading, keep unrelated public boards out of All Boards, index the narrowed query shapes, and share linked-card discovery within one composite parent evaluation without TTL authorization caching.

Thanks to xet7 !
2026-08-25 15:04:22 +03:00
Lauri Ojansivu a1dfa88b49 Report blocked security attempts
Add bounded, attributed Problems events for denied MiniProfileBleed, PositionHistoryBleed, and CasBleed attempts. Keep UserSearchBleed and SubtaskExportBleed silent because their safe paths are indistinguishable from ordinary use. Also prevent clients from rewriting validated position history.
2026-08-25 01:26:28 +03:00
Lauri Ojansivu bdec1744f4 Apply board filters in Table view
Build the Table card query from the active board Filter and an immutable board and archive scope, while retaining the view-specific text search.

Thanks to rmb82 and xet7 !

Fixes #6629,
2026-08-25 01:14:39 +03:00
Lauri Ojansivu 3f69df3170 Require authentication before importing boards.
Reject anonymous importBoard and importScoped DDP calls before argument parsing, feature checks, parsers or direct database writers can run. Carry the authenticated method user explicitly into scoped imports and add source-level plus logged-out browser regression coverage for ImportBleed.

Thanks to Char0n1507 and xet7 !
2026-08-23 18:56:39 +03:00
Lauri Ojansivu 6ec619e438 Bound platform resources and report runtime failures. 2026-08-23 00:16:15 +03:00
Lauri Ojansivu 216146edc9 Restrict Organization and Team DDP writes.
Thanks to Char0n1507 and xet7 !

Fixes GHSA-p4cq-83j9-7g73.
2026-08-21 23:41:09 +03:00
Lauri Ojansivu d1c75e9950 Use canonical REST board write access.
Thanks to Char0n1507 and xet7 !

Fixes GHSA-f396-42fx-vr88.
2026-08-21 23:08:34 +03:00
Lauri Ojansivu 518a4d2fec Normalize uploaded JFIF names to JPEG.
Replace the unrecognized JFIF suffix with the detected JPEG extension so downloaded images use a portable filename and open through normal desktop file associations. Keep existing JPG and JPEG suffixes unchanged and cover the sanitization log reason.\n\nThanks to xet7 !
2026-08-18 23:14:12 +03:00
Lauri Ojansivu ff9d0bab8b Add country login locations to Admin Panel People.
Place a Location column immediately before account Status. Each user shows a flag and successful-login count for every country known from that user's addresses.

Clicking a country opens a Table.md report for that person. Its left menu lists countries busiest first, while the selected country shows city, IPv4, IPv6, and the person's first and last login times for each address. Search, pagination and Back use the shared table controls.

Location details are fetched once per People page and restricted through the same site-admin or tenant-admin scope as the People list. Unknown locations are not guessed, stale page responses are ignored, and new logins retain their supplied location on the per-user address tally.

Focused positive and negative coverage checks country totals, ordering, both address families, city rows, timestamps, menu/table wiring, authorization and missing geography.

Thanks to xet7 !
2026-08-18 23:07:48 +03:00
Lauri Ojansivu 480074969b Show available initials in the Offices people column.
The server computed each person's initials, but person grouping discarded them and the shared table tried to find the user again in client cache. Users not published to that cache therefore rendered as empty grey circles.

Carry initials through every table layer and let the existing avatar template render supplied initials before falling back to its reactive user lookup.

Regression coverage checks the person-grouped response, shared table cell and direct initials fallback.

Thanks to xet7 !
2026-08-18 22:49:53 +03:00
Lauri Ojansivu 3539f2bbf3 Group Admin Panel Offices login addresses by person.
Show each person's successful-login addresses together, with separate IPv4 and IPv6 columns, the latest country flag and city supplied by Cloudflare or another supported proxy, and that person's login count for each address.

Search continues to match usernames, full names, addresses and locations. Address metadata for each page is fetched in one batch, and people sharing an address remain separate groups with their own counts.

Focused coverage checks grouping, shared addresses, both address families, proxy location headers, missing locations and the person-first server response.

Thanks to xet7 !
2026-08-18 22:48:26 +03:00
Lauri Ojansivu a7879012c9 Fix custom-field interactions and deleted-field exports.
Thanks to Heart1010 and xet7 !

Fixes #6611.
2026-08-18 18:10:47 +03:00
Lauri Ojansivu 5f1d422117 Filter Recovery events by operation outcome. 2026-08-17 23:58:04 +03:00
Lauri Ojansivu 7a0b7b7cdb Audit failed permanent-delete attempts with status and address.
Record successful, failed, and unauthorized permanent-delete attempts in Recovery with Boolean Done and deleted-data fields, actor ID and username, proxy-aware IPv4 or IPv6, and requested board IDs and titles. Render Done first with green success, red failure, and yellow deletion icons. Preserve original errors after recording failed attempts.

Thanks to xet7 !
2026-08-17 23:54:36 +03:00
Lauri Ojansivu fd0369b899 Skip empty board visibility branches.
Do not add org, team or domain elemMatch clauses whose cleaned id list is empty. Preserve the active direct-member clause and every RevokeBleed security invariant, with positive and negative selector coverage.\n\nThanks to xet7 !
2026-08-17 23:07:50 +03:00
Lauri Ojansivu 4ab3161b4f Add permanent delete to Admin Panel Problems.
The Delete pane sits above Notifications and exposes the existing, default-off enablePermanentDelete gate for Global Admins. It has its own URL, documentation, and regression coverage for menu order, rendering and the setting handler.

Thanks to xet7 !
2026-08-17 21:11:35 +03:00
Lauri Ojansivu 0885b9a10b Share one card document adapter across PDF and Excel exports. 2026-08-17 04:04:13 +03:00
Lauri Ojansivu ec9f9e76d8 Use the detailed card layout for board Excel exports. 2026-08-17 03:57:58 +03:00
Lauri Ojansivu 1b0f2075e5 Export complete card fields at every scope. 2026-08-17 03:43:01 +03:00
Lauri Ojansivu bb5275e974 Select requesters and assigners from board members. 2026-08-17 03:05:41 +03:00
Lauri Ojansivu 4b27f4fc45 Name PDF and Excel exports by their localized scope. 2026-08-17 02:34:38 +03:00
Lauri Ojansivu fb52149e94 Align PDF and Excel card attachment layouts.
Place three previews per row with filename-only captions below, retain every attachment in the six-field details table, and draw PDF labels, metadata positions, and checklist progress like the printable Excel card.\n\nThanks to xet7 !
2026-08-17 01:52:34 +03:00
Lauri Ojansivu 7eb0d5ac50 List previewed image attachments only once.
Remove successfully displayed images from the attachment bullet list while retaining non-image files and images whose preview could not be read. Keep filename and size in each preview caption.\n\nThanks to xet7 !
2026-08-17 01:43:26 +03:00
Lauri Ojansivu 9ff542b9b1 Wrap PDF metadata and arrange image previews in rows.
Keep complete date and time values visible, place up to three attachment previews on one atomic row, and caption each preview with its filename and human-readable size.\n\nThanks to xet7 !
2026-08-17 01:17:53 +03:00
Lauri Ojansivu 3b47e10ee5 Normalize markdown-it module interop.
The Meteor production bundle exposes markdown-it through its default export while bare Node returns the constructor directly. Normalize both shapes so loading the export routes cannot stop WeKan during startup.\n\nThanks to xet7 !
2026-08-17 01:02:51 +03:00
Lauri Ojansivu c796fc6c6b Complete multilingual PDF and Excel exports.
Embed OFL-licensed GNU Unifont fonts in PDF exports, centralize the printable Excel card renderer on the shared card document, and consistently use the saved user language or browser fallback plus the opened card's date format. Document the XLSX font-embedding limitation and cover the locale, font, PDF, and workbook behavior with regression tests.\n\nThanks to xet7 !
2026-08-17 00:50:10 +03:00
Lauri Ojansivu 74888f1edf Embed attachment images in PDF exports.
Move the Excel and PDF export design and progress out of TODO Later into format-specific documentation, then complete JPEG and PNG previews for card and board PDFs with failure-safe image handling and byte-level tests.\n\nThanks to xet7 !
2026-08-17 00:37:22 +03:00
Lauri Ojansivu f6e3144452 Step 4: the PDF draws the shared card document, so both formats have one layout.
"PDF export layout should be like Excel layout", and "export board, swimlane,
list, card to Excel and PDF should have same layout like export card to Excel" -
with markdown rendered and only the fields that have data.

The PDF laid a card out itself: a hundred and sixty lines that had to be kept in
step with the Excel exporter's layout by hand, and were not. The Excel export
drew sections under filled headers with label/value columns; the PDF drew a flat
list of monospaced lines. Both ask models/lib/cardDocument.js for the layout now
and only the drawing differs, so a section added to one is in the other.

WHAT A PAGE MAKES OF THE DOCUMENT, in pdfDocument.js: a section is a filled grey
bar, a meta block is a row of label/value columns with the labels in bold, text
is markdown wrapped and styled, a list keeps its marker, a comment keeps its
date and its author. The bars are real rectangles - drawn outside BT/ET, because
a PDF text object may not contain a path - and the y of each line is known from
its index, so it needs no layout pass.

What is left in the exporter is the MAPPING: Meteor documents, user ids and
dates turned into the plain names and strings the document takes. That is the
only part that knows a Mongo document from a string.

FOUR REGRESSIONS THE EXISTING GUARDS CAUGHT, every one a field that would have
gone missing from the file:

  * requested by / assigned by - a card's own record of who asked for it, and a
    suite exists precisely because they have been lost from an export before;
  * card number, last activity, spent time and overtime;
  * the labels and the dates, which two suites check by name;
  * and every label's English fallback. The document was passing keys without
    one, so a missing translation would have printed "card-due" on the page.
    The words live in one table now, which also stops a PDF saying "Due" where
    a spreadsheet says "Due date".

The guards themselves follow the layout to where it went: they read the exporter
AND the document, because a field is now carried by the pair, and reading only
the exporter would report a field as lost when it had merely moved to where both
formats take it from.

Verified as far as this sandbox allows: the mapping is extracted from the file
and executed against a stand-in exporter (tests/pdfDrawsTheDocument.test.cjs),
the document it builds is checked section by section, and the bytes are checked
to be a PDF whose xref offset points at its table. There is no PDF viewer here,
so how the page LOOKS is still to be checked by eye.

Thanks to Heart1010 and xet7 !

Fixes #6586,
2026-08-16 23:50:10 +03:00
Lauri Ojansivu 50edf13a89 Only the fields that have data are added, decided once for both formats.
An export should not carry a Comments heading with nothing under it, or a Custom
fields section for a card that has none, or a row of dashes where a description
would be.

"Empty" is a JUDGEMENT, not a length check - a checklist with no items yet is
empty, a checklist whose items are all unticked is not; a custom field with a
definition and no value is not data, and most cards carry several of those - so
it is answered in ONE function, models/lib/cardDocument.js's hasSectionData, and
both exporters ask it. Two exporters answering it separately is how a PDF and a
spreadsheet of the same card come to contain different sections, which is the
whole reason the document model exists.

The document itself now contains only the sections that have something in them,
and the Excel and PDF exporters call the same predicate beside their existing
`?fields=` check - which stays, because it is a different question: the
selection says what the reader ASKED for, the data says what there is to give
them, and a section needs both.

One thing worth naming, because it nearly shipped: an edit that added the
guards threw part-way through, so the file kept a call to hasSectionData and
lost the import that defines it - which no test would have caught, since none of
them can import a Meteor path, and the first symptom would have been a card that
would not export at all. The import is there, and every guard's local was
checked against what cardBlockLines actually destructures from its data.

Thanks to xet7 !
2026-08-16 23:30:13 +03:00
Lauri Ojansivu d8fe42c1e0 Step 3: the card layout, described once, as a document both formats can draw.
The layout is the one "Export card to Excel" already draws - a title, meta rows
of label/value pairs, then a section per part of the card, each under a filled
header. It is the one that was designed, and it is what every export should be.

What was missing is that only ONE exporter could draw it. The Excel code knew
the layout AND how to write a worksheet, so the PDF could not use it without
becoming a worksheet - and grew its own instead: a list of monospaced lines with
none of the structure. That is the duplication, and "make the PDF look like the
Excel code" would have doubled it rather than removed it.

models/lib/cardDocument.js describes the layout as data - blocks that name no
colour, no column letter and no font size:

  title | section | meta | text | list | rows | images | note

A renderer decides what those look like in its medium, and only the renderer
knows the difference between a spreadsheet and a page. A test fails if a colour,
a merge or a page dimension appears in the document.

Three things it settles by construction, which two exporters could otherwise
disagree about:

  * WHICH SECTIONS. `?fields=` - the export popup's checkboxes - is applied here,
    so unticking "Comments" means the same thing in a PDF as in a spreadsheet.
  * WHAT IS THE AUTHOR'S TEXT AND WHAT IS THE EXPORT'S OWN MARK. A checklist
    item's `[x]` and a comment's author name are separate from the runs beside
    them, so a renderer can style them and the markdown that follows is not
    pasted into a string with them.
  * MARKDOWN IS ALREADY PARSED. A renderer is handed blocks, never a source
    string, so there cannot be a second parser.

Pure: no Meteor, no database, no ExcelJS. It is given a card and the rows that
belong to it and returns an array, which is what lets both exporters be checked
against the same document and lets the suite run as arithmetic under bare node.

Nothing renders it yet - this commit adds the description and its tests only, so
both exports still work exactly as they did. The Excel renderer moves onto it
next, with unchanged output as the check, then the PDF renderer and its images.

Thanks to xet7 !
2026-08-16 23:20:42 +03:00
Lauri Ojansivu b4e9d1f8d1 Exports render markdown the way WeKan renders it, from one shared parser.
A card's description, its comments and its checklist items are markdown, and
WeKan draws them as markdown everywhere it shows them. The exports did not: the
PDF flattened `**bold**` to the word with its asterisks still attached, and
Excel wrote the source text into a cell. A card that reads well on screen
exported as something nobody would write on purpose - #6586, "markdown is not
formatted - this doesn't make sense in a pdf file, does it?"

models/lib/exportMarkdown.js parses it with THE SAME markdown-it options the
reader's renderer uses - html, linkify, typographer, breaks - so the export and
the screen agree about what is emphasis, what is a list and where a paragraph
ends. It answers in a shape neither exporter is: blocks carrying runs of styled
text, `{ text, bold, italic, code, strike, link }`. Excel turns runs into an
ExcelJS richText array; the PDF will pick one of its four Courier faces. Neither
has to know markdown, and a fix to how a list nests reaches both at once - which
is the whole reason there is one module rather than two.

HTML in a card is kept as TEXT, deliberately. An export is a document, and a
card containing a script tag should put those characters in the file rather than
have anything act on them.

Wired into the Excel card export's description first, where a single unstyled
run is still written as a plain string - so a card with no markdown in it
produces exactly the file it did before.

AND THE PLAN FOR THE REST IS WRITTEN DOWN, because the request is one rule:
the same functions, layouts and templates for every PDF and Excel export, with
no duplicated code. docs/Features/ImportExport/One-Card-Layout.md says what that
means and in what order it lands.

Two of the four quarters are already true, and by the same method - one
renderer, called by every scope. Excel draws the card layout at every scope
(ExporterExcelBoard renders each card through ExporterExcelCard.renderCardBlock),
and the PDF already shares one block across scopes (ExporterBoardPDF and
ExporterCardPDF both render through PDFExporterBase.cardBlockLines). What is
missing is that the PDF's block is not that LAYOUT: monospaced lines, no
sections, no label columns, no boxes, no images.

So the next step is not "make the PDF look like the Excel code". It is a card
DOCUMENT - one description of the layout, built once from a card, rendered twice
- with the Excel renderer moved onto it first, unchanged output being what makes
that step verifiable, and the PDF renderer and its images following.

Thanks to Heart1010 and xet7 !
2026-08-16 23:05:44 +03:00
Lauri Ojansivu 6dc2651b48 Admin Panel / Problems / API: who called which endpoint, and how often.
Every other pane under Problems answers what went WRONG. This one answers what
is being DONE: `POST /api/boards` called 34 times by alice last month, 812 times
yesterday by nobody with an account. Without it the only record of REST API use
is whatever the reverse proxy happens to keep, and most instances keep none.

The table is username, endpoint, calls, the window they fall in, and the
addresses - sorted by calls, because a usage report's question is "what is used
most" where a problem report's is "what happened last".

THE NAME IS THE ROUTE PATTERN, NOT THE PATH. `/api/boards/:boardId/lists` is one
endpoint; `/api/boards/abc123/lists` and ten thousand of its siblings are that
one endpoint being used. Naming rows after paths would put a row per board in
the collection - the one-row-per-event cost this whole page exists to remove -
and a request that matched NO route is counted under a single "(no route)" name
rather than under the path it invented, because a 404 sweep is an attacker
walking a wordlist and a row per guess would let them fill the database.

ONE ROW PER ACCOUNT AND ENDPOINT, which makes the account part of a row's
identity - the one deliberate exception to the rule every other stream follows.
For those the question is "what is happening" and the caller would multiply the
rows; here "who called what" IS the report, and the cardinality is bounded by
real accounts times real endpoints. The account is stored by ID, so a rename
does not split its history in two.

NOTHING PER REQUEST. Ordinary API traffic is not rare the way a guard firing is
rare, so calls are counted in memory and folded on a timer - a thousand requests
become one write. A few seconds of counts are lost if the process stops between
flushes, which is acceptable here and nowhere else on this page: this report
decides nothing and nothing is protected by it. The tracked pairs are capped and
the rest counted, not dropped.

Counting hooks the middleware chain, not the routes, so a route cannot be added
without being counted - and it counts on the response's `finish` event, which is
where Express has filled req.route.path and authentication has run.

The pane is the SHARED event-stream report with a different column list, not a
second table page. The API stream is deliberately NOT in EVENT_STREAMS: it is
usage, not a problem, and an instance serving its API would otherwise report
thousands of new problems.

AND THE IPv4/IPv6 SPLIT IS FINISHED WHILE HERE. The summary rows have had ipv4
and ipv6 fields since the summaries were written, and not one of the four
loggers ever filled them - so the columns the design asked for could not have
worked. The fold splits the address now, once, for every stream, and the two
columns are one shared pair used by both reports rather than a copy each. They
fall back to classifying the stored `ip`, so rows written before today display
correctly instead of showing two empty columns for all of history.

Seven i18n keys in 239 language files, in en.i18n.json's order, English as the
placeholder where nothing is translated yet.

Thanks to xet7 !
2026-08-16 17:52:18 +03:00
Lauri Ojansivu ebe985d453 A location in an Admin Panel table opens a map, through the card's own chooser.
Admin Panel / Problems / Offices names the places accounts log in from -
"London", with the country's flag - and a name is only useful if it leads
somewhere. Clicking one now asks which map to open it at, from the same eleven
providers a card's location offers.

THE SAME CHOOSER, not a second one. The provider list was eleven options inside
cardDetails.jade; it is client/components/main/mapProvider.jade now, and both
callers include it. Two lists would be eleven places to add a provider instead
of one, and they would disagree the first time only one was edited. The
isMapProvider helper moves with it, so neither caller needs its own copy, and so
do its styles - they were scoped to .js-card-location-form, which stopped being
true the moment a second template used them.

What the two do NOT share is the rest. A card's popup EDITS a location - name,
address, coordinates, delete - and none of that applies to an office: its
location arrived in a CDN header, WeKan did not ask for it and cannot correct
it. So tablePageMapPopup is the map half alone: where this is, the link, the
chooser, and a save that makes the choice the default for cards too, because
profile.mapProvider is the one setting both read.

A cell is a link only when the row HAS coordinates. A city name is not a
position, and a map URL built from one would either search for the word or
invent a place, so buildRows drops a location without lat/lon and the cell stays
plain text. The link follows the selection BEFORE it is saved: choosing a
provider and finding the link still pointing at the old one reads as broken.

The handler lives on the shared table page, not on the report. That is also
where the "clicking a user opens the Edit user popup" handler goes: three
reports each had their own identical copy, because each was written where its
own page was. A Blaze event bubbles through the template hierarchy, so one
handler on tablePage reaches every report - and a report added later gets both
without being told.

Two things the guards caught, both worth naming. The popup had no title, which
in WeKan means no header and so no close button; it opens with
titleKey: 'location-open-map-at' - the phrase the chooser is already labelled
with in every language - rather than adding a key to 154 files. And a comment
between an `if` and its `else if` breaks jade nesting, which
tests/jadeCompiles.test.cjs has a negative test for; the comments sit above the
chain.

Thanks to xet7 !
2026-08-16 17:33:09 +03:00
Lauri Ojansivu 961ff6cb47 Admin Panel / Problems / Offices: where people log in from, grouped.
A new pane at /admin/problems/office, through the shared table page like every
other report here (docs/Features/Page/Table.md) - same layout, same search, same
paginator - so it needed no design of its own.

The columns are what an admin actually asks:

  Location   the country flag and the city: "London", not 100.100.100.100. An
             admin recognises their own offices at a glance, and the flag says
             WHICH London. Empty when nothing in front of WeKan resolved it.
  Address    the IPv4 or IPv6 it really is
  People     each account as its INITIALS, or its avatar where it has one, with
             its own login count beside it - the same way the board sidebar and
             a card show a member, and for the same reason: a column of avatars
             fits where a column of usernames does not. Clicking one opens the
             existing Edit user popup.
  Logins     how many, and the first-seen / last-seen window they fall in

Two additions to the shared table page rather than a second table: a cell that
holds SEVERAL people, and a leading flag kept apart from the cell's text so it
is not searched or sorted as text. Both are available to every other report now.

The pane is registered the way the others are - slug, title, menu entry,
reactive var, helper, reset and menu branch - and three guards caught the pieces
I would otherwise have missed: adminUrls wanted the URL in the design doc,
adminPanelDocsMatchMenu wanted the pane in the Problems README with its gap
count updated, and tablePage wanted the third paginator handler explained rather
than merely allowed. Ten strings in en.i18n.json, in key order, and appended to
238 language files as English placeholders for the fill rules to replace.

Thanks to xet7 !
2026-08-16 16:29:31 +03:00
Lauri Ojansivu d8d1863dba Login offices: who logs in from where, and users shown as initials or avatar.
WHAT WAS ALREADY THERE, checked first: server/lib/loginAttemptThrottle.js
resolves a client address for the REST throttle, the lockout resolves one for
DDP, models/users.js has getInitials() and profile.avatarUrl, the board sidebar
and cards show members through +userAvatar / +userAvatarInitials, cardDetails.js
builds "open in map" links for a dozen providers, and Admin Panel tables already
had a js-table-page-edit-user handler and a `userId` column option. All of it is
reused rather than rewritten; only geolocation from CDN headers is new.

THE TALLY, both directions from one successful login. On the user: which
addresses this account uses - `100.100.100.100 25, 122.122.122.122 50`. On a new
loginAddresses collection: which accounts use each address. Capped both ways
with an overflow count, as the Problems summaries are.

WHY THE SECOND DIRECTION EXISTS: an address several accounts log in from is an
office, a VPN, a university, a carrier's NAT. Blocking it takes everyone behind
it off WeKan at once - including the reverse proxy itself if
HTTP_FORWARDED_COUNT is wrong, which is every user there is. So WeKan blocks the
ACCOUNT that attempted the vulnerability and never the address, and this record
is what lets an admin see that shape before drawing any conclusion from an
address.

Blocking uses loginDisabled, the field Admin Panel / People already toggles, so
an admin unblocks from the table they know and no second notion of "blocked"
appears beside the one that exists. `services.securityBlock` records why, from
what and when. Only a 'blocked' action at high or critical severity, and only
with a userId: an unauthenticated attempt has nobody to block, and guessing from
the address is the mistake above.

LOCATION, when something in front of WeKan already knows it: Cloudflare, Fastly,
CloudFront, Vercel, Google Cloud or a hand-configured proxy. WeKan does no
geolocation of its own - no database to ship, no third-party lookup of a user's
address. An office in London is labelled London. DISPLAY ONLY, and the file says
so twice: anything a client can send it can forge, and X-Forwarded-For at least
has HTTP_FORWARDED_COUNT to say how much to believe, where a city name has
nothing.

USERS AS INITIALS OR AVATAR, in every Admin Panel / Problems table at once - it
is one line of the shared table page, so Security, Speed, Tests, CPU, Database,
Integrity and Impersonation all change together. The name is the title, so
hovering still says who it is, and clicking opens the existing "Edit user"
popup. Not +userAvatar: it renders its own anchor for the board's member popup,
and an anchor inside the cell's anchor is invalid and would swallow the click.

mapLinkFor and its Chinese datum conversions move to models/lib/mapLink.js so
the card and the Admin Panel build map links the same way, with the user's own
profile.mapProvider choice applying in both.

Thanks to xet7 !
2026-08-16 16:17:13 +03:00