3
0

Fixed federation uri node generation

This commit is contained in:
Peter Grlica
2022-05-25 08:45:28 +02:00
parent 17406362dd
commit fb5b0b59f8
3 changed files with 5 additions and 3 deletions

View File

@@ -517,6 +517,7 @@ func (app *CortezaApp) InitServices(ctx context.Context) (err error) {
err = fedService.Initialize(ctx, app.Log, app.Store, fedService.Config{
ActionLog: app.Opt.ActionLog,
Federation: app.Opt.Federation,
Server: app.Opt.HTTPServer,
})
if err != nil {

View File

@@ -58,7 +58,7 @@ type (
}
)
func Node(s store.Storer, u service.UserService, al actionlog.Recorder, th tokenIssuer, options options.FederationOpt, ac nodeAccessController) *node {
func Node(s store.Storer, u service.UserService, al actionlog.Recorder, th tokenIssuer, options options.FederationOpt, sopt options.HttpServerOpt, ac nodeAccessController) *node {
return &node{
store: s,
sysUser: u,
@@ -68,8 +68,7 @@ func Node(s store.Storer, u service.UserService, al actionlog.Recorder, th token
name: options.Label,
host: options.Host,
// @todo use HTTP_API_BASE_URL (HttpServerOpt.ApiBaseUrl) to prefix URI path
baseURL: "/federation",
baseURL: fmt.Sprintf("%s/federation", strings.TrimRight(sopt.ApiBaseUrl, "/")),
handshaker: HttpHandshake(http.DefaultClient),
}

View File

@@ -24,6 +24,7 @@ type (
ActionLog options.ActionLogOpt
Storage options.ObjectStoreOpt
Federation options.FederationOpt
Server options.HttpServerOpt
}
)
@@ -99,6 +100,7 @@ func Initialize(_ context.Context, log *zap.Logger, s store.Storer, c Config) (e
)
},
c.Federation,
c.Server,
DefaultAccessControl,
)
DefaultNodeSync = NodeSync()