* fix: [ocisdev-1433] fix public share, add The grpc clients keepalive and more (#13020) * fix: the public share configuration and fixed graceful shutdown * fix: [OCISDEV-1433] remove GRPC_MAX_CONNECTION_AGE The setting closed healthy grpc connections on a timer so that clients would redo their DNS lookup. It never helped against the failure it was reached for - a connection whose peer stopped answering - because the age limit is enforced by the server, the grace period was left at infinity so a request already in flight was never ended, and any value without a unit suffix silently disabled it again. Detecting a peer that stops answering is now the job of the grpc clients, which ping the peer while a request is in flight. The servers here got the matching enforcement policy so they accept those pings; the client side arrives with the next reva bump. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix: Added the new variable OCDAV_DISABLE_PROPFIND_PUBLIC_LINK_RESOLUTION that disable the resolution of public link shares when answering PROPFIND requests. * chore: bump reva * fix: The keepalive added to grpc clinet * chore: bump reva * build(deps): bump go 1.26.8, grpc-go dependency --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> * chore: bump pnpm dependencies * fix: avoid go vet false positive in userlog conversion.go The go.mod bump to go 1.26.8 made go vet flag loadTemplates' calls to t.Get(nt.Subject/nt.Message) as non-constant format strings, breaking the build for services/userlog/pkg/service. These are translation lookup keys, not printf format strings, so route the call through a local func value to defeat vet's static trace. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
81 lines
2.1 KiB
Go
81 lines
2.1 KiB
Go
package defaults
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/owncloud/ocis/v2/ocis-pkg/structs"
|
|
"github.com/owncloud/ocis/v2/services/policies/pkg/config"
|
|
)
|
|
|
|
// FullDefaultConfig returns a fully initialized default configuration which is needed for doc generation.
|
|
func FullDefaultConfig() *config.Config {
|
|
cfg := DefaultConfig()
|
|
EnsureDefaults(cfg)
|
|
Sanitize(cfg)
|
|
return cfg
|
|
}
|
|
|
|
// DefaultConfig returns the default config
|
|
func DefaultConfig() *config.Config {
|
|
return &config.Config{
|
|
Service: config.Service{
|
|
Name: "policies",
|
|
},
|
|
Debug: config.Debug{
|
|
Addr: "127.0.0.1:9129",
|
|
Token: "",
|
|
Pprof: false,
|
|
Zpages: false,
|
|
},
|
|
GRPC: config.GRPC{
|
|
Addr: "127.0.0.1:9125",
|
|
Namespace: "com.owncloud.api",
|
|
},
|
|
Events: config.Events{
|
|
Endpoint: "127.0.0.1:9233",
|
|
Cluster: "ocis-cluster",
|
|
EnableTLS: false,
|
|
},
|
|
Engine: config.Engine{
|
|
Timeout: 10 * time.Second,
|
|
},
|
|
}
|
|
}
|
|
|
|
func EnsureDefaults(cfg *config.Config) {
|
|
if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil {
|
|
cfg.Log = &config.Log{
|
|
Level: cfg.Commons.Log.Level,
|
|
Pretty: cfg.Commons.Log.Pretty,
|
|
Color: cfg.Commons.Log.Color,
|
|
File: cfg.Commons.Log.File,
|
|
}
|
|
} else if cfg.Log == nil {
|
|
cfg.Log = &config.Log{}
|
|
}
|
|
|
|
if cfg.GRPCClientTLS == nil && cfg.Commons != nil {
|
|
cfg.GRPCClientTLS = structs.CopyOrZeroValue(cfg.Commons.GRPCClientTLS)
|
|
}
|
|
if cfg.GRPCClientOptions == nil && cfg.Commons != nil {
|
|
cfg.GRPCClientOptions = structs.CopyOrZeroValue(cfg.Commons.GRPCClientOptions)
|
|
}
|
|
if cfg.GRPC.TLS == nil && cfg.Commons != nil {
|
|
cfg.GRPC.TLS = structs.CopyOrZeroValue(cfg.Commons.GRPCServiceTLS)
|
|
}
|
|
|
|
// provide with defaults for shared tracing, since we need a valid destination address for "envdecode".
|
|
if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil {
|
|
cfg.Tracing = &config.Tracing{
|
|
Enabled: cfg.Commons.Tracing.Enabled,
|
|
Type: cfg.Commons.Tracing.Type,
|
|
Endpoint: cfg.Commons.Tracing.Endpoint,
|
|
Collector: cfg.Commons.Tracing.Collector,
|
|
}
|
|
} else if cfg.Tracing == nil {
|
|
cfg.Tracing = &config.Tracing{}
|
|
}
|
|
}
|
|
|
|
func Sanitize(_ *config.Config) {}
|