Static file server for the gemini protocol
Find a file
Jeena c193d831ed Prepare Pollux v1.0.0 release
- Update Cargo.toml version to 1.0.0
- Revise README.md: document available CLI options (--config, --test-processing-delay), update config format
- Update INSTALL.md: change user from gemini to pollux, simplify certificate setup, remove Let's Encrypt instructions
- Update systemd service user to pollux
- Add comprehensive CHANGELOG.md documenting all v1.0.0 features
- Remove references to eliminated CLI options (--root, --cert, --key, --host, --port)

Key features in v1.0.0:
- Rate limiting with configurable concurrent requests
- Comprehensive config validation and error handling
- Custom logging system with structured output
- Security features: path traversal protection, URI validation
- Systemd integration and complete installation guide
- Full test suite (22 tests) with zero warnings
2026-01-18 23:52:29 +00:00
dist Prepare Pollux v1.0.0 release 2026-01-18 23:52:29 +00:00
src Unify integration test environment and add valid config validation 2026-01-16 23:59:54 +00:00
tests Simplify test environment setup to return TempDir directly 2026-01-17 00:06:27 +00:00
.gitignore Refine repository structure 2026-01-15 08:31:43 +09:00
AGENTS.md Implement rate limiting with 41 responses and comprehensive logging 2026-01-16 06:00:18 +00:00
BACKLOG.md Mark graceful config validation as completed in BACKLOG.md 2026-01-16 22:22:03 +00:00
Cargo.toml Prepare Pollux v1.0.0 release 2026-01-18 23:52:29 +00:00
CHANGELOG.md Prepare Pollux v1.0.0 release 2026-01-18 23:52:29 +00:00
README.md Prepare Pollux v1.0.0 release 2026-01-18 23:52:29 +00:00

Pollux - A Simple Gemini Server

Pollux is a lightweight Gemini server for serving static files securely. It supports TLS, hostname validation, and basic directory serving.

Requirements

Rust 1.70+ and Cargo.

Building

Clone or download the source, then run:

cargo build --release

This produces the target/release/pollux binary.

Running

Create a config file at /etc/pollux/config.toml or use --config to specify a path:

root = "/path/to/static/files"
cert = "/path/to/cert.pem"
key = "/path/to/key.pem"
bind_host = "0.0.0.0"
hostname = "gemini.example.com"
port = 1965
log_level = "info"
max_concurrent_requests = 1000

Development Setup

Quick Start with Self-Signed Certs

mkdir -p tmp
openssl req -x509 -newkey rsa:2048 \
  -keyout tmp/key.pem \
  -out tmp/cert.pem \
  -days 365 \
  -nodes \
  -subj "/CN=localhost"

Update config.toml:

cert = "tmp/cert.pem"
key = "tmp/key.pem"

Run the server:

./pollux --config /path/to/config.toml

Access with a Gemini client like Lagrange at gemini://yourdomain.com/.

Development Notes

  • These certificates are for local testing only
  • Browsers will show security warnings with self-signed certs
  • Certificates in the dev/ directory are gitignored for security

Options

  • --config (-C): Path to config file (default /etc/pollux/config.toml)
  • --test-processing-delay (debug builds only): Add delay before processing requests (seconds) - for testing rate limiting

Certificate Management

  • Never commit certificate files to version control
  • Use development certificates only for local testing
  • Production certificates should be obtained via Let's Encrypt or your CA

Testing

Run cargo test for the full test suite, which includes integration tests that require Python 3.

Note: Integration tests use Python 3 for Gemini protocol validation. If Python 3 is not available, integration tests will be skipped automatically.