- docs/: shiroa book with three example categories (thermo, security, homelab); pages declare access via '#let access-groups = (...)' - cmd/parser: scans docs/ and generates acl.json (public by default, skips book.typ/template.typ/partials) - internal/acl: loads acl.json, normalizes URLs to page keys so a page's renderer data (*.multi.sir.in) inherits its protection; fail closed on malformed input - internal/oidc: authorization-code flow client, verified ID tokens, groups claim from Authentik - internal/middleware: in-memory sessions, login/logout/callback handlers, CSRF states, access gate + security headers - cmd/server + embed.go: single binary embedding dist/ and acl.json; /searchindex.json blocked; graceful shutdown - Justfile (build/run/parse/check/clean/preview-docs), Gitea Actions workflow (shiroa v0.4.0-rc2), rootless Dockerfile, README - legacy docs moved to legacy_docs/; .idea untracked
27 lines
630 B
Go
27 lines
630 B
Go
// Package yggdrasil embeds the build artifacts: the static site compiled by
|
|
// shiroa (dist/) and the access control list (acl.json). Embedding them at
|
|
// the repository root lets //go:embed see both directories relative to this
|
|
// file; `go build` requires acl.json and dist/ to exist (see the Justfile).
|
|
package yggdrasil
|
|
|
|
import (
|
|
"embed"
|
|
"io/fs"
|
|
)
|
|
|
|
//go:embed all:dist
|
|
var distFS embed.FS
|
|
|
|
//go:embed acl.json
|
|
var aclData []byte
|
|
|
|
// DistFS returns the embedded static site.
|
|
func DistFS() (fs.FS, error) {
|
|
return fs.Sub(distFS, "dist")
|
|
}
|
|
|
|
// ACLData returns the embedded acl.json.
|
|
func ACLData() []byte {
|
|
return aclData
|
|
}
|