Rename project from TopDeck to Canon
- Module github.com/cdnutter/canon, binary/command cmd/canon, Docker image and compose project "canon" - Environment variables now use the CANON_ prefix - Default site title is "<Your name>'s Canon" (or "Canon" with no name); a Site title set in Settings still overrides it - Existing topdeck.db (and WAL files) is renamed to canon.db on start - README: upgrade notes, including moving the old compose volume Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
58a29b7339
commit
3923444b3b
26 files changed
+215
-120
No files matched your search
@@ -1,4 +1,4 @@
|
||||
// Command topdeck serves a personal, self-hosted collection of ranked
|
||||
// Command canon serves a personal, self-hosted collection of ranked
|
||||
// favorites.
|
||||
package main
|
||||
|
||||
@@ -16,12 +16,12 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/cdnutter/topdeck/internal/auth"
|
||||
"github.com/cdnutter/topdeck/internal/config"
|
||||
"github.com/cdnutter/topdeck/internal/imgcache"
|
||||
"github.com/cdnutter/topdeck/internal/providers"
|
||||
"github.com/cdnutter/topdeck/internal/server"
|
||||
"github.com/cdnutter/topdeck/internal/store"
|
||||
"github.com/cdnutter/canon/internal/auth"
|
||||
"github.com/cdnutter/canon/internal/config"
|
||||
"github.com/cdnutter/canon/internal/imgcache"
|
||||
"github.com/cdnutter/canon/internal/providers"
|
||||
"github.com/cdnutter/canon/internal/server"
|
||||
"github.com/cdnutter/canon/internal/store"
|
||||
)
|
||||
|
||||
// version is set at build time with -ldflags "-X main.version=…".
|
||||
@@ -29,7 +29,7 @@ var version = "dev"
|
||||
|
||||
func main() {
|
||||
level := slog.LevelInfo
|
||||
if strings.EqualFold(os.Getenv("TOPDECK_LOG_LEVEL"), "debug") {
|
||||
if strings.EqualFold(os.Getenv("CANON_LOG_LEVEL"), "debug") {
|
||||
level = slog.LevelDebug
|
||||
}
|
||||
log := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{Level: level}))
|
||||
@@ -92,7 +92,7 @@ func run(log *slog.Logger) error {
|
||||
}
|
||||
errc := make(chan error, 1)
|
||||
go func() {
|
||||
log.Info("TopDeck is running", "addr", cfg.ListenAddr, "data", cfg.DataDir, "version", version)
|
||||
log.Info("Canon is running", "addr", cfg.ListenAddr, "data", cfg.DataDir, "version", version)
|
||||
errc <- httpSrv.ListenAndServe()
|
||||
}()
|
||||
select {
|
||||
@@ -119,7 +119,7 @@ func bootstrapAdmin(ctx context.Context, cfg config.Config, st *store.Store, srv
|
||||
}
|
||||
if cfg.AdminUsername != "" && cfg.AdminPassword != "" {
|
||||
if len(cfg.AdminPassword) < auth.MinPasswordLength {
|
||||
return fmt.Errorf("TOPDECK_ADMIN_PASSWORD must be at least %d characters", auth.MinPasswordLength)
|
||||
return fmt.Errorf("CANON_ADMIN_PASSWORD must be at least %d characters", auth.MinPasswordLength)
|
||||
}
|
||||
hash, err := auth.HashPassword(cfg.AdminPassword)
|
||||
if err != nil {
|
||||
Reference in new issue
Block a user