A http to ftp proxy server application
Project description
ftp-proxy
Http proxy to interact with FTP servers
Install
pip install ftp-proxy
Deployment
Use the provided docker image
Usage
Using the python client
Using an http client
ftp-proxy can be used with any http client
Authentication headers
All api routes expect the same authentication headers
Header | Content | Default |
---|---|---|
X-ftpproxy-host |
server host | No default, mandatory header |
X-ftpproxy-port |
server port | 21 |
X-ftpproxy-user |
login | anonymous |
X-ftpproxy-password |
password |
Available routes
Ping (/ftp/ping)
Test connection to the remote FTP server Returns HTTP 200 on success
LS (ftp/ls)
List the files on the ftp server Optional parameters:
- path (string): path to list content. Defaults to "/"
- recursive (true/false): recurse down subdirectories. Defaults to "false"
- extension (string): list only files with matching extension if provided (example: ".py")
Response:
["/file1.txt", "/other.py", "/folder", "/folder/nested.txt", "/folder/subfolder"]
Download (/ftp/download)
Download a file from the ftp server Mandatory parameters:
- path (string): path to file to download
SFTP support
SFTP support API is roughly the same as ftp, and can be achieved by switching the url prefixes from ftp to sftp The following features are not yet available for SFTP:
- recursive listing
- extension filtering
Errors
If an error occured on the proxy or the FTP server, the request will return a HTTP 400 json response with the following format
{
"error": "<DESCRIPTION>"
}
Development
Setup
git clone git@github.com:uptilab2/ftp-proxy.git
cd ftp-proxy
# Project uses pipenv for dependency management
# so it should be installed first
pipenv install --dev
# Run the tests:
pipenv run py.test
# Run the development server:
pipenv run python -m aiohttp.web -H 0.0.0.0 -P 5000 ftp_proxy:init_func
Deployment
pipenv run python setup.py test
pipenv run python setup.py sdist
pipenv run python setup.py bdist_wheel
pipenv run python setup.py upload
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ftp-proxy-0.0.18.tar.gz
.
File metadata
- Download URL: ftp-proxy-0.0.18.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c196b7f184033bb0294b67a7c3abc78341881e862415412e99687637d1859933 |
|
MD5 | e159c6fb40a496840e8108789e3a8254 |
|
BLAKE2b-256 | aa9d9c094edcda555e786f82b16cd143afdc398ad089215e8da468aa0f4dd4d2 |
File details
Details for the file ftp_proxy-0.0.18-py3-none-any.whl
.
File metadata
- Download URL: ftp_proxy-0.0.18-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05bf4974029e428ba8a027fc223026f725c51020397e0b6414bcf24dd02d14a9 |
|
MD5 | ef8763d98444340c189a65263ca55a05 |
|
BLAKE2b-256 | 93685e82d8f337b6f4f2ac7312cb05bf289cedada9ec7a7488f25d3f0f0aeea5 |