From b6ec90ed70da40fd2e739225e5b0c6e84d56eb3c Mon Sep 17 00:00:00 2001 From: riomoo Date: Sun, 25 Jan 2026 17:36:35 -0500 Subject: [PATCH] declaring 1.3.0 Package Release Number better licence image Shrunk image Fixed size MASCOT UPDATE fixed CSS and Added Mascot to main site --- Containerfile.build | 5 ++- Makefile | 2 +- README.md | 14 +++++- app/gopherbook/main.go | 23 +++++++--- .../static/images/favicon/favicon.ico | 3 ++ .../static/images/pngs/CutePose2.png | 3 ++ app/gopherbook/templates/index.html | 43 +++++++++++-------- docs/images/gopherbook-title.png | 3 ++ docs/images/svgs/PIL.svg | 3 ++ scripts-bash/package-release.sh | 2 +- scripts-bash/run.sh | 2 +- 11 files changed, 73 insertions(+), 30 deletions(-) create mode 100644 app/gopherbook/static/images/favicon/favicon.ico create mode 100644 app/gopherbook/static/images/pngs/CutePose2.png create mode 100644 docs/images/gopherbook-title.png create mode 100644 docs/images/svgs/PIL.svg diff --git a/Containerfile.build b/Containerfile.build index f9fab6a..7747181 100644 --- a/Containerfile.build +++ b/Containerfile.build @@ -35,12 +35,15 @@ RUN echo "Building Linux binary..." && \ # Build Windows binary RUN echo "Building Windows binary..." && \ + echo 'IDI_ICON1 ICON "./app/gopherbook/static/images/favicon/favicon.ico"' > gopherbook.rc && \ + x86_64-w64-mingw32-windres gopherbook.rc -o ./app/gopherbook/gopherbook.syso && \ CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc go build \ -a \ -ldflags="-s -w" \ -trimpath \ -o bin/gopherbook-windows.exe ./app/gopherbook && \ - upx --best --ultra-brute bin/gopherbook-windows.exe + upx --best --ultra-brute bin/gopherbook-windows.exe && \ + rm ./app/gopherbook/gopherbook.syso gopherbook.rc # Verify binaries were created RUN ls -lh bin/ && \ diff --git a/Makefile b/Makefile index 11a28fe..797294d 100644 --- a/Makefile +++ b/Makefile @@ -2,4 +2,4 @@ build: go build -o bin/main ./app/gopherbook clean: - rm -rf watch etc library cache + rm -rf watch etc library cache binaries releases diff --git a/README.md b/README.md index 2766fdc..07f9195 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,21 @@ -# Gopherbook – Self-Hosted Comic Library & CBZ/CBT Reader +
+ +Description + +
+ +
+ +## Self-Hosted Comic Library & CBZ/CBT Reader Gopherbook is a lightweight, single-binary, self-hosted web comic reader and library manager written in Go. It is designed for people who want full control over their digital comic collection (CBZ/CBT files), including support for password-protected/encrypted archives, per-user libraries, tagging, automatic organization, and a clean modern reader. +
+ ## License -[![Custom badge](https://img.shields.io/endpoint?style=for-the-badge&url=https%3A%2F%2Fshare.jester-designs.com%2Fview%2Fpil.json)](LICENSE) +[![Custom badge](docs/images/svgs/PIL.svg)](LICENSE) ## Features diff --git a/app/gopherbook/main.go b/app/gopherbook/main.go index 7ed7bae..40b2c65 100644 --- a/app/gopherbook/main.go +++ b/app/gopherbook/main.go @@ -21,6 +21,7 @@ import ( "regexp" "sort" "strings" + "io/fs" "sync" "time" "runtime" @@ -39,6 +40,9 @@ import ( //go:embed templates/index.html var templateFS embed.FS +//go:embed all:static +var staticFS embed.FS + // ComicInfo represents the standard ComicInfo.xml metadata type ComicInfo struct { XMLName xml.Name `xml:"ComicInfo"` @@ -135,6 +139,14 @@ func main() { loadUsers() initWatchFolders() + // Create static sub-filesystem once + staticSubFS, err := fs.Sub(staticFS, "static") + if err != nil { + log.Fatal(fmt.Errorf("failed to create static sub-filesystem: %w", err)) + } + + // Create handlers once and reuse + staticHandler := http.FileServer(http.FS(staticSubFS)) http.HandleFunc("/api/register", handleRegister) http.HandleFunc("/api/login", handleLogin) @@ -154,6 +166,7 @@ func main() { http.HandleFunc("/api/admin/delete-comic/", authMiddleware(handleDeleteComic)) http.HandleFunc("/api/watch-folder", authMiddleware(handleWatchFolder)) http.HandleFunc("/", serveUI) + http.Handle("/static/", http.StripPrefix("/static/", staticHandler)) go func() { for { @@ -1643,7 +1656,7 @@ func handleTags(w http.ResponseWriter, r *http.Request) { } if req.Color == "" { - req.Color = "#1f6feb" + req.Color = "#446B6E" } tagsMutex.Lock() @@ -1832,7 +1845,7 @@ func handleTryKnownPasswords(w http.ResponseWriter, r *http.Request) { tagData.Count++ tags[tag] = tagData } else { - tags[tag] = Tag{Name: tag, Color: "#1f6feb", Count: 1} + tags[tag] = Tag{Name: tag, Color: "#446B6E", Count: 1} } } tagsMutex.Unlock() @@ -1947,7 +1960,7 @@ func handleSetPassword(w http.ResponseWriter, r *http.Request) { tagData.Count++ tags[tag] = tagData } else { - tags[tag] = Tag{Name: tag, Color: "#1f6feb", Count: 1} + tags[tag] = Tag{Name: tag, Color: "#446B6E", Count: 1} } } tagsMutex.Unlock() @@ -2419,7 +2432,7 @@ func processComic(filePath, filename string, modTime time.Time) Comic { tagData.Count++ tags[tag] = tagData } else { - tags[tag] = Tag{Name: tag, Color: "#1f6feb", Count: 1} + tags[tag] = Tag{Name: tag, Color: "#446B6E", Count: 1} } } tagsMutex.Unlock() @@ -2481,7 +2494,7 @@ func loadComicMetadataLazy(comicID string) error { tagData.Count++ tags[tag] = tagData } else { - tags[tag] = Tag{Name: tag, Color: "#1f6feb", Count: 1} + tags[tag] = Tag{Name: tag, Color: "#446B6E", Count: 1} } } tagsMutex.Unlock() diff --git a/app/gopherbook/static/images/favicon/favicon.ico b/app/gopherbook/static/images/favicon/favicon.ico new file mode 100644 index 0000000..c9b5b45 --- /dev/null +++ b/app/gopherbook/static/images/favicon/favicon.ico @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8202e8bb8e72d5a050ec53a218fc7bf9eb0c19c0ce185792788ad56be29f2a25 +size 443814 diff --git a/app/gopherbook/static/images/pngs/CutePose2.png b/app/gopherbook/static/images/pngs/CutePose2.png new file mode 100644 index 0000000..98cd9d1 --- /dev/null +++ b/app/gopherbook/static/images/pngs/CutePose2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e98f5d51fbb1fc335f7640b295e2b6f65eb724bde94e6f760bda277492ce10cd +size 334430 diff --git a/app/gopherbook/templates/index.html b/app/gopherbook/templates/index.html index a501978..b9e422d 100644 --- a/app/gopherbook/templates/index.html +++ b/app/gopherbook/templates/index.html @@ -3,6 +3,7 @@ + Gopherbook