Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sorokinmax committed Dec 29, 2023
1 parent f4295e5 commit b34ac0f
Show file tree
Hide file tree
Showing 882 changed files with 473,030 additions and 47,293 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@

# Go workspace file
go.work
cmd/astore/apk.db
cmd/astore/data/apk.db
cmd/astore/apps/*
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
## Build stage
##
FROM golang:1.21.5-alpine3.19 AS build
RUN apk update && apk upgrade
RUN apk update && apk upgrade&& \
apk add --no-cache git gcc g++ musl-dev
COPY . /src
WORKDIR /src

RUN GOOS=linux go build -o /astore .
RUN GOOS=linux CGO_ENABLED=1 go build -o /astore ./cmd/astore/

##
## Final image stage
Expand All @@ -21,4 +22,4 @@ COPY --from=build /src/cmd/astore/data /astore/data
RUN mkdir -p /astore/apps && mkdir -p /astore/tmp

EXPOSE 80
ENTRYPOINT ["/astore"]
ENTRYPOINT ["/astore/astore"]
8 changes: 3 additions & 5 deletions cmd/astore/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"android-store/internal/api"
"android-store/internal/db"
"android-store/internal/globals"
"android-store/internal/middleware"
models "android-store/internal/models/apk"
"fmt"
"log"
Expand All @@ -20,7 +19,6 @@ import (
"github.com/foolin/goview/supports/ginview"
"github.com/gin-gonic/contrib/static"
"github.com/gin-gonic/gin"
"github.com/sorokinmax/websspi"
)

func init() {
Expand Down Expand Up @@ -52,16 +50,16 @@ func main() {
router.Use(sloggin.New(slog.Default()))

router.HTMLRender = ginview.Default()
config := websspi.NewConfig()
auth, _ := websspi.New(config)
//config := websspi.NewConfig()
//auth, _ := websspi.New(config)

//router.Use(MidAuth(auth))
//router.Use(AddUserToCtx())
router.StaticFile("favicon.ico", "./views/favicon.ico")
router.Use(static.Serve("/apps", static.LocalFile("./apps", false)))
router.Use(static.Serve("/icons", static.LocalFile("./icons", false)))
router.GET("/", api.IndexHandler)
router.GET("/admin", middleware.MidAuth(auth), middleware.AddUserToCtx(), api.IndexHandler)
//router.GET("/admin", middleware.MidAuth(auth), middleware.AddUserToCtx(), api.IndexHandler)
router.GET("/app/:id", api.VersionHandler)
router.GET("/qr/:id", api.QRHandler)
router.POST("/remove", api.RemoveHandler)
Expand Down
44 changes: 25 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,44 @@ require (
github.com/fatih/color v1.16.0
github.com/fogleman/gg v1.3.0
github.com/foolin/goview v0.3.0
github.com/gin-gonic/contrib v0.0.0-20201101042839-6a891bf89f19
github.com/gin-gonic/gin v1.7.7
github.com/sorokinmax/websspi v1.0.2
github.com/gin-gonic/contrib v0.0.0-20221130124618-7e01895a63f2
github.com/gin-gonic/gin v1.9.1
gorm.io/driver/sqlite v1.5.4
gorm.io/gorm v1.25.5
)

require (
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect
github.com/bytedance/sonic v1.10.2 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-playground/validator/v10 v10.10.1 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.16.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/gorilla/sessions v1.2.1 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.16.6 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-sqlite3 v1.14.17 // indirect
github.com/mattn/go-sqlite3 v1.14.19 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/ugorji/go/codec v1.2.7 // indirect
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd // indirect
golang.org/x/image v0.0.0-20220302094943-723b81ca9867 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/arch v0.6.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/image v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit b34ac0f

Please sign in to comment.