Skip to content

Commit

Permalink
fix: support http2 (#56)
Browse files Browse the repository at this point in the history
* fix: support http2

* fix: resolve new public ip
  • Loading branch information
hysyeah authored Dec 2, 2024
1 parent 2ff744e commit 9b0d947
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
27 changes: 13 additions & 14 deletions cmd/apiserver/app/watch_entrance_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,15 @@ func reconcile(ctx context.Context, terminusName constants.TerminusName, zone st
}
log.Debugf("got current public ip: %s", publicIp)

if publicIp == publicDomainIp {
log.Info("public ip no changed")
return nil
}
if err = cm.AddDNSRecord(&publicIp, nil, nil); err != nil {
return errors.WithStack(err)
if publicIp != publicDomainIp {
if err = cm.AddDNSRecord(&publicIp, nil, nil); err != nil {
return errors.WithStack(err)
}
userPatches = append(userPatches, func(u *iamV1alpha2.User) {
u.Annotations[constants.UserAnnotationPublicDomainIp] = publicIp
})
log.Infof("resolved new public ip: %v", publicIp)
}
userPatches = append(userPatches, func(u *iamV1alpha2.User) {
u.Annotations[constants.UserAnnotationPublicDomainIp] = publicIp
})
log.Infof("resolved new public ip: %v", publicIp)
}

// nat gateway ip
Expand Down Expand Up @@ -149,10 +147,6 @@ func reconcile(ctx context.Context, terminusName constants.TerminusName, zone st
u.Annotations[constants.UserAnnotationLocalDomainIp] = *newLocalIp
})

if err = op.UpdateUser(user, userPatches); err != nil {
return errors.WithStack(err)
}

log.Infof("resolved new local ip: %s", *newLocalIp)

if isCloudFlareTunnel {
Expand Down Expand Up @@ -203,6 +197,11 @@ func reconcile(ctx context.Context, terminusName constants.TerminusName, zone st
}
}
}
if len(userPatches) > 0 {
if err = op.UpdateUser(user, userPatches); err != nil {
return errors.WithStack(err)
}
}

return
}
Expand Down
2 changes: 1 addition & 1 deletion internal/ingress/controllers/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ func NewDefault() Configuration {
WorkerShutdownTimeout: "240s",
VariablesHashBucketSize: 256,
VariablesHashMaxSize: 2048,
UseHTTP2: false,
UseHTTP2: true,
BindAddressIpv4: defBindAddress,
BindAddressIpv6: defBindAddress,
DefaultType: "text/html",
Expand Down

0 comments on commit 9b0d947

Please sign in to comment.