SFTP Slurper is a lightweight SFTP server designed for local testing of SFTP file uploads.
585
SFTP Slurper is a lightweight, configurable SFTP server designed for local testing of SFTP connections and file uploads. It provides a simple way to simulate an SFTP server environment without the need for complex setup, making it ideal for development and testing scenarios.
This application allows developers to:
All uploaded files are stored in a configurable local directory, making it easy to inspect and validate the uploaded content.
SFTP Slurper can be configured using command-line flags or environment variables:
| Option | Flag | Environment Variable | Default Value | Description |
|---|---|---|---|---|
| Web Host | -h | HOST | localhost:8080 | Address and port to listen on for the Web interface |
| SFTP Address | -sftph | SFTP_HOST | localhost:2200 | Address and port to listen on for the SFTP server |
The easiest way to get started with SFTP Slurper is to use Docker Compose. To begin, you will need compose.yml and .env files. Put these into a directory named sftpslurper. Also create a subdirectory named uploads.
mkdir -p ./sftpslurper/uploads
cd sftpslurper
services:
sftpslurper:
container_name: "sftpslurper"
image: adampresley/sftpslurper:latest
env_file:
- ./.env
user: "1000:1000"
ports:
- 8080:8080
- 2222:2222
volumes:
- ./uploads:/dist/uploads
LOG_LEVEL="info"
HOST="0.0.0.0:8080"
SFTP_HOST="0.0.0.0:2222"
Now start it up!
docker compose up --build
git clone https://github.com/adampresley/sftpslurper.git
cd sftpslurper/cmd/sftpslurper
go build
Run the server with default settings:
./sftpslurper
This will start an SFTP server on localhost:2200 with the username testuser and password password. Files will be uploaded to the ./uploads directory. To view the web interface visit http://localhost:8080.
Using command-line flags:
`./sftpslurper -h=0.0.0.0:8080 -sftph=0.0.0.0:2222
Using environment variables:
HOST=0.0.0.0:8080 SFTP_HOST=0.0.0.0:2222 ./sftpslurper
On most Unix-like systems (Linux, MacOS), trying to bind to a port lower than 1000 will require administrative privileges.
You can connect to the server using any SFTP client. For example, using the command-line sftp client. The user name and password are:
userpasswordsftp -P 22 user@localhost
Or with custom port:
sftp -P 2222 user@localhost
Stopping the Server
The server can be stopped by sending an interrupt signal (Ctrl+C).
Once connected, you can perform standard SFTP operations:
# Upload a file
put localfile.txt remotefile.txt
# Download a file
get remotefile.txt downloadedfile.txt
# List files
ls
# Change directory
cd some-directory
# Remove a file
rm file-to-delete.txt
SFTP Slurper is designed for local development and testing purposes only. It includes:
However, it is not recommended for production use as it:
USE AT YOUR OWN RISK!
MIT License
Content type
Image
Digest
sha256:b951f08f7…
Size
19.2 MB
Last updated
over 1 year ago
docker pull adampresley/sftpslurper