https://github.com/ltriant/sidegate
Share files with friends 😊
https://github.com/ltriant/sidegate
file-download file-sharing file-transfer file-upload-server golang
Last synced: 17 days ago
JSON representation
Share files with friends 😊
- Host: GitHub
- URL: https://github.com/ltriant/sidegate
- Owner: ltriant
- License: mit
- Created: 2020-02-06T00:43:42.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-06-22T23:37:25.000Z (11 months ago)
- Last Synced: 2025-05-05T23:16:11.636Z (17 days ago)
- Topics: file-download, file-sharing, file-transfer, file-upload-server, golang
- Language: Go
- Homepage:
- Size: 51.8 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SideGate
Share files with friends :)
# What does it do?
1. Serves a directory and everything below it over HTTP
2. Files can be downloaded from any of the served directories
3. Files can be uploaded into any of the served directories# Why?
On several occasions my friends and I have wanted to share large files with each other, but we have run into at least one of the following issues:
1. My MacBook only has USB-C ports, so I can't get the files via a USB flash drive, or external hard drive, unless one of us has an adapter or hub, which we don't
2. The friend's computer isn't also a Mac, so we can't use AirDrop
3. The files can be uploaded to a cloud file hosting provider, and then downloaded, but this seems wasteful of bandwidth when we're connected to the same local network and sitting a few feet from each other
4. The friend's laptop can't run a simple fileserver (like Python's SimpleHTTPServer), because perhaps they don't have enough privilegesAll of this is a bit ridiculous, so I wrote this simple program that I can run on my laptop, and then any of my friends with a web browser can either upload files to or download files from my laptop, without us needing to work around these silly problems.
# Why not any of the other projects?
There are other projects out there that perform this function, but, of the ones that I saw, I don't like them because:
1. They're often written in Python with third-party dependencies, and I just want a static binary that's easy to compile with no external dependencies or runtimes necessary, that I can also cross-compile for other platforms and share with less technical friends if they want to use this for themselves
2. Some projects require Apache or nginx, because they're CGI or PHP scripts
3. They have a ton of extra features that I'm not interested in, e.g. user accounts and groups of users — i.e. a database dependency — in-browser file viewers, and tons of JavaScript and CSS effectsThis is a lot more than I thought was necessary.
I wanted something approachable, simple, and portable.
# Install
If you have the [Go toolchain](https://golang.org/) installed, then the system can be installed by:
$ go install github.com/ltriant/sidegate@latest
It will be installed into you Go path's `bin` directory...
$ $(go env GOPATH)/bin/sidegate
# Build
The [Go toolchain](https://golang.org/) is necessary to build.
$ git clone https://github.com/ltriant/sidegate.git
$ cd sidegate
$ go build# Running
After installing or building, it can be run without any parameters:
$ sidegate
2020/03/02 09:53:43 Serving local directory /Users/ltriant/projects/github/sidegate
2020/03/02 09:53:43 Listening on http://10.1.18.33:8000The logged URL — which points to your IP address on your local network — can be shared with your friends, and then amazing file-sharing experiences may commence :)
By default, files are served from the current working directory (i.e. whichever directory you ran the program from), but this can be overridden with the `-dir` parameter.
Also by default, the server listens on port 8000, but can be overridden by the `-port` parameter.
$ sidegate -dir /tmp -port 1234
This was intended to be run on a local network only and _not_ the public-facing internet, so there's no SSL.