Fixes
This commit is contained in:
parent
0a292ab8a9
commit
1dc3e04f11
7 changed files with 13 additions and 23 deletions
12
Makefile
12
Makefile
|
|
@ -2,13 +2,13 @@
|
|||
benchmark:
|
||||
go test -bench=.
|
||||
|
||||
.PHONY: build-docker
|
||||
build-docker:
|
||||
docker build --platform linux/amd64 . -t quineglobal/hyper-quineglobal-com
|
||||
.PHONY: build
|
||||
build:
|
||||
docker build --platform linux/amd64 . -t forge.quinefoundation.com/ironmagma/hyper-quineglobal-com
|
||||
|
||||
.PHONY: push-docker
|
||||
push-docker: build-docker
|
||||
docker push quineglobal/hyper-quineglobal-com
|
||||
.PHONY: push
|
||||
push: build
|
||||
docker push forge.quinefoundation.com/ironmagma/hyper-quineglobal-com
|
||||
|
||||
.PHONY: cover
|
||||
cover:
|
||||
|
|
|
|||
|
|
@ -36,8 +36,7 @@ func start(log *slog.Logger) error {
|
|||
|
||||
// Set up the HTTP server, injecting the database and logger
|
||||
s := http.NewServer(http.NewServerOptions{
|
||||
Log: log,
|
||||
PostmarkToken: os.Getenv("POSTMARK_SERVER_TOKEN"),
|
||||
Log: log,
|
||||
})
|
||||
|
||||
// Use an errgroup to wait for separate goroutines which can error
|
||||
|
|
|
|||
5
go.mod
5
go.mod
|
|
@ -11,7 +11,4 @@ require (
|
|||
maragu.dev/is v0.2.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
github.com/mrz1836/postmark v1.9.2 // indirect
|
||||
)
|
||||
require github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||
|
|
|
|||
2
go.sum
2
go.sum
|
|
@ -4,8 +4,6 @@ github.com/maragudk/is v0.1.0 h1:obq9anZNmOYcaNbeT0LMyjIexdNeYTw/TLAPD/BnZHA=
|
|||
github.com/maragudk/is v0.1.0/go.mod h1:W/r6+TpnISu+a88OLXQy5JQGCOhXQXXLD2e5b4xMn5c=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/mrz1836/postmark v1.9.2 h1:uzF2vp9c23JdwGBv1KL83X1YesjDMGvuieZgeUsmDFM=
|
||||
github.com/mrz1836/postmark v1.9.2/go.mod h1:FGjqkTsuJsTWt8TQqjdB+H7qa31u169LFupMOxCmGrc=
|
||||
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
|
||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
maragu.dev/env v0.2.0 h1:nQKitDEB65ArZsh6E7vxzodOqY9bxEVFdBg+tskS1ys=
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ func stableSection(stable []Release, dl DownloadProps) Node {
|
|||
Text("Recommended"),
|
||||
),
|
||||
H2(Class("mt-1 font-mono text-xl font-bold text-white"),
|
||||
Text("Quine Hyper v"+latest.Version),
|
||||
Text("Quine Hyper v"+latest.DisplayVersion()),
|
||||
),
|
||||
P(Class("mt-1 font-mono text-xs text-zinc-500"),
|
||||
Text(latest.Date+" · "+platformLabel(dl.SelectedOS, dl.SelectedArch)+fileExt(dl.SelectedOS)),
|
||||
|
|
@ -213,7 +213,7 @@ func canarySection(canary []Release, dl DownloadProps) Node {
|
|||
Text("Latest Canary"),
|
||||
),
|
||||
H2(Class("mt-1 font-mono text-xl font-bold text-white"),
|
||||
Text("Quine Hyper v"+latest.Version),
|
||||
Text("Quine Hyper v"+latest.DisplayVersion()),
|
||||
),
|
||||
P(Class("mt-1 font-mono text-xs text-zinc-500"),
|
||||
Text(latest.Date+" · "+platformLabel(dl.SelectedOS, dl.SelectedArch)+fileExt(dl.SelectedOS)),
|
||||
|
|
@ -267,7 +267,7 @@ func releaseRows(releases []Release, dl DownloadProps, linkCls string) []Node {
|
|||
}
|
||||
nodes[i] = Div(Class("flex items-center justify-between px-5 py-4"),
|
||||
Div(Class("flex items-center gap-4"),
|
||||
Span(Class("font-mono text-sm font-semibold text-white"), Text("v"+r.Version)),
|
||||
Span(Class("font-mono text-sm font-semibold text-white"), Text("v"+r.DisplayVersion())),
|
||||
Span(Class("font-mono text-xs text-zinc-500"), Text(r.Date)),
|
||||
),
|
||||
link,
|
||||
|
|
@ -10,7 +10,6 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/mrz1836/postmark"
|
||||
)
|
||||
|
||||
// Server holds dependencies for the HTTP server as well as the HTTP server itself.
|
||||
|
|
@ -18,13 +17,11 @@ type Server struct {
|
|||
log *slog.Logger
|
||||
mux chi.Router
|
||||
server *http.Server
|
||||
postmark *postmark.Client
|
||||
releases *ReleaseCache
|
||||
}
|
||||
|
||||
type NewServerOptions struct {
|
||||
Log *slog.Logger
|
||||
PostmarkToken string
|
||||
Log *slog.Logger
|
||||
}
|
||||
|
||||
func NewServer(opts NewServerOptions) *Server {
|
||||
|
|
@ -37,7 +34,6 @@ func NewServer(opts NewServerOptions) *Server {
|
|||
return &Server{
|
||||
log: opts.Log,
|
||||
mux: mux,
|
||||
postmark: postmark.NewClient(opts.PostmarkToken, ""),
|
||||
releases: &ReleaseCache{log: opts.Log},
|
||||
server: &http.Server{
|
||||
Addr: ":8081",
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue