Fast and extremely simple frontend for Gelbooru https://gel.bloat.cat
  • Go 69.5%
  • HTML 10.4%
  • CSS 10.1%
  • Nix 7.3%
  • Dockerfile 1.3%
  • Other 1.4%
Find a file
Image vlnst 2d3dc9bc53
Image
All checks were successful
Lint / golangci-lint (push) Successful in 34s
Release Gelbooru-Go / build-and-push (release) Successful in 4m41s
Release Gelbooru-Go / deploy (release) Successful in 52s
Update golangci-lint version
2026-02-20 16:08:30 +03:00
.forgejo/workflows Update golangci-lint version 2026-02-20 16:08:30 +03:00
ansible chore(deps): update dependency community.docker to v5.0.6 2026-02-20 16:08:30 +03:00
contrib/nix chore: Build gelbooru-go with Go 1.26 2026-02-08 12:18:13 +02:00
static chore: initial project state 2026-01-12 00:53:14 +03:00
templates feat: show artist name on post view (#7); add test for artist name 2026-02-08 14:28:36 +03:00
.env.example chore: initial project state 2026-01-12 00:53:14 +03:00
.envrc Add Nix package and NixOS module 2026-01-30 10:15:22 +02:00
.gitignore Add Nix package and NixOS module 2026-01-30 10:15:22 +02:00
api.go chore: initial project state 2026-01-12 00:53:14 +03:00
artist.go feat: show artist name on post view (#7); add test for artist name 2026-02-08 14:28:36 +03:00
artist_test.go feat: show artist name on post view (#7); add test for artist name 2026-02-08 14:28:36 +03:00
build.sh chore: initial project state 2026-01-12 00:53:14 +03:00
caching.go chore: initial project state 2026-01-12 00:53:14 +03:00
compose.exaple.yaml chore(deps): update git.bloat.cat/vlnst/gelbooru-go docker tag to v0.2.1 2026-02-20 16:08:30 +03:00
config.go feat: add cookie for preferred rating, fix #10 2026-02-04 14:17:30 +03:00
Dockerfile chore(deps): update golang docker tag to v1.26 2026-02-20 16:08:30 +03:00
flake.lock chore: Update nix flake 2026-02-08 12:18:13 +02:00
flake.nix fix: invalid content type error 2026-02-20 16:08:30 +03:00
go.mod chore: use go 1.25 version 2026-02-08 13:15:06 +03:00
handlers.go feat: show artist name on post view (#7); add test for artist name 2026-02-08 14:28:36 +03:00
handlers_post_opengraph_test.go feat: add test for opengraph 2026-02-08 14:28:36 +03:00
main.go feat: show artist name on post view (#7); add test for artist name 2026-02-08 14:28:36 +03:00
Makefile chore: initial project state 2026-01-12 00:53:14 +03:00
models.go fix: invalid content type error 2026-02-20 16:08:30 +03:00
README.md chore: initial project state 2026-01-12 00:53:14 +03:00
renovate.json chore: initial project state 2026-01-12 00:53:14 +03:00

Gelbooru-Go

A lightweight, JavaScript-free (for now, this may change) private frontend for Gelbooru written in Go with caching and security features. The project uses only Go standard library, keeping dependencies minimal.

Instances

Public instances of Gelbooru-Go:

Country Address Rating
Germany gel.bloat.cat General

Requirements

  • Latest version of Go

Deployment

Docker Compose

Copy compose.example.yaml to compose.yaml and .env.example to .env, then edit them as needed:

cp compose.example.yaml compose.yaml
cp .env.example .env

Edit .env file with your configuration. You can obtain your API key and user ID from Gelbooru Account Options.

Then run:

docker compose up -d

Without Docker

Clone the repository:

git clone https://git.bloat.cat/vlnst/gelbooru-go
cd gelbooru-go

Set environment variables and run:

export API_KEY=your_api_key_here
export USER_ID=your_user_id_here
export PORT=3000
export POSTS_LIMIT=30
export RATING=general
make run

You can automate this using systemd or another init system.

Configuration

Required Variables

Optional Variables

  • PORT - Server port (default: 3000)
  • POSTS_LIMIT - Posts per page, 1-100 (default: 30)
  • RATING - Maximum allowed rating (default: general)

Rating System

Ratings follow a hierarchy: generalsensitivequestionableexplicit

Setting RATING=explicit allows all ratings (general, sensitive, questionable, and explicit). Setting RATING=questionable allows general, sensitive, and questionable, but not explicit. And so on.

Performance & Security

Caching

  • API responses: Cached for 5 minutes
  • Images: Cached for 60 minutes
  • Large files (>10MB) and videos are streamed instead of cached

Security Features

  • Security headers: X-Content-Type-Options, X-Frame-Options, X-XSS-Protection
  • Request deduplication: Multiple concurrent requests for the same post share a single API call (singleflight pattern)
  • URL validation: Proxy endpoint only allows Gelbooru domains
  • Content-Type validation: Only allowed media types are served
  • Size limits: Maximum image size 50MB, URL length 2048 chars, tags length 500 chars

Contributing

This project follows Semantic Versioning and uses Conventional Commits for commit messages.

Commit Message Format

Follow the Conventional Commits specification:

  • fix: - Bug fixes (patch version bump)
  • feat: - New features (minor version bump)
  • feat!: or fix!: - Breaking changes (major version bump)
  • docs: - Documentation changes
  • style: - Code style changes (formatting, etc.)
  • refactor: - Code refactoring
  • perf: - Performance improvements
  • test: - Test additions or changes
  • chore: - Other changes (build, config, etc.)

Examples:

  • fix: resolve memory leak in cache cleanup
  • feat: add support for custom rating filters
  • feat!: change API response format

Code Quality

Before submitting code:

  1. Format code: go fmt
  2. Run linter: golangci-lint run