How an-empty-string/amethyst works
Amethyst serves Gemini requests by selecting a configured host and resource, then returning a Gemini response. Its filesystem resource supports metadata-based directory handling, file delivery, and optional CGI; bundled extensions provide Python documentation browsing and redirects. The README documents entry-point extensibility, while the sampled excerpts do not show configuration loading or resource-registry internals, so those links are limited to the documented integration. Several core modules are represented by their exact tree paths without claims about unsampled implementation details.
Main entry points: resource.py Filesystem resource · server.py Connection server · response.py Gemini response · handler.py Generic handler
Components 17
Gemini server
- Connection server
amethyst/amethyst/server.py - TLS and SNI
amethyst/amethyst/tls.py - Server configuration
amethyst/amethyst/config.py - Server manager
amethyst/amethyst/kindergarten.py - Generic handler
amethyst/amethyst/handler.py - Request context
amethyst/amethyst/request.py - Gemini response
amethyst/amethyst/response.py
Resource handling
- Resource registry
amethyst/amethyst/resource_registry.py - Filesystem resource
amethyst/amethyst/resource.py - File metadata
amethyst/amethyst/resource.py - CGI execution
amethyst/amethyst/resource.py - Path normalization
amethyst/amethyst/util.py - MIME handling
amethyst/amethyst/mime.py
Bundled extensions
- Python doc browser
amethyst_extensions/amethyst_ext/pydoc.py - Redirect generator
amethyst_extensions/amethyst_ext/redirect.py
Other components
- Gemini client
- Python environment
Connections 19
- Gemini client → Connection server: opens Gemini connection
- Server manager → Server configuration: loads configuration
- Server manager → Connection server: starts server
- Connection server → TLS and SNI: creates TLS context
- Connection server → Generic handler: dispatches request
- Connection server → Request context: builds connection
- Generic handler → Path normalization: normalizes paths
- Generic handler → Resource registry: selects resource
- Generic handler → Filesystem resource: invokes resource
- Filesystem resource → File metadata: loads metadata
- Filesystem resource → Path normalization: resolves paths
- Filesystem resource → CGI execution: runs eligible scripts
- Filesystem resource → MIME handling: determines content type
- Filesystem resource → Gemini response: creates response
- CGI execution → Gemini response: creates response
- Python doc browser → Python environment: inspects modules
- Python doc browser → Gemini response: creates response
- Redirect generator → Gemini response: creates response
- Connection server → Gemini response: writes response