Skip to content

Lightweight, cross-platform local file server built in Golang

License

Notifications You must be signed in to change notification settings

lazybark/go-local-fileserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-local-fileserver

Go Report Card GitHub last commit

go-local-fileserver is a lightweight, cross-platform local file server built in Golang with directory listing, file downloads, and extensive customization options. This server is perfect for sharing files on a local network or hosting files on your machine with minimal setup. It supports a range of useful features, from QR code file access to media previews and basic authentication.

Features

  • File Downloads: Quickly and easily download any file listed in the served directory.
  • QR Code Links: Generate and display QR codes for each file, allowing easy access via mobile devices.
  • Thumbnail Previews: Automatic thumbnail generation for image files, with efficient cleanup on server shutdown.
  • Subdirectory Support: Seamlessly browse through directories and subdirectories.
  • Basic Authentication: Secure your directories with optional basic authentication.
  • CLI Logging: Real-time logging of server activity and requests.
  • Sorting & Grouping: Sort files by name or date, and group them by file type.
  • Hidden Files: Files prefixed with . are hidden from the listing and cannot be accessed.
  • File Type Icons: Visual indicators for different file types.
  • Customizable Interface: Easily modify the server’s HTML template to change the appearance of the file listing.

Planned Features

  • User Management: Support for multiple users with custom permissions.
  • Advanced Logging: Track full request history with detailed analytics.
  • File Type Whitelisting/Blacklisting: Control allowed file types for download or restrict specific formats.
  • Directory Whitelisting/Blacklisting: Limit access to specific directories based on settings.
  • Limit max file size: Prevent large file uploads or downloads to save bandwidth.
  • ZIP Compression: Download entire directories as compressed ZIP files via the interface.
  • Smart Search: Advanced search options, allowing filtering by media types (videos, text, audio, etc.).
  • File Uploads: Enable file uploads via the web interface.
  • Admin panel: To control users, statistics and config server in real time.
  • Rate limiting: Limit the number of requests or file downloads per user / IP to prevent abuse.
  • External storages support: If you have a lot of files, you can use external storage like S3, Various Clouds, etc.
  • Fancy audio player: Not sure if I have enough skill & time.
  • Fancy video player: Not sure if I have enough skill & time (2).

Installation

Via executable

Just download the executable for your platform from the releases page and run it in the directory you want to serve.

Add to PATH for global access.

Via Go

git clone https://github.com/yourusername/go-local-fileserver.git
cd go-local-fileserver

go build

Don't forget to download templates & icons archive from the releases page and extract it to the same directory. Or you can use your own templates & icons.

Usage

go-local-fileserver [flags]

Flags

  -dir string
        Directory to serve files from (default "./public")
  -log-requests
        Log HTTP requests
  -user string
        Username for basic authentication
  -pass string
        Password for basic authentication
  -port int
        Port to run the server on (default 8080)

Interface

  • Sorting & Grouping: Sort files by name or date, group them by file type to simplify browsing.
  • QR Codes: Click on the QR icon next to any file to get a scannable link for mobile download.
  • Authentication: Use the -auth flag to enable basic authentication for sensitive directories.
  • Custom Themes: Modify the template.html file in the templates/ folder to change the look and feel.

About

Lightweight, cross-platform local file server built in Golang

Resources

License

Stars

Watchers

Forks

Packages

No packages published