Skip to content

LocalSend Web App

LocalSend is a free and open-source cross-platform app that allows you to securely share files and messages with nearby devices over your local network without the need for an internet connection.

I use this as a self-hosted web app to transer files between my Chromebook, or other system that uses a browser.

Note

The current version of the web app is not compatible with the mobile app nor LocalSend Go

🛠 Installation

Default Port: 8080

Clone the repo.

git clone https://github.com/localsend/web.git /opt/localsend
cd /opt/localsend
sudo mkdir -p /opt/localsend
sudo chown -R $USER:$USER /opt/localsend
git clone https://github.com/localsend/web.git /opt/localsend
cd /opt/localsend

Make sure to install pnpm.

npm install -g pnpm

Get dependencies

pnpm install

Start the development server

pnpm run dev

Deployment

Generates the static website in the dist directory.

pnpm run generate

Caddy

Caddy needs to be installed to run the LXC as a webserver.

apt install -y git curl caddy
sudo apt install -y git curl caddy

âš™ Config

WIP

Caddy

/etc/caddy/Caddyfile
:8080 {
    root * /opt/localsend/dist
    file_server
    encode gzip
}

Traefik

homelab/pve/traefik/conf.d/localsend.yaml
---
http:
 #region routers 
  routers:
    localsend:
      entryPoints:
        - "websecure"
      rule: "Host(`localsend.l.nicholaswilde.io`)"
      middlewares:
        - default-headers@file
        - https-redirectscheme@file
      tls: {}
      service: localsend
#endregion
#region services
  services:
    localsend:
      loadBalancer:
        servers:
          - url: "http://192.168.2.191:8080"
        passHostHeader: true
#endregion
  middlewares:
    https-redirectscheme:
      redirectScheme:
        scheme: https
        permanent: true
    default-headers:
      headers:
        frameDeny: true
        browserXssFilter: true
        contentTypeNosniff: true
        forceSTSHeader: true
        stsIncludeSubdomains: true
        stsPreload: true
        stsSeconds: 15552000
        customFrameOptionsValue: SAMEORIGIN
        customRequestHeaders:
          X-Forwarded-Proto: https

    default-whitelist:
      ipAllowList:
        sourceRange:
        - "10.0.0.0/8"
        - "192.168.0.0/16"
        - "172.16.0.0/12"

    secured:
      chain:
        middlewares:
        - default-whitelist
        - default-headers

Task List

task: Available tasks for this project:
* create-template:       Create template from existing .env file
* decrypt:               Decrypt sensitive configuration files using SOPS.
* default:               List all available tasks.
* enable:                Enable the application's systemd service.
* encrypt:               Encrypt sensitive configuration files using SOPS.
* export:                Export the task list to `task-list.txt`.
* init:                  Initialize the application's environment and configuration files.
* logs:                  Show caddy logs
* mklinks:               Create symbolic links for configuration files.
* restart:               Restart the application's systemd service.
* start:                 Start the application's systemd service.
* status:                Check the status of the application's systemd service.
* stop:                  Stop the application's systemd service.
* stow:                  Create symbolic links for caddy files.
* update:                Update the application or its running containers.
* upgrade:               Upgrade the application by pulling the latest changes and updating.
* verify-secrets:        Checks if the decrypted secret matches the local file

🔗 References