createfileshare
v2.1.0
Published
**createfileshare** is an automated Node.js CLI tool that transforms your computer into a persistent, public file server. It securely exposes your local user directory to the internet via an auto-healing tunnel that can survive machine reboots and network
Readme
createfileshare
createfileshare is an automated Node.js CLI tool that transforms your computer into a persistent, public file server. It securely exposes your local user directory to the internet via an auto-healing tunnel that can survive machine reboots and network disconnections.
🚀 Features
- Instant File Server: Instantly serves your
C:\Users(Windows),/Users(macOS), or/home(Linux) directory on your local network. - Public Tunneling: Automatically binds your local server to a public, internet-accessible URL using
localtunnel. - Zero Downtime (Self-Healing): A built-in network monitor constantly verifies both your internet connection and the public tunnel's health. If the tunnel goes stale or network drops, it immediately kills zombie processes and recycles the connection.
- System Daemon Persistence: Automatically installs and configures
pm2to run the server entirely in the background. Setup includes OS-level startup scripts so your server boots up automatically whenever the computer restarts. - Webhook Reporting: Posts the active, live URL directly to a specified API endpoint (default:
https://linksaver-psi.vercel.app/api/save) upon a successful connection so you never lose your dynamic address.
📦 Prerequisites
You need Node.js installed on your machine.
🛠️ Usage
Run the script using Node.js. You can optionally provide a folder name, followed by a username and password for basic authentication:
```bash node index.js [folder-name] [username] [password] ```
Example: ```bash node index.js secure-share admin supersecret123 ``` (If you don't provide credentials, it defaults to `admin` and `password123`)
What happens next?
- It creates the designated folder (defaulting to
my-fileshare). - Inside that folder, it generates a custom daemon script (
index.js) tailored for your operating system. - It installs necessary local dependencies (
localtunnel,axios,serve). - It globally installs the
pm2process manager. - It configures the new daemon to run continuously in the background and sets it to auto-start on boot.
🛑 How to Stop or Remove
Because createfileshare integrates tightly with process managers to ensure 100% uptime, closing the terminal will not kill the server.
To view logs (to check connectivity or URLs): ```bash pm2 logs my-fileshare ```
To temporarily stop the server: ```bash pm2 stop my-fileshare ```
To completely remove and delete the persistent daemon: ```bash pm2 delete my-fileshare pm2 save ```
⚠️ Security Warning
Use with caution. While this tool now uses Basic Authentication, the data streaming through the tunnel exposes your entire user directory. Do not use this tool on a computer containing highly sensitive, unencrypted private keys, passwords, or personal documents unless you understand the risks. Make sure to define a strong username and password when executing the setup script.
