diff --git a/pages/assets/style.css b/pages/assets/style.css deleted file mode 100644 index 24323c0..0000000 --- a/pages/assets/style.css +++ /dev/null @@ -1,3 +0,0 @@ -html, body { - color-scheme: light dark; -} diff --git a/pages/edit-otp.go.html b/pages/edit-otp.go.html deleted file mode 100644 index 8525fca..0000000 --- a/pages/edit-otp.go.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - {{.ServiceName}} - - - -
-

{{.ServiceName}}

-
-
-
- - -

- OTP QR code not loading -

-

Raw OTP string: {{.OtpUrl}}

-
- - -
- -
-
- - diff --git a/pages/edit-password.go.html b/pages/edit-password.go.html deleted file mode 100644 index 1ef09c1..0000000 --- a/pages/edit-password.go.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - {{.ServiceName}} - - - -
-

{{.ServiceName}}

-
-
-
-
- - -
-
- - -
-
- - -
- -
-
- - diff --git a/pages/edit.go.html b/pages/edit.go.html deleted file mode 100644 index ef67d3d..0000000 --- a/pages/edit.go.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - {{.ServiceName}} - - - -
-

{{.ServiceName}}

-
-
-
Logged in as: {{.User.Name}} ({{.User.Subject}})
-
-
- -
- - -
-
- - -
-
- - -
-
- - - -
-
- - - -
-
- - - - {{range .ListZoneInfo}} - - {{end}} - - -
-
- - - - {{range .ListLocale}} - - {{end}} - - -
- -
-
- -
-
-
- - diff --git a/pages/header.go.html b/pages/header.go.html deleted file mode 100644 index 55901e6..0000000 --- a/pages/header.go.html +++ /dev/null @@ -1,3 +0,0 @@ -
-

{{.ServiceName}}

-
diff --git a/pages/index-guest.go.html b/pages/index-guest.go.html deleted file mode 100644 index 3d2db8f..0000000 --- a/pages/index-guest.go.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - {{.ServiceName}} - - - - -{{template "header.go.html" .}} -
-
Not logged in
-
-
- -
-
-
- - diff --git a/pages/index.go.html b/pages/index.go.html deleted file mode 100644 index b6e891d..0000000 --- a/pages/index.go.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - {{.ServiceName}} - - - - -{{template "header.go.html" .}} -
-
Logged in as: {{.Auth.UserInfo.name}} ({{.Auth.Subject}})
-
-
- -
-
- {{if .IsAdmin}} -
-
- -
-
- {{end}} - {{if .OtpEnabled}} -
-
- - -
-
- {{else}} -
-
- - - - -
-
- {{end}} -
-
- - -
-
-
- - diff --git a/pages/login-memory.go.html b/pages/login-memory.go.html deleted file mode 100644 index dcb0bc3..0000000 --- a/pages/login-memory.go.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - {{.ServiceName}} - - - - -{{template "header.go.html" .}} -
-
Log in as: {{.LoginName}}
-
-
- -
-
-
-
- - - -
-
-
- - diff --git a/pages/login.go.html b/pages/login.go.html deleted file mode 100644 index 281c22e..0000000 --- a/pages/login.go.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - {{.ServiceName}} - - - - -{{template "header.go.html" .}} -
- {{if eq .Mismatch "1"}} -

Invalid username or password

- {{else if eq .Mismatch "2"}} -

Check your inbox for a verification email

- {{end}} - {{if eq .Source "start"}} -
- -
- - -
- -
- -
-

Enter your email address below to receive an email with instructions on how to reset your password.

-

Please note this only works if your email address is already verified.

-
- - -
- -
- {{else if eq .Source "password"}} -
- - -
- - -
- -
- {{else if eq .Source "otp"}} -
- -
- - -
- -
- {{end}} -
- - diff --git a/pages/manage-apps-create.go.html b/pages/manage-apps-create.go.html deleted file mode 100644 index 95d14c7..0000000 --- a/pages/manage-apps-create.go.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - {{.ServiceName}} - - - - - -{{template "header.go.html" .}} -
-
- -
- -

Create Client Application

-
- - -
- - -
-
- - -
- {{if .IsAdmin}} -
- - -
- {{end}} -
- -
- {{if .IsAdmin}} -
- -
- {{end}} -
- -
- -
-
- - diff --git a/pages/manage-apps-edit.go.html b/pages/manage-apps-edit.go.html deleted file mode 100644 index 50e30a8..0000000 --- a/pages/manage-apps-edit.go.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - {{.ServiceName}} - - - - - -{{template "header.go.html" .}} -
-
- -
- -

Edit Client Application

-
- - - -
- -
-
- - -
-
- - -
- {{if .IsAdmin}} -
- - -
- {{end}} -
- -
- {{if .IsAdmin}} -
- -
- {{end}} -
- -
- -
-
- - -
-
- - diff --git a/pages/manage-apps.go.html b/pages/manage-apps.go.html deleted file mode 100644 index 7a92a65..0000000 --- a/pages/manage-apps.go.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - {{.ServiceName}} - - - - - -{{template "header.go.html" .}} -
-
- -
- - {{if .NewAppSecret}} -
New application secret: {{.NewAppSecret}} for {{.NewAppName}}
- {{end}} - -

Manage Client Applications

-
- -
- {{if eq (len .Apps) 0}} -
No client applications found
- {{else}} - - - - - - - - - - - - - - - {{range .Apps}} - - - - - - - - - - - {{end}} - -
IDNameDomainPermsSSOActiveOwnerActions
{{.Subject}}{{.Name}}{{.Domain}}{{.Perms}}{{.Sso}}{{.Active}}{{.Owner}} -
- - - -
-
- - - - -
-
- {{end}} -
- - diff --git a/pages/manage-users-create.go.html b/pages/manage-users-create.go.html deleted file mode 100644 index d8a0720..0000000 --- a/pages/manage-users-create.go.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - {{.ServiceName}} - - - -
-

{{.ServiceName}}

-
-
-
- -
- -

Create User

-
- - -
- - -
-
- - -
-
- -

Using an `@{{.Namespace}}` email address will automatically verify as it is owned by this login - service.

- -
-
- - -
-
- -
- -
-
- - diff --git a/pages/manage-users-edit.go.html b/pages/manage-users-edit.go.html deleted file mode 100644 index 6b1b47f..0000000 --- a/pages/manage-users-edit.go.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - {{.ServiceName}} - - - - -{{template "header.go.html" .}} -
-
- -
- -

Edit User

-
- - -
- - -
-
- - -
-
- -
- -
-
- - -
-
- - diff --git a/pages/manage-users.go.html b/pages/manage-users.go.html deleted file mode 100644 index 900163d..0000000 --- a/pages/manage-users.go.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - {{.ServiceName}} - - - - -{{template "header.go.html" .}} -
-
- -
- -

Manage Users

- {{if eq (len .Users) 0}} -
No users found, this is definitely a bug.
- {{else}} - - - - - - - - - - - - - - {{range .Users}} - - - - - - - - - - {{end}} - -
SubjectEmailEmail VerifiedRolesLast UpdatedActiveActions
{{.Subject}} - {{if $.EmailShow}} - {{.Email}} - {{else}} - {{emailHide .Email}} - {{end}} - {{.EmailVerified}}{{.Roles}}{{.UpdatedAt}}{{.Active}} -
- - - -
-
- - -
-
-
- - {{if not .EmailShow}} - - {{end}} - -
- {{end}} -
- - diff --git a/pages/oauth-authorize.go.html b/pages/oauth-authorize.go.html deleted file mode 100644 index 62002fc..0000000 --- a/pages/oauth-authorize.go.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - {{.ServiceName}} - - - - -{{template "header.go.html" .}} -
-
-
The application {{.AppName}} wants to access your account ({{.Auth.UserInfo.name}}). It requests the following permissions:
-
-
    - {{range .WantsList}} -
  • {{.}}
  • - {{end}} -
-
-
- - - - - - - - - -
-
Authorizing this action will redirect you to {{.AppDomain}} with access to the permissions requested above.
-
-
- - diff --git a/pages/pages.go b/pages/pages.go deleted file mode 100644 index 7a7f900..0000000 --- a/pages/pages.go +++ /dev/null @@ -1,69 +0,0 @@ -package pages - -import ( - "bytes" - "embed" - _ "embed" - "errors" - "github.com/1f349/lavender/logger" - "github.com/1f349/lavender/utils" - "github.com/1f349/overlapfs" - "html/template" - "io" - "io/fs" - "os" - "path/filepath" -) - -var ( - //go:embed *.go.html assets/*.css - wwwPages embed.FS - wwwTemplates *template.Template - loadOnce utils.Once[error] - cssAssetMap = make(map[string][]byte) -) - -func LoadPages(wd string) error { - return loadOnce.Do(func() (err error) { - var o fs.FS = wwwPages - if wd != "" { - wwwDir := filepath.Join(wd, "www") - err = os.Mkdir(wwwDir, os.ModePerm) - if err != nil && !errors.Is(err, os.ErrExist) { - return err - } - wdFs := os.DirFS(wwwDir) - o = overlapfs.OverlapFS{A: wwwPages, B: wdFs} - } - wwwTemplates, err = template.New("pages").Funcs(template.FuncMap{ - "emailHide": utils.EmailHide, - }).ParseFS(o, "*.go.html") - - glob, err := fs.Glob(o, "assets/*") - if err != nil { - return err - } - for _, i := range glob { - cssAssetMap[i], err = fs.ReadFile(o, i) - if err != nil { - return err - } - } - return nil - }) -} - -func RenderPageTemplate(wr io.Writer, name string, data any) { - err := wwwTemplates.ExecuteTemplate(wr, name+".go.html", data) - if err != nil { - logger.Logger.Warn("Failed to render page", "name", name, "err", err) - } -} - -func RenderCss(name string) io.ReadSeeker { - b, ok := cssAssetMap[name] - if !ok { - return nil - } - return bytes.NewReader(b) -} diff --git a/pages/remove-otp.go.html b/pages/remove-otp.go.html deleted file mode 100644 index 22f5997..0000000 --- a/pages/remove-otp.go.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - {{.ServiceName}} - - - -
-

{{.ServiceName}}

-
-
-
- -
- - -
- -
-
- - diff --git a/pages/reset-password.go.html b/pages/reset-password.go.html deleted file mode 100644 index 97dcebe..0000000 --- a/pages/reset-password.go.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - {{.ServiceName}} - - - -
-

{{.ServiceName}}

-
-
-
- -
- - -
-
- - -
- -
-
- -