Skip to content

Commit 16eb9cd

Browse files
committed
Initial commit
0 parents  commit 16eb9cd

File tree

4 files changed

+84
-0
lines changed

4 files changed

+84
-0
lines changed

Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM dperson/samba:amd64
2+
3+
RUN apk add --no-cache --update \
4+
cifs-utils
5+
6+
RUN mkdir /share
7+
8+
COPY ./docker-cmd.sh /docker-cmd.sh
9+
RUN chmod +x /docker-cmd.sh
10+
ENTRYPOINT ["/docker-cmd.sh"]

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Jan Dittrich
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# SMB1-Proxy #
2+
3+
![](https://img.shields.io/docker/pulls/jandi/smb1-proxy)
4+
![](https://img.shields.io/docker/image-size/jandi/smb1-proxy)
5+
6+
This container is used to proxy an existing secure smb share (version 2+) to allow devices, that only support cifs/smb v1 the access to a specific share or folder on the secure share - without downgrading the complete server to smb v1.
7+
8+
## Usage ##
9+
10+
Example docker-compose configuration:
11+
12+
```yml
13+
version: '3.7'
14+
15+
services:
16+
smb1proxy:
17+
image: jandi/smb1-proxy
18+
environment:
19+
TZ: 'Europe/Berlin'
20+
USERID: 1000
21+
GROUPID: 1000
22+
PROXY_SHARE: legacyshare
23+
PROXY_USERNAME: user
24+
PROXY_PASSWORD: password
25+
SERVER_SHARE: //secure-host/share/path/to/folder
26+
SERVER_DOMAIN: DOM
27+
SERVER_USERNAME: User
28+
SERVER_PASSWORD: password
29+
ports:
30+
- "445:445/tcp"
31+
tmpfs:
32+
- /tmp
33+
restart: unless-stopped
34+
stdin_open: true
35+
tty: true
36+
privileged: true
37+
```

docker-cmd.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
chown -R $USERID:$GROUPID /share
6+
7+
echo "Mounting $SERVER_SHARE with user $SERVER_DOMAIN\\$SERVER_USERNAME.."
8+
mount -t cifs -o username=$SERVER_USERNAME,password=$SERVER_PASSWORD,domain=$SERVER_DOMAIN,vers=3.0,uid=$USERID,gid=$GROUPID \
9+
$SERVER_SHARE /share
10+
11+
echo "Starting samba.."
12+
export USER="$PROXY_USERNAME;$PROXY_PASSWORD"
13+
export SHARE="$PROXY_SHARE;/share;yes;no;no;$PROXY_USERNAME"
14+
export RECYCLE=x # disable recycle bin
15+
export SMB=x # disable SMB2 minimum version
16+
/sbin/tini -s -- /usr/bin/samba.sh

0 commit comments

Comments
 (0)