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

+17 -17
View File
@@ -1,4 +1,4 @@
// Package config holds Nurse's settings: where to listen, where notes live and how to reach
// Package config holds Mako's settings: where to listen, where notes live and how to reach
// Authentik. The notes themselves are not in here.
package config
@@ -15,7 +15,7 @@ import (
"sync"
)
// OIDC is the OAuth client Authentik gives you for Nurse.
// OIDC is the OAuth client Authentik gives you for Mako.
type OIDC struct {
Issuer string `json:"issuer"`
ClientID string `json:"client_id"`
@@ -26,7 +26,7 @@ type Config struct {
Listen string `json:"listen"`
DataDir string `json:"data_dir"`
// PublicURL is the address you open Nurse at, such as https://notes.example.com. The sign-in
// PublicURL is the address you open Mako at, such as https://notes.example.com. The sign-in
// redirect is PublicURL + /auth/callback.
PublicURL string `json:"public_url"`
OIDC OIDC `json:"oidc"`
@@ -61,7 +61,7 @@ func (c *Config) Defaults() {
// RedirectURL is the address to enter in Authentik as the redirect URI.
func (c Config) RedirectURL() string { return c.PublicURL + "/auth/callback" }
// Secure says whether Nurse is reached over HTTPS, which decides whether cookies are Secure.
// Secure says whether Mako is reached over HTTPS, which decides whether cookies are Secure.
func (c Config) Secure() bool { return strings.HasPrefix(c.PublicURL, "https://") }
// IsLocal reports whether a URL points at this machine, where plain http is fine.
@@ -81,23 +81,23 @@ func checkURL(name, raw string) error {
return nil
}
// Check says what is still missing before Nurse can sign anyone in, in words a person can act on.
// Check says what is still missing before Mako can sign anyone in, in words a person can act on.
func (c Config) Check() error {
var missing []string
if c.PublicURL == "" {
missing = append(missing, " public_url (NURSE_PUBLIC_URL) where you open Nurse, such as https://notes.example.com")
missing = append(missing, " public_url (MAKO_PUBLIC_URL) where you open Mako, such as https://notes.example.com")
}
if c.OIDC.Issuer == "" {
missing = append(missing, " oidc.issuer (NURSE_OIDC_ISSUER) from Authentik, such as https://auth.example.com/application/o/nurse/")
missing = append(missing, " oidc.issuer (MAKO_OIDC_ISSUER) from Authentik, such as https://auth.example.com/application/o/mako/")
}
if c.OIDC.ClientID == "" {
missing = append(missing, " oidc.client_id (NURSE_OIDC_CLIENT_ID) the Client ID of the Authentik provider")
missing = append(missing, " oidc.client_id (MAKO_OIDC_CLIENT_ID) the Client ID of the Authentik provider")
}
if c.OIDC.ClientSecret == "" {
missing = append(missing, " oidc.client_secret (NURSE_OIDC_CLIENT_SECRET) the Client Secret of the Authentik provider")
missing = append(missing, " oidc.client_secret (MAKO_OIDC_CLIENT_SECRET) the Client Secret of the Authentik provider")
}
if len(missing) > 0 {
return fmt.Errorf("Nurse signs in with Authentik, and these settings are still empty:\n%s\n\nIn Authentik, make an OAuth2/OpenID provider with the redirect URI %s/auth/callback.\nSee the README for the steps", strings.Join(missing, "\n"), orPlaceholder(c.PublicURL))
return fmt.Errorf("Mako signs in with Authentik, and these settings are still empty:\n%s\n\nIn Authentik, make an OAuth2/OpenID provider with the redirect URI %s/auth/callback.\nSee the README for the steps", strings.Join(missing, "\n"), orPlaceholder(c.PublicURL))
}
if err := checkURL("public_url", c.PublicURL); err != nil {
return err
@@ -156,13 +156,13 @@ func (h *Holder) Get() Config {
*to = v
}
}
env("NURSE_LISTEN", &c.Listen)
env("NURSE_DATA", &c.DataDir)
env("NURSE_PUBLIC_URL", &c.PublicURL)
env("NURSE_OIDC_ISSUER", &c.OIDC.Issuer)
env("NURSE_OIDC_CLIENT_ID", &c.OIDC.ClientID)
env("NURSE_OIDC_CLIENT_SECRET", &c.OIDC.ClientSecret)
if v := os.Getenv("NURSE_ALLOWED"); strings.TrimSpace(v) != "" {
env("MAKO_LISTEN", &c.Listen)
env("MAKO_DATA", &c.DataDir)
env("MAKO_PUBLIC_URL", &c.PublicURL)
env("MAKO_OIDC_ISSUER", &c.OIDC.Issuer)
env("MAKO_OIDC_CLIENT_ID", &c.OIDC.ClientID)
env("MAKO_OIDC_CLIENT_SECRET", &c.OIDC.ClientSecret)
if v := os.Getenv("MAKO_ALLOWED"); strings.TrimSpace(v) != "" {
c.Allowed = nil
for _, a := range strings.FieldsFunc(v, func(r rune) bool { return r == ',' || r == ';' || r == '\n' }) {
if a = strings.TrimSpace(a); a != "" {