Fix Makefile
This commit is contained in:
parent
eb3c1fb32a
commit
b56ce43c80
3 changed files with 11 additions and 5 deletions
4
Makefile
4
Makefile
|
@ -2,7 +2,7 @@ build:
|
|||
go build
|
||||
|
||||
run:
|
||||
go build & ./hibiscus-txt
|
||||
go build && ./hibiscus-txt
|
||||
|
||||
dev:
|
||||
go build & ./hibiscus-txt --config config/dev-config.txt
|
||||
go build && ./hibiscus-txt --config config/dev-config.txt
|
5
TODO.md
5
TODO.md
|
@ -3,13 +3,16 @@ List of things to add to this project
|
|||
|
||||
## Urgent (1.1.5-2.0.0)
|
||||
* `style.css` in config instead of theme (provide themes as examples in repo)
|
||||
* man page, maybe try packaging for fun
|
||||
* Auth improvement so it DOESN'T ASK ME FOR PASSWORD EVERY DAY UGH XD
|
||||
|
||||
## Nice to have
|
||||
* Forward/backward buttons for days
|
||||
* Changelog included
|
||||
* Refactor code
|
||||
* API field for version
|
||||
* Notifications late in the day
|
||||
* man page, maybe try packaging for fun
|
||||
* store passwords as hash
|
||||
|
||||
## Brainstorming
|
||||
Don't expect any of this, these are ideas floating inside my head
|
||||
|
|
|
@ -3,7 +3,6 @@ package main
|
|||
import (
|
||||
"embed"
|
||||
"errors"
|
||||
"github.com/go-chi/chi/v5"
|
||||
"html/template"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
|
@ -11,6 +10,8 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
)
|
||||
|
||||
type EntryList struct {
|
||||
|
@ -56,6 +57,7 @@ var viewTemplate = template.Must(template.New("").Funcs(templateFuncs).ParseFS(P
|
|||
var listTemplate = template.Must(template.New("").Funcs(templateFuncs).ParseFS(Pages, "pages/base.html", "pages/list.html"))
|
||||
|
||||
var template404 = template.Must(template.New("404").Funcs(templateFuncs).ParseFS(Pages, "pages/error/404.html"))
|
||||
|
||||
// NotFound returns a user-friendly 404 error page.
|
||||
func NotFound(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(404)
|
||||
|
@ -69,12 +71,13 @@ func NotFound(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
var template500 = template.Must(template.New("500").Funcs(templateFuncs).ParseFS(Pages, "pages/error/500.html"))
|
||||
|
||||
// InternalError returns a user-friendly 500 error page.
|
||||
func InternalError(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(500)
|
||||
|
||||
err := template500.Execute(w, nil)
|
||||
if err != nil { // Well this is awkward
|
||||
if err != nil { // Well this is awkward
|
||||
slog.Error("error rendering error 500 page", "error", err)
|
||||
HandleWrite(w.Write([]byte("500. Something went *very* wrong.")))
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue