An open API service indexing awesome lists of open source software.

https://github.com/aredoff/veldoc

Veldoc is a lightweight self-hosted web viewer for browsing and rendering Markdown documentation from a local directory, with optional auth and Docker support.
https://github.com/aredoff/veldoc

developer-tools docker docs documentation file-browser golang knowledge-base markdown markdown-viewer self-hosted

Last synced: about 15 hours ago
JSON representation

Veldoc is a lightweight self-hosted web viewer for browsing and rendering Markdown documentation from a local directory, with optional auth and Docker support.

Awesome Lists containing this project

README

          

# Veldoc

[![Docker Pulls](https://img.shields.io/docker/pulls/aredoff/veldoc.svg?maxAge=604800)](https://hub.docker.com/r/aredoff/veldoc/)
[![Go Report Card](https://goreportcard.com/badge/github.com/aredoff/veldoc)](https://goreportcard.com/report/github.com/aredoff/veldoc)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)

Minimal file browser for viewing a mounted directory in the browser. Designed for Docker: mount a folder, open the UI, read files and rendered Markdown.

## Quick start

```bash
docker run -p 8080:8080 -v ./your-folder:/data ghcr.io/aredoff/veldoc
```

Open http://localhost:8080

## Docker Compose

```bash
mkdir -p data
echo "# Hello" > data/readme.md
docker compose up --build
```

## Configuration

| Flag / Env | Default | Description |
|---|---|---|
| `--root` / `VELDOC_ROOT` | `/data` | Directory to serve |
| `--addr` / `VELDOC_ADDR` | `:8080` | Listen address |
| `--auth` / `VELDOC_AUTH` | `none` | `none`, `basic`, `form`, `token` |
| `VELDOC_BASIC_USER` | | Basic auth username |
| `VELDOC_BASIC_PASSWORD` | | Basic auth password |
| `VELDOC_FORM_USER` | | Form auth username |
| `VELDOC_FORM_PASSWORD` | | Form auth password |
| `VELDOC_SESSION_SECRET` | | Form auth session secret |
| `VELDOC_TOKEN` | | Bearer token |
| `--poll-interval` / `VELDOC_POLL_INTERVAL` | `3s` | UI poll interval |
| `--max-preview-size` / `VELDOC_MAX_PREVIEW_SIZE` | `52428800` | Max file size for preview in bytes (download is unlimited) |

## Excluding files (`.docignore`)

Place a `.docignore` file in the served root or any subdirectory. Syntax matches `.gitignore`: wildcards (`*`, `?`, `**`), negation (`!`), directory patterns (trailing `/`), and comments (`#`).

Ignored paths are hidden from the file tree and cannot be read via the API. `.docignore` files themselves are always hidden.

**Root example** (`data/.docignore`):

```gitignore
# secrets
.env
private/

# build artifacts
*.log
dist/

# except this one
!important.log
```

**Nested example** (`data/docs/.docignore`):

```gitignore
drafts/
*.tmp
```

Patterns in a nested `.docignore` apply only to files under that directory, like Git.

## Auth examples

**Basic auth:**
```bash
docker run -p 8080:8080 -v ./data:/data \
-e VELDOC_AUTH=basic \
-e VELDOC_BASIC_USER=admin \
-e VELDOC_BASIC_PASSWORD=secret \
veldoc
```

**Form auth:**
```bash
docker run -p 8080:8080 -v ./data:/data \
-e VELDOC_AUTH=form \
-e VELDOC_FORM_USER=admin \
-e VELDOC_FORM_PASSWORD=secret \
-e VELDOC_SESSION_SECRET=change-me \
veldoc
```

**Token auth:**
```bash
curl -H "Authorization: Bearer my-token" http://localhost:8080/api/tree
```

## Development

```bash
go run ./cmd/veldoc --root ./data
go test ./...
```

## License

MIT