Glaze ๐Ÿฏ

Glaze is a small web frontend for soft-serve, built in Odin.

It serves server-rendered HTML pages that let you browse public git repositories, inspect trees and files, view rendered README files, and access raw blobs. Glaze is intentionally simple, self-hosted, and backend-driven.

It is also built on top of a custom HTTP/1.x library written in Odin using raw sockets.

Features

  • List public soft-serve repositories
  • Filter hidden/private repositories using soft-serve metadata
  • Browse repository trees
  • Browse refs through URL-based routes
  • View files in a simple blob page
  • Access raw blob contents
  • Render README.md files as HTML
  • Show latest commit metadata on repository pages
  • Serve static assets
  • Provide a warm, minimal HTML interface

Architecture

Glaze is split into a few main layers:

Glaze app
  โ”œโ”€ routes and page handlers
  โ”œโ”€ templates and view models
  โ”œโ”€ soft-serve metadata access
  โ””โ”€ git repository access

HTTP library
  โ”œโ”€ raw socket HTTP/1.x server
  โ”œโ”€ request parsing
  โ”œโ”€ response building
  โ”œโ”€ routing
  โ”œโ”€ middleware
  โ”œโ”€ static file serving
  โ””โ”€ connection management

HTTP library

Glaze includes a small reusable HTTP library written in Odin.

Current capabilities include:

  • HTTP/1.x request parsing
  • keep-alive support
  • pipelining/carry-buffer support
  • growing ring buffer for connection data
  • thread-per-connection handling
  • active connection cap
  • idle timeout support
  • request size limits
  • unsupported Transfer-Encoding rejection
  • structured response building
  • default response headers
  • static file serving
  • router support:
    • exact routes
    • prefix routes
    • pattern routes
    • route params
    • wildcard path params
  • middleware support using explicit handler/user-data chaining

The HTTP layer is intended to remain reusable outside Glaze.

Routing

Glaze uses route patterns for repository browsing.

Examples:

/
 /r/:repo
 /r/:repo/tree/:ref/*path
 /r/:repo/blob/:ref/*path
 /r/:repo/raw/:ref/*path

This allows repository names, refs, and paths to be extracted cleanly from URLs.

Templates

Glaze uses a small custom template system.

Supported syntax:

{{field}}

{{#block}}
  ...
{{/block}}

Blocks can be used for repeated data and conditional rendering. If a block has no data, it is not rendered.

Templates are intentionally simple. Logic stays in Odin, while templates focus on presentation.

soft-serve integration

Glaze reads soft-serve repository metadata from the soft-serve.db SQLite database.

This allows Glaze to respect repository visibility/configuration and only expose public repositories.

The database is expected to be mounted into the Glaze container.

Git integration

Glaze reads repository data directly from bare git repositories using a small libgit2 wrapper.

It currently uses libgit2 to read:

  • current commit summary
  • author
  • commit timestamp
  • tree entries
  • blob contents

Repositories are mounted into the Glaze container as a Docker volume.

Deployment

Glaze is designed to run alongside soft-serve.

A typical deployment mounts:

  • the soft-serve database
  • the bare repository directory
  • static/web assets, if needed

Glaze does not currently handle TLS directly. Use a reverse proxy such as Caddy, nginx, or similar for HTTPS.

Development

Build and run locally:

./build.sh
./glaze

Test with curl:

curl -v http://127.0.0.1:8080/

Non-goals

Glaze intentionally does not aim to be a full GitHub/Gitea replacement.

Currently out of scope:

  • issues
  • pull requests
  • repository editing
  • account management
  • public JSON API
  • HTTP/2
  • built-in TLS termination

Status

Glaze is experimental but functional.

It is already capable of browsing public soft-serve repositories, rendering repository trees, displaying README content, and serving raw files.

License

TBD