Skip to content

A crossplatform Electron desktop application for local file server using Express. Share files across your local network with authentication and speed.

License

Notifications You must be signed in to change notification settings

KristupasJon/LocalServerDrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LocalServerDrop

A cross-platform Electron desktop application that will act as a local file sharing server using Express web server, with Multer storage. Share files fast across your local network.

What is LocalServerDrop?

LocalServerDrop combines the convenience of a desktop application with the accessibility of a web server to create a seamless filesharing solution. Upload files through the desktop app or web interface, and share them instantly across your local network. Perfect for quick file transfers between devices without cloud dependencies or complex setup.

image image

Why LocalServerDrop?

  • Privacy First: Everything stays local.
  • Simple Setup: No configuration required, install and use.
  • Cross Device Compatible: Access from any device with a web browser or run the application which is also multiplatform (Electron).

Getting Started

Prerequisites

  • Node.js
  • npm

Installation

  1. Download the installer
  2. Run as administrator (for proper installation)
  3. Follow the setup wizard
  4. Launch from Start Menu or desktop shortcut

Tip

Run the installer as administrator to ensure proper installation and avoid permission issues.

Running with Node.js runtime (No installation)

  1. Clone the repository

    git clone https://github.com/KristupasJon/LocalServerDrop.git
    cd LocalServerDrop
  2. Install dependencies

    npm install
  3. Build CSS (required - output.css is not tracked in git)

    npm run buildcss

Note

The CSS build step is required because output.css is not tracked in git. You must run this command before starting the application.

  1. Start the application
    npm start

Development Mode

For development with auto-reload:

npm run dev

Building for Distribution

Build for your current platform:

npm run build

Build for specific platforms:

npm run build:win    # Windows
npm run build:mac    # macOS
npm run build:linux  # Linux

Built applications will be available in the dist/ directory.

Usage

Desktop App

  1. Launch LocalServerDrop
  2. Drag and drop files onto the upload zone, or click to browse
  3. Files are automatically uploaded to the local server
  4. Use the "File Vault" section to manage uploaded files
  5. Click the server button to open the web interface. The button shows your device IPv4 address

Web Interface

  1. Open any web browser
  2. Navigate to http://localhost:8080 on the same machine, or http://<your-device-ip>:8080 from other devices on the same network
  3. Upload and download files through the web interface
  4. Perfect for sharing with other devices on your network

Network Sharing

  • The Electron UI shows your device IPv4 so others can connect (for example, http://192.168.1.50:8080)
  • Other devices on your network can access files by visiting http://[YOUR-IP]:8080
  • Find your IP address using ipconfig (Windows) or ifconfig (Mac/Linux)

Important

Windows Firewall may block inbound connections the first time the server runs. Approve the prompt when Windows asks to allow access. If needed, you can add a rule to allow TCP 8080.

image

Windows PowerShell (run as Administrator):

New-NetFirewallRule -DisplayName "LocalServerDrop 8080" -Direction Inbound -Action Allow -Protocol TCP -LocalPort 8080

To remove later:

Remove-NetFirewallRule -DisplayName "LocalServerDrop 8080"

Tip

To share files across your network, replace [YOUR-IP] with your actual IP address. Use ipconfig on Windows or ifconfig on Mac/Linux to find your IP.

Security Features

  • Local Network Ready: Server binds to 0.0.0.0 by default (listens on all interfaces). Use a trusted network or change binding to 127.0.0.1 to restrict to the local machine only.
  • Admin Token Authentication: File deletion requires admin token
  • Path Traversal Protection: Prevents unauthorized file access

Note

Security Notes:

  • Per-session admin token: A new admin token is generated on each app start and passed to the server via X-Admin-Token header for delete operations. Restarting the app changes the token.
  • Upload safety: Filenames are sanitized to their basename (no path components). No explicit file size limit is enforced by default; add a Multer limit in code if you need one.

API Endpoints

  • POST /upload - Upload a file
  • GET /list - List all uploaded files
    • Returns an array of objects: { name: string, size: number } (size in bytes)
  • GET /files/:filename - Download a specific file
  • DELETE /delete/:filename - Delete a file (admin token required)
    • Requires header: X-Admin-Token: <token>
  • GET / - Serve the web interface

Configuration

  • Port can be configured via environment variable:
    • LSD_PORT (default: 8080)
  • Binding host can be configured via environment variable:
    • LSD_BIND_HOST (default: 0.0.0.0 to listen on all interfaces)
    • Set to 127.0.0.1 to restrict access to the local machine only
  • Admin token is managed automatically by the Electron app:
    • LSD_ADMIN_TOKEN is set by the Electron main process per run. You typically do not need to set this manually unless you’re running the server outside the app.

For testing with Postman or curl:

# Replace TOKEN_HERE with your actual admin token
curl -X DELETE "http://127.0.0.1:8080/delete/filename.ext" \
   -H "X-Admin-Token: TOKEN_HERE"
Screenshot 2025-09-25 155349

Note

The server's CORS configuration specifically allows the X-Admin-Token header for browser console testing and external API tools. Since the token is per-session and managed by the app, delete actions should generally be performed via the Electron UI. Manual testing requires the exact token for that run.

Troubleshooting

  • 403 Forbidden on delete:
    • The admin token likely doesn’t match. Restart the Electron app and try the delete again from within the app UI.
    • If testing manually, ensure you’re sending the correct X-Admin-Token for the current session.
  • CSS not applying after clone:
    • Run npm run buildcss to generate renderer/css/output.css (it is not tracked in git).