file-uncle, an anywhere to anywhere file transfer utility using http.
- Receive Files: Create a http server to Receive files from anywhere via http.
- Serve Files: Create a http file server to let anyone download the file from your system.
To install File Uncle, follow these steps:
- Clone the repository:
git clone https://github.com/theadarshsaxena/file-uncle.git - Navigate to the project directory:
cd file-uncle - Run the project:
go run .
- You need to install file-uncle in one system
- Install file-uncle in system #1
- Run
file-uncle servecommand to start a http server in system #1- Both system in same network
file-uncle serve --host <IPOfServer#1> - System on different network (send via internet)
file-uncle serve --with-ngrok
- Both system in same network
- Above command will return a link, which will open a http page in browser with a list of files to download.
- Note: To download the files from CLI (system #2), use wget after copying link for any file by opening first in browser.
- Install file-uncle in system #2
- Run
file-uncle receivecommand to start the http server, it starts the server at 8080 (by default) and it also provide a webUI to upload the files- Both system in same network
file-uncle receive --host <IPOfServer#2> (or) file-uncle receive --host <IPOfServer#2> --user <username> --password <somepassword> - System on different network (send via internet)
file-uncle receive --with-ngrok (or) file-uncle receive --with-ngrok --user <username> --password <somepassword>
- Both system in same network
- Now, from system #1, open the link given by above command in browser and upload the file
- Note: To send file from system #1 using CLI, follows the below steps:
In addition to this, if you want to send the files via CLI in remote system, you the following commands:
-
To upload a file to the server using curl:
curl -F "uploadFile=@/path/to/your/file" http://localhost:8080/ -
If authentication is enabled:
curl -u username:password -F "uploadFile=@/path/to/your/file" http://localhost:8080/
For better security when sending the file via tunnel, e.g., ngrok, prefer sending the encrypted file. You can encrypt a file before sending and decrypt it after receiving using OpenSSL (AES-256) as follows:
-
Encrypt before sending:
openssl enc -aes-256-cbc -salt -in /path/to/your/file -out /path/to/your/file.enc -k yourpassword
-
Send the encrypted file:
curl -F "uploadFile=@/path/to/your/file.enc" http://localhost:8080/ -
Decrypt after receiving:
openssl enc -d -aes-256-cbc -in /path/to/received/file.enc -out /path/to/decrypted/file -k yourpassword
Replace
/path/to/your/fileandyourpasswordwith your actual file path and password.
-
To expose your server to the internet, use the built-in ngrok integration:
- Add the
--with-ngrokflag to either theserveorreceivecommand:./file-uncle serve --with-ngrok ./file-uncle receive --with-ngrok
- Set the following environment variables before running the command:
NGROK_AUTHTOKEN: Your ngrok authtoken (required for authentication)
- The tunnel endpoint will be printed in the console when started.
- When you stop the server with CTRL+C, the tunnel will be closed
- Add the
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request. Make sure to follow our contribution guidelines.
To build the project from source:
go build -o file-uncle ./cmd/file-uncle/main.goThis project uses Tailwind CSS for styling. To regenerate the CSS:
# One-time build
npm run tailwind
# Watch mode for development
npm run tailwind:watchThe Tailwind configuration is defined in tailwind.config.js and scans the HTML files in internal/src/html/ for utility classes.
This project uses GoReleaser to automate building and releasing binaries for multiple platforms. The configuration is in .goreleaser.yaml.
- Pre-release Verification: Runs
go mod tidyand tests before building - Multi-platform Compilation: Builds binaries for:
- Linux (amd64, arm64)
- macOS/Darwin (amd64, arm64)
- Windows (amd64)
- Optimization: Reduces binary size using optimized linker flags
- Checksums: Generates SHA256 checksums for all binaries
- Changelog Generation: Automatically generates changelogs from commits organized by type:
- π― Features (commits with
feat:) - π Bug fixes (commits with
fix:) - β‘ Performance improvements (commits with
perf:) - Others
- π― Features (commits with
- GitHub Releases: Publishes releases to GitHub with formatted notes and downloadable binaries
-
Tag a commit with a version number:
git tag v1.0.0 git push origin v1.0.0
-
GoReleaser will automatically trigger (if configured with GitHub Actions) or manually run:
goreleaser release --clean
-
The release will be published to GitHub Releases with all built binaries.
The GitHub Actions workflow is configured in .github/workflows/goreleaser.yaml. Here's how to set it up:
Step 1: Ensure the Workflow File Exists
- The workflow file is already included in the repository at
.github/workflows/goreleaser.yaml - It automatically triggers when you push a git tag with version format
v*(e.g.,v1.0.0)
Step 2: Verify GitHub Token Permission
- Go to your GitHub repository settings
- Navigate to: Settings β Actions β General
- Under "Workflow permissions", select "Read and write permissions"
- This allows GitHub Actions to create releases
Step 3: Create and Push a Tag
# Create a local tag
git tag v1.0.0
# Push the tag to GitHub
git push origin v1.0.0Step 4: Monitor the Workflow
- Go to your repository on GitHub
- Click on the Actions tab
- You'll see the "GoReleaser" workflow running
- Wait for it to complete (usually 2-5 minutes)
Step 5: Check the Release
- Once completed, go to Releases tab
- You'll see the new release with all built binaries and checksums
- Triggers: When you push a version tag (v1.0.0, v1.1.0, etc.)
- Checks out code with full git history
- Sets up Go environment
- Sets up Node.js for Tailwind CSS
- Builds CSS using npm
- Runs GoReleaser to build and publish binaries
- Automatically publishes release to GitHubWorkflow not triggering?
- Make sure you're pushing tags:
git push origin v1.0.0 - Tags must match the pattern
v*(e.g.,v1.0.0) - Check Actions tab to see if workflow runs
Release not being created?
- Verify "Workflow permissions" are set to "Read and write"
- Check the workflow logs in the Actions tab for errors
- Ensure
.goreleaser.yamlis configured correctly
Local Testing (Optional): If you want to test GoReleaser locally before pushing:
# Install GoReleaser
brew install goreleaser # macOS
# or download from https://goreleaser.com/
# Create a dry-run (without publishing)
goreleaser release --skip=publish --cleanThis project is licensed under the MIT License.


