@@ -101,7 +101,6 @@ type Options struct {
101101 Clock quartz.Clock
102102 SocketServerEnabled bool
103103 SocketPath string // Path for the agent socket server socket
104- BoundaryLogSocket string // Path for the boundary audit log socket
105104}
106105
107106type Client interface {
@@ -209,7 +208,6 @@ func New(options Options) Agent {
209208 containerAPIOptions : options .DevcontainerAPIOptions ,
210209 socketPath : options .SocketPath ,
211210 socketServerEnabled : options .SocketServerEnabled ,
212- boundaryLogSocket : options .BoundaryLogSocket ,
213211 }
214212 // Initially, we have a closed channel, reflecting the fact that we are not initially connected.
215213 // Each time we connect we replace the channel (while holding the closeMutex) with a new one
@@ -293,7 +291,6 @@ type agent struct {
293291 socketServerEnabled bool
294292 socketPath string
295293 socketServer * agentsocket.Server
296- boundaryLogSocket string
297294}
298295
299296func (a * agent ) TailnetConn () * tailnet.Conn {
@@ -400,25 +397,23 @@ func (a *agent) initSocketServer() {
400397 a .logger .Debug (a .hardCtx , "socket server started" , slog .F ("path" , a .socketPath ))
401398}
402399
403- // startBoundaryLogProxyServer starts the boundary log proxy socket server if
404- // configured via the --boundary-log-socket flag or CODER_AGENT_BOUNDARY_LOG_SOCKET
405- // env var.
406- func (a * agent ) startBoundaryLogProxyServer () {
407- if a .boundaryLogSocket == "" {
408- return
409- }
400+ // boundaryAuditSocketPath is the well-known path for the boundary audit log socket.
401+ // Boundary connects to this socket to send audit logs to the agent.
402+ const boundaryAuditSocketPath = "/tmp/boundary-audit.sock"
410403
411- proxy := boundarylogproxy .NewServer (a .logger , a .boundaryLogSocket )
404+ // startBoundaryLogProxyServer starts the boundary log proxy socket server.
405+ // The socket is always created at the well-known path so boundary can connect.
406+ func (a * agent ) startBoundaryLogProxyServer () {
407+ proxy := boundarylogproxy .NewServer (a .logger , boundaryAuditSocketPath )
412408 if err := proxy .Start (a .hardCtx ); err != nil {
413409 a .logger .Warn (a .hardCtx , "failed to start boundary log proxy" , slog .Error (err ))
414410 return
415411 }
416412
417413 a .boundaryLogProxy = proxy
418414 a .logger .Info (a .hardCtx , "boundary log proxy server started" ,
419- slog .F ("socket_path" , a . boundaryLogSocket ))
415+ slog .F ("socket_path" , boundaryAuditSocketPath ))
420416}
421-
422417// forwardBoundaryLogs forwards buffered boundary audit logs to coderd.
423418// This is called via startAgentAPI to ensure the API client is always current.
424419func (a * agent ) forwardBoundaryLogs (ctx context.Context , aAPI proto.DRPCAgentClient27 ) error {
0 commit comments