Self-hosted Typst editor and REST API. Native Node.js service, local Typst compiler, Monaco editor. No Docker or database required. The source is intentionally separated from user data.
backend/: HTTP API, access control, fonts, update requests, ZIP handlingfrontend/: editor, administration and UI; Monaco 0.52.2 is supplied by the existing installationtests/: API regression tests (real Typst on server)deployment/deploy-update.py: privileged deployment helper, installed manually by the 0.2.4 bootstrap; it is not downloaded/executed as root by the GUI updater.VERSION: release version, must match the backendVERSIONconstant and frontend version strings.
The administration page checks the main branch of https://github.com/edudocck/typststudio. Only a numerically newer version can be requested, and the request pins the exact commit. The root-owned helper fetches a fixed allowlist of source files over HTTPS, validates syntax, backs up the current program files, restarts Typst Studio and checks the API. On failure it restores the prior program version. It does not execute remotely supplied installers as root. The helper, systemd units, dependencies, engine upgrades and changes to the deployment file list require a manual reviewed installation. GitHub repository writers are trusted to provide executable application code (runs as the restricted service account). Protect the main branch and use strong account authentication.
The 0.2.4 installer upgrades existing version 0.2.3. It does not enable public access or change Apache. Use the SSH tunnel for the first test. When Apache forwards /typst/ with X-Forwarded-Prefix: /typst, only the existing main administrator key is accepted. A URL subpath shares the origin with OpenClaw and is NOT an isolation boundary. Do not expose it to untrusted users; use a separate HTTPS origin for multiuser access. A proper browser and deployment test is needed before external use.
Never commit credentials (server.env, API key hashes, tokens, private keys), workspaces, project files, backups, user fonts or generated PDFs. No user data is included in this repository package. Monaco and Typst are third-party dependencies distributed separately.
Administrator: clearly labeled download-and-install button and installed version/status shown on opening Administration. Install 0.2.4 once using the bootstrap script, then apply 0.2.4.1 via the GUI. No privileged helper or system changes in this patch.
Font previews and ZIP exports now finish removing temporary files before sending the HTTP response, preventing a subsequent sequential request from failing with HTTP 409 while the operation lock is held. The 0.2.4 bootstrap installer contains the same fix; a server still on 0.2.3 can run it and then update through the administrator UI. The real compiler regression tests remain mandatory during bootstrap.
Monaco: client-side Typst completions, contextual parameters and selected values, German hover help, project paths, workspace fonts and snippets. Ctrl+Space invokes suggestions. Structured compiler diagnostics list with file/line/column navigation, German rule-based explanation and suggested checks, original Typst output and per-file markers. No new runtime dependencies. The completion scanner and suggestions are heuristic, not a full language server or AI. Tests: node tests/editor.test.cjs.
Optional semantic markup toolbar, central layout rules, current-file heading outline, local #let completion and definition navigation, heading folding, Monaco search/replace, bounded read-only project search, conservative indentation for simple multiline calls, independent opt-in autosave, editor settings and searchable command reference. No new runtime dependencies or updater changes. Local navigation is heuristic and not a semantic language server. Layout rules are inserted after the initial contiguous #set/#import preamble in the main file and may be overridden by later rules. Full custom logical styles remain planned for 0.3.5. Run node tests/editor026.test.cjs and node tests/editor.test.cjs.
Project-only media manager, SHA-256 duplicate detection on media upload, storage usage, static reference audit, file selection and copy from projects in the same workspace, HTTPS URL import with IPv4 DNS pinning and per-redirect validation, local file/clipboard/drop upload. Project ZIP includes media. Markdown editor, safe DOM preview, common Markdown-to-Typst conversion and optional include, original retained. No image editing or new runtime services. Static references are advisory; renames warn but do not rewrite source. Thumbnail downloads limited to 16 small images per view. Markdown is a supported subset, not CommonMark-complete. HTTPS importer rejects IPv6-only hosts and private IPv4 addresses. API: GET/POST /api/projects/{id}/media, POST accepts path plus base64, url, or fromProject/fromPath. Duplicate response saved:false, paths. Existing generic file API remains unchanged for source writes. Tests: node tests/media030.test.cjs.
URL imports are serialized and capped at 16 MiB/25 seconds (plus bounded DNS resolution); thumbnail and Markdown preview fetches are bounded. Reference and duplicate detail lists are capped, with duplicate counts supplied separately. API regression coverage includes content deduplication, explicit duplicate override, workspace isolation, project copies and private URL rejection. Run the server tests only against an isolated installation, not production user data.
40 project-local styles in five groups, style gallery, real cached Typst PNG previews, editable style properties, favorites, group renaming, JSON import/export, optional task numbering/points and teacher-only blocks. Project styles are generated into stile.typ and stile.json; manual edits are not overwritten. Use #studio-gesamtpunkte() for the final points total. Teacher/student compilation via --input studio-mode=lehrkraft or schueler. The source remains confidential; student mode is not an access-control boundary. Existing projects are unchanged until style installation. Custom specialized styles currently share the generic block renderer.
Administrator-only invitations, email/password login, scrypt hashes, Secure HttpOnly SameSite Strict cookies, one-use invitation/reset links, session revocation, per-account workspaces and API keys. Existing bootstrap token remains a recovery/admin path; bootstrap account creation links the existing private workspace. SMTP configuration uses Python stdlib TLS SMTP; secrets stored in access/accounts.json (0600), not returned by API. Set the dedicated public HTTPS domain before inviting users. Existing /typst/ shared origin remains admin-only. Account deletion currently means access suspension after explicit confirmation; files are retained for recovery and the account can be re-enabled by admin. No shared projects or self-registration. No email address change UI in this version. API and browser integration need live testing. Configure SMTP then send a test message before issuing invitations.
All account roles can sign in and use their workspace through the HTTPS /typst/ reverse proxy as well as a dedicated HTTPS domain. Configure SMTP public base URL to the actual HTTPS address, including /typst/ if applicable. Session cookie path, HTTPS requirement, role and workspace checks remain. A shared origin with another application is not a security boundary: scripts on that origin may make authenticated requests to either application. A dedicated origin remains recommended for untrusted users. An explicit invalid Authorization header no longer falls back to cookie authentication.
New projects receive stile.typ, stile.json and an initial import; existing and imported projects get missing managed styles without overwriting custom source. The root stile.json is hidden in the editor tree and media gallery but remains in the project archive and API. Embedded original SVG line icons are available in outline, color and monochrome variants, plus text symbols and no icon. Legacy style source is preserved unless explicitly changed. Editor model edits use undo-aware model APIs; ordinary typing is enabled during save/compile and changes mark PDF stale. Interactive PDF inspection uses Poppler pdfinfo, pdftohtml and pdftoppm, without an external viewer dependency; the native PDF viewer remains available. Page-level text matching is heuristic, not compiler source mapping. Unique literal text matches can jump to source, forward search is limited to 30 pages, and font replacement is limited to explicit matching text/font or managed style rules after confirmation. Recompile before inspecting source mappings. Dynamic content, repeated text, font fallback and complex styling may not map. No cross-project file reads. Poppler binaries must be available. Browser and actual Typst integration require server testing.
New display name, approved logo and favicon, public About dialog with upstream license links and detected component versions. The existing repository, systemd service, API paths and HTTPS proxy/subdomain remain unchanged. The logo and favicon are delivered from embedded WebP assets in the existing backend, avoiding changes to the deployment allowlist. Managed style libraries migrate their title rows to inline icon boxes, preserving manually modified libraries. See THIRD-PARTY-NOTICES.md. Own project license is not yet selected. External software and font licenses remain version-specific.
Seven built-in templates (empty, worksheet, info, exam, book, letter, report) and four independent designs (sachlich, modern, kopiervorlage, natuerlich). New projects contain main.typ, stile.typ, stile.json, layout.typ, variablen.typ, design.json and optionally design-logo.png and chapter files. Internal JSON is hidden from the tree and media view. Generated documents remain portable with Typst. Design changes check generated files before replacing them, preserve handwritten main content, and optionally adapt managed styles. Legacy projects are not automatically redesigned; existing explicit set rules may override the new layout. Personal and global libraries are stored in quota-counted hidden workspace directories; only administrators modify global items. Snapshot templates are ZIP copies (including content and assets), not live linked projects. A template can be edited by making a project from it and replacing the saved snapshot. Personal defaults include an independently saved corporate design and document variables. A PNG logo up to 256 KiB can be stored with a design. The preview compiles with real Typst and Poppler on demand, caches up to 48 PNGs for 24 hours, and offers a representative design page or first template page. Existing user-uploaded fonts are used, not copied into templates. No extra runtime dependencies or updater changes.
All paths relative to the existing API base. Bearer API key or existing authenticated cookie. GET /api/library returns designs, templates, preferences including built-in IDs and scoped personal/global references. PUT /api/library/preferences accepts {defaultDesign,defaultTemplate,variables}. POST /api/library/designs accepts {name,description,scope,design}, where scope defaults to personal; PUT /api/library/designs/{ref} updates, DELETE removes. POST /api/library/templates accepts {name,description,scope,project} to snapshot the named project, {source} to duplicate, or {zip} (base64) to import. GET /api/library/templates/{ref}/zip exports; PUT can replace from project, source or ZIP; PATCH renames; DELETE removes. Global writes require administrator privileges. POST /api/library/preview accepts {templateId,designId,design,variables,representative} and returns image/png; {templateId,snapshot:true} previews a saved template. POST /api/projects accepts {id,templateId,designId,design,variables,applyStyles} in addition to the prior ZIP path. Saved templates are copied as-is unless explicit design/variables are supplied. GET /api/projects/{id}/design returns {configuration} (null for legacy projects); PUT accepts {designId,design,variables,applyStyles}. applyStyles:false preserves style configuration. Set custom variable values via dokument.at("key") in Typst and {key} in header/footer. The application version remains subject to live Typst/compiler and browser integration testing.
The selected document type/design automatically generates its representative preview after an 850 ms debounce; other cards remain lightweight schematic thumbnails. Manual preview buttons allow rendering the current edited settings or the actual first page. Existing raw ZIP imports may still be media-only projects; saved templates require a Typst main file. A variables-only project design PUT preserves managed logical styles by default.
Corrected nested select-option arrays in the design editor so every default value can be selected. Client and server now identify the field when a design choice, numeric value, font, color, text or heading setting is invalid. No change to stored design schema or deployment paths.
The PDF button is available before the first compilation. It saves edited files and compiles the selected output mode, checks that the returned blob starts with %PDF-, then presents an editable filename and a separate explicit save action. Uses the native save picker where supported; otherwise triggers an ordinary browser download. The Firefox download location prompt is controlled by Firefox settings. No stale preview is exported after a compile failure.
Text undo/redo uses Monaco's model history for open tabs; the fallback text editor has a bounded local history. Separate project undo/redo handles successful managed design/variable/style and typography operations, with exact byte snapshots, conflict checking, up to 20 operations per project and an 8 MiB server-wide memory budget. History is session/runtime only; changed source tabs are reloaded, unchanged tabs keep their editor history. It is not a permanent backup and does not undo arbitrary file deletions, uploads, template edits or account operations. New projects use four configurable heading levels; old six-level settings remain readable and legacy generated layout source is preserved. The reusable font browser displays cached, real Typst/Poppler PNGs on demand, with categories (heuristic + admin override), search, browser-local favorites and recent families. All new font uploads are global, with SHA-256 deduplication and optional license/source metadata. Only admins delete fonts; old personal fonts may be copied via the admin migration button, leaving originals intact. Review redistribution rights before migration. Managed typography can independently set body/heading fonts and optionally replace statically identifiable literal font arguments in project Typst files while preserving weight, size and other arguments. Dynamic or uncertain cases are reported; this is not a full Typst AST parser. The PDF font replacement now uses the same atomic project transaction. Limits: up to 100 source files / 4 MiB for global rewrites, 240 cached font PNGs, 256 MiB global uploaded fonts.
Authenticated: GET /api/font-catalog, GET /api/font-thumbnail?font=..., PUT /api/projects/{id}/typography with {bodyFont,headingFont,size,force,boxes} or {replaceFrom,replaceTo,boxes}, GET /api/projects/{id}/history, POST /api/projects/{id}/history with {direction:"undo"|"redo"}. Admin only: PUT /api/font-category with {name,category:"serif"|"sans"|"other"|"auto"}, POST /api/font-migrate, GET /api/admin/compiler/check, GET /api/admin/compiler/status, POST /api/admin/compiler with {version}.
The release check works immediately after the normal application update. The service never receives write permission on bin/typst. To enable the optional install button, review the three files under deployment/ and install the pinned revision as root, following the commands below. Replace COMMIT with the reviewed 0.4.1 commit hash. The existing app updater's fixed allowlist intentionally does not deploy root-owned helpers. No automatic compiler update is performed. The helper independently verifies the official stable GitHub release and asset SHA-256, extracts only the compiler binary, tests it as the unprivileged typst user, backs up the old binary, restarts the service, checks the API, and rolls back on a failed restart. If a release lacks an official asset digest, the GUI refuses automatic installation. The existing application and compiler update queues are checked separately; do not run the root helpers concurrently manually.
# Run as root; pin to a reviewed commit.
COMMIT=REPLACE_WITH_REVIEWED_COMMIT
TMP=$(mktemp -d)
for file in compiler-update.py typst-compiler-update.service typst-compiler-update.path; do
curl -fsS --proto '=https' "https://raw.githubusercontent.com/edudocck/typststudio/$COMMIT/deployment/$file" -o "$TMP/$file" || exit 1
done
python3 -m py_compile "$TMP/compiler-update.py" || exit 1
install -o root -g root -m 0755 "$TMP/compiler-update.py" /usr/local/lib/typst-studio/compiler-update.py
install -o root -g root -m 0644 "$TMP/typst-compiler-update.service" "$TMP/typst-compiler-update.path" /etc/systemd/system/
systemctl daemon-reload && systemctl enable --now typst-compiler-update.path && install -o root -g root -m 0644 /dev/null /mnt/HC_Volume_107558752/typst/update/compiler-enabled
rm -rf "$TMP"The root helper is optional and not yet tested on the live host. Existing subdomain, service, storage paths and application updater remain unchanged. Unit/isolated generator checks are not a full browser or real Typst integration test.