Rename Nurse to Mako
CI / test (push) Successful in 2m9s
Release / release (push) Successful in 2m16s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
VeillaxandClaude Sonnet 5.5 committed 2026-11-01 00:07:43 -06:00
1 parent 6a4be5b2f4
commit e3147597e8
24 files changed
+208 -208

No files matched your search

+21 -21
View File
@@ -1,4 +1,4 @@
// Command nurse is a private notebook: pages you can link, nest and search, kept as plain
// Command mako is a private notebook: pages you can link, nest and search, kept as plain
// markdown files. You sign in with Authentik; there is no other way in.
package main
@@ -15,27 +15,27 @@ import (
"syscall"
"time"
"git.veillax.com/Veillax/nurse/internal/config"
"git.veillax.com/Veillax/nurse/internal/oidc"
"git.veillax.com/Veillax/nurse/internal/web"
"git.veillax.com/Veillax/mako/internal/config"
"git.veillax.com/Veillax/mako/internal/oidc"
"git.veillax.com/Veillax/mako/internal/web"
)
var version = "dev"
const usage = `nurse is a private notebook that you sign in to with Authentik.
const usage = `mako is a private notebook that you sign in to with Authentik.
nurse serve [-config nurse.json] [-listen addr] [-data dir]
mako serve [-config mako.json] [-listen addr] [-data dir]
run the notebook
nurse check [-config nurse.json] test the Authentik settings without starting
nurse version
mako check [-config mako.json] test the Authentik settings without starting
mako version
Settings come from the settings file and can be overridden by environment variables:
NURSE_PUBLIC_URL where you open Nurse, such as https://notes.example.com
NURSE_OIDC_ISSUER the Authentik provider's OpenID configuration issuer
NURSE_OIDC_CLIENT_ID the provider's Client ID
NURSE_OIDC_CLIENT_SECRET the provider's Client Secret
NURSE_ALLOWED optional: only these emails or usernames may sign in (comma separated)
NURSE_LISTEN, NURSE_DATA, NURSE_CONFIG
MAKO_PUBLIC_URL where you open Mako, such as https://notes.example.com
MAKO_OIDC_ISSUER the Authentik provider's OpenID configuration issuer
MAKO_OIDC_CLIENT_ID the provider's Client ID
MAKO_OIDC_CLIENT_SECRET the provider's Client Secret
MAKO_ALLOWED optional: only these emails or usernames may sign in (comma separated)
MAKO_LISTEN, MAKO_DATA, MAKO_CONFIG
`
// exitConfig is the exit status for settings that need fixing by hand, so a service manager does
@@ -55,7 +55,7 @@ func main() {
case "check":
err = check(os.Args[2:])
case "version", "-v", "--version":
fmt.Println("nurse", version)
fmt.Println("mako", version)
case "help", "-h", "--help":
fmt.Print(usage)
default:
@@ -63,7 +63,7 @@ func main() {
os.Exit(2)
}
if err != nil {
fmt.Fprintln(os.Stderr, "nurse:", err)
fmt.Fprintln(os.Stderr, "mako:", err)
var ce configError
if errors.As(err, &ce) {
os.Exit(exitConfig)
@@ -75,9 +75,9 @@ func main() {
type configError struct{ error }
func configFlag(fs *flag.FlagSet) *string {
def := os.Getenv("NURSE_CONFIG")
def := os.Getenv("MAKO_CONFIG")
if def == "" {
def = "nurse.json"
def = "mako.json"
}
return fs.String("config", def, "path of the settings file")
}
@@ -89,10 +89,10 @@ func serve(args []string) error {
data := fs.String("data", "", "override the folder the notes are kept in")
fs.Parse(args)
if *listen != "" {
os.Setenv("NURSE_LISTEN", *listen)
os.Setenv("MAKO_LISTEN", *listen)
}
if *data != "" {
os.Setenv("NURSE_DATA", *data)
os.Setenv("MAKO_DATA", *data)
}
h, err := config.Load(*path)
@@ -122,7 +122,7 @@ func serve(args []string) error {
defer stop()
errc := make(chan error, 1)
go func() { errc <- srv.ListenAndServe() }()
log.Printf("nurse %s: notes are kept in %s; open %s", version, cfg.DataDir, cfg.PublicURL)
log.Printf("mako %s: notes are kept in %s; open %s", version, cfg.DataDir, cfg.PublicURL)
log.Printf("sign-in goes through %s; the redirect URI to allow there is %s", cfg.OIDC.Issuer, cfg.RedirectURL())
if len(cfg.Allowed) == 0 {
log.Print("anyone Authentik lets into this application gets a notebook of their own; set \"allowed\" to limit it")