Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/cmd/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@ var gatewaySystemdInstallCmd = &cobra.Command{
util.HandleError(err, "Unable to parse domain flag")
}

if domain != "" {
config.INFISICAL_URL = util.AppendAPIEndpoint(domain)
}

gatewayName, err := cmd.Flags().GetString("name")
if err != nil {
util.HandleError(err, "Unable to parse name flag")
Expand Down
6 changes: 6 additions & 0 deletions packages/gateway-v2/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/Infisical/infisical-merge/packages/api"
"github.com/Infisical/infisical-merge/packages/pam"
"github.com/Infisical/infisical-merge/packages/pam/session"
"github.com/Infisical/infisical-merge/packages/systemd"
"github.com/Infisical/infisical-merge/packages/util"
"github.com/go-resty/resty/v2"
"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -107,6 +108,7 @@ type Gateway struct {
cancel context.CancelFunc
heartbeatStarted bool
heartbeatMu sync.Mutex
notifyOnce sync.Once
}

// NewGateway creates a new gateway instance
Expand Down Expand Up @@ -313,6 +315,10 @@ func (g *Gateway) connectWithRetry(ctx context.Context, errCh chan error) error

g.startHeartbeatOnce(ctx, errCh)

g.notifyOnce.Do(func() {
systemd.SdNotify(false, systemd.SdNotifyReady)
})

log.Info().Msgf("Relay connection established for gateway")
return g.handleConnection(client)
}
Expand Down
3 changes: 3 additions & 0 deletions packages/relay/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"time"

"github.com/Infisical/infisical-merge/packages/api"
"github.com/Infisical/infisical-merge/packages/systemd"
"github.com/Infisical/infisical-merge/packages/util"
"github.com/go-resty/resty/v2"
"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -188,6 +189,8 @@ func (r *Relay) Start(ctx context.Context) error {

log.Info().Msg("Relay server started successfully")

systemd.SdNotify(false, systemd.SdNotifyReady)

// Wait for context cancellation
<-ctx.Done()

Expand Down
Loading