mirror of
https://github.com/atmoz/sftp.git
synced 2024-11-17 12:51:33 -05:00
Merge branch 'master' into feature/user-create-on-restart
This commit is contained in:
commit
6385df2e9a
9 changed files with 413 additions and 69 deletions
179
.github/public-keys/atmoz.asc
vendored
Normal file
179
.github/public-keys/atmoz.asc
vendored
Normal file
|
@ -0,0 +1,179 @@
|
|||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQINBFnfpzIBEAC5rEA7zyYl8JdcXowGzFquerQBhFEJkH2fiJ544v/9pCkkaCIv
|
||||
5tqSWDHAL2mbhh6Y5wVJtXuOGzPgJXd1zl8H88NlZpUInOyPtgLpy6Mr7H/0VzS6
|
||||
U6+SusR4u8Mwi+glNuVCFla7N0WsnWCK9sLo1hhvpFRoDY0cRPE8TnlhU5WO30b6
|
||||
g64yeZEqSIApgPftDolfDprtO4ah3br6bGLyfwOfOODPV4Aqn347WX8o0afP5gHp
|
||||
ogG2xHdwk2beLXR9CSnS1RiMQw/zthXb6aP5w3BpwevN5MHWx3wfatceyfhTACst
|
||||
LcliiOXLJvlvUiOL4W+vwkKp9v1N4aEDq4fPlEfE9Fh8YpN6/AHAafaxqfLaDLGn
|
||||
Grm2GGWSKlWcyfqfKd3RyAIXVnBv3ceg5331vRGtW17bKKzoRgPRJwqRM+0QfSX/
|
||||
rqPDjoJTmmlI2NWfdtYmarbGn3ipGFdm4zCEG6tDAYHUMti+ynC3mXaoH9G7KH6r
|
||||
7TI3Q4EETYbS9+QV+EfV4cEaJ/m9lHyPqAgcUHSd+MpdJVMqpRDSac8xD0Oixo8I
|
||||
fIfWIOMbMTgrE4xmA5DHdET2Htj8LE8ayQQ7sr1XIMuEHmCTMdZ+zf/7Lfja/pwZ
|
||||
/qc8lWOBYCC+kPUf3B3TLhdyWPO7yW0g9jGd+2Pqg3o4KRgekAyFT8HSKQARAQAB
|
||||
tCJBZHJpYW4gRHZlcmdzZGFsIDxwcml2YXRAYXRtb3oubm8+iQI3BBMBCgAhBQJZ
|
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ewx3Rk5o/6ckdT2BZ3RJYpFl0d
|
||||
piz6G8B4J1JhWXt/4t204/iLOC7dk3DHMEQXmaKjaxNHu5mAc9A8lBlxPRf0DtgP
|
||||
HHw9jDHotpR/x2wYBBhGwkiNhFGVayRL1Ouyk46U56Ca8y3TZ5sTeUnVhiuyDTDk
|
||||
biwHgPe6jVzj2f0nYnkEDX9Mnva9tB7xCmWhkbVe/BvT2RLODsT+nShIjwVBP3Bl
|
||||
vqsTjwEh/ZFIYLeizjBfcBNlh4FthILou3u7WaLRL+dObctq6qzsm8EuSBvkjHDA
|
||||
JnTIEhOKQRTJ4KvLeuCJh/X7zlWM9q+7zrc1zB8rhIpfDkRYxde7MJbqSU2Ldbs6
|
||||
XkdLs+qYGPNu+tRk/9CJt/NoiuPT30BKDSHzi2KahCnN9DYAlgz4SkTh3MnDlLov
|
||||
FGroFDCOGy5pUUlok6F2LJ5pkg4QfRqEO/408WdlGKz02aE98Ft6i7pkVUpMa8bH
|
||||
SEugQcE3WcXDNxzbpZSxrxtW6B73b63E45rJltz2A2qRZgL07f4wC9IIHx8maN2E
|
||||
nz002JC8K182bWHVc8yvxnCYC6+Ko3rD2joQwBEGpDScz73WhLDzvRKdz4hwyDN/
|
||||
dFqBkw==
|
||||
=4DZp
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
86
.github/workflows/build.yml
vendored
Normal file
86
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,86 @@
|
|||
name: build
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 12 * * *"
|
||||
push:
|
||||
paths-ignore:
|
||||
- "*.md"
|
||||
- "*.txt"
|
||||
- "*.png"
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
IMAGE_NAME: atmoz/sftp
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0 # for proper signature verification
|
||||
submodules: true # for shunit2
|
||||
|
||||
- name: Run ShellCheck
|
||||
uses: ludeeus/action-shellcheck@master
|
||||
with:
|
||||
ignore: tests/shunit2
|
||||
|
||||
- name: Build debian image
|
||||
run: |
|
||||
docker build . \
|
||||
--pull=true \
|
||||
--file=Dockerfile \
|
||||
--tag="$IMAGE_NAME:latest" \
|
||||
--tag="$IMAGE_NAME:debian" \
|
||||
--label="org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
|
||||
--label="org.opencontainers.image.revision=$GITHUB_SHA" \
|
||||
--label="org.opencontainers.image.created=$(date --rfc-3339=seconds)"
|
||||
|
||||
- name: Test debian image
|
||||
run: tests/run $IMAGE_NAME:debian
|
||||
|
||||
- name: Build alpine image
|
||||
run: |
|
||||
docker build . \
|
||||
--pull=true \
|
||||
--file=Dockerfile-alpine \
|
||||
--tag="$IMAGE_NAME:alpine" \
|
||||
--label="org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
|
||||
--label="org.opencontainers.image.revision=$GITHUB_SHA" \
|
||||
--label="org.opencontainers.image.created=$(date --rfc-3339=seconds)"
|
||||
|
||||
- name: Test alpine image
|
||||
run: tests/run $IMAGE_NAME:alpine
|
||||
|
||||
- name: Verify signature
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: atmoz/git-verify-ref@master
|
||||
with:
|
||||
import-github-users: atmoz
|
||||
|
||||
- name: Push images to Docker Hub registry
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login \
|
||||
-u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
|
||||
|
||||
docker push $IMAGE_NAME # no tags specified to include all tags
|
||||
docker logout
|
||||
|
||||
- name: Push images to GitHub registry
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com \
|
||||
-u ${{ github.actor }} --password-stdin
|
||||
|
||||
TAG_DEBIAN=docker.pkg.github.com/$GITHUB_REPOSITORY/debian
|
||||
TAG_ALPINE=docker.pkg.github.com/$GITHUB_REPOSITORY/alpine
|
||||
docker tag $IMAGE_NAME:debian $TAG_DEBIAN
|
||||
docker tag $IMAGE_NAME:alpine $TAG_ALPINE
|
||||
docker push $TAG_DEBIAN
|
||||
docker push $TAG_ALPINE
|
||||
docker logout docker.pkg.github.com
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
FROM debian:stretch
|
||||
FROM debian:buster
|
||||
MAINTAINER Adrian Dvergsdal [atmoz.net]
|
||||
|
||||
# Steps done in one RUN layer:
|
||||
|
|
21
Dockerfile-alpine
Normal file
21
Dockerfile-alpine
Normal file
|
@ -0,0 +1,21 @@
|
|||
FROM alpine:latest
|
||||
MAINTAINER Adrian Dvergsdal [atmoz.net]
|
||||
|
||||
# Steps done in one RUN layer:
|
||||
# - Install packages
|
||||
# - Fix default group (1000 does not exist)
|
||||
# - OpenSSH needs /var/run/sshd to run
|
||||
# - Remove generic host keys, entrypoint generates unique keys
|
||||
RUN echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
|
||||
apk add --no-cache bash shadow@community openssh openssh-sftp-server && \
|
||||
sed -i 's/GROUP=1000/GROUP=100/' /etc/default/useradd && \
|
||||
mkdir -p /var/run/sshd && \
|
||||
rm -f /etc/ssh/ssh_host_*key*
|
||||
|
||||
COPY files/sshd_config /etc/ssh/sshd_config
|
||||
COPY files/create-sftp-user /usr/local/bin/
|
||||
COPY files/entrypoint /
|
||||
|
||||
EXPOSE 22
|
||||
|
||||
ENTRYPOINT ["/entrypoint"]
|
30
README.md
30
README.md
|
@ -1,19 +1,17 @@
|
|||
# SFTP
|
||||
|
||||
![Docker Automated build](https://img.shields.io/docker/automated/atmoz/sftp.svg) ![Docker Build Status](https://img.shields.io/docker/build/atmoz/sftp.svg) ![Docker Stars](https://img.shields.io/docker/stars/atmoz/sftp.svg) ![Docker Pulls](https://img.shields.io/docker/pulls/atmoz/sftp.svg)
|
||||
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/atmoz/sftp/build?logo=github) ![GitHub stars](https://img.shields.io/github/stars/atmoz/sftp?logo=github) ![Docker Stars](https://img.shields.io/docker/stars/atmoz/sftp?label=stars&logo=docker) ![Docker Pulls](https://img.shields.io/docker/pulls/atmoz/sftp?label=pulls&logo=docker)
|
||||
|
||||
![OpenSSH logo](https://raw.githubusercontent.com/atmoz/sftp/master/openssh.png "Powered by OpenSSH")
|
||||
|
||||
# Supported tags and respective `Dockerfile` links
|
||||
|
||||
- [`debian-stretch`, `debian`, `latest` (*Dockerfile*)](https://github.com/atmoz/sftp/blob/master/Dockerfile) [![](https://images.microbadger.com/badges/image/atmoz/sftp.svg)](http://microbadger.com/images/atmoz/sftp "Get your own image badge on microbadger.com")
|
||||
- [`debian-jessie` (*Dockerfile*)](https://github.com/atmoz/sftp/blob/debian-jessie/Dockerfile) [![](https://images.microbadger.com/badges/image/atmoz/sftp:debian-jessie.svg)](http://microbadger.com/images/atmoz/sftp:debian-jessie "Get your own image badge on microbadger.com")
|
||||
- [`alpine` (*Dockerfile*)](https://github.com/atmoz/sftp/blob/alpine/Dockerfile) [![](https://images.microbadger.com/badges/image/atmoz/sftp:alpine.svg)](http://microbadger.com/images/atmoz/sftp:alpine "Get your own image badge on microbadger.com")
|
||||
- [`debian`, `latest` (*Dockerfile*)](https://github.com/atmoz/sftp/blob/master/Dockerfile) ![Docker Image Size (debian)](https://img.shields.io/docker/image-size/atmoz/sftp/debian?label=debian&logo=debian&style=plastic)
|
||||
- [`alpine` (*Dockerfile*)](https://github.com/atmoz/sftp/blob/master/Dockerfile-alpine) ![Docker Image Size (alpine)](https://img.shields.io/docker/image-size/atmoz/sftp/alpine?label=alpine&logo=Alpine%20Linux&style=plastic)
|
||||
|
||||
# Securely share your files
|
||||
|
||||
Easy to use SFTP ([SSH File Transfer Protocol](https://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol)) server with [OpenSSH](https://en.wikipedia.org/wiki/OpenSSH).
|
||||
This is an automated build linked with the [debian](https://hub.docker.com/_/debian/) and [alpine](https://hub.docker.com/_/alpine/) repositories.
|
||||
|
||||
# Usage
|
||||
|
||||
|
@ -49,7 +47,7 @@ Let's mount a directory and set UID:
|
|||
|
||||
```
|
||||
docker run \
|
||||
-v /host/upload:/home/foo/upload \
|
||||
-v <host-dir>/upload:/home/foo/upload \
|
||||
-p 2222:22 -d atmoz/sftp \
|
||||
foo:pass:1001
|
||||
```
|
||||
|
@ -60,7 +58,7 @@ docker run \
|
|||
sftp:
|
||||
image: atmoz/sftp
|
||||
volumes:
|
||||
- /host/upload:/home/foo/upload
|
||||
- <host-dir>/upload:/home/foo/upload
|
||||
ports:
|
||||
- "2222:22"
|
||||
command: foo:pass:1001
|
||||
|
@ -74,12 +72,12 @@ The OpenSSH server runs by default on port 22, and in this example, we are forwa
|
|||
|
||||
```
|
||||
docker run \
|
||||
-v /host/users.conf:/etc/sftp/users.conf:ro \
|
||||
-v <host-dir>/users.conf:/etc/sftp/users.conf:ro \
|
||||
-v mySftpVolume:/home \
|
||||
-p 2222:22 -d atmoz/sftp
|
||||
```
|
||||
|
||||
/host/users.conf:
|
||||
<host-dir>/users.conf:
|
||||
|
||||
```
|
||||
foo:123:1001:100
|
||||
|
@ -93,7 +91,7 @@ Add `:e` behind password to mark it as encrypted. Use single quotes if using ter
|
|||
|
||||
```
|
||||
docker run \
|
||||
-v /host/share:/home/foo/share \
|
||||
-v <host-dir>/share:/home/foo/share \
|
||||
-p 2222:22 -d atmoz/sftp \
|
||||
'foo:$1$0G2g0GSt$ewU0t6GXG15.0hWoOX8X9.:e:1001'
|
||||
```
|
||||
|
@ -107,9 +105,9 @@ Mount public keys in the user's `.ssh/keys/` directory. All keys are automatical
|
|||
|
||||
```
|
||||
docker run \
|
||||
-v /host/id_rsa.pub:/home/foo/.ssh/keys/id_rsa.pub:ro \
|
||||
-v /host/id_other.pub:/home/foo/.ssh/keys/id_other.pub:ro \
|
||||
-v /host/share:/home/foo/share \
|
||||
-v <host-dir>/id_rsa.pub:/home/foo/.ssh/keys/id_rsa.pub:ro \
|
||||
-v <host-dir>/id_other.pub:/home/foo/.ssh/keys/id_other.pub:ro \
|
||||
-v <host-dir>/share:/home/foo/share \
|
||||
-p 2222:22 -d atmoz/sftp \
|
||||
foo::1001
|
||||
```
|
||||
|
@ -120,9 +118,9 @@ This container will generate new SSH host keys at first run. To avoid that your
|
|||
|
||||
```
|
||||
docker run \
|
||||
-v /host/ssh_host_ed25519_key:/etc/ssh/ssh_host_ed25519_key \
|
||||
-v /host/ssh_host_rsa_key:/etc/ssh/ssh_host_rsa_key \
|
||||
-v /host/share:/home/foo/share \
|
||||
-v <host-dir>/ssh_host_ed25519_key:/etc/ssh/ssh_host_ed25519_key \
|
||||
-v <host-dir>/ssh_host_rsa_key:/etc/ssh/ssh_host_rsa_key \
|
||||
-v <host-dir>/share:/home/foo/share \
|
||||
-p 2222:22 -d atmoz/sftp \
|
||||
foo::1001
|
||||
```
|
||||
|
|
|
@ -81,12 +81,20 @@ else
|
|||
fi
|
||||
|
||||
# Add SSH keys to authorized_keys with valid permissions
|
||||
if [ -d "/home/$user/.ssh/keys" ]; then
|
||||
for publickey in "/home/$user/.ssh/keys"/*; do
|
||||
cat "$publickey" >> "/home/$user/.ssh/authorized_keys"
|
||||
userKeysQueuedDir="/home/$user/.ssh/keys"
|
||||
if [ -d "$userKeysQueuedDir" ]; then
|
||||
userKeysAllowedFileTmp="$(mktemp)"
|
||||
userKeysAllowedFile="/home/$user/.ssh/authorized_keys"
|
||||
|
||||
for publickey in "$userKeysQueuedDir"/*; do
|
||||
cat "$publickey" >> "$userKeysAllowedFileTmp"
|
||||
done
|
||||
chown "$uid" "/home/$user/.ssh/authorized_keys"
|
||||
chmod 600 "/home/$user/.ssh/authorized_keys"
|
||||
|
||||
# Remove duplicate keys
|
||||
sort < "$userKeysAllowedFileTmp" | uniq > "$userKeysAllowedFile"
|
||||
|
||||
chown "$uid" "$userKeysAllowedFile"
|
||||
chmod 600 "$userKeysAllowedFile"
|
||||
fi
|
||||
|
||||
# Make sure dirs exists
|
||||
|
|
|
@ -89,6 +89,10 @@ if [ ! -f "$userConfFinalPath" ] || [ -n "$SFTP_USERS" ]; then
|
|||
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
|
||||
ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key -N ''
|
||||
fi
|
||||
|
||||
# Restrict access from other users
|
||||
chmod 600 /etc/ssh/ssh_host_ed25519_key || true
|
||||
chmod 600 /etc/ssh/ssh_host_rsa_key || true
|
||||
fi
|
||||
|
||||
# Source custom scripts, if any
|
||||
|
|
141
tests/run
141
tests/run
|
@ -1,18 +1,33 @@
|
|||
#!/bin/bash
|
||||
# See: https://github.com/kward/shunit2
|
||||
|
||||
argImage=$1
|
||||
argOutput=${2:-"quiet"}
|
||||
argCleanup=${3:-"cleanup"}
|
||||
testDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
imageName="$argImage"
|
||||
tmpDir="$(mktemp -d /tmp/atmoz_sftp_XXXX)"
|
||||
sshKeyPri="$tmpDir/rsa"
|
||||
sshKeyPub="$tmpDir/rsa.pub"
|
||||
sshHostEd25519Key="$tmpDir/ssh_host_ed25519_key"
|
||||
sshHostKeyMountArg="--volume=$sshHostEd25519Key:/etc/ssh/ssh_host_ed25519_key"
|
||||
sshKnownHosts="$tmpDir/known_hosts"
|
||||
|
||||
if [ $UID != 0 ] && ! groups | grep -qw docker; then
|
||||
echo "Run with sudo/root or add user $USER to group 'docker'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
argBuild=${1:-"build"}
|
||||
argOutput=${2:-"quiet"}
|
||||
argCleanup=${3:-"cleanup"}
|
||||
testDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
buildDir="$testDir/.."
|
||||
imageName="atmoz/sftp_test"
|
||||
buildOptions=(--tag "$imageName")
|
||||
if [ ! -f "$testDir/shunit2/shunit2" ]; then
|
||||
echo "Could not find shunit2 in $testDir/shunit2."
|
||||
echo "Run 'git submodule update --init'"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ -z "$argImage" ]; then
|
||||
echo "Missing image name"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
if [ "$argOutput" == "quiet" ]; then
|
||||
redirect="/dev/null"
|
||||
|
@ -20,12 +35,6 @@ else
|
|||
redirect="/dev/stdout"
|
||||
fi
|
||||
|
||||
if [ ! -f "$testDir/shunit2/shunit2" ]; then
|
||||
echo "Could not find shunit2 in $testDir/shunit2."
|
||||
echo "Run 'git submodules init && git submodules update'"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# clear argument list (or shunit2 will try to use them)
|
||||
set --
|
||||
|
||||
|
@ -34,29 +43,16 @@ set --
|
|||
##############################################################################
|
||||
|
||||
function oneTimeSetUp() {
|
||||
if [ "$argBuild" == "build" ]; then
|
||||
buildOptions+=("--no-cache" "--pull=true")
|
||||
fi
|
||||
|
||||
# Build image
|
||||
if ! docker build "${buildOptions[@]}" "$buildDir"; then
|
||||
echo "Build failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Generate temporary ssh keys for testing
|
||||
if [ ! -f "/tmp/atmoz_sftp_test_rsa" ]; then
|
||||
ssh-keygen -t rsa -f "/tmp/atmoz_sftp_test_rsa" -N '' > "$redirect" 2>&1
|
||||
if [ ! -f "$sshKeyPri" ]; then
|
||||
ssh-keygen -t rsa -f "$sshKeyPri" -N '' > "$redirect" 2>&1
|
||||
fi
|
||||
|
||||
# Private key can not be read by others (sshd will complain)
|
||||
chmod go-rw "/tmp/atmoz_sftp_test_rsa"
|
||||
}
|
||||
chmod go-rw "$sshKeyPri"
|
||||
|
||||
function oneTimeTearDown() {
|
||||
if [ "$argCleanup" == "cleanup" ]; then
|
||||
docker image rm "$imageName" > "$redirect" 2>&1
|
||||
fi
|
||||
# Generate host key
|
||||
ssh-keygen -t ed25519 -f "$sshHostEd25519Key" < /dev/null
|
||||
}
|
||||
|
||||
function setUp() {
|
||||
|
@ -72,7 +68,7 @@ function tearDown() {
|
|||
retireContainer "$containerName"
|
||||
|
||||
if [ "$argCleanup" == "cleanup" ] && [ -d "$containerTmpDir" ]; then
|
||||
rm -rf "$containerTmpDir"
|
||||
rm -rf "$containerTmpDir" || true # Can fail on GitHub Actions
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -98,15 +94,16 @@ function runSftpCommands() {
|
|||
user="$2"
|
||||
shift 2
|
||||
|
||||
echo "$ip $(cat "$sshHostEd25519Key.pub")" >> "$sshKnownHosts"
|
||||
|
||||
commands=""
|
||||
for cmd in "$@"; do
|
||||
commands="$commands$cmd"$'\n'
|
||||
done
|
||||
|
||||
echo "$commands" | sftp \
|
||||
-i "/tmp/atmoz_sftp_test_rsa" \
|
||||
-oStrictHostKeyChecking=no \
|
||||
-oUserKnownHostsFile=/dev/null \
|
||||
-i "$sshKeyPri" \
|
||||
-oUserKnownHostsFile="$sshKnownHosts" \
|
||||
-b - "$user@$ip" \
|
||||
> "$redirect" 2>&1
|
||||
|
||||
|
@ -138,7 +135,7 @@ function waitForServer() {
|
|||
##############################################################################
|
||||
|
||||
function testSmallestUserConfig() {
|
||||
docker run --name "$containerName" \
|
||||
docker run --name "$containerName" "$sshHostKeyMountArg" \
|
||||
--entrypoint="/bin/sh" \
|
||||
"$imageName" \
|
||||
-c "create-sftp-user u: && id u" \
|
||||
|
@ -147,7 +144,7 @@ function testSmallestUserConfig() {
|
|||
}
|
||||
|
||||
function testCreateUserWithDot() {
|
||||
docker run --name "$containerName" \
|
||||
docker run --name "$containerName" "$sshHostKeyMountArg" \
|
||||
--entrypoint="/bin/sh" \
|
||||
"$imageName" \
|
||||
-c "create-sftp-user user.with.dot: && id user.with.dot" \
|
||||
|
@ -156,7 +153,7 @@ function testCreateUserWithDot() {
|
|||
}
|
||||
|
||||
function testUserCustomUidAndGid() {
|
||||
id="$(docker run --name "$containerName" \
|
||||
id="$(docker run --name "$containerName" "$sshHostKeyMountArg" \
|
||||
--entrypoint="/bin/sh" \
|
||||
"$imageName" \
|
||||
-c "create-sftp-user u::1234:4321: > /dev/null && id u" )"
|
||||
|
@ -172,14 +169,14 @@ function testUserCustomUidAndGid() {
|
|||
}
|
||||
|
||||
function testCommandPassthrough() {
|
||||
docker run --name "$containerName" \
|
||||
docker run --name "$containerName" "$sshHostKeyMountArg" \
|
||||
"$imageName" test 1 -eq 1 \
|
||||
> "$redirect" 2>&1
|
||||
assertTrue "command passthrough" $?
|
||||
}
|
||||
|
||||
function testUsersConf() {
|
||||
docker run --name "$containerName" -d \
|
||||
docker run --name "$containerName" "$sshHostKeyMountArg" -d \
|
||||
-v "$testDir/files/users.conf:/etc/sftp/users.conf:ro" \
|
||||
"$imageName" \
|
||||
> "$redirect" 2>&1
|
||||
|
@ -232,7 +229,7 @@ function testAddUsersConf() {
|
|||
}
|
||||
|
||||
function testLegacyUsersConf() {
|
||||
docker run --name "$containerName" -d \
|
||||
docker run --name "$containerName" "$sshHostKeyMountArg" -d \
|
||||
-v "$testDir/files/users.conf:/etc/sftp-users.conf:ro" \
|
||||
"$imageName" \
|
||||
> "$redirect" 2>&1
|
||||
|
@ -245,7 +242,7 @@ function testLegacyUsersConf() {
|
|||
}
|
||||
|
||||
function testCreateUsersUsingEnv() {
|
||||
docker run --name "$containerName" -d \
|
||||
docker run --name "$containerName" "$sshHostKeyMountArg" -d \
|
||||
-e "SFTP_USERS=user-from-env: user-from-env-2:" \
|
||||
"$imageName" \
|
||||
> "$redirect" 2>&1
|
||||
|
@ -261,7 +258,7 @@ function testCreateUsersUsingEnv() {
|
|||
}
|
||||
|
||||
function testCreateUsersUsingCombo() {
|
||||
docker run --name "$containerName" -d \
|
||||
docker run --name "$containerName" "$sshHostKeyMountArg" -d \
|
||||
-v "$testDir/files/users.conf:/etc/sftp-users.conf:ro" \
|
||||
-e "SFTP_USERS=user-from-env:" \
|
||||
"$imageName" \
|
||||
|
@ -282,8 +279,8 @@ function testCreateUsersUsingCombo() {
|
|||
}
|
||||
|
||||
function testWriteAccessToAutocreatedDirs() {
|
||||
docker run --name "$containerName" -d \
|
||||
-v "/tmp/atmoz_sftp_test_rsa.pub":/home/test/.ssh/keys/id_rsa.pub:ro \
|
||||
docker run --name "$containerName" "$sshHostKeyMountArg" -d \
|
||||
-v "$sshKeyPub":/home/test/.ssh/keys/id_rsa.pub:ro \
|
||||
"$imageName" "test::::testdir,dir with spaces" \
|
||||
> "$redirect" 2>&1
|
||||
|
||||
|
@ -305,6 +302,41 @@ function testWriteAccessToAutocreatedDirs() {
|
|||
assertTrue "dir with spaces write access" $?
|
||||
}
|
||||
|
||||
function testWriteAccessToLimitedChroot() {
|
||||
# Modified sshd_config with chrooted home subdir
|
||||
tmpConfig="$(mktemp)"
|
||||
sed 's/^ChrootDirectory.*/ChrootDirectory %h\/sftp/' \
|
||||
< "$testDir/../files/sshd_config" > "$tmpConfig"
|
||||
|
||||
# Set correct permissions on chroot
|
||||
tmpScript="$(mktemp)"
|
||||
cat > "$tmpScript" <<EOF
|
||||
mkdir -p /home/*/sftp
|
||||
chown root:root /home/*/sftp
|
||||
chmod 755 /home/*/sftp
|
||||
EOF
|
||||
chmod +x "$tmpScript"
|
||||
|
||||
docker run --name "$containerName" "$sshHostKeyMountArg" -d \
|
||||
-v "$sshKeyPub":/home/test/.ssh/keys/id_rsa.pub:ro \
|
||||
-v "$tmpConfig:/etc/ssh/sshd_config" \
|
||||
-v "$tmpScript:/etc/sftp.d/limited_home_dir" \
|
||||
"$imageName" "test::::sftp/upload" \
|
||||
> "$redirect" 2>&1
|
||||
|
||||
waitForServer "$containerName"
|
||||
assertTrue "waitForServer" $?
|
||||
|
||||
runSftpCommands "$containerName" "test" \
|
||||
"cd upload" \
|
||||
"mkdir test" \
|
||||
"exit"
|
||||
assertTrue "runSftpCommands" $?
|
||||
|
||||
docker exec "$containerName" test -d /home/test/sftp/upload/test
|
||||
assertTrue "limited chroot write access" $?
|
||||
}
|
||||
|
||||
function testBindmountDirScript() {
|
||||
mkdir -p "$containerTmpDir/custom/bindmount"
|
||||
echo "mkdir -p /home/custom/bindmount && \
|
||||
|
@ -313,9 +345,9 @@ function testBindmountDirScript() {
|
|||
> "$containerTmpDir/mount.sh"
|
||||
chmod +x "$containerTmpDir/mount.sh"
|
||||
|
||||
docker run --name "$containerName" -d \
|
||||
docker run --name "$containerName" "$sshHostKeyMountArg" -d \
|
||||
--privileged=true \
|
||||
-v "/tmp/atmoz_sftp_test_rsa.pub":/home/custom/.ssh/keys/id_rsa.pub:ro \
|
||||
-v "$sshKeyPub":/home/custom/.ssh/keys/id_rsa.pub:ro \
|
||||
-v "$containerTmpDir/custom/bindmount":/custom \
|
||||
-v "$containerTmpDir/mount.sh":/etc/sftp.d/mount.sh \
|
||||
"$imageName" custom:123 \
|
||||
|
@ -334,6 +366,21 @@ function testBindmountDirScript() {
|
|||
assertTrue "directory exist" $?
|
||||
}
|
||||
|
||||
function testDuplicateSshKeys() {
|
||||
docker run --name "$containerName" "$sshHostKeyMountArg" -d \
|
||||
-v "$sshKeyPub":/home/user/.ssh/keys/key1.pub:ro \
|
||||
-v "$sshKeyPub":/home/user/.ssh/keys/key2.pub:ro \
|
||||
"$imageName" "user:" \
|
||||
> "$redirect" 2>&1
|
||||
|
||||
waitForServer "$containerName"
|
||||
assertTrue "waitForServer" $?
|
||||
|
||||
lines="$(docker exec "$containerName" sh -c \
|
||||
"wc -l < /home/user/.ssh/authorized_keys")"
|
||||
assertEquals "1" "$lines"
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
## Run
|
||||
##############################################################################
|
||||
|
|
1
tests/shunit2
Submodule
1
tests/shunit2
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 3f2bff2a815097be557a5c0af77f967a87139409
|
Loading…
Reference in a new issue