File Uncle (WIP)
file-uncle, an anywhere to anywhere file transfer utility using http.
Features
- 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.
Installation
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 .
Usage
Prerequisite
- You need to install file-uncle in one system
Case #1: file-uncle installed in system #1
- Install file-uncle in system #1
- Run
file-uncle serve command to start a http server in system #1
- 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.
Case #2: file-uncle installed in system #2
- Install file-uncle in system #2
- Run
file-uncle receive command 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>
- 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:
Sending Files via CLI (curl)
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/
Encrypting and Decrypting Files
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/file and yourpassword with your actual file path and password.
Using Ngrok for sending/receiving via internet
-
To expose your server to the internet, use the built-in ngrok integration:
Contributing
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.
License
This project is licensed under the MIT License.