- TypeScript 71.5%
- JavaScript 27.2%
- Shell 1%
- HTML 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .forgejo | ||
| .githooks | ||
| assets | ||
| client | ||
| feed | ||
| locales | ||
| shim | ||
| templates | ||
| worker | ||
| .env.example | ||
| .gitignore | ||
| apps.ts | ||
| artcraft.plugin.json | ||
| artcraft.ts | ||
| artcraft_block_editor.tsx | ||
| artcraft_create_dialog.tsx | ||
| artcraft_directive.test.ts | ||
| artcraft_directive.ts | ||
| artcraft_editor_tool.tsx | ||
| artcraft_embed_options.test.ts | ||
| artcraft_embed_options.ts | ||
| artcraft_host.test.ts | ||
| artcraft_icon.tsx | ||
| block_editors.ts | ||
| client_config.ts | ||
| compose.dev.yml | ||
| content_types.ts | ||
| create.test.ts | ||
| create.ts | ||
| deploy.json | ||
| deploy_json.test.ts | ||
| embed_asset_patterns.ts | ||
| LICENSE.md | ||
| limedoc.project.json | ||
| origin_probe.test.ts | ||
| origin_probe.ts | ||
| plugin.devkit.json | ||
| README.md | ||
| request_body.ts | ||
| settings_schema.ts | ||
| shim_bundle.test.ts | ||
| shim_bundle.ts | ||
| shim_config.test.ts | ||
| shim_config.ts | ||
| shim_core.test.ts | ||
| shim_version.ts | ||
| state.test.ts | ||
| state.ts | ||
| status_route.test.ts | ||
| syntax.test.ts | ||
| syntax.ts | ||
| tool_logic.test.ts | ||
| tool_logic.ts | ||
| zip_store.ts | ||
ArtCraft for Limedoc
Edit PDFs, drawings, CAD files, presentations, designs and video/effect projects in Limedoc with the ArtCraft editors (ADR 0005 in the Limedoc repo). The editors are WebAssembly apps; each runs on its own sub-domain inside a frame, behind a small relay page (the shim) that speaks Limedoc's frame editor protocol (LCX v1). Limedoc keeps the session: the editor gets file bytes, never credentials.
Status: in development (plan in the Limedoc repo, ADR 0005 §8). The pack
pins the <app>-web-<version>.zip releases of
github.com/storytold in
worker/apps.lock.json (sha256-checked on install).
Requirements
- Limedoc ≥ 0.76.0 (frame editors, edit sessions, project content,
deploy.jsoncommands and guided configure, runtime editor switch; the After Effects content types and project Save as from a plain file). - ldcmd ≥ 0.8.0 (
sidecar upgrade,SIDECAR_PACK_DIR). - One dedicated sub-domain per app (e.g.
pdfcraft.edit.example.org) with a certificate on the reverse proxy in front of Limedoc. Browser storage is per origin; use hosts that serve nothing but these editors.
Operator setup (managed sidecar)
The sidecar fetches the pinned app builds, verifies their sha256, places the shim next to each build and serves them over plain HTTP. Your reverse proxy keeps TLS and ports 80/443.
-
ldcmd sidecar up artcraft --configureasks for the settings, explains each one and offers a default (Enter keeps it):Setting Default Meaning ARTCRAFT_APPSpdfcraft,cadcraft,vectorcraftApps to download and serve ARTCRAFT_PUBLIC_HOST_PATTERN{app}.<APP_BASE_HOST>Public host per app, e.g. {app}.edit.example.orgARTCRAFT_PUBLIC_SCHEME/_PORT(advanced)https/443How browsers reach the app hosts ARTCRAFT_PROXY_DIR(advanced)<deploy dir>/proxy/artcraftWhere the proxy snippets are written ARTCRAFT_TRUSTED_PROXIES(advanced)private_rangesSources of trusted X-Forwarded-*ARTCRAFT_APPS_MIRROR(advanced, optional)— Download mirror (air-gapped) ARTCRAFT_HOST_PORT8790Host port the sidecar is published on (every mode) ARTCRAFT_PROXY_UPSTREAMby mode, see below What the generated proxy snippets forward to ARTCRAFT_BIND(advanced)127.0.0.1Host address of that port ARTCRAFT_BASE_URL(Limedoc → sidecar) is derived from the network mode. Change the settings later withldcmd sidecar configure artcraft; an unattendedsidecar upreports what is missing, with the same explanations. -
The one-shot
artcraft-fetchinstalls what is missing (a sha256 mismatch stops here, nothing is served), then theartcraftCaddy starts. -
Include the generated snippet from
ARTCRAFT_PROXY_DIR(default<deploy dir>/proxy/artcraft):caddy/artcraft.caddy(import) ornginx/artcraft.conf(includeinhttp {}). ItsREADME.mdlists the hosts and the upstream. These files are rewritten from the current settings on everyldcmd sidecar up artcraft, so afterldcmd sidecar configure artcraftthey match your setup. Do not addContent-Security-Policy,X-Frame-OptionsorCache-Controlfor these hosts; the sidecar sets them. -
Limedoc → Settings → ArtCraft: activate the apps. Only deployed apps can be activated; the editors appear without a restart (reload open tabs).
Where the reverse proxy points
Browsers must reach every editor on its own host, so the sidecar is always
reachable for your proxy, whatever Limedoc's DEPLOY_NETWORK_MODE is:
| Your proxy runs … | Upstream |
|---|---|
| on the host | 127.0.0.1:${ARTCRAFT_HOST_PORT} (8790) |
as a container on the Docker network DOCKER_NETWORK_NAME |
artcraft:8080 |
| on another machine | ARTCRAFT_BIND=0.0.0.0, <this host>:8790, firewalled to the proxy |
ARTCRAFT_PROXY_UPSTREAM picks the one the snippets use. Its default
follows the network mode (internal → artcraft:8080, external →
127.0.0.1:${ARTCRAFT_HOST_PORT}); set it when your proxy runs elsewhere.
The network mode itself only decides how Limedoc reads /manifest.json
(ARTCRAFT_BASE_URL, internal address, never through the proxy).
Upgrading app builds
ldcmd sidecar upgrade artcraft --check # plan only
ldcmd sidecar upgrade artcraft # newest tested builds
ldcmd sidecar upgrade artcraft --app pdfcraft --channel latest
ldcmd sidecar upgrade artcraft --rollback pdfcraft
Builds come from a feed signed by the pack publisher (Ed25519, key in
worker/feed-keys.json); a bad signature aborts with nothing changed. A
second run is a no-op, so a timer is safe. Exit codes: 0 upgraded or up to
date, 2 some apps skipped (they need a newer artcraft plugin), 1 error.
ldcmd sidecar up never moves an installed build; open editors keep
working, new sessions get the new build. The previous build stays for
--rollback.
Air-gapped: ARTCRAFT_APPS_MIRROR=https://mirror.lan/artcraft downloads
<mirror>/<app>/<version>/<file>.zip instead; the sha256 pins still apply.
Self-hosted apps
When you host the app builds yourself (Settings → ArtCraft → Deployment: Self-hosted), enter each app's origin and place the shim next to the app:
- Download
/api/plugins/artcraft/shim/<app>(admin; e.g./api/plugins/artcraft/shim/pdfcraft). The zip holds the shim files, alimedoc-shim.jsonfor this Limedoc instance andHEADERS.md. - Unzip it next to the app's
index.html. - Add the headers from
HEADERS.md(nginx and Caddy snippets) to the app's site. Do not addX-Frame-Optionsthere. - Use a dedicated sub-domain per app that only Limedoc uses: the shim clears the origin's browser storage when the Limedoc user changes.
- EffectCraft: the bundle's
sw.jsreplaces the app's service worker (which would answer the shim page with the app's own page). Put it back after every app update.
Pinning and verifying the app builds is up to you in this mode; download the bundle again when Settings reports the shim as outdated.
Origin check
For each activated app the server asks <origin>/limedoc-shim.json and
reports one of four results in the app's status
(GET /api/plugins/artcraft/status, admin): OK, not reachable, not checked
(address refused), or "answers, but not with the shim". The origins are
free text, so the check applies Limedoc's outbound address policy: an origin
that is, or resolves to, a private, loopback or link-local address is not
contacted, the connection goes to the address that was checked, redirects
are not followed, and the reply is limited in time and size. What the host
answered is never shown; a failed check is one line in the server log.
App builds hosted on a private network are a legitimate target. Allow them in the app's environment:
ARTCRAFT_ALLOW_PRIVATE_HOSTS=true
Unset, the switch is off in production-like deployments and on in
development (false turns it off there too). The check is advisory: an
activated app with an origin is offered whatever the result, because
browsers load the editors, not the server. The managed sidecar's
/manifest.json is read from ARTCRAFT_BASE_URL (the deployment's own
internal address) and is not subject to the switch.
Using the editors
- Open: a file card's Edit (
::embed, the file manager, "Open with…") opens the file in the active ArtCraft app for its type. - Save: in the app, with File ▸ Save (Ctrl+S); Limedoc stores what the app saves (Limedoc ≥ 0.65.0 has no Save button in the editor bar). A file opens in the app under its own name, so File ▸ Save writes it back without asking for a name (VectorCraft keeps an SVG as SVG). Closing an editor saves pending changes through the app's own File ▸ Save (bridge apps from PdfCraft 0.20, CADCraft 0.19, WordCraft 0.17, GridCraft 0.18 on; older builds ask when there are unsaved changes). Save as creates a new file next to the original (needs the right to create files in that folder); later saves overwrite that new file.
- DeckCraft edits
.deckcraftpresentations; new decks start fromtemplates/blank.deckcraft(one title slide). PowerPoint (.pptx) opens in DeckCraft only after Settings → ArtCraft → "DeckCraft: also open PowerPoint (.pptx)" (Collabora keeps it otherwise); a Save writes.pptxback. PowerPoint 97-2003 decks (.ppt, DeckCraft ≥ 0.20) open in DeckCraft too; it cannot write them, so the first Save creates<name>.deckcraftnext to the.ppt(needs the right to create files in that folder) and later saves go to that file. Exports (PDF, images, GIF) run from DeckCraft's export dialog and land next to the deck. The presenter pop-out window is not available inside the frame. - FigCraft edits
.figcraftdesigns (new ones fromtemplates/blank.figcraft). It imports.figand.sketchfiles, but their Save becomes a new.figcraft, so the pack does not offer it for them. Needs WebAssembly SIMD (any current browser; Safari ≥ 16.4); a crash recovery entry another session left is discarded when a Limedoc document opens. - CADCraft edits DXF. Its web build cannot read DWG:
.dwgfiles keep listing and downloading, without an editor. - FilmCraft needs 0.18 or newer (host mode).
ldcmd sidecar up artcraftmoves an older installed build to the pack's baseline (the old one stays forldcmd sidecar upgrade artcraft --rollback); until then Settings shows it as outdated and it is not offered. Video export (H.264) fails in FilmCraft's web build (0.19 to 0.21, upstream); interchange exports (EDL, XML, …) and frames work. - Pictures:
shows the drawing itself (Limedoc ≥ 0.63.0); in the viewer its Edit button opens VectorCraft. - Toolbar tool (ArtCraft icon): with the cursor on an
::artcraft,::officeor::embeddirective, or on a markdown imageof a file an app edits, it opens that file (the pinned app, the only app, or a choice); elsewhere it opens a dialog to create a new file next to the document (PDF, DXF, SVG, DeckCraft presentation, FigCraft design, FilmCraft or EffectCraft project, from the blank templates intemplates/) or embed an existing one. Images (SVG) are inserted asby default, other files as::embed. ::artcraft <path> [app=<id>] [title="…"] [download=true] :::renders the same file card as::embedand pins the editor. Prefer::embedwhen the document should render the same without this plugin.::officewithout Collabora: the pack renders::officedirectives as file cards (below Collabora in the election, so Collabora wins wherever it is installed); they open in WordCraft/GridCraft (and.pptxin DeckCraft, opt-in) when those are active. The editor's options tool (wrench) edits their file and download flag; the pack declares the directive's form for it (artcraft_embed_options.ts).- Media from Limedoc (FilmCraft, EffectCraft): the editor shell's
"Aus Limedoc einfügen" puts Limedoc files into the app (Limedoc ≥ 0.63).
A save links them in the project instead of copying them; dragged-in
files are uploaded next to the project (
<project>.assets/). Reopening a project puts its media back into the app (EffectCraft: relinked after the open). - After Effects projects (
.aep,.aepx; Limedoc ≥ 0.76, EffectCraft ≥ 0.24): Edit opens one in EffectCraft as a new project; the first Save creates<name>.ecprojnext to it (the.aepis never written). Parts EffectCraft cannot bring over are left out (its notice says how many). Footage the.aepnames by another computer's path arrives missing: put the files in with "Insert from Limedoc" and relink them in EffectCraft. An.aepinserted into an open project is imported into it. - PdfCraft saves (0.21): after Apply redactions the app's Save
creates
<name>_Redacted.pdfnext to the original, which becomes the open file. After a Fill & Sign signature, Save first asks whether to lock it into the page; closing the editor before the question is answered keeps it open and says so. - Browser storage: media from Limedoc open in FilmCraft from memory (no copy in the browser); FilmCraft still autosaves a recovery snapshot, and closing after a confirmed save, with nothing changed since, clears the origin's storage. EffectCraft clears its project store on close. When the Limedoc user changes, the shim clears the origin's storage before the app starts.
Maintainers: app updates
The daily feed-update.yml adds new upstream releases to
feed/apps.feed.json as latest. Before promoting a build to tested
(what ldcmd sidecar upgrade artcraft installs), run the real-build smoke
test, locally or with the manual workflow "Shim smoke":
deno run -A worker/testing/shim_smoke.ts filmcraft@0.19.0 # Chromium via Playwright
deno run -A worker/feed_update.ts --promote filmcraft@0.19.0 --write
It serves the build with the shim, plays Limedoc's frame editor in a second
origin and drives the app through its own window.<app> API: open, edit,
dirty, the app's Save, Save As, exports, a refused save, storage hygiene
and close (scenarios in worker/testing/shim_smoke_scenarios.ts). Move the
lock baseline (worker/apps.lock.json) only to tested builds; a build the
shim cannot drive any more needs minVersion in apps.ts.
License
FSL-1.1-ALv2 (see LICENSE.md).