Sign inSign up

sean1832/wolite

By sean1832

•Updated 8 months ago

A minimal Wake-on-LAN server with a web interface.

Image
Networking
Internet of things
0

1.3K

sean1832/wolite repository overview

wolite logo

⁠Wolite

GitHub License Go Version SvelteKit GitHub Release Docker

Wolite is a lightweight, secure Wake-on-LAN (WoL) service that enables remote machine power control over the network.

⁠Features

  • Remote Power Control: Wake up devices on your network with a single click.
  • Secure Authentication: Protected access with secure login and session management.
  • Device Management: Add, edit, and manage your devices easily.
  • Single Binary Deployment: The frontend is embedded directly into the Go binary for easy distribution.
  • Simple Storage: Uses a local JSON database for simplicity and easy updates.

⁠Docker Deployment

You can deploy Wolite quickly using Docker.

⁠Option 1: Docker Compose

Create a data directory to persist the database and set permission to user 65532:

mkdir data
chown 65532:65532 data

Create a docker-compose.yml file:

services:
  wolite:
    image: sean1832/wolite:latest
    container_name: wolite
    restart: unless-stopped
    network_mode: host
    volumes:
      # Mount a local directory to persist the database
      # Ensure ./data is writable by user 65532 (or let Docker create it)
      - ./data:/data
    environment:
      # Optional: Override database path within the container
      - DATABASE_PATH=/data/wolite.json
      # Optional: Set the port (default: 8080)
      - PORT=8080
      # Optional: Set JWT secret (if not set, a random one is generated on startup)
      # - JWT_SECRET=your-secure-random-string
      # Optional: Set JWT expiry in seconds (default: 7 days)
      # - JWT_EXPIRY_SECONDS=604800
      # Optional: Enable development mode (allows CORS)
      # - DEV_MODE=false
    user: "65532:65532"
    read_only: true
    tmpfs:
      - /tmp

Run the container:

docker-compose up -d
⁠Option 2: Docker Run

Alternatively, you can run the container directly without docker-compose:

docker run -d \
  --name wolite \
  --restart unless-stopped \
  -p 8080:8080 \
  -v "$(pwd)/data:/data" \
  -e DATABASE_PATH=/data/wolite.json \
  --user "65532:65532" \
  --read-only \
  --tmpfs /tmp \
  sean1832/wolite:latest

The application will be available at http://localhost:8080.

⁠Local Deployment

⁠Download the latest release

Download the latest release⁠ according to your OS and architecture. Extract the executable to a desired place.

⁠Configure a .env file
  1. Create a .env file next to the executable
  2. Edit the .env file
DATABASE_PATH=./wolite.json
PORT=8080
JWT_SECRET=your-secure-random-string # <-- make sure you replace this
JWT_EXPIRY_SECONDS=604800
⁠Execute the program
./wolite

You should be able to access the url http://localhost:8080

⁠Build from source

⁠Prerequisites
⁠1. Clone the repository
git clone https://github.com/sean1832/wolite.git
cd wolite
⁠2. Build the project

To build both the frontend and backend:

task build

This commands will:

  1. Install frontend dependencies and build the SvelteKit app.
  2. Embed the build artifacts into the Go backend.
  3. Compile the Go binary to backend/bin/wolite (or wolite.exe).
⁠3. Run the application

You need to set up the environment configuration. Create a .env file in the backend directory or set the environment variables directly.

Required Environment Variables:

  • DATABASE_PATH: Absolute or relative path to the JSON database file (e.g., ./wolite.db or /data/wolite.json).

Optional Environment Variables:

  • JWT_SECRET: Secret key for signing JWTs. One will be generated automatically if not provided.
  • JWT_EXPIRY_SECONDS: Session expiry time in seconds (default: 604800 / 7 days).
  • DEV_MODE: Set to true to enable CORS (for development).

Run command:

cd backend
./bin/wolite

Access the application at http://localhost:8080.

⁠Development

You can run the frontend and backend independently for development features like Hot Module Replacement (HMR).

⁠Frontend (SvelteKit)
cd frontend
npm install
npm run dev

The frontend will run on http://localhost:5173. Update vite.config.ts to proxy requests to the backend if needed, or use DEV_MODE=true on the backend.

⁠Backend (Go)
cd backend
go run main.go

⁠Project Structure

  • backend/: Go source code, API handlers, and database logic.
  • frontend/: SvelteKit application, UI components, and styles.
  • Taskfile.yml: Build scripts and task commands.

⁠Tech Stack

  • Backend: Go (Golang)
  • Frontend: Svelte 5 + SvelteKit (TypeScript)
  • Styling: Tailwind CSS v4 + tailwind-variants
  • UI Components: shadcn-svelte (bits-ui), Lucide icons
  • Build System: Taskfile

⁠License

APACHE 2.0⁠

Tag summary

Content type

Image

Digest

sha256:58ff702c2…

Size

3.9 MB

Last updated

8 months ago

docker pull sean1832/wolite