Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c105d5b3cf | |||
| 713317a4a0 | |||
| f9e3d41c62 | |||
| 895707036a | |||
| 2124d9af00 |
16
dockerfile
Normal file
16
dockerfile
Normal file
@@ -0,0 +1,16 @@
|
||||
FROM golang:1.23.1-alpine3.20 as build
|
||||
|
||||
COPY . /src
|
||||
|
||||
RUN cd /src \
|
||||
&& go build -o retrohub \
|
||||
&& mkdir -p ./fs/var/opt/retrohub \
|
||||
&& mkdir -p ./fs/opt/retrohub \
|
||||
&& cp retrohub ./fs/opt/retrohub/retrohub
|
||||
|
||||
FROM scratch as prod
|
||||
|
||||
COPY --from=build --chmod=755 /src/fs /
|
||||
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT [ "/opt/retrohub/retrohub", "-content", "/var/opt/retrohub/content.json" ]
|
||||
6
go.mod
6
go.mod
@@ -1,8 +1,8 @@
|
||||
module retroHub
|
||||
|
||||
go 1.20
|
||||
go 1.22
|
||||
|
||||
require (
|
||||
github.com/go-chi/chi/v5 v5.0.8
|
||||
github.com/mileusna/useragent v1.3.2
|
||||
github.com/go-chi/chi/v5 v5.1.0
|
||||
github.com/mileusna/useragent v1.3.5
|
||||
)
|
||||
|
||||
8
go.sum
8
go.sum
@@ -1,4 +1,4 @@
|
||||
github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0=
|
||||
github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
|
||||
github.com/mileusna/useragent v1.3.2 h1:yGBQVNkyrlnSe4l0rlaQoH8XlG9xDkc6a7ygwPxALoU=
|
||||
github.com/mileusna/useragent v1.3.2/go.mod h1:3d8TOmwL/5I8pJjyVDteHtgDGcefrFUX4ccGOMKNYYc=
|
||||
github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw=
|
||||
github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
|
||||
github.com/mileusna/useragent v1.3.5 h1:SJM5NzBmh/hO+4LGeATKpaEX9+b4vcGg2qXGLiNGDws=
|
||||
github.com/mileusna/useragent v1.3.5/go.mod h1:3d8TOmwL/5I8pJjyVDteHtgDGcefrFUX4ccGOMKNYYc=
|
||||
|
||||
@@ -2,18 +2,18 @@ package server
|
||||
|
||||
import (
|
||||
"embed"
|
||||
_ "embed"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
"github.com/mileusna/useragent"
|
||||
"html/template"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"retroHub/data"
|
||||
"strings"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
"github.com/mileusna/useragent"
|
||||
)
|
||||
|
||||
type injector struct {
|
||||
@@ -36,7 +36,7 @@ type errorInjector struct {
|
||||
StatusText string
|
||||
}
|
||||
|
||||
const version string = "0.1"
|
||||
const version string = "0.1.1"
|
||||
|
||||
//go:embed templates
|
||||
var templates embed.FS
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<hr/>
|
||||
{{ template "content" . }}
|
||||
<hr/>
|
||||
<p>Retro Hub v{{ .Version }} powered by Go, made by thelilfrog (<a href="https://github.com/mojitaurelie">Github</a>, not available for old systems)</p>
|
||||
<p>Retro Hub v{{ .Version }} powered by Go, made by thelilfrog (<a href="https://git.thelilfrog.com/thelilfrog/retrohub">Source</a>, may not display correctly on older system)</p>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user