🐛 Bug fixes on server register

This commit is contained in:
LittleSheep 2024-06-22 21:17:31 +08:00
parent 93b924d0a4
commit f327a27714
3 changed files with 4 additions and 3 deletions

2
go.mod
View File

@ -3,7 +3,7 @@ module git.solsynth.dev/hydrogen/paperclip
go 1.21.6
require (
git.solsynth.dev/hydrogen/passport v0.0.0-20240622050421-7007cda8f210
git.solsynth.dev/hydrogen/passport v0.0.0-20240622131052-18ae5f12e2e7
github.com/go-playground/validator/v10 v10.17.0
github.com/gofiber/fiber/v2 v2.52.4
github.com/golang-jwt/jwt/v5 v5.2.0

2
go.sum
View File

@ -1,5 +1,7 @@
git.solsynth.dev/hydrogen/passport v0.0.0-20240622050421-7007cda8f210 h1:DM4AVhG/l3cOfmhA5IDFgn120BL2PEATnPQDtINIS/Q=
git.solsynth.dev/hydrogen/passport v0.0.0-20240622050421-7007cda8f210/go.mod h1:XTNEOv75sZI52sNgpum7Z/tgYmlRcHfK7VdhyV7kc0w=
git.solsynth.dev/hydrogen/passport v0.0.0-20240622131052-18ae5f12e2e7 h1:4zoeDzrAY9/C9RaXsfv7vDE0cC/j94IR1vVpIQEEB6A=
git.solsynth.dev/hydrogen/passport v0.0.0-20240622131052-18ae5f12e2e7/go.mod h1:tUr7x1v0trG3ALDacdDuhJiPRPgFhJ1Si9OqNlYbgSk=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=

View File

@ -18,11 +18,10 @@ func Register() error {
return err
}
httpBind := strings.SplitN(viper.GetString("bind"), ":", 2)
grpcBind := strings.SplitN(viper.GetString("grpc_bind"), ":", 2)
outboundIp, _ := GetOutboundIP()
port, _ := strconv.Atoi(httpBind[1])
port, _ := strconv.Atoi(grpcBind[1])
registration := new(api.AgentServiceRegistration)
registration.ID = viper.GetString("id")