Translate user-facing docs and node help to English
README, NODES.md, install scripts, palette help text, and example flows — node .js logic unchanged.
This commit is contained in:
+30
-52
@@ -1,66 +1,44 @@
|
||||
# Infrastruktur — cloud.domain.name (192.168.1.10)
|
||||
# Infrastructure
|
||||
|
||||
Verifierad 2026-08-22. Sidecar ska passa in utan att röra befintliga tjänster.
|
||||
Verified layout for integrate mode (nodes on existing `:1880`, not sidecar).
|
||||
|
||||
## Containers
|
||||
|
||||
| Container | Image | Port | Nätverk | IP |
|
||||
|-----------|-------|------|---------|-----|
|
||||
| `code` | collabora/code:latest (26.04.3.1) | 127.0.0.1:9980 | `bridge` | 172.17.0.2 |
|
||||
| `nextcloud-node-red` | nextcloud-node-red:latest | 0.0.0.0:1880 | `nextcloud-node-red_odds_network` | 172.18.0.3 |
|
||||
| `nextcloud-node-red` | nextcloud-node-red:latest | 0.0.0.0:1880 | odds_network + **bridge** (efter install) | 172.18.0.3 |
|
||||
| ~~nextcloud-collabora-nodered~~ | — | — | **Används ej** — noder integreras i :1880 | — |
|
||||
| `gitea_server` | gitea/gitea:latest | 127.0.0.1:3000 | (egen) | — |
|
||||
| `odds-postgres` | postgres:16-alpine | 5433 | odds_network | — |
|
||||
| Container | Image | Port | Network | Notes |
|
||||
|-----------|-------|------|---------|-------|
|
||||
| nextcloud-node-red | custom | 1880 | odds_network (+ bridge for CODE) | Existing Node-RED |
|
||||
| code | collabora/code | 127.0.0.1:9980 | bridge | Collabora CODE |
|
||||
| odds-postgres | postgres:16 | 5433→5432 | odds_network | Odds scraper DB — do not touch |
|
||||
|
||||
## Viktigt om nätverk
|
||||
Sidecar `nextcloud-collabora-nodered` on :1881 is **not used** — integrate mode patches the :1880 instance.
|
||||
|
||||
- **CODE** ligger på Docker **`bridge`** (172.17.0.0/16), inte på `odds_network`.
|
||||
- **Collabora-noder** installeras i befintlig `nextcloud-node-red` — ingen ny container
|
||||
- **`install.sh`** patchar `/home/ncdeploy/nextcloud-node-red` och bygger om samma image
|
||||
- Efter install: `docker network connect bridge nextcloud-node-red` (sker automatiskt)
|
||||
- `127.0.0.1:9980` på host når CODE, men **inte** från en container utan bridge/host-mode.
|
||||
- `host.docker.internal` är opålitligt på Linux — använd **172.17.0.2**.
|
||||
- **nextcloud-node-red** (:1880) ska **inte** flyttas till bridge; den stannar på odds_network.
|
||||
## Networking
|
||||
|
||||
## Nextcloud
|
||||
- **CODE** runs on Docker **`bridge`** (typically 172.17.0.x), not on `odds_network`.
|
||||
- After `docker compose up`, connect Node-RED to bridge:
|
||||
`docker network connect bridge nextcloud-node-red`
|
||||
- Host `127.0.0.1:9980` reaches CODE from the host, not from containers without bridge.
|
||||
- On Linux, prefer detected bridge IP over `host.docker.internal`.
|
||||
- **nextcloud-node-red** stays on `odds_network`; bridge is an extra attachment for CODE only.
|
||||
|
||||
- URL: https://cloud.domain.name
|
||||
- Host: 192.168.1.10, `/var/www/nextcloud`
|
||||
- Sidecar: `extra_hosts: cloud.domain.name:192.168.1.10`, `verifyTls: false` tills cert i container
|
||||
|
||||
## CODE
|
||||
|
||||
- `aliasgroup1=https://cloud.domain.name:443`
|
||||
- Starta **ingen** ny CODE-container
|
||||
- REST: `/cool/convert-to`, `/cool/extract-document-structure`, `/cool/transform-document-structure`
|
||||
- WOPI discovery: `/hosting/discovery`, `/hosting/capabilities`
|
||||
|
||||
## Git (Gitea)
|
||||
|
||||
- https://git.domain.name/your-user/nextcloud-collabora-nodered
|
||||
- SSH port **2222** på host
|
||||
|
||||
## Bootstrap (ny VM)
|
||||
|
||||
```bash
|
||||
curl -fsSL https://git.domain.name/your-user/nextcloud-collabora-nodered/raw/branch/main/bootstrap-install.sh | bash
|
||||
```
|
||||
|
||||
## Kataloger på host
|
||||
## Install paths (example host)
|
||||
|
||||
```
|
||||
/home/ncdeploy/
|
||||
├── nextcloud-node-red/ # :1880 — orört
|
||||
├── nextcloud-collabora-nodered/ # :1881 — detta paket
|
||||
├── your-userode/ # Gitea compose
|
||||
├── odds-scraper/ # ignoreras
|
||||
└── nodered-embed/
|
||||
├── nextcloud-node-red/ # :1880 — patched by integrate
|
||||
│ └── nodes/nextcloud-collabora/ # copied package (lib/ + nodes/)
|
||||
└── nextcloud-collabora-nodered/ # this repo
|
||||
```
|
||||
|
||||
## Collabora SDK (referens)
|
||||
## Public vs internal URLs
|
||||
|
||||
- [Conversion API](https://sdk.collaboraonline.com/docs/conversion_api.html)
|
||||
- [Extract/Transform API](https://sdk.collaboraonline.com/docs/extract_transform_api.html)
|
||||
- [Linking API](https://sdk.collaboraonline.com/docs/linking_api.html)
|
||||
- postMessage: webbläsare/iframe — **inte** Node-RED
|
||||
| Use | URL |
|
||||
|-----|-----|
|
||||
| Nextcloud API / WebDAV | `https://cloud.example.com` |
|
||||
| CODE from Node-RED container | `https://<bridge-ip>:9980` (verifyTls=false) |
|
||||
| Browser editor / WOPI | `collaboraPublicUrl` — usually same as Nextcloud proxy |
|
||||
|
||||
## Gitea (optional)
|
||||
|
||||
- https://git.domain.name/your-user/nextcloud-collabora-nodered
|
||||
- SSH git on port 2222 if configured
|
||||
|
||||
+81
-81
@@ -1,71 +1,71 @@
|
||||
# Noder — nextcloud collabora
|
||||
# Nodes — nextcloud collabora
|
||||
|
||||
Sex flödesnoder i paletten + en config. Alla sex pekar på samma **nc-collab-config** (kugghjul, inte i paletten). Utan config händer inget.
|
||||
Six flow nodes in the palette plus one config node. All six point at the same **nc-collab-config** (gear menu, not in the palette). Without config, nothing works.
|
||||
|
||||
## Backends
|
||||
|
||||
| Backend | Typisk adress | Roll |
|
||||
|---------|---------------|------|
|
||||
| Nextcloud | `https://cloud.domain.name` | Filer (WebDAV) + Office-API (OCS) |
|
||||
| Collabora CODE | `https://172.17.0.2:9980` | Konvertering (`/cool/...`) på Docker bridge |
|
||||
| Backend | Typical URL | Role |
|
||||
|---------|-------------|------|
|
||||
| Nextcloud | `https://cloud.example.com` | Files (WebDAV) + Office API (OCS) |
|
||||
| Collabora CODE | `https://172.17.0.2:9980` | Conversion (`/cool/...`) on Docker bridge |
|
||||
|
||||
Auth: **användarnamn + app-lösenord**. Inte kontolösen.
|
||||
Auth: **username + app password**. Not your account password.
|
||||
|
||||
Standardutdata om du inte anger sökväg: `/Dokument/OfficeOut/`
|
||||
Default output folder if you omit a path: `/Dokument/OfficeOut/` (or set your own via `destNcPath`).
|
||||
|
||||
---
|
||||
|
||||
## Så hänger de ihop
|
||||
## How they fit together
|
||||
|
||||
```
|
||||
nc-collab-config (URL + app-lösen)
|
||||
nc-collab-config (URLs + app password)
|
||||
│
|
||||
┌────┼────┬────────────┐
|
||||
▼ ▼ ▼ ▼
|
||||
collabora-* nc-office collabora-wopi collabora-bridge
|
||||
(direkt CODE) (NC OCS) (health/WOPI) (kedjor + sparar)
|
||||
(direct CODE) (NC OCS) (health/WOPI) (pipelines + save)
|
||||
```
|
||||
|
||||
**Tumregel**
|
||||
**Rules of thumb**
|
||||
|
||||
- PDF i Nextcloud → `collabora-bridge` **ncFileToPdf**
|
||||
- Fylla mall i NC → **fillTemplateSave** eller `nc-office template:fillFields`
|
||||
- Öppna i webbläsaren → `nc-office` **document:direct**
|
||||
- Bara byta format i minnet → `collabora-convert`
|
||||
- Se fältnamn → `collabora-extract` eller bridge **extractToPayload**
|
||||
- Kolla att CODE lever → `collabora-wopi` **capabilities**
|
||||
- PDF in Nextcloud → `collabora-bridge` **ncFileToPdf**
|
||||
- Fill template in NC → **fillTemplateSave** or `nc-office template:fillFields`
|
||||
- Open in browser → `nc-office` **document:direct**
|
||||
- Convert in memory only → `collabora-convert`
|
||||
- List field names → `collabora-extract` or bridge **extractToPayload**
|
||||
- Check CODE is alive → `collabora-wopi` **capabilities**
|
||||
|
||||
---
|
||||
|
||||
## Gemensamma fält i msg
|
||||
## Common `msg` fields
|
||||
|
||||
| Fält | Betydelse |
|
||||
|------|-----------|
|
||||
| `ncPath` | Sökväg i användarens filer, t.ex. `/Dokument/avtal.docx` |
|
||||
| `fileId` | NC fil-id (slås upp från ncPath om saknas) |
|
||||
| `payload` | Rådata redan i flödet (Buffer eller HTML) |
|
||||
| Field | Meaning |
|
||||
|-------|---------|
|
||||
| `ncPath` | Path in the user's files, e.g. `/Documents/contract.docx` |
|
||||
| `fileId` | Nextcloud numeric file id (resolved from `ncPath` if missing) |
|
||||
| `payload` | Raw data already in the flow (Buffer or HTML string) |
|
||||
| `format` | pdf, png, docx, html, … |
|
||||
| `destNcPath` | Exakt målsökväg |
|
||||
| `destFolder` / `destName` | Mapp + namn (default `/Dokument/OfficeOut/`) |
|
||||
| `fields` / `transform` | JSON att skriva in i mall |
|
||||
| `templateNcPath` | Extra mall till convert |
|
||||
| `compareNcPath` | Gammal version för diff-PDF |
|
||||
| `operation` | Överstyr dropdown på noden |
|
||||
| `destNcPath` | Exact destination path |
|
||||
| `destFolder` / `destName` | Folder + name (default folder `/Dokument/OfficeOut/`) |
|
||||
| `fields` / `transform` | JSON to merge into a template |
|
||||
| `templateNcPath` | Extra template file for convert |
|
||||
| `compareNcPath` | Older version for diff PDF |
|
||||
| `operation` | Overrides the node dropdown |
|
||||
|
||||
Fel → `msg.error` + röd nod. Flödet dör inte tyst.
|
||||
Errors go to `msg.error` and turn the node red. The flow does not fail silently.
|
||||
|
||||
---
|
||||
|
||||
## 1. collabora-convert
|
||||
|
||||
Gör om fil till annat format via CODE. Sparar **inte** i Nextcloud — utdata i `msg.payload` (Buffer).
|
||||
Convert a file to another format via CODE. Does **not** save to Nextcloud — output is `msg.payload` (Buffer).
|
||||
|
||||
**In:** `msg.payload` eller WebDAV GET `msg.ncPath`. Valfritt `templateNcPath`, `compareNcPath`, `format`.
|
||||
**In:** `msg.payload` or WebDAV GET `msg.ncPath`. Optional `templateNcPath`, `compareNcPath`, `format`.
|
||||
|
||||
**Ut:** `payload`, `filename`, `format`, `contentType`, `statusCode`.
|
||||
**Out:** `payload`, `filename`, `format`, `contentType`, `statusCode`.
|
||||
|
||||
```
|
||||
inject { ncPath: "/Dokument/avtal.docx", format: "pdf" }
|
||||
inject { ncPath: "/Documents/contract.docx", format: "pdf" }
|
||||
→ collabora-convert → debug
|
||||
```
|
||||
|
||||
@@ -73,12 +73,12 @@ inject { ncPath: "/Dokument/avtal.docx", format: "pdf" }
|
||||
|
||||
## 2. collabora-extract
|
||||
|
||||
Lista struktur (content controls, fält …). JSON ut, ingen fil.
|
||||
List structure inside a document (content controls, fields, etc.). JSON out, no file.
|
||||
|
||||
**In:** samma källa som convert. Filter: nod eller `msg.filter` (default `contentcontrol`).
|
||||
**In:** same as convert. Filter: node dropdown or `msg.filter` (default `contentcontrol`).
|
||||
|
||||
```
|
||||
inject { ncPath: "/Mallar/avtal.docx" }
|
||||
inject { ncPath: "/Templates/contract.docx" }
|
||||
→ collabora-extract → function → collabora-transform
|
||||
```
|
||||
|
||||
@@ -86,50 +86,50 @@ inject { ncPath: "/Mallar/avtal.docx" }
|
||||
|
||||
## 3. collabora-transform
|
||||
|
||||
Skriv värden i dokument via CODE. Kräver `msg.fields` eller `msg.transform`.
|
||||
Write values into a document via CODE. Requires `msg.fields` or `msg.transform`.
|
||||
|
||||
```
|
||||
msg.ncPath = "/Mallar/avtal.docx"
|
||||
msg.fields = { "Kund": "AB Exempel", "Datum": "2026-08-22" }
|
||||
msg.ncPath = "/Templates/contract.docx"
|
||||
msg.fields = { "Customer": "ACME Ltd", "Date": "2026-08-22" }
|
||||
→ collabora-transform
|
||||
```
|
||||
|
||||
Spara själv efteråt om filen ska ligga i NC.
|
||||
Save yourself afterwards if the file should live in Nextcloud.
|
||||
|
||||
---
|
||||
|
||||
## 4. collabora-wopi
|
||||
|
||||
Hälsokoll och WOPI — inte konvertering.
|
||||
Health checks and WOPI helpers — not conversion.
|
||||
|
||||
| Operation | Syfte |
|
||||
|-----------|--------|
|
||||
| `capabilities` | Första test att CODE svarar |
|
||||
| `discovery` | mime → editor-URL |
|
||||
| Operation | Purpose |
|
||||
|-----------|---------|
|
||||
| `capabilities` | First test that CODE responds |
|
||||
| `discovery` | mime → editor URL |
|
||||
| `buildEditor` | `wopiSrc` + `token` → `editorUrl` |
|
||||
| `checkFileInfo` / `getFile` | Felsökning |
|
||||
| `checkFileInfo` / `getFile` | Debugging |
|
||||
|
||||
Publik editor-URL går via Nextcloud (`collaboraPublicUrl`), inte intern IP.
|
||||
Public editor URLs go through Nextcloud (`collaboraPublicUrl`), not the internal CODE IP.
|
||||
|
||||
---
|
||||
|
||||
## 5. nc-office
|
||||
|
||||
Nextcloud richdocuments OCS — mallar, fält, editor-URL, assets.
|
||||
Nextcloud richdocuments OCS — templates, fields, editor URL, assets.
|
||||
|
||||
| Operation | Kort |
|
||||
|-----------|------|
|
||||
| `templates:list` | Lista mallar |
|
||||
| `templates:create` | Ny fil från mall |
|
||||
| `template:extractFields` | Fält-JSON via NC |
|
||||
| `template:fillFields` | Fyll + spara i NC |
|
||||
| `document:direct` | `editorUrl` för inloggad användare |
|
||||
| `document:public` | Samma med shareToken |
|
||||
| `files:convert` | NC → NC konvertering |
|
||||
| `assets:create` | Infogningslänk till öppen editor |
|
||||
| Operation | Summary |
|
||||
|-----------|---------|
|
||||
| `templates:list` | List templates |
|
||||
| `templates:create` | New file from template |
|
||||
| `template:extractFields` | Field JSON via NC |
|
||||
| `template:fillFields` | Fill + save in NC |
|
||||
| `document:direct` | `editorUrl` for logged-in user |
|
||||
| `document:public` | Same with `shareToken` |
|
||||
| `files:convert` | NC → NC conversion |
|
||||
| `assets:create` | One-shot insert URL for open editor |
|
||||
|
||||
```
|
||||
inject { ncPath: "/Dokument/avtal.docx" }
|
||||
inject { ncPath: "/Documents/contract.docx" }
|
||||
→ nc-office (document:direct) → debug editorUrl
|
||||
```
|
||||
|
||||
@@ -137,38 +137,38 @@ inject { ncPath: "/Dokument/avtal.docx" }
|
||||
|
||||
## 6. collabora-bridge
|
||||
|
||||
Färdiga pipelines — det mesta i vardagsflöden.
|
||||
Ready-made pipelines — what you'll use most day to day.
|
||||
|
||||
| Operation | Gör |
|
||||
|-----------|-----|
|
||||
| `ncFileToPdf` | NC-fil → PDF i OfficeOut |
|
||||
| `ncFileToPng` | Förhandsvisning |
|
||||
| `ncFileToHtml` | HTML-export |
|
||||
| Operation | Does |
|
||||
|-----------|------|
|
||||
| `ncFileToPdf` | NC file → PDF in OfficeOut |
|
||||
| `ncFileToPng` | Preview PNG |
|
||||
| `ncFileToHtml` | HTML export |
|
||||
| `htmlToOffice` | HTML → docx/pdf … |
|
||||
| `fillTemplateSave` | Mall + fält → spara i NC |
|
||||
| `compareVersionsPdf` | Diff-PDF |
|
||||
| `extractToPayload` | Fält-JSON i msg |
|
||||
| `createAssetLink` | assetUrl |
|
||||
| `fillTemplateSave` | Template + fields → save in NC |
|
||||
| `compareVersionsPdf` | Diff PDF |
|
||||
| `extractToPayload` | Field JSON in msg |
|
||||
| `createAssetLink` | `assetUrl` |
|
||||
|
||||
```
|
||||
inject { ncPath: "/Dokument/avtal.docx" }
|
||||
inject { ncPath: "/Documents/contract.docx" }
|
||||
→ collabora-bridge (ncFileToPdf)
|
||||
→ debug destNcPath
|
||||
```
|
||||
|
||||
Efter bridge kan du koppla dina befintliga OCS-noder (Talk, Mail, dela länk): först PDF i `/Dokument/OfficeOut/`, sedan dela.
|
||||
Chain your existing OCS nodes (Talk, Mail, share link) after bridge: PDF lands in `/Dokument/OfficeOut/`, then share or send.
|
||||
|
||||
---
|
||||
|
||||
## Config: nc-collab-config
|
||||
|
||||
Skapas under kugghjul i Node-RED. Alla sex noder väljer samma config-instans.
|
||||
Create under the gear icon in Node-RED. All six flow nodes pick the same config instance.
|
||||
|
||||
| Fält | Exempel |
|
||||
|------|---------|
|
||||
| nextcloudUrl | `https://cloud.domain.name` |
|
||||
| collaboraUrl | `https://172.17.0.2:9980` (bridge-IP, verifyTls=false) |
|
||||
| collaboraPublicUrl | `https://cloud.domain.name` |
|
||||
| username + app-lösenord | Nextcloud-inloggning |
|
||||
| Field | Example |
|
||||
|-------|---------|
|
||||
| nextcloudUrl | `https://cloud.example.com` |
|
||||
| collaboraUrl | `https://172.17.0.2:9980` (bridge IP, verifyTls=false) |
|
||||
| collaboraPublicUrl | `https://cloud.example.com` |
|
||||
| username + app password | Nextcloud login |
|
||||
|
||||
IP för CODE detekteras vid `./install.sh` — se `.env.example`.
|
||||
CODE IP is detected when you run `./install.sh` — see `.env.example`.
|
||||
|
||||
Reference in New Issue
Block a user