saltcorn-samba 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,25 @@ All notable changes to `saltcorn-samba` are documented here.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [0.3.2] – 2026-07-05
8
+
9
+ ### Fixed
10
+ - **Installations-Fehler `plugin[key] is not a function` behoben.**
11
+ Der Top-Level-Manifest-Key `fieldviews` wurde aus `module.exports`
12
+ entfernt: Saltcorns Plugin-Loader erlaubt Fieldviews nur eingebettet in
13
+ ein `types`-Objekt, nicht global. Das Feature `samba_pdf` bleibt im
14
+ Paket enthalten, wird aber erst mit der geplanten DB-Verknüpfung als
15
+ echter typgebundener Fieldview reaktiviert. Der inline-PDF-Viewer im
16
+ `SambaFileManager` und die Route `GET /sambafile?disposition=inline`
17
+ funktionieren wie bisher.
18
+
19
+ ## [0.3.1] – 2026-07-05
20
+
21
+ ### Fixed
22
+ - `smb-client.js` lädt `@marsaud/smb2` jetzt lazy – `npm test` läuft ohne
23
+ vorheriges `npm install`, weil die reinen Sanitizer-Helfer keinen SMB-
24
+ Import mehr auslösen.
25
+
7
26
  ## [0.3.0] – 2026-07-05
8
27
 
9
28
  ### Added
package/README.md CHANGED
@@ -9,7 +9,7 @@ Features:
9
9
  - ⬆️ **Upload / Neuer Ordner / Umbenennen / Löschen** — optional aktivierbar,
10
10
  Multi-File-Upload mit Drag-&-Drop, Toast-Feedback, Rollen-Gate.
11
11
  - 🌳 **`SambaTree`-View** — Lazy-loading Verzeichnisbaum, ideal zum Einbetten in Show-Views.
12
- - 📄 **`samba_pdf`-Fieldview** — String-Feld mit Datei-Pfad PDF/Bild inline im Browser, plus Download- und externe-App-Buttons.
12
+ - 📄 **Inline-PDF-/Bild-Anzeige** direkt im `SambaFileManager` (Klick auf eine Datei), plus Download- und externe-App-Buttons.
13
13
  - 🚀 **`smb://`-Links** — Öffnet Dateien und Ordner direkt in Nemo, Nautilus, Dolphin (Linux) oder Explorer (Windows).
14
14
  - 🔒 **Sicherheit** — Base-Path als „Chroot", strenge Path-Traversal-Prüfung (`..`, absolute Pfade, UNC, Drive-Letters, NUL-Bytes), CSRF-Schutz auf Schreib-Routen, Filename-Sanitizer, Extension-Blocklist, rollenbasierter Zugriff (getrennte Lese-/Schreib-Rollen).
15
15
  - 🐳 **Docker-freundlich** — direkt per SMB2-Protokoll, keine System-Binaries nötig.
@@ -168,7 +168,15 @@ Mode = `from_field`, Row field = `akte_dir` einbetten.
168
168
  Kompaktere Alternative – lazy-loading Baum, ideal in einer Sidebar oder
169
169
  neben Formularen. Gleiche Path-Modi wie beim File-Manager.
170
170
 
171
- ### Fieldview `samba_pdf`
171
+ ### Fieldview `samba_pdf` (deaktiviert seit 0.3.2)
172
+
173
+ > Der eigenständige Fieldview `samba_pdf` ist temporär nicht als
174
+ > Fieldview registriert, weil er ohne DB-Verknüpfung an einen konkreten
175
+ > Saltcorn-Typ gebunden werden müsste. Er kehrt in einer späteren
176
+ > Version zusammen mit der DB-Integration zurück. Bis dahin liefert der
177
+ > `SambaFileManager` selbst die Inline-Anzeige.
178
+
179
+ _Historische Beschreibung:_
172
180
 
173
181
  Für ein String-Feld mit Datei-Pfad (relativ zum Base-Path). In der View-
174
182
  Konfiguration `Field view = samba_pdf` wählen. Rendert PDFs im `<iframe>`,
package/index.js CHANGED
@@ -38,7 +38,8 @@ const {
38
38
  } = require("./smb-client");
39
39
  const treeView = require("./tree-view");
40
40
  const fileManagerView = require("./filemanager-view");
41
- const { samba_pdf } = require("./pdf-view");
41
+ // pdf-view is intentionally NOT wired into the manifest (see note at bottom).
42
+ // The file is kept in the package so the DB-linkage release can revive it.
42
43
 
43
44
  const PLUGIN_VERSION = pkg.version;
44
45
  const PLUGIN_NAME = "saltcorn-samba@" + PLUGIN_VERSION;
@@ -611,12 +612,17 @@ module.exports = {
611
612
  plugin_name: PLUGIN_NAME,
612
613
  configuration_workflow,
613
614
  viewtemplates: [wrapView(fileManagerView), wrapView(treeView)],
614
- fieldviews: {
615
- samba_pdf,
616
- },
617
615
  routes,
618
616
  headers: [
619
617
  { css: `/plugins/public/${PLUGIN_NAME}/samba.css` },
620
618
  ],
621
619
  dependencies: [],
622
620
  };
621
+
622
+ // Note: the `samba_pdf` fieldview shipped in v0.1–0.3.1 has been removed from
623
+ // the top-level manifest because Saltcorn's plugin loader requires field
624
+ // views to be attached to a type, not registered globally. The inline PDF /
625
+ // image viewer is still available through the SambaFileManager view (click a
626
+ // row) and via the `GET /sambafile?path=...&disposition=inline` route.
627
+ // A properly-typed reintroduction of `samba_pdf` will follow together with
628
+ // the DB-linkage feature in a later release.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saltcorn-samba",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Saltcorn plugin: browse, upload, rename and delete files on a Samba/CIFS share. File-manager view, directory tree, inline PDF viewer, external-app open (smb://).",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -49,8 +49,5 @@
49
49
  ],
50
50
  "publishConfig": {
51
51
  "access": "public"
52
- },
53
- "directories": {
54
- "test": "test"
55
52
  }
56
53
  }
package/smb-client.js CHANGED
@@ -7,7 +7,16 @@
7
7
  */
8
8
 
9
9
  const path = require("path");
10
- const SMB2 = require("@marsaud/smb2");
10
+
11
+ // @marsaud/smb2 is loaded lazily so the pure sanitizer helpers exported by
12
+ // this module can be required (e.g. from unit tests) without needing the
13
+ // native SMB dependency installed.
14
+ let _SMB2 = null;
15
+ function getSMB2() {
16
+ if (_SMB2) return _SMB2;
17
+ _SMB2 = require("@marsaud/smb2");
18
+ return _SMB2;
19
+ }
11
20
 
12
21
  // ---------------------------------------------------------------------------
13
22
  // Path helpers
@@ -108,6 +117,7 @@ function buildClient(config) {
108
117
  if (/[\\/]/.test(share)) throw new Error("Samba: share must not contain slashes");
109
118
 
110
119
  const shareStr = `\\\\${server}${port ? ":" + port : ""}\\${share}`;
120
+ const SMB2 = getSMB2();
111
121
  const smb = new SMB2({
112
122
  share: shareStr,
113
123
  domain: domain || "WORKGROUP",