- 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
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
# shiroa bundles its own Typst compiler, so no separate typst install.
|
|
- name: Install shiroa
|
|
run: |
|
|
curl -sSL -o /tmp/shiroa.tar.gz \
|
|
https://github.com/Myriad-Dreamin/shiroa/releases/download/v0.4.0-rc2/shiroa-x86_64-unknown-linux-musl.tar.gz
|
|
tar -xzf /tmp/shiroa.tar.gz -C /tmp
|
|
install -m 755 /tmp/shiroa-x86_64-unknown-linux-musl/shiroa /usr/local/bin/shiroa
|
|
shiroa --version
|
|
|
|
- name: Generate acl.json
|
|
run: go run ./cmd/parser -in docs -out acl.json
|
|
|
|
- name: Build the book
|
|
run: shiroa build docs --dest-dir ../dist
|
|
|
|
- name: Test and build the server
|
|
run: |
|
|
go vet ./...
|
|
go test ./...
|
|
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o yggdrasil-server ./cmd/server
|
|
|
|
- name: Upload server artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: yggdrasil-server-linux-amd64
|
|
path: yggdrasil-server
|