ScuttleBot

fix: gofmt formatting and remove unused presenceLoop from relays

lmata 2026-04-03 22:47 trunk
Commit d924aea3e69d212e85d44ebb30d0a578f696b67e5057b5277d7cd7863d2883dc
--- cmd/claude-relay/main.go
+++ cmd/claude-relay/main.go
@@ -722,27 +722,10 @@
722722
}
723723
}
724724
}
725725
}
726726
727
-func presenceLoop(ctx context.Context, relay sessionrelay.Connector, interval time.Duration) {
728
- if interval <= 0 {
729
- return
730
- }
731
- ticker := time.NewTicker(interval)
732
- defer ticker.Stop()
733
-
734
- for {
735
- select {
736
- case <-ctx.Done():
737
- return
738
- case <-ticker.C:
739
- _ = relay.Touch(ctx)
740
- }
741
- }
742
-}
743
-
744727
func injectMessages(writer io.Writer, cfg config, state *relayState, controlChannel string, batch []message) error {
745728
lines := make([]string, 0, len(batch))
746729
for _, msg := range batch {
747730
text := ircagent.TrimAddressedText(strings.TrimSpace(msg.Text), cfg.Nick)
748731
if text == "" {
749732
--- cmd/claude-relay/main.go
+++ cmd/claude-relay/main.go
@@ -722,27 +722,10 @@
722 }
723 }
724 }
725 }
726
727 func presenceLoop(ctx context.Context, relay sessionrelay.Connector, interval time.Duration) {
728 if interval <= 0 {
729 return
730 }
731 ticker := time.NewTicker(interval)
732 defer ticker.Stop()
733
734 for {
735 select {
736 case <-ctx.Done():
737 return
738 case <-ticker.C:
739 _ = relay.Touch(ctx)
740 }
741 }
742 }
743
744 func injectMessages(writer io.Writer, cfg config, state *relayState, controlChannel string, batch []message) error {
745 lines := make([]string, 0, len(batch))
746 for _, msg := range batch {
747 text := ircagent.TrimAddressedText(strings.TrimSpace(msg.Text), cfg.Nick)
748 if text == "" {
749
--- cmd/claude-relay/main.go
+++ cmd/claude-relay/main.go
@@ -722,27 +722,10 @@
722 }
723 }
724 }
725 }
726
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
727 func injectMessages(writer io.Writer, cfg config, state *relayState, controlChannel string, batch []message) error {
728 lines := make([]string, 0, len(batch))
729 for _, msg := range batch {
730 text := ircagent.TrimAddressedText(strings.TrimSpace(msg.Text), cfg.Nick)
731 if text == "" {
732
--- cmd/codex-relay/main.go
+++ cmd/codex-relay/main.go
@@ -413,27 +413,10 @@
413413
}
414414
}
415415
}
416416
}
417417
418
-func presenceLoop(ctx context.Context, relay sessionrelay.Connector, interval time.Duration) {
419
- if interval <= 0 {
420
- return
421
- }
422
- ticker := time.NewTicker(interval)
423
- defer ticker.Stop()
424
-
425
- for {
426
- select {
427
- case <-ctx.Done():
428
- return
429
- case <-ticker.C:
430
- _ = relay.Touch(ctx)
431
- }
432
- }
433
-}
434
-
435418
func injectMessages(writer io.Writer, cfg config, state *relayState, controlChannel string, batch []message) error {
436419
lines := make([]string, 0, len(batch))
437420
for _, msg := range batch {
438421
text := ircagent.TrimAddressedText(strings.TrimSpace(msg.Text), cfg.Nick)
439422
if text == "" {
440423
--- cmd/codex-relay/main.go
+++ cmd/codex-relay/main.go
@@ -413,27 +413,10 @@
413 }
414 }
415 }
416 }
417
418 func presenceLoop(ctx context.Context, relay sessionrelay.Connector, interval time.Duration) {
419 if interval <= 0 {
420 return
421 }
422 ticker := time.NewTicker(interval)
423 defer ticker.Stop()
424
425 for {
426 select {
427 case <-ctx.Done():
428 return
429 case <-ticker.C:
430 _ = relay.Touch(ctx)
431 }
432 }
433 }
434
435 func injectMessages(writer io.Writer, cfg config, state *relayState, controlChannel string, batch []message) error {
436 lines := make([]string, 0, len(batch))
437 for _, msg := range batch {
438 text := ircagent.TrimAddressedText(strings.TrimSpace(msg.Text), cfg.Nick)
439 if text == "" {
440
--- cmd/codex-relay/main.go
+++ cmd/codex-relay/main.go
@@ -413,27 +413,10 @@
413 }
414 }
415 }
416 }
417
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418 func injectMessages(writer io.Writer, cfg config, state *relayState, controlChannel string, batch []message) error {
419 lines := make([]string, 0, len(batch))
420 for _, msg := range batch {
421 text := ircagent.TrimAddressedText(strings.TrimSpace(msg.Text), cfg.Nick)
422 if text == "" {
423
--- cmd/gemini-relay/main.go
+++ cmd/gemini-relay/main.go
@@ -361,27 +361,10 @@
361361
}
362362
}
363363
}
364364
}
365365
366
-func presenceLoop(ctx context.Context, relay sessionrelay.Connector, interval time.Duration) {
367
- if interval <= 0 {
368
- return
369
- }
370
- ticker := time.NewTicker(interval)
371
- defer ticker.Stop()
372
-
373
- for {
374
- select {
375
- case <-ctx.Done():
376
- return
377
- case <-ticker.C:
378
- _ = relay.Touch(ctx)
379
- }
380
- }
381
-}
382
-
383366
func injectMessages(writer io.Writer, cfg config, state *relayState, controlChannel string, batch []message) error {
384367
lines := make([]string, 0, len(batch))
385368
for _, msg := range batch {
386369
text := ircagent.TrimAddressedText(strings.TrimSpace(msg.Text), cfg.Nick)
387370
if text == "" {
388371
--- cmd/gemini-relay/main.go
+++ cmd/gemini-relay/main.go
@@ -361,27 +361,10 @@
361 }
362 }
363 }
364 }
365
366 func presenceLoop(ctx context.Context, relay sessionrelay.Connector, interval time.Duration) {
367 if interval <= 0 {
368 return
369 }
370 ticker := time.NewTicker(interval)
371 defer ticker.Stop()
372
373 for {
374 select {
375 case <-ctx.Done():
376 return
377 case <-ticker.C:
378 _ = relay.Touch(ctx)
379 }
380 }
381 }
382
383 func injectMessages(writer io.Writer, cfg config, state *relayState, controlChannel string, batch []message) error {
384 lines := make([]string, 0, len(batch))
385 for _, msg := range batch {
386 text := ircagent.TrimAddressedText(strings.TrimSpace(msg.Text), cfg.Nick)
387 if text == "" {
388
--- cmd/gemini-relay/main.go
+++ cmd/gemini-relay/main.go
@@ -361,27 +361,10 @@
361 }
362 }
363 }
364 }
365
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
366 func injectMessages(writer io.Writer, cfg config, state *relayState, controlChannel string, batch []message) error {
367 lines := make([]string, 0, len(batch))
368 for _, msg := range batch {
369 text := ircagent.TrimAddressedText(strings.TrimSpace(msg.Text), cfg.Nick)
370 if text == "" {
371
--- internal/api/policies.go
+++ internal/api/policies.go
@@ -25,15 +25,15 @@
2525
Config map[string]any `json:"config,omitempty"`
2626
}
2727
2828
// AgentPolicy defines requirements applied to all registering agents.
2929
type AgentPolicy struct {
30
- RequireCheckin bool `json:"require_checkin"`
31
- CheckinChannel string `json:"checkin_channel"`
32
- RequiredChannels []string `json:"required_channels"`
33
- OnlineTimeoutSecs int `json:"online_timeout_secs,omitempty"`
34
- ReapAfterDays int `json:"reap_after_days,omitempty"`
30
+ RequireCheckin bool `json:"require_checkin"`
31
+ CheckinChannel string `json:"checkin_channel"`
32
+ RequiredChannels []string `json:"required_channels"`
33
+ OnlineTimeoutSecs int `json:"online_timeout_secs,omitempty"`
34
+ ReapAfterDays int `json:"reap_after_days,omitempty"`
3535
}
3636
3737
// LoggingPolicy configures message logging.
3838
type LoggingPolicy struct {
3939
Enabled bool `json:"enabled"`
4040
--- internal/api/policies.go
+++ internal/api/policies.go
@@ -25,15 +25,15 @@
25 Config map[string]any `json:"config,omitempty"`
26 }
27
28 // AgentPolicy defines requirements applied to all registering agents.
29 type AgentPolicy struct {
30 RequireCheckin bool `json:"require_checkin"`
31 CheckinChannel string `json:"checkin_channel"`
32 RequiredChannels []string `json:"required_channels"`
33 OnlineTimeoutSecs int `json:"online_timeout_secs,omitempty"`
34 ReapAfterDays int `json:"reap_after_days,omitempty"`
35 }
36
37 // LoggingPolicy configures message logging.
38 type LoggingPolicy struct {
39 Enabled bool `json:"enabled"`
40
--- internal/api/policies.go
+++ internal/api/policies.go
@@ -25,15 +25,15 @@
25 Config map[string]any `json:"config,omitempty"`
26 }
27
28 // AgentPolicy defines requirements applied to all registering agents.
29 type AgentPolicy struct {
30 RequireCheckin bool `json:"require_checkin"`
31 CheckinChannel string `json:"checkin_channel"`
32 RequiredChannels []string `json:"required_channels"`
33 OnlineTimeoutSecs int `json:"online_timeout_secs,omitempty"`
34 ReapAfterDays int `json:"reap_after_days,omitempty"`
35 }
36
37 // LoggingPolicy configures message logging.
38 type LoggingPolicy struct {
39 Enabled bool `json:"enabled"`
40
--- internal/bots/auditbot/auditbot.go
+++ internal/bots/auditbot/auditbot.go
@@ -102,15 +102,15 @@
102102
if err != nil {
103103
return fmt.Errorf("auditbot: parse irc addr: %w", err)
104104
}
105105
106106
c := girc.New(girc.Config{
107
- Server: host,
108
- Port: port,
109
- Nick: botNick,
110
- User: botNick,
111
- Name: "scuttlebot auditbot",
107
+ Server: host,
108
+ Port: port,
109
+ Nick: botNick,
110
+ User: botNick,
111
+ Name: "scuttlebot auditbot",
112112
SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
113113
PingDelay: 30 * time.Second,
114114
PingTimeout: 30 * time.Second,
115115
SSL: false,
116116
})
117117
--- internal/bots/auditbot/auditbot.go
+++ internal/bots/auditbot/auditbot.go
@@ -102,15 +102,15 @@
102 if err != nil {
103 return fmt.Errorf("auditbot: parse irc addr: %w", err)
104 }
105
106 c := girc.New(girc.Config{
107 Server: host,
108 Port: port,
109 Nick: botNick,
110 User: botNick,
111 Name: "scuttlebot auditbot",
112 SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
113 PingDelay: 30 * time.Second,
114 PingTimeout: 30 * time.Second,
115 SSL: false,
116 })
117
--- internal/bots/auditbot/auditbot.go
+++ internal/bots/auditbot/auditbot.go
@@ -102,15 +102,15 @@
102 if err != nil {
103 return fmt.Errorf("auditbot: parse irc addr: %w", err)
104 }
105
106 c := girc.New(girc.Config{
107 Server: host,
108 Port: port,
109 Nick: botNick,
110 User: botNick,
111 Name: "scuttlebot auditbot",
112 SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
113 PingDelay: 30 * time.Second,
114 PingTimeout: 30 * time.Second,
115 SSL: false,
116 })
117
--- internal/bots/bridge/bridge.go
+++ internal/bots/bridge/bridge.go
@@ -151,15 +151,15 @@
151151
if err != nil {
152152
return fmt.Errorf("bridge: parse irc addr: %w", err)
153153
}
154154
155155
c := girc.New(girc.Config{
156
- Server: host,
157
- Port: port,
158
- Nick: b.nick,
159
- User: b.nick,
160
- Name: "scuttlebot bridge",
156
+ Server: host,
157
+ Port: port,
158
+ Nick: b.nick,
159
+ User: b.nick,
160
+ Name: "scuttlebot bridge",
161161
SASL: &girc.SASLPlain{User: b.nick, Pass: b.password},
162162
PingDelay: 30 * time.Second,
163163
PingTimeout: 30 * time.Second,
164164
SSL: false,
165165
})
166166
--- internal/bots/bridge/bridge.go
+++ internal/bots/bridge/bridge.go
@@ -151,15 +151,15 @@
151 if err != nil {
152 return fmt.Errorf("bridge: parse irc addr: %w", err)
153 }
154
155 c := girc.New(girc.Config{
156 Server: host,
157 Port: port,
158 Nick: b.nick,
159 User: b.nick,
160 Name: "scuttlebot bridge",
161 SASL: &girc.SASLPlain{User: b.nick, Pass: b.password},
162 PingDelay: 30 * time.Second,
163 PingTimeout: 30 * time.Second,
164 SSL: false,
165 })
166
--- internal/bots/bridge/bridge.go
+++ internal/bots/bridge/bridge.go
@@ -151,15 +151,15 @@
151 if err != nil {
152 return fmt.Errorf("bridge: parse irc addr: %w", err)
153 }
154
155 c := girc.New(girc.Config{
156 Server: host,
157 Port: port,
158 Nick: b.nick,
159 User: b.nick,
160 Name: "scuttlebot bridge",
161 SASL: &girc.SASLPlain{User: b.nick, Pass: b.password},
162 PingDelay: 30 * time.Second,
163 PingTimeout: 30 * time.Second,
164 SSL: false,
165 })
166
--- internal/bots/herald/herald.go
+++ internal/bots/herald/herald.go
@@ -137,15 +137,15 @@
137137
if err != nil {
138138
return fmt.Errorf("herald: parse irc addr: %w", err)
139139
}
140140
141141
c := girc.New(girc.Config{
142
- Server: host,
143
- Port: port,
144
- Nick: botNick,
145
- User: botNick,
146
- Name: "scuttlebot herald",
142
+ Server: host,
143
+ Port: port,
144
+ Nick: botNick,
145
+ User: botNick,
146
+ Name: "scuttlebot herald",
147147
SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
148148
PingDelay: 30 * time.Second,
149149
PingTimeout: 30 * time.Second,
150150
SSL: false,
151151
})
152152
--- internal/bots/herald/herald.go
+++ internal/bots/herald/herald.go
@@ -137,15 +137,15 @@
137 if err != nil {
138 return fmt.Errorf("herald: parse irc addr: %w", err)
139 }
140
141 c := girc.New(girc.Config{
142 Server: host,
143 Port: port,
144 Nick: botNick,
145 User: botNick,
146 Name: "scuttlebot herald",
147 SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
148 PingDelay: 30 * time.Second,
149 PingTimeout: 30 * time.Second,
150 SSL: false,
151 })
152
--- internal/bots/herald/herald.go
+++ internal/bots/herald/herald.go
@@ -137,15 +137,15 @@
137 if err != nil {
138 return fmt.Errorf("herald: parse irc addr: %w", err)
139 }
140
141 c := girc.New(girc.Config{
142 Server: host,
143 Port: port,
144 Nick: botNick,
145 User: botNick,
146 Name: "scuttlebot herald",
147 SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
148 PingDelay: 30 * time.Second,
149 PingTimeout: 30 * time.Second,
150 SSL: false,
151 })
152
--- internal/bots/oracle/oracle.go
+++ internal/bots/oracle/oracle.go
@@ -148,15 +148,15 @@
148148
if err != nil {
149149
return fmt.Errorf("oracle: parse irc addr: %w", err)
150150
}
151151
152152
c := girc.New(girc.Config{
153
- Server: host,
154
- Port: port,
155
- Nick: botNick,
156
- User: botNick,
157
- Name: "scuttlebot oracle",
153
+ Server: host,
154
+ Port: port,
155
+ Nick: botNick,
156
+ User: botNick,
157
+ Name: "scuttlebot oracle",
158158
SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
159159
PingDelay: 30 * time.Second,
160160
PingTimeout: 30 * time.Second,
161161
SSL: false,
162162
})
163163
--- internal/bots/oracle/oracle.go
+++ internal/bots/oracle/oracle.go
@@ -148,15 +148,15 @@
148 if err != nil {
149 return fmt.Errorf("oracle: parse irc addr: %w", err)
150 }
151
152 c := girc.New(girc.Config{
153 Server: host,
154 Port: port,
155 Nick: botNick,
156 User: botNick,
157 Name: "scuttlebot oracle",
158 SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
159 PingDelay: 30 * time.Second,
160 PingTimeout: 30 * time.Second,
161 SSL: false,
162 })
163
--- internal/bots/oracle/oracle.go
+++ internal/bots/oracle/oracle.go
@@ -148,15 +148,15 @@
148 if err != nil {
149 return fmt.Errorf("oracle: parse irc addr: %w", err)
150 }
151
152 c := girc.New(girc.Config{
153 Server: host,
154 Port: port,
155 Nick: botNick,
156 User: botNick,
157 Name: "scuttlebot oracle",
158 SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
159 PingDelay: 30 * time.Second,
160 PingTimeout: 30 * time.Second,
161 SSL: false,
162 })
163
--- internal/bots/scribe/scribe.go
+++ internal/bots/scribe/scribe.go
@@ -52,15 +52,15 @@
5252
if err != nil {
5353
return fmt.Errorf("scribe: parse irc addr: %w", err)
5454
}
5555
5656
c := girc.New(girc.Config{
57
- Server: host,
58
- Port: port,
59
- Nick: botNick,
60
- User: botNick,
61
- Name: "scuttlebot scribe",
57
+ Server: host,
58
+ Port: port,
59
+ Nick: botNick,
60
+ User: botNick,
61
+ Name: "scuttlebot scribe",
6262
SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
6363
PingDelay: 30 * time.Second,
6464
PingTimeout: 30 * time.Second,
6565
SSL: false,
6666
})
6767
--- internal/bots/scribe/scribe.go
+++ internal/bots/scribe/scribe.go
@@ -52,15 +52,15 @@
52 if err != nil {
53 return fmt.Errorf("scribe: parse irc addr: %w", err)
54 }
55
56 c := girc.New(girc.Config{
57 Server: host,
58 Port: port,
59 Nick: botNick,
60 User: botNick,
61 Name: "scuttlebot scribe",
62 SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
63 PingDelay: 30 * time.Second,
64 PingTimeout: 30 * time.Second,
65 SSL: false,
66 })
67
--- internal/bots/scribe/scribe.go
+++ internal/bots/scribe/scribe.go
@@ -52,15 +52,15 @@
52 if err != nil {
53 return fmt.Errorf("scribe: parse irc addr: %w", err)
54 }
55
56 c := girc.New(girc.Config{
57 Server: host,
58 Port: port,
59 Nick: botNick,
60 User: botNick,
61 Name: "scuttlebot scribe",
62 SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
63 PingDelay: 30 * time.Second,
64 PingTimeout: 30 * time.Second,
65 SSL: false,
66 })
67
--- internal/bots/scroll/scroll.go
+++ internal/bots/scroll/scroll.go
@@ -61,15 +61,15 @@
6161
if err != nil {
6262
return fmt.Errorf("scroll: parse irc addr: %w", err)
6363
}
6464
6565
c := girc.New(girc.Config{
66
- Server: host,
67
- Port: port,
68
- Nick: botNick,
69
- User: botNick,
70
- Name: "scuttlebot scroll",
66
+ Server: host,
67
+ Port: port,
68
+ Nick: botNick,
69
+ User: botNick,
70
+ Name: "scuttlebot scroll",
7171
SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
7272
PingDelay: 30 * time.Second,
7373
PingTimeout: 30 * time.Second,
7474
SSL: false,
7575
})
7676
--- internal/bots/scroll/scroll.go
+++ internal/bots/scroll/scroll.go
@@ -61,15 +61,15 @@
61 if err != nil {
62 return fmt.Errorf("scroll: parse irc addr: %w", err)
63 }
64
65 c := girc.New(girc.Config{
66 Server: host,
67 Port: port,
68 Nick: botNick,
69 User: botNick,
70 Name: "scuttlebot scroll",
71 SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
72 PingDelay: 30 * time.Second,
73 PingTimeout: 30 * time.Second,
74 SSL: false,
75 })
76
--- internal/bots/scroll/scroll.go
+++ internal/bots/scroll/scroll.go
@@ -61,15 +61,15 @@
61 if err != nil {
62 return fmt.Errorf("scroll: parse irc addr: %w", err)
63 }
64
65 c := girc.New(girc.Config{
66 Server: host,
67 Port: port,
68 Nick: botNick,
69 User: botNick,
70 Name: "scuttlebot scroll",
71 SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
72 PingDelay: 30 * time.Second,
73 PingTimeout: 30 * time.Second,
74 SSL: false,
75 })
76
--- internal/bots/sentinel/sentinel.go
+++ internal/bots/sentinel/sentinel.go
@@ -132,15 +132,15 @@
132132
if err != nil {
133133
return fmt.Errorf("sentinel: %w", err)
134134
}
135135
136136
c := girc.New(girc.Config{
137
- Server: host,
138
- Port: port,
139
- Nick: b.cfg.Nick,
140
- User: b.cfg.Nick,
141
- Name: "scuttlebot sentinel",
137
+ Server: host,
138
+ Port: port,
139
+ Nick: b.cfg.Nick,
140
+ User: b.cfg.Nick,
141
+ Name: "scuttlebot sentinel",
142142
SASL: &girc.SASLPlain{User: b.cfg.Nick, Pass: b.cfg.Password},
143143
PingDelay: 30 * time.Second,
144144
PingTimeout: 30 * time.Second,
145145
})
146146
147147
--- internal/bots/sentinel/sentinel.go
+++ internal/bots/sentinel/sentinel.go
@@ -132,15 +132,15 @@
132 if err != nil {
133 return fmt.Errorf("sentinel: %w", err)
134 }
135
136 c := girc.New(girc.Config{
137 Server: host,
138 Port: port,
139 Nick: b.cfg.Nick,
140 User: b.cfg.Nick,
141 Name: "scuttlebot sentinel",
142 SASL: &girc.SASLPlain{User: b.cfg.Nick, Pass: b.cfg.Password},
143 PingDelay: 30 * time.Second,
144 PingTimeout: 30 * time.Second,
145 })
146
147
--- internal/bots/sentinel/sentinel.go
+++ internal/bots/sentinel/sentinel.go
@@ -132,15 +132,15 @@
132 if err != nil {
133 return fmt.Errorf("sentinel: %w", err)
134 }
135
136 c := girc.New(girc.Config{
137 Server: host,
138 Port: port,
139 Nick: b.cfg.Nick,
140 User: b.cfg.Nick,
141 Name: "scuttlebot sentinel",
142 SASL: &girc.SASLPlain{User: b.cfg.Nick, Pass: b.cfg.Password},
143 PingDelay: 30 * time.Second,
144 PingTimeout: 30 * time.Second,
145 })
146
147
--- internal/bots/snitch/snitch.go
+++ internal/bots/snitch/snitch.go
@@ -121,15 +121,15 @@
121121
if err != nil {
122122
return fmt.Errorf("snitch: %w", err)
123123
}
124124
125125
c := girc.New(girc.Config{
126
- Server: host,
127
- Port: port,
128
- Nick: b.cfg.Nick,
129
- User: b.cfg.Nick,
130
- Name: "scuttlebot snitch",
126
+ Server: host,
127
+ Port: port,
128
+ Nick: b.cfg.Nick,
129
+ User: b.cfg.Nick,
130
+ Name: "scuttlebot snitch",
131131
SASL: &girc.SASLPlain{User: b.cfg.Nick, Pass: b.cfg.Password},
132132
PingDelay: 30 * time.Second,
133133
PingTimeout: 30 * time.Second,
134134
})
135135
136136
--- internal/bots/snitch/snitch.go
+++ internal/bots/snitch/snitch.go
@@ -121,15 +121,15 @@
121 if err != nil {
122 return fmt.Errorf("snitch: %w", err)
123 }
124
125 c := girc.New(girc.Config{
126 Server: host,
127 Port: port,
128 Nick: b.cfg.Nick,
129 User: b.cfg.Nick,
130 Name: "scuttlebot snitch",
131 SASL: &girc.SASLPlain{User: b.cfg.Nick, Pass: b.cfg.Password},
132 PingDelay: 30 * time.Second,
133 PingTimeout: 30 * time.Second,
134 })
135
136
--- internal/bots/snitch/snitch.go
+++ internal/bots/snitch/snitch.go
@@ -121,15 +121,15 @@
121 if err != nil {
122 return fmt.Errorf("snitch: %w", err)
123 }
124
125 c := girc.New(girc.Config{
126 Server: host,
127 Port: port,
128 Nick: b.cfg.Nick,
129 User: b.cfg.Nick,
130 Name: "scuttlebot snitch",
131 SASL: &girc.SASLPlain{User: b.cfg.Nick, Pass: b.cfg.Password},
132 PingDelay: 30 * time.Second,
133 PingTimeout: 30 * time.Second,
134 })
135
136
--- internal/bots/steward/steward.go
+++ internal/bots/steward/steward.go
@@ -116,15 +116,15 @@
116116
if err != nil {
117117
return fmt.Errorf("steward: %w", err)
118118
}
119119
120120
c := girc.New(girc.Config{
121
- Server: host,
122
- Port: port,
123
- Nick: b.cfg.Nick,
124
- User: b.cfg.Nick,
125
- Name: "scuttlebot steward",
121
+ Server: host,
122
+ Port: port,
123
+ Nick: b.cfg.Nick,
124
+ User: b.cfg.Nick,
125
+ Name: "scuttlebot steward",
126126
SASL: &girc.SASLPlain{User: b.cfg.Nick, Pass: b.cfg.Password},
127127
PingDelay: 30 * time.Second,
128128
PingTimeout: 30 * time.Second,
129129
})
130130
131131
--- internal/bots/steward/steward.go
+++ internal/bots/steward/steward.go
@@ -116,15 +116,15 @@
116 if err != nil {
117 return fmt.Errorf("steward: %w", err)
118 }
119
120 c := girc.New(girc.Config{
121 Server: host,
122 Port: port,
123 Nick: b.cfg.Nick,
124 User: b.cfg.Nick,
125 Name: "scuttlebot steward",
126 SASL: &girc.SASLPlain{User: b.cfg.Nick, Pass: b.cfg.Password},
127 PingDelay: 30 * time.Second,
128 PingTimeout: 30 * time.Second,
129 })
130
131
--- internal/bots/steward/steward.go
+++ internal/bots/steward/steward.go
@@ -116,15 +116,15 @@
116 if err != nil {
117 return fmt.Errorf("steward: %w", err)
118 }
119
120 c := girc.New(girc.Config{
121 Server: host,
122 Port: port,
123 Nick: b.cfg.Nick,
124 User: b.cfg.Nick,
125 Name: "scuttlebot steward",
126 SASL: &girc.SASLPlain{User: b.cfg.Nick, Pass: b.cfg.Password},
127 PingDelay: 30 * time.Second,
128 PingTimeout: 30 * time.Second,
129 })
130
131
--- internal/bots/systembot/systembot.go
+++ internal/bots/systembot/systembot.go
@@ -79,15 +79,15 @@
7979
if err != nil {
8080
return fmt.Errorf("systembot: parse irc addr: %w", err)
8181
}
8282
8383
c := girc.New(girc.Config{
84
- Server: host,
85
- Port: port,
86
- Nick: botNick,
87
- User: botNick,
88
- Name: "scuttlebot systembot",
84
+ Server: host,
85
+ Port: port,
86
+ Nick: botNick,
87
+ User: botNick,
88
+ Name: "scuttlebot systembot",
8989
SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
9090
PingDelay: 30 * time.Second,
9191
PingTimeout: 30 * time.Second,
9292
SSL: false,
9393
})
9494
--- internal/bots/systembot/systembot.go
+++ internal/bots/systembot/systembot.go
@@ -79,15 +79,15 @@
79 if err != nil {
80 return fmt.Errorf("systembot: parse irc addr: %w", err)
81 }
82
83 c := girc.New(girc.Config{
84 Server: host,
85 Port: port,
86 Nick: botNick,
87 User: botNick,
88 Name: "scuttlebot systembot",
89 SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
90 PingDelay: 30 * time.Second,
91 PingTimeout: 30 * time.Second,
92 SSL: false,
93 })
94
--- internal/bots/systembot/systembot.go
+++ internal/bots/systembot/systembot.go
@@ -79,15 +79,15 @@
79 if err != nil {
80 return fmt.Errorf("systembot: parse irc addr: %w", err)
81 }
82
83 c := girc.New(girc.Config{
84 Server: host,
85 Port: port,
86 Nick: botNick,
87 User: botNick,
88 Name: "scuttlebot systembot",
89 SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
90 PingDelay: 30 * time.Second,
91 PingTimeout: 30 * time.Second,
92 SSL: false,
93 })
94
--- internal/bots/warden/warden.go
+++ internal/bots/warden/warden.go
@@ -185,15 +185,15 @@
185185
if err != nil {
186186
return fmt.Errorf("warden: parse irc addr: %w", err)
187187
}
188188
189189
c := girc.New(girc.Config{
190
- Server: host,
191
- Port: port,
192
- Nick: botNick,
193
- User: botNick,
194
- Name: "scuttlebot warden",
190
+ Server: host,
191
+ Port: port,
192
+ Nick: botNick,
193
+ User: botNick,
194
+ Name: "scuttlebot warden",
195195
SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
196196
PingDelay: 30 * time.Second,
197197
PingTimeout: 30 * time.Second,
198198
SSL: false,
199199
})
200200
--- internal/bots/warden/warden.go
+++ internal/bots/warden/warden.go
@@ -185,15 +185,15 @@
185 if err != nil {
186 return fmt.Errorf("warden: parse irc addr: %w", err)
187 }
188
189 c := girc.New(girc.Config{
190 Server: host,
191 Port: port,
192 Nick: botNick,
193 User: botNick,
194 Name: "scuttlebot warden",
195 SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
196 PingDelay: 30 * time.Second,
197 PingTimeout: 30 * time.Second,
198 SSL: false,
199 })
200
--- internal/bots/warden/warden.go
+++ internal/bots/warden/warden.go
@@ -185,15 +185,15 @@
185 if err != nil {
186 return fmt.Errorf("warden: parse irc addr: %w", err)
187 }
188
189 c := girc.New(girc.Config{
190 Server: host,
191 Port: port,
192 Nick: botNick,
193 User: botNick,
194 Name: "scuttlebot warden",
195 SASL: &girc.SASLPlain{User: botNick, Pass: b.password},
196 PingDelay: 30 * time.Second,
197 PingTimeout: 30 * time.Second,
198 SSL: false,
199 })
200
--- internal/registry/registry.go
+++ internal/registry/registry.go
@@ -72,17 +72,17 @@
7272
ChangePassword(name, passphrase string) error
7373
}
7474
7575
// Registry manages registered agents and their credentials.
7676
type Registry struct {
77
- mu sync.RWMutex
78
- agents map[string]*Agent // keyed by nick
79
- provisioner AccountProvisioner
80
- signingKey []byte
81
- dataPath string // path to persist agents JSON; empty = no persistence
82
- db *store.Store // when non-nil, supersedes dataPath
83
- onlineTimeout time.Duration
77
+ mu sync.RWMutex
78
+ agents map[string]*Agent // keyed by nick
79
+ provisioner AccountProvisioner
80
+ signingKey []byte
81
+ dataPath string // path to persist agents JSON; empty = no persistence
82
+ db *store.Store // when non-nil, supersedes dataPath
83
+ onlineTimeout time.Duration
8484
}
8585
8686
// New creates a new Registry with the given provisioner and HMAC signing key.
8787
// Call SetDataPath to enable persistence before registering any agents.
8888
func New(provisioner AccountProvisioner, signingKey []byte) *Registry {
8989
--- internal/registry/registry.go
+++ internal/registry/registry.go
@@ -72,17 +72,17 @@
72 ChangePassword(name, passphrase string) error
73 }
74
75 // Registry manages registered agents and their credentials.
76 type Registry struct {
77 mu sync.RWMutex
78 agents map[string]*Agent // keyed by nick
79 provisioner AccountProvisioner
80 signingKey []byte
81 dataPath string // path to persist agents JSON; empty = no persistence
82 db *store.Store // when non-nil, supersedes dataPath
83 onlineTimeout time.Duration
84 }
85
86 // New creates a new Registry with the given provisioner and HMAC signing key.
87 // Call SetDataPath to enable persistence before registering any agents.
88 func New(provisioner AccountProvisioner, signingKey []byte) *Registry {
89
--- internal/registry/registry.go
+++ internal/registry/registry.go
@@ -72,17 +72,17 @@
72 ChangePassword(name, passphrase string) error
73 }
74
75 // Registry manages registered agents and their credentials.
76 type Registry struct {
77 mu sync.RWMutex
78 agents map[string]*Agent // keyed by nick
79 provisioner AccountProvisioner
80 signingKey []byte
81 dataPath string // path to persist agents JSON; empty = no persistence
82 db *store.Store // when non-nil, supersedes dataPath
83 onlineTimeout time.Duration
84 }
85
86 // New creates a new Registry with the given provisioner and HMAC signing key.
87 // Call SetDataPath to enable persistence before registering any agents.
88 func New(provisioner AccountProvisioner, signingKey []byte) *Registry {
89
--- internal/store/store.go
+++ internal/store/store.go
@@ -100,10 +100,11 @@
100100
for _, stmt := range addColumns {
101101
_, _ = s.db.Exec(stmt) // ignore "column already exists"
102102
}
103103
return nil
104104
}
105
+
105106
// AgentUpsert inserts or updates an agent row by nick.
106107
func (s *Store) AgentUpsert(r *AgentRow) error {
107108
revoked := 0
108109
if r.Revoked {
109110
revoked = 1
110111
--- internal/store/store.go
+++ internal/store/store.go
@@ -100,10 +100,11 @@
100 for _, stmt := range addColumns {
101 _, _ = s.db.Exec(stmt) // ignore "column already exists"
102 }
103 return nil
104 }
 
105 // AgentUpsert inserts or updates an agent row by nick.
106 func (s *Store) AgentUpsert(r *AgentRow) error {
107 revoked := 0
108 if r.Revoked {
109 revoked = 1
110
--- internal/store/store.go
+++ internal/store/store.go
@@ -100,10 +100,11 @@
100 for _, stmt := range addColumns {
101 _, _ = s.db.Exec(stmt) // ignore "column already exists"
102 }
103 return nil
104 }
105
106 // AgentUpsert inserts or updates an agent row by nick.
107 func (s *Store) AgentUpsert(r *AgentRow) error {
108 revoked := 0
109 if r.Revoked {
110 revoked = 1
111
--- pkg/sessionrelay/irc.go
+++ pkg/sessionrelay/irc.go
@@ -203,11 +203,11 @@
203203
default:
204204
}
205205
}()
206206
continue
207207
}
208
- fmt.Fprintf(os.Stderr, "sessionrelay: credentials refreshed, dialing...\n", )
208
+ fmt.Fprintf(os.Stderr, "sessionrelay: credentials refreshed, dialing...\n")
209209
210210
wait = min(wait*2, ircReconnectMax)
211211
c.dial(host, port, func() {
212212
wait = ircReconnectMin
213213
fmt.Fprintf(os.Stderr, "sessionrelay: reconnected successfully\n")
214214
--- pkg/sessionrelay/irc.go
+++ pkg/sessionrelay/irc.go
@@ -203,11 +203,11 @@
203 default:
204 }
205 }()
206 continue
207 }
208 fmt.Fprintf(os.Stderr, "sessionrelay: credentials refreshed, dialing...\n", )
209
210 wait = min(wait*2, ircReconnectMax)
211 c.dial(host, port, func() {
212 wait = ircReconnectMin
213 fmt.Fprintf(os.Stderr, "sessionrelay: reconnected successfully\n")
214
--- pkg/sessionrelay/irc.go
+++ pkg/sessionrelay/irc.go
@@ -203,11 +203,11 @@
203 default:
204 }
205 }()
206 continue
207 }
208 fmt.Fprintf(os.Stderr, "sessionrelay: credentials refreshed, dialing...\n")
209
210 wait = min(wait*2, ircReconnectMax)
211 c.dial(host, port, func() {
212 wait = ircReconnectMin
213 fmt.Fprintf(os.Stderr, "sessionrelay: reconnected successfully\n")
214

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button