Skip to content

Add auth and session management#121

Merged
LumePart merged 25 commits intodevfrom
feat/backend
May 5, 2026
Merged

Add auth and session management#121
LumePart merged 25 commits intodevfrom
feat/backend

Conversation

@LumePart
Copy link
Copy Markdown
Owner

@LumePart LumePart commented Apr 29, 2026

This PR adds in-memory authentication and session management for the UI/backend

Thanks to @dammitjeff for the UI PR! (#116)

Included changes

  • Authentication using credentials defined via environment variables
  • Basic login page
  • Ability to protect API endpoints behind authentication
  • Session creation and validation
  • CSRF token generation and verification
  • UI API endpoints moved to /api/ui/
  • Minor backend cleanup/refactoring

A larger backend refactor is planned in the future

Test

  1. Clone the repository feat/backend branch:
git clone -b feat/backend https://github.com/LumePart/Explo.git explo-backend
cd explo-backend
  1. Copy over your .env file (optional)
  2. Open docker-compose.yaml, replace:
    image: ghcr.io/lumepart/explo:latest
    with
    build: .

Add under environment:

  • UI_USERNAME=test
  • UI_PASSWORD=testpass
  1. run docker compose up -d --build
  2. access the UI http://{YOUR_IP}:7288 and login with credentials defined in docker-compose

docker-compose sample:

services:
  explo:
    build: .
    restart: unless-stopped
    container_name: explo-backend
    ports:
      - "7288:7288"
    extra_hosts:
      - "host.docker.internal:host-gateway"
    volumes:
      - /path/to/.env:/opt/explo/.env
      - /data/music/explo:/data/ # has to be in the same path you have your music system pointed to (it's recommended to put explo under a subfolder)
      # - /path/to/slskd/downloads:/slskd/ # if using slskd and MIGRATE_DOWNLOADS is set to true in .env
      # - $PLAYLIST_DIR:$PLAYLIST_DIR # for MPD. Both paths should be as defined in .env (e.g /my/playlists/:/my/playlists/)

      # - /path/to/cookies.txt:/opt/explo/cookies.txt # Path to optional cookies file (for yt-dlp)
    environment:
      - UI_USERNAME=test
      - UI_PASSWORD=testpass
      - TZ=UTC 

PS! /api/ui/config is not behind authentication at the moment, due to it breaking the login page. (needs front end fix)
Feedback is welcome

@LumePart LumePart merged commit 235b718 into dev May 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants