GithubHelp home page GithubHelp logo

teaftp's Introduction

TeaFTP

Build Go Report Card License

Simple, read-only TFTP server.

Features and Limitations

  • Suitable for dealing with hardware devices that read files over TFTP at boot (PXE).
  • Security is provided by providing a list of whitelisted prefixes, suffixes and/or running the server from within a Docker container.
  • If not whitelisted filename prefixes or suffixes are provided, the server may share ANY file on the system, but not write to anything.
    • Consider using the provided Docker container as a method to serve only a select group of files.
    • Alternatively, utilize the list of allowed prefixes or suffixes for added security.
  • Every access is logged to stdout.

Requirements

Go 1.17 or later

Installation with Go 1.17 or Later

go install github.com/xyproto/teaftp@latest

Running

Directly

Navigate to the directory where you intend to share files:

With sudo:

sudo ./teaftp

On Linux, you can teaftp it to /usr/bin and grant additional capabilities using setcap:

sudo install -Dm755 teaftp /usr/bin/teaftp
sudo setcap cap_net_bind_service=+ep /usr/bin/teaftp

Starting the server:

teaftp

Docker

To build the Docker container and copy the contents of the static directory to /srv/tftp inside the container:

docker build . -t teaftp

To run TeaFTP with Docker:

docker run --network=host -t teaftp

To run TeaFTP with Docker and serve on port 9000 instead of port 69:

docker run -ePORT=9000 --network=host -t teaftp

Allowed Suffixes

You can pass allowed filename suffixes as arguments to TeaFTP. When no arguments are given, there's no restriction on the file suffixes.

Example:

sudo ./teaftp ".txt"

This configuration will only serve filenames that end with .txt.

Dependencies

General information

teaftp's People

Contributors

xyproto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

priestd09

teaftp's Issues

Needs an option to specify port

I have looked around for a simple tftp server program I can run manually to serve files from a directory and teaftp is about all I can find that does that in a simple manner. However, you can not specify a network port to serve files on. This is a problem because it means you must always run teaftp using sudo (because the default port 69 is privileged) which I always prefer to avoid. In short I want to type:

teaftp -p 8000

rather than:

sudo teaftp

I am on Arch Linux using teaftp 1.1.1-1 from the AUR.

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.