Skip to content
/ yafs Public

Charmunks/yafs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ed0a272 · · Jan 27, 2026

History

53 Commits
Jan 27, 2026
Jan 27, 2026
Jan 17, 2026
Dec 28, 2025
Jan 27, 2026
Jan 27, 2026
Dec 28, 2025
Dec 31, 2025
Dec 31, 2025

Repository files navigation

YAFS - Yet Another File Server

A simple Web UI for managing, viewing, and sharing files hosted on your own server.

More info on https://yafs.site

Tech Stack

  • Express.js (backend)
  • Nunjucks (templating)
  • PostgreSQL with Knex.js (database)
  • Multer (file uploads)
  • bcrypt (password hashing)

Installation

Prerequisites

  • Node.js 20+
  • PostgreSQL database

Manual Setup

  1. Clone the repository:

    git clone https://github.com/Charmunks/yafs.git
    
    cd yafs
  2. Install dependencies:

    npm install
  3. Create a .env file based on .env.example:

    cp .env.example .env
  4. Configure the environment variables:

  5. Run database migrations:

    npm run migrate
  6. Start the server:

    npm start

    For development with auto-reload:

    npm run dev

Docker Setup

  1. Build the image:

    docker build -t yafs .
  2. Run with Docker:

    docker run -d \
      -p 3000:3000 \
      -e DATABASE_URL=postgresql://user:password@host:5432/yafs \
      -e SESSION_SECRET=your-secret-key \
      -e API_TOKEN=your-api-token \
      -e API_USER_ID=1 \
      -v /path/to/uploads:/app/uploads \
      yafs
      yafs

Docker Compose

version: '3.8'


services:
   yafs:
     build: .
     ports:
      -  "3000:3000"
     environment:
      -  DATABASE_URL=postgresql://yafs:yafs@db:5432/yafs
      -  SESSION_SECRET=change-this-in-production
      -  API_TOKEN=your-api-token
      -  API_USER_ID=1
     volumes:
      -  uploads:/app/uploads
     depends_on:
      -  db

    db:
     image: postgres:16-alpine
     environment:
      -  POSTGRES_USER=yafs
      -  POSTGRES_PASSWORD=yafs
      -  POSTGRES_DB=yafs
     volumes:
      -  pgdata:/var/lib/postgresql/data


volumes:
   uploads:
   pgdata:

Run with:

docker compose up -d

Environment Variables

Variable Description
PORT Server port (default: 3000)
DATABASE_URL PostgreSQL connection string
SESSION_SECRET Secret key for session encryption
API_TOKEN Token for programmatic file uploads
API_USER_ID User ID associated with API uploads