Giter Club home page Giter Club logo

lftp-server's Introduction

LFTP server Build Status Go Report Card license

JSON RPC server for LFTP.

Description

LFTP server is a HTTP server that accepts FTP download requests in JSON format and forwards them to LFTP. Requests have the following format:

{
	"path": "...",
	"username": "...",
	"password": "...",
	"secret": "..."
}

Path is FTP file or directory to be downloaded, username/password are optional FTP credentials, and secret must match --rpc-secret parameter used when server was started.

If the request was valid, server sends 200 OK response to the client, with the ID of the created job. Response looks like this:

{
	"id": "..."
}

In case of any error, server sends 400 Bad Request to the client, with the error message in the following format:

{
	"message": "..."
}

If FTP credentials are missing or invalid, server responds to the client with 401 Unauthorized status code.

Installation

$ go get github.com/metalnem/lftp-server

Binaries (x64)

Linux
Mac OS X

Usage

$ ./lftp-server
Usage of ./lftp-server:
  -max-retries int
	  The maximum number of sequential tries of an operation without success. Possible values: 1-100 (default 5)
  -n int
	  Number of connections to use when downloading single file. Possible values: 1-100 (default 4)
  -o string
	  Output directory (optional, default value is the current working directory)
  -p int
	  Number of files to download in parallel when mirroring directories. Possible values: 1-10 (default 1)
  -rpc-listen-port int
	  Specify a port number for JSON-RPC server to listen to. Possible values: 1024-65535 (default 7800)
  -rpc-secret string
	  Set RPC secret authorization token (required)
  -s string
	  Script to run after successful download

Example

$ ./lftp-server -rpc-listen-port 7800 -rpc-secret SECRET -max-retries 10 -n 4 -p 1 -o ~/Downloads -s ./script.sh

lftp-server's People

Contributors

letsjustfixit avatar metalnem avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.