Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
21
This project implements a RFC7033-compliant WebFinger server in Go, providing user discovery via `acct:` URIs with both API endpoints and an HTML frontend for manual lookups.
Sign in to like and favorite skills
This project implements a RFC7033-compliant WebFinger server in Go, providing user discovery via
acct: URIs with both API endpoints and an HTML frontend for manual lookups.
cmd/asdf/main.go requires PORT, SSL_CERT_PATH, and SSL_KEY_PATH environment variablesinternal/server/server.go configures routes, TLS, and environment-based behavior (GO_ENV=test enables HTTP mode and auto-seeding)internal/rest/html_handler.go serves both /.well-known/webfinger API and HTML frontend via unified handlerinternal/resource/ validates acct: resources, requiring @ symbol for validityinternal/store/ provides Store interface with Postgres implementation, auto-creates schema in test modeinternal/types/jrd.go defines JRD (JSON Resource Descriptor) with Subject, Aliases, Properties, Linksweb/template/ contains search and account display templates, web/static/ serves CSSdocker-compose up --build starts both web server and Postgres DB.env file with PORT, DATABASE_URL, SSL_CERT_PATH, SSL_KEY_PATHopenssl genrsa -out server.key 2048 && openssl req -new -x509 -sha256 -key server.key -out server.crt -days 365GO_ENV=test for HTTP mode (no TLS) and automatic schema initializationgithub.com/stretchr/testify/require for assertionsgo test ./... - tests use mock store for isolationGET /.well-known/webfinger?resource=acct:[email protected]/ for manual user lookupsHTMLHandler serves both WebFinger API and HTML UI from same struct via method routingresource.ParseResource() strips acct: prefix, validates @ presence for email-like identifiersGO_ENV=test switches HTTP/HTTPS, enables auto-seeding of acct:[email protected]LookupBySubject() and SearchSubjects() methods for testabilityLoadTemplates() called at startup, templates executed directly in handlersapplication/jrd+json, search API returns application/jsongithub.com/jackc/pgx/v5/pgxpool with JSONB columns for properties/links/.well-known/webfinger endpoint with resource query paramdocker-compose.yml orchestrates web server + Postgres with volume persistence/static/ route serves web/static/ directory (CSS, JS, images)acct: URIs that resolve to email-like identifiers with @users table with subject, aliases[], properties (JSONB), links (JSONB)GO_ENV=test bypasses TLS, auto-seeds example user, enables HTTP-only operationstore.NewMockStore() provides in-memory implementation for unit tests