Skip to content

Commit bfcac92

Browse files
mudlerclaude
andauthored
feat: add samba MCP (#32)
The server speaks SMB2/SMB3 to a share over the network instead of reading a mounted path. A cifs mount inside a container needs either a privileged container or a host bind-mount, so dialling the share directly keeps the image self-contained. It exposes six tools: list, search, read, write, move and delete. Every path is relative to the share root and passes through one cleanPath choke point, so no request can address anything outside the share. Search matches names only and never reads file contents, which keeps it cheap on a share full of large files. Reads refuse binary files and anything above SMB_READ_MAX_BYTES. Two switches restrict what the server exposes. SMB_READ_ONLY drops write, move and delete. SMB_DISABLE_DELETE drops delete, and also makes write and move refuse to overwrite an existing path, because either would destroy the previous content. The tool handlers run against a temporary directory in the specs. Four integration specs drive a real SMB server and are skipped unless SMB_TEST_ADDRESS names one; samba/README-test.md starts a disposable container for them. Claude-Session: https://claude.ai/code/session_01TCUqUeXa7TJWrifZYPzXyh Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent cf78cc3 commit bfcac92

23 files changed

Lines changed: 2682 additions & 0 deletions

.github/workflows/image.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ jobs:
6363
- mcp: filesystem
6464
dockerfile: ./Dockerfile
6565
context: ./
66+
- mcp: samba
67+
dockerfile: ./Dockerfile
68+
context: ./
6669
- mcp: opencode
6770
dockerfile: ./opencode/Dockerfile
6871
context: ./

README.md

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,132 @@ mcp:
14251425
}
14261426
```
14271427

1428+
### 🗄️ Samba Server
1429+
1430+
An SMB2/SMB3 server that talks to a Windows or Samba share over the network. It connects to the share directly, so no `mount`, no `cifs-utils` and no privileged container are needed.
1431+
1432+
**Features:**
1433+
- Native SMB2/SMB3 client, no host mount required
1434+
- Every path is relative to the share root and cannot escape it
1435+
- Name-based recursive search that never downloads file contents
1436+
- Reads refuse binary files and anything above a configurable size limit
1437+
- Two independent safety switches: read-only, and deletion disabled
1438+
- JSON schema validation for inputs/outputs
1439+
1440+
**Tools:**
1441+
- `list` - List the files and directories directly inside a directory on the share
1442+
- `search` - Find files and directories by name, matching a glob such as `*.gguf` or plain text as a substring
1443+
- `read` - Read a text file with line numbers, refusing binary and oversized files
1444+
- `write` - Write content to a file, creating parent directories as needed
1445+
- `move` - Move or rename a file or directory within the share
1446+
- `delete` - Delete a file or directory, recursing only when asked
1447+
1448+
**Configuration:**
1449+
1450+
| Variable | Default | Description |
1451+
| --- | --- | --- |
1452+
| `SMB_HOST` | *required* | SMB server host, optionally with `:port` (default port 445) |
1453+
| `SMB_SHARE` | *required* | Share name, for example `Data` |
1454+
| `SMB_USER` | empty | Username; leave empty for a guest or anonymous session |
1455+
| `SMB_PASSWORD` | empty | Password |
1456+
| `SMB_DOMAIN` | empty | NTLM domain or workgroup |
1457+
| `SMB_TIMEOUT` | `30s` | Bounds the connection and every operation |
1458+
| `SMB_READ_MAX_BYTES` | `1048576` | Largest file `read` will pull over the wire |
1459+
| `SMB_READ_ONLY` | `false` | When true, only `list`, `search` and `read` are exposed |
1460+
| `SMB_DISABLE_DELETE` | `false` | When true, `delete` is not exposed, and `write` and `move` refuse to overwrite anything |
1461+
1462+
`SMB_DISABLE_DELETE` protects existing data rather than just hiding one tool: with it set, writing over an existing file and moving onto an existing destination are both refused, because either would destroy the previous content.
1463+
1464+
**List Input Format:**
1465+
```json
1466+
{
1467+
"path": "models/qwen"
1468+
}
1469+
```
1470+
1471+
**Search Input Format:**
1472+
```json
1473+
{
1474+
"pattern": "*.gguf",
1475+
"path": "models",
1476+
"max_depth": 10,
1477+
"max_results": 100
1478+
}
1479+
```
1480+
1481+
Search matches names only, never file contents, so it stays cheap on a share full of large files. It reports `truncated` when it stopped at `max_results`.
1482+
1483+
**Read Input Format:**
1484+
```json
1485+
{
1486+
"path": "models/qwen/config.json",
1487+
"offset": 0,
1488+
"limit": 50
1489+
}
1490+
```
1491+
1492+
**Write Input Format:**
1493+
```json
1494+
{
1495+
"path": "notes/todo.txt",
1496+
"content": "file content here"
1497+
}
1498+
```
1499+
1500+
**Move Input Format:**
1501+
```json
1502+
{
1503+
"from": "notes/todo.txt",
1504+
"to": "archive/done.txt",
1505+
"overwrite": false
1506+
}
1507+
```
1508+
1509+
**Delete Input Format:**
1510+
```json
1511+
{
1512+
"path": "archive",
1513+
"recursive": true
1514+
}
1515+
```
1516+
1517+
**Docker Image:**
1518+
```bash
1519+
docker run -i --rm \
1520+
-e SMB_HOST=192.168.1.10 \
1521+
-e SMB_SHARE=Data \
1522+
-e SMB_USER=nasuser \
1523+
-e SMB_PASSWORD=secret \
1524+
ghcr.io/mudler/mcps/samba:latest
1525+
```
1526+
1527+
**LocalAI configuration (to add to the model config):**
1528+
```yaml
1529+
mcp:
1530+
stdio: |
1531+
{
1532+
"mcpServers": {
1533+
"samba": {
1534+
"command": "docker",
1535+
"env": {
1536+
"SMB_HOST": "192.168.1.10",
1537+
"SMB_SHARE": "Data",
1538+
"SMB_USER": "nasuser",
1539+
"SMB_PASSWORD": "secret",
1540+
"SMB_DISABLE_DELETE": "true"
1541+
},
1542+
"args": [
1543+
"run", "-i", "--rm",
1544+
"-e", "SMB_HOST", "-e", "SMB_SHARE",
1545+
"-e", "SMB_USER", "-e", "SMB_PASSWORD",
1546+
"-e", "SMB_DISABLE_DELETE",
1547+
"ghcr.io/mudler/mcps/samba:master"
1548+
]
1549+
}
1550+
}
1551+
}
1552+
```
1553+
14281554
### 🤖 Claude Server
14291555

14301556
An MCP server for controlling Claude Code CLI sessions asynchronously. Start sessions, monitor progress, retrieve logs, and manage multiple concurrent Claude Code processes. It follows the same pattern as the opencode MCP server but is specifically designed for Claude Code.

go.mod

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ go 1.26
44

55
require (
66
github.com/blevesearch/bleve/v2 v2.5.7
7+
github.com/cloudsoda/go-smb2 v0.0.0-20260803221621-0b399b9d036c
78
github.com/dghubble/oauth1 v0.7.3
89
github.com/g8rswimmer/go-twitter/v2 v2.1.5
910
github.com/gofrs/flock v0.13.0
@@ -49,7 +50,9 @@ require (
4950
github.com/chromedp/cdproto v0.0.0-20260321001828-e3e3800016bc // indirect
5051
github.com/chromedp/chromedp v0.15.1 // indirect
5152
github.com/chromedp/sysutil v1.1.0 // indirect
53+
github.com/cloudsoda/sddl v0.0.0-20250224235906-926454e91efc // indirect
5254
github.com/dlclark/regexp2 v1.11.5 // indirect
55+
github.com/geoffgarside/ber v1.1.0 // indirect
5356
github.com/go-json-experiment/json v0.0.0-20260214004413-d219187c3433 // indirect
5457
github.com/go-logr/logr v1.4.3 // indirect
5558
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
@@ -60,7 +63,14 @@ require (
6063
github.com/google/go-cmp v0.7.0 // indirect
6164
github.com/google/jsonschema-go v0.4.2 // indirect
6265
github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 // indirect
66+
github.com/hashicorp/go-uuid v1.0.3 // indirect
6367
github.com/huandu/xstrings v1.5.0 // indirect
68+
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
69+
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
70+
github.com/jcmturner/gofork v1.7.6 // indirect
71+
github.com/jcmturner/goidentity/v6 v6.0.1 // indirect
72+
github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect
73+
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
6474
github.com/json-iterator/go v1.1.12 // indirect
6575
github.com/mitchellh/copystructure v1.2.0 // indirect
6676
github.com/mitchellh/reflectwalk v1.0.2 // indirect

go.sum

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR
7272
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
7373
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
7474
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
75+
github.com/cloudsoda/go-smb2 v0.0.0-20260803221621-0b399b9d036c h1:7VByb9X2X3LXbk89eMavoQO9uD5dcAjY6uPZhAR9Yso=
76+
github.com/cloudsoda/go-smb2 v0.0.0-20260803221621-0b399b9d036c/go.mod h1:1pQXB0vAlzRlqcY7LYKOOZMw0wKfJPFxTLsJRF2Gswo=
77+
github.com/cloudsoda/sddl v0.0.0-20250224235906-926454e91efc h1:0xCWmFKBmarCqqqLeM7jFBSw/Or81UEElFqO8MY+GDs=
78+
github.com/cloudsoda/sddl v0.0.0-20250224235906-926454e91efc/go.mod h1:uvR42Hb/t52HQd7x5/ZLzZEK8oihrFpgnodIJ1vte2E=
7579
github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI=
7680
github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M=
7781
github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE=
@@ -109,6 +113,8 @@ github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWo
109113
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
110114
github.com/g8rswimmer/go-twitter/v2 v2.1.5 h1:Uj9Yuof2UducrP4Xva7irnUJfB9354/VyUXKmc2D5gg=
111115
github.com/g8rswimmer/go-twitter/v2 v2.1.5/go.mod h1:/55xWb313KQs25X7oZrNSEwLQNkYHhPsDwFstc45vhc=
116+
github.com/geoffgarside/ber v1.1.0 h1:qTmFG4jJbwiSzSXoNJeHcOprVzZ8Ulde2Rrrifu5U9w=
117+
github.com/geoffgarside/ber v1.1.0/go.mod h1:jVPKeCbj6MvQZhwLYsGwaGI52oUorHoHKNecGT85ZCc=
112118
github.com/gkampitakis/ciinfo v0.3.2 h1:JcuOPk8ZU7nZQjdUhctuhQofk7BGHuIy0c9Ez8BNhXs=
113119
github.com/gkampitakis/ciinfo v0.3.2/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo=
114120
github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M=
@@ -166,8 +172,27 @@ github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/v
166172
github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI=
167173
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
168174
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
175+
github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=
176+
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
177+
github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI=
178+
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
179+
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
180+
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
181+
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
169182
github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI=
170183
github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
184+
github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=
185+
github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs=
186+
github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=
187+
github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM=
188+
github.com/jcmturner/gofork v1.7.6 h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVETg=
189+
github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo=
190+
github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o=
191+
github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg=
192+
github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8=
193+
github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs=
194+
github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY=
195+
github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc=
171196
github.com/joshdk/go-junit v1.0.0 h1:S86cUKIdwBHWwA6xCmFlf3RTLfVXYQfvanM5Uh+K6GE=
172197
github.com/joshdk/go-junit v1.0.0/go.mod h1:TiiV0PqkaNfFXjEiyjWM3XXrhVyCa1K4Zfga6W52ung=
173198
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
@@ -267,8 +292,14 @@ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVs
267292
github.com/spf13/cast v1.7.0 h1:ntdiHjuueXFgm5nzDRdOS4yfT43P5Fnud6DH50rz/7w=
268293
github.com/spf13/cast v1.7.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
269294
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
295+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
296+
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
270297
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
298+
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
271299
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
300+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
301+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
302+
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
272303
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
273304
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
274305
github.com/testcontainers/testcontainers-go v0.38.0 h1:d7uEapLcv2P8AvH8ahLqDMMxda2W9gQN1nRbHS28HBw=
@@ -310,6 +341,7 @@ go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
310341
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
311342
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
312343
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
344+
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
313345
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
314346
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
315347
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -325,6 +357,7 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r
325357
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
326358
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
327359
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
360+
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
328361
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
329362
golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
330363
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
@@ -407,6 +440,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN
407440
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
408441
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
409442
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
443+
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
410444
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
411445
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
412446
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

samba/README-test.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Running the samba integration specs
2+
3+
The unit specs need nothing: `go test ./samba/`. They drive the tool handlers
4+
against a temporary local directory and skip the four integration specs.
5+
6+
The integration specs talk to a real SMB server. **Point them at a throwaway
7+
server only** — they create, move and delete files, so never aim them at a NAS
8+
you care about.
9+
10+
Start a disposable Samba container:
11+
12+
```bash
13+
mkdir -p /tmp/sambaroot && chmod 777 /tmp/sambaroot
14+
docker run -d --name mcps-samba-test -p 13445:445 \
15+
-v /tmp/sambaroot:/share \
16+
dperson/samba -p \
17+
-u "smbtest;smbtest" \
18+
-s "testshare;/share;yes;no;no;smbtest"
19+
```
20+
21+
Run the specs against it:
22+
23+
```bash
24+
SMB_TEST_ADDRESS=127.0.0.1:13445 \
25+
SMB_TEST_SHARE=testshare \
26+
SMB_TEST_USER=smbtest \
27+
SMB_TEST_PASSWORD=smbtest \
28+
go test ./samba/ -v
29+
```
30+
31+
Tear it down:
32+
33+
```bash
34+
docker rm -f mcps-samba-test && rm -rf /tmp/sambaroot
35+
```
36+
37+
Each integration spec works inside a scratch directory named after the Ginkgo
38+
random seed and removes it afterwards, so repeated runs do not pile up.

0 commit comments

Comments
 (0)