isosilo/README.md
2026-03-23 09:15:52 +01:00

94 lines
2.6 KiB
Markdown

# ISOSilo
A lightweight Go web server that lets you browse and download files from ISO 9660 images via your browser — without mounting them.
## Features
- **Library view** — lists all `.iso` files in a directory as clickable cards
- **In-ISO browsing** — navigate directories inside any ISO just like a file manager
- **File downloads** — download individual files directly from within an ISO
- **Clean UI** — dark-themed, responsive interface with file-type icons
- **Safe** — path traversal protection; only `.iso` files in the served directory are accessible
- **Zero mount required** — reads ISO images directly using the ISO 9660 library
## Installation
### Prerequisites
- Go 1.22 or later
### Build from source
```bash
git clone https://github.com/yourname/isosilo
cd isosilo
go mod tidy # fetches github.com/kdomanski/iso9660
go build -o isosilo .
```
### Run with Docker
```bash
docker build -t isosilo .
docker run -p 8080:8080 -v /path/to/your/isos:/isos isosilo
```
## Usage
```
isosilo [flags]
Flags:
-dir string Directory containing ISO files to serve (default: current directory)
-addr string Address to listen on (default: :8080)
```
### Examples
```bash
# Serve ISOs from the current directory on port 8080
./isosilo
# Serve a specific directory on a custom port
./isosilo -dir /mnt/isos -addr :9000
# Serve on all interfaces (default) or localhost only
./isosilo -addr 127.0.0.1:8080
```
Then open http://localhost:8080 in your browser.
## URL Structure
| URL | Description |
|-----|-------------|
| `GET /` | List all ISO files in the served directory |
| `GET /browse/{iso}` | Browse the root of an ISO |
| `GET /browse/{iso}/{path}` | Browse a subdirectory inside an ISO |
| `GET /file/{iso}/{path}` | Download a file from inside an ISO |
## Dependencies
- [`github.com/kdomanski/iso9660`](https://github.com/kdomanski/iso9660) — pure-Go ISO 9660 reader
## Project Layout
```
isosilo/
├── main.go # Entry point, CLI flags, route registration
├── go.mod
├── go.sum
├── Dockerfile
└── internal/
├── iso/
│ └── reader.go # ISO open/list/read abstraction
└── handlers/
└── handlers.go # HTTP handlers + HTML templates
```
## Security Notes
- The server only serves files with a `.iso` extension from the configured directory.
- ISO names are validated to prevent path traversal (`..`, `/`, `\`).
- Internal ISO paths are cleaned before use.
- There is **no authentication**. Do not expose this server to the public internet without adding auth (e.g. a reverse proxy with basic auth).