Skip to content

Commit

Permalink
update go and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
vintikzzz committed Jan 4, 2025
1 parent 30e3733 commit 20fdbe4
Show file tree
Hide file tree
Showing 377 changed files with 276 additions and 227,326 deletions.
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@ WORKDIR /app
# copy the source files
COPY . .

# enable modules
# ENV GO111MODULE=on

# disable crosscompiling
# disable crosscompiling
ENV CGO_ENABLED=0

# compile linux only
ENV GOOS=linux

# build the binary with debug information removed
RUN go build -mod=vendor -ldflags '-w -s' -a -installsuffix cgo -o server
RUN go build -ldflags '-w -s' -a -installsuffix cgo -o server

FROM scratch

Expand Down
20 changes: 0 additions & 20 deletions cloudbuild.yaml

This file was deleted.

15 changes: 10 additions & 5 deletions configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,32 @@ import (

func configure(app *cli.App) {
app.Flags = []cli.Flag{}
cs.RegisterProbeFlags(app)
s.RegisterWebFlags(app)
app.Flags = cs.RegisterProbeFlags(app.Flags)
app.Flags = s.RegisterWebFlags(app.Flags)
app.Action = run
}

func run(c *cli.Context) error {
var servers []cs.Servable
// Setting ProbeService
probe := cs.NewProbe(c)
defer probe.Close()
if probe != nil {
servers = append(servers, probe)
defer probe.Close()
}

// Setting WebService
web := s.NewWeb(c)
defer web.Close()
servers = append(servers, web)

// Setting ServeService
serve := cs.NewServe(probe, web)
serve := cs.NewServe(servers...)

// And SERVE!
err := serve.Serve()
if err != nil {
log.WithError(err).Error("Got server error")
log.WithError(err).Error("got server error")
}
return err
}
43 changes: 36 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,41 @@
module github.com/webtor-io/external-proxy

go 1.16
go 1.23

require (
github.com/joonix/log v0.0.0-20190524090622-13fe31bbdd7a // indirect
github.com/pkg/errors v0.8.1
github.com/sirupsen/logrus v1.4.2
github.com/urfave/cli v1.22.2
github.com/vincent-petithory/dataurl v0.0.0-20191104211930-d1553a71de50
github.com/webtor-io/common-services v0.0.0-20200102124507-e840419c0302
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.3
github.com/urfave/cli v1.22.16
github.com/vincent-petithory/dataurl v1.0.0
github.com/webtor-io/common-services v0.0.0-20241105172818-f7eb346e94e6
)

require (
github.com/aws/aws-sdk-go v1.55.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/go-pg/migrations/v8 v8.1.0 // indirect
github.com/go-pg/pg/v10 v10.14.0 // indirect
github.com/go-pg/zerochecker v0.2.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/prometheus/client_golang v1.20.5 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.61.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/redis/go-redis/v9 v9.7.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect
github.com/vmihailenco/bufpool v0.1.11 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser v0.1.2 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/sys v0.29.0 // indirect
google.golang.org/protobuf v1.36.1 // indirect
mellium.im/sasl v0.3.2 // indirect
)
242 changes: 212 additions & 30 deletions go.sum

Large diffs are not rendered by default.

28 changes: 16 additions & 12 deletions services/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,25 @@ func NewWeb(c *cli.Context) *Web {
return &Web{host: c.String(WEB_HOST_FLAG), port: c.Int(WEB_PORT_FLAG)}
}

func RegisterWebFlags(c *cli.App) {
c.Flags = append(c.Flags, cli.StringFlag{
Name: WEB_HOST_FLAG,
Usage: "listening host",
Value: "",
})
c.Flags = append(c.Flags, cli.IntFlag{
Name: WEB_PORT_FLAG,
Usage: "http listening port",
Value: 8080,
})
func RegisterWebFlags(f []cli.Flag) []cli.Flag {
return append(f,
cli.StringFlag{
Name: WEB_HOST_FLAG,
Usage: "listening host",
Value: "",
EnvVar: "WEB_HOST",
},
cli.IntFlag{
Name: WEB_PORT_FLAG,
Usage: "http listening port",
Value: 8080,
EnvVar: "WEB_PORT",
},
)
}

func (s *Web) ServeRemote(data string) (io.ReadCloser, string, error) {
u, err := url.Parse(string(data))
u, err := url.Parse(data)
if err != nil {
return nil, "", errors.Wrap(err, "failed to parse url")
}
Expand Down
21 changes: 0 additions & 21 deletions vendor/github.com/cpuguy83/go-md2man/v2/LICENSE.md

This file was deleted.

14 changes: 0 additions & 14 deletions vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go

This file was deleted.

Loading

0 comments on commit 20fdbe4

Please sign in to comment.