Fortress Go

Easily write secure, fast, production-ready web sites and servers in Golang.

Want to create a secure site in Go? It's a fantastic choice but unlike Ruby (with Rails), C# (with Asp.Net MVC), or Python (with Django or Flask) it isn't obvious where to start if you want to go beyond the (excellent) tutorials on request routing, handlers, and middleware.

Include Fortress Go in your own application and with a simple set of configuration options you get a standard server with masses of extras built in. Deploy with confidence.

Easily write secure, fast, production-ready web sites and servers in Golang.

This is not a framework. Rather than fitting your own file structure and code into someone else's framework, with Fortress Go you get a single package which you import and use with standard routing, templates, handlers, and middleware. Fortress Go is open source .

HTTPS

Automatic LetsEncrypt (HTTPS) by specifying port 443. Certificates cached in any folder so they can be shared. Automatic renewals.

Server Security

Cookies are encrypted and secure. Cookie based session support. User login/logout/get current. Public and signed-in routes.

Client Security

Individual cookies have explicit lifetimes. Per request cookie based CSRF with automatic checking. CORS with support for headers, methods, and origins. CSP (content security policy) for default, styles, scripts, and fonts.

Page Rendering

Serve static assets (CSS, JavaScript etcetera) from a specified folder. HTML templates automatically loaded and cached. Helper method executes any cached template with any data. Built-in template functions including Markdown rendering.

Resilience

Panic handling (server continues). Request logging in Apache format (stdout or custom destination). Optional database ping at startup with connection made available to all handlers.

Convenience

Standard HTTP(S) server with standard handler signatures and routing. Restrict the server by hostname. Load server configuration from a config file.

Full documentation is not yet done, but there is a very easy to follow example site on GitHub - there are only 2 Go source files, both tiny.