cmap functions, email, architecture documentation.

This commit is contained in:
2026-08-18 03:33:10 +02:00
parent 12f1ed2764
commit 63b7ca0853
33 changed files with 3974 additions and 80 deletions
+107 -1
View File
@@ -2,7 +2,7 @@
Version 0.2.31 adds page namespaces as database metadata and extends wiki references to forms such as `RWS:ModelTreeWalker` and `[roadmap](racket:roadmap)`. Todo items and bookmarks are grouped by namespace. The source has also been documented more thoroughly, especially `static/js/wiki.js`.
Current development version: **0.2.84**.
Current development version: **0.2.94**.
A small self-hosted wiki with a Racket backend and an HTML5/CSS/JavaScript frontend.
@@ -289,6 +289,46 @@ Untrusted uploads are not blindly rendered inline. Only common raster image form
For internet-facing deployment, put the server behind a TLS terminating reverse proxy, use `--secure-cookie`, and add normal operational controls such as backups, access logging and upload limits appropriate to the installation.
## Architecture documentation import
The package contains a coherent Dutch architecture documentation set under
`architecture/`: twelve namespaced wiki pages and two native concept maps. The
pages cover structure, behaviour, data and versioning, modularity,
maintainability, analyzability, testability, long-term performance, security,
coding rules, and architecture evolution.
Validate and preview the import first:
```text
racket architecture/import.rkt --data ./wiki-data --dry-run
```
Import the set and record a recognizable author in page and CMap history:
```text
racket architecture/import.rkt --data ./wiki-data --author "Hans Dijkema"
```
From DrRacket or another module, the equivalent convenience call is:
```racket
(require racket-wiki/architecture/import)
(import-racket-wiki-architecture-from-data-directory!
"wiki-data"
#:author "Hans Dijkema")
```
Imported pages use namespace `racket-wiki`. The concept maps use the stable
slugs `racket-wiki-architectuur` and `racket-wiki-kwaliteitskenmerken` and are
embedded in the overview pages with `{{cmap:...}}`.
Every imported item carries a source hash. A later import updates an item only
when its imported source has not been edited locally. Modified items are
reported as `skipped-modified`; use `--overwrite-modified` only after reviewing
their version history. Re-importing identical sources does not create needless
versions.
## Next useful steps
The backend and storage API remain independent of EasyMDE. Useful next additions include internal wiki-link syntax, page namespaces/navigation, restore-from-archive, site settings, per-page ACLs and a richer admin console.
@@ -728,3 +768,69 @@ CMap autosave and Ctrl/Cmd+S remain available. Navigation again follows the prov
Creating an item and editing another item are now guaranteed to form two separate Undo transactions. Item creation and content editing start their history transaction before the CMap node is redrawn. A synchronous render callback can therefore no longer replace the pre-edit history snapshot while automatically fitting the node to its text.
The same transaction ordering is used for inline linking-phrase edits. Automatic sizing remains part of the edit that caused it, rather than becoming a separate Undo step.
### 0.2.85
Users can manage their own display name and email address from **Profile**. A password change requires the current password, keeps the active browser session and revokes the user's other sessions. Administrators can also maintain email addresses in user administration.
The login page now links to a password-reset flow. Reset tokens are random, stored only as SHA-256 hashes, expire after one hour, work once and revoke all existing sessions when used. The public response never reveals whether an account exists. The number of reset links per user in a rolling hour is configurable from **Admin → Email and password reset** and defaults to two.
SMTP uses Racket's `net/smtp` library directly. Administrators configure the public wiki URL, SMTP server/port, sender, credentials and STARTTLS in the same admin screen. Values can alternatively be supplied through `RACKET_WIKI_PUBLIC_URL`, `RACKET_WIKI_SMTP_HOST`, `RACKET_WIKI_SMTP_PORT`, `RACKET_WIKI_SMTP_FROM`, `RACKET_WIKI_SMTP_USER`, `RACKET_WIKI_SMTP_PASSWORD`, `RACKET_WIKI_SMTP_TLS`, `RACKET_WIKI_SMTP_ACCEPT_UNTRUSTED_CERTIFICATES` and `RACKET_WIKI_RESET_LIMIT`. Environment variables act as fallbacks for values not stored by the administrator.
### 0.2.86
Concept maps now have immutable database-backed version history. Creation, manual saves, autosaves and renames each store a complete CMap snapshot with version number, title, author, action, summary and timestamp. Schema migration 11 creates `concept_map_versions` and records the current state of every existing CMap as its first available historical snapshot.
### 0.2.87
Fixed startup of the password-reset mail module by importing Racket's `db` library explicitly. The module uses `query-rows`, `query-exec` and `call-with-transaction` directly and therefore must require that library itself.
### 0.2.88
The SMTP administration form now includes a test recipient and a synchronous test-email action. The test uses the current form values without storing them and keeps using an already stored SMTP password when the password field is empty. SMTP acceptance or the concrete connection/authentication error is shown next to the form. Password-reset requests retain their account-enumeration-safe response, now show a clearer next step, and write a server diagnostic when SMTP has not been configured.
### 0.2.89
STARTTLS now uses a secure client context with automatic modern TLS negotiation and SMTP-hostname certificate verification. This avoids `net/smtp`'s legacy callback argument `'tls`, which selects TLS 1.0 and can produce OpenSSL's `no protocols available` error on current systems where TLS 1.0 is disabled.
Certificate and hostname verification remain enabled by default. An administrator can explicitly disable verification for a trusted local SMTP server with a self-signed or otherwise locally invalid certificate. This exception still uses modern TLS encryption, but it does not authenticate the SMTP server and should not be used for an untrusted network or public server.
### 0.2.90
The STARTTLS choice now follows the administration setting directly. With **Accept untrusted certificates** disabled, mail uses `ssl-secure-client-context` and verifies both the certificate chain and SMTP hostname. With the setting enabled, mail uses `ssl-make-client-context 'auto`; communication remains encrypted, but the server certificate is not authenticated.
### 0.2.91
Dragging the background frame of an expanded sub-CMap once again moves the complete sub-CMap, including its main concept, descendants and nested sub-CMaps. Dragging the main concept itself continues to move only that concept within the sub-CMap.
The CMap tools menu contains **CMap history**. Historical versions can be loaded visually into the normal editor. Loading does not overwrite the current version: the historical map remains an unsaved editor state until the user explicitly saves it, at which point a new current version is created.
### 0.2.92
The CMap tools menu can create an explicitly described snapshot. Unlike autosave, this always creates a new immutable CMap version, even when the document itself has not changed since the last automatic save.
Wiki Markdown can embed a stored concept map on its own line with `{{cmap:Test}}`. The page shows a compact read-only rendition without page guides; double-clicking it opens the full CMap editor. The Markdown CMap picker can insert either the ordinary link or the embedded form.
### 0.2.93
Adds a bundled architecture documentation set consisting of twelve linked wiki
pages under namespace `racket-wiki` and two native concept maps. It documents
the current structure and behaviour together with modularity, maintainability,
analyzability, testability, long-term performance expectations, security,
coding rules and architecture evolution.
`architecture/import.rkt` validates the complete set and imports it through the
normal page and CMap storage procedures. Source hashes make repeated imports
idempotent and protect locally edited imported content. The command supports
`--dry-run`, an explicit history author and deliberate
`--overwrite-modified`. Its test submodule validates internal page links, CMap
embeds, node ids, connector endpoints and source-change detection.
### 0.2.94
Fixes two overescaped line-ending expressions in the architecture importer.
The source-marker expression now uses Racket string escapes for CR and LF,
instead of passing the invalid alphabetic escapes `\\r` and `\\n` to the
regexp parser. The CMap-embed expression uses an actual newline character in
its exclusion class for the same reason. Regression tests cover LF and CRLF
source markers and single-line CMap embeds.