Skip to content

3ziye/put-file

Repository files navigation

put-file


put-file

[English] | [العربية] | [Dansk] | [Deutsch] | [Español] | [Français] | [Italiano] | [日本語] | [한국어] | [Nederlands] | [Norsk] | [Polski] | [Português] | [Русский] | [Svenska] | [ไทย] | [Tiếng Việt] | [中文(简体)]

| ** Issues ** | ** Releases ** | ** README ** | ** Architecture ** |

License    Go    performance    status

put-file is a high-performance, lightweight static file server developed in Go language. It supports basic operations such as file upload, download, deletion, and also provides features like permission control and logging, making it an ideal choice for simple file serving needs.

About 3ziye Open Source Organization

Welcome to the 3ziye GitHub open source organization! We are rooted in technology and innovative in thinking, deeply cultivating the field of industrial digital intelligence. We are committed to building a technical exchange platform for developers and enterprises worldwide through open source collaboration, jointly injecting continuous momentum into industrial digital intelligence, and working together to create a technology ecosystem that empowers the future.

🌟 Our Vision
To become a leading provider of digital solutions in the industry, driving enterprise innovation and development with technology, and creating greater value for customers.

In the open source field, we hope to extend this vision — through opening core technologies, sharing solutions, breaking down technical barriers, helping more developers grow rapidly, assisting more enterprises in reducing the cost of digital transformation, and ultimately achieving the goal of "technology for all, ecological win-win"

For more information, please visit our GitHub Organization Page or contact us at team@3ziye.com.

Features

  • 🚀 High Performance: Based on Go's high concurrency features, capable of efficiently handling a large number of file requests
  • 🔒 Access Control: Supports basic authentication and file access permission control
  • 📝 Detailed Logging: Records requests and operation logs for troubleshooting and monitoring
  • 📁 File Operations: Supports file upload, download, deletion, renaming, etc.
  • 📋 Directory Listing: Automatically generates directory listings for easy browsing and file access
  • ⚙️ Flexible Configuration: Supports configuration through configuration files, environment variables, and command-line parameters
  • 🐳 Container Support: Provides Docker images for easy deployment and operation
  • 🚀 Automatic Deployment: Supports automatic deployment to remote servers via GitHub Actions

Quick Start

Installation

Install Using Go

If you have Go installed, you can install put-file directly using the go install command:

# Install the latest version
go install github.com/3ziye/put-file@latest

Build from Source

  1. Clone the repository

    git clone https://github.com/3ziye/put-file.git
    cd put-file
  2. Build the project

    go build -o put-file cmd/main.go
  3. Run the service

    ./put-file

Using Precompiled Binary Files

put-file provides precompiled binary files for Linux, Windows, and Mac systems, which can be downloaded and used directly. Each release package includes all necessary files such as the executable binary, configuration templates, web interface files, and installation scripts.

  1. Visit the GitHub Releases page and download the compressed package of binary files corresponding to your platform

  2. Extract the corresponding files according to your operating system:

Using Installation Scripts

Each release package includes dedicated installation scripts for each platform to simplify the installation process:

For Linux:

# Download and extract the Linux version
wget https://github.com/3ziye/put-file/releases/download/vX.Y.Z/put-file_vX.Y.Z_linux_amd64.tar.gz
tar -xzf put-file_vX.Y.Z_linux_amd64.tar.gz
cd put-file_vX.Y.Z_linux_amd64

# Run the installation script
chmod +x scripts/install_linux.sh
./scripts/install_linux.sh

# Or run the service directly without installation
./put-file

For Windows:

# Download and extract the Windows version
# Right-click on the downloaded zip file and select "Extract All"
cd put-file_vX.Y.Z_windows_amd64

# Run the installation script (double-click or run from command prompt)
scripts\install_windows.bat

# Or run the service directly without installation
put-file.exe

For Mac:

# Download and extract the Mac version
curl -OL https://github.com/3ziye/put-file/releases/download/vX.Y.Z/put-file_vX.Y.Z_darwin_amd64.tar.gz
tar -xzf put-file_vX.Y.Z_darwin_amd64.tar.gz
cd put-file_vX.Y.Z_darwin_amd64

# Run the installation script
chmod +x scripts/install_mac.sh
./scripts/install_mac.sh

# Or run the service directly without installation
chmod +x put-file
./put-file

What's Included in the Release Package

Each release package contains the following files and directories to ensure a complete experience:

  • Executable binary file for the target platform
  • config.json.example: Configuration template file
  • web/static/: Web interface files
  • doc/: Documentation files
  • uploads/: Default directory for storing uploaded files
  • scripts/: Installation scripts for each platform
  • README.md: Project documentation
  1. View version information After starting the service, you can see the current version number in the console logs

Using Docker

Pull the image from Docker Hub:

docker pull 3ziye/put-file:latest

Run the Docker container:

docker run -p 8080:8080 -v ./files:/app/uploads 3ziye/put-file:latest

Pull the image from GitHub Package:

docker pull ghcr.io/3ziye/put-file:latest

Run the GitHub Package container:

docker run -p 8080:8080 -v ./files:/app/uploads ghcr.io/3ziye/put-file:latest

GitHub Package Docker Image

Pulling the Image from GitHub Package

  1. Ensure you have Docker installed
  2. Run the following command to pull the image:
docker pull ghcr.io/3ziye/put-file:latest

Running the GitHub Package Image

docker run -p 8080:8080 -v ./files:/app/uploads ghcr.io/3ziye/put-file:latest

This command will run the container, map port 8080 of the container to port 8080 of the host, and mount the host's ./files directory to the /app/uploads directory inside the container.

Pushing the Image to GitHub Package (Maintainers Only)

  1. Log in to GitHub Container Registry:
docker login ghcr.io -u YOUR_GITHUB_USERNAME -p YOUR_GITHUB_TOKEN
  1. Build the image:
docker build -t ghcr.io/3ziye/put-file:latest .
  1. Push the image:
docker push ghcr.io/3ziye/put-file:latest

Automatic Deployment to Server

put-file supports automatic deployment to remote servers via GitHub Actions. For detailed configuration steps, please refer to the deployment documentation.

Key features include:

  • Secure management of server credentials via GitHub Secrets
  • Automatic download of the latest Linux binary version
  • Automatic backup and deployment on the server side
  • Support for systemd service management
  • Can be triggered manually or through Release publishing

About

put-file is a high-performance, lightweight static file server. It supports basic operations such as file upload, download, deletion, and also provides features like permission control and logging, making it an ideal choice for simple file serving needs.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors