repos / pico

pico services mono repo
git clone https://github.com/picosh/pico.git

commit
abd75f3
parent
d2b70f4
author
Antonio Mika
date
2026-03-27 16:14:33 -0400 EDT
Update soju build to support webpush changes and upgrade to go 1.26
7 files changed,  +24, -24
M .github/actions/test/action.yml
+1, -1
1@@ -8,7 +8,7 @@ runs:
2     - name: Set up Go
3       uses: actions/setup-go@v3
4       with:
5-        go-version: 1.25
6+        go-version: 1.26
7     - name: Lint the codebase
8       uses: golangci/golangci-lint-action@v8
9       with:
M Dockerfile
+1, -1
1@@ -1,4 +1,4 @@
2-FROM --platform=$BUILDPLATFORM golang:1.25 AS builder-deps
3+FROM --platform=$BUILDPLATFORM golang:1.26 AS builder-deps
4 LABEL maintainer="Pico Maintainers <hello@pico.sh>"
5 
6 WORKDIR /app
M Dockerfile.cdn
+1, -1
1@@ -1,4 +1,4 @@
2-FROM --platform=$BUILDPLATFORM golang:1.25 AS builder-deps
3+FROM --platform=$BUILDPLATFORM golang:1.26 AS builder-deps
4 LABEL maintainer="Pico Maintainers <hello@pico.sh>"
5 
6 WORKDIR /app
M Dockerfile.standalone
+1, -1
1@@ -1,4 +1,4 @@
2-FROM --platform=$BUILDPLATFORM golang:1.25 AS builder-deps
3+FROM --platform=$BUILDPLATFORM golang:1.26 AS builder-deps
4 LABEL maintainer="Pico Maintainers <hello@pico.sh>"
5 
6 WORKDIR /app
M Makefile
+1, -1
1@@ -95,7 +95,7 @@ build: build-prose build-pastes build-feeds build-pgs build-auth build-pico buil
2 
3 scripts:
4 	# might need to set MINIO_URL
5-	docker run --rm -it --env-file .env -v $(shell pwd):/app -w /app golang:1.25 /bin/bash
6+	docker run --rm -it --env-file .env -v $(shell pwd):/app -w /app golang:1.26 /bin/bash
7 .PHONY: scripts
8 
9 fmt:
M bouncer/Dockerfile
+3, -3
 1@@ -1,4 +1,4 @@
 2-FROM --platform=$BUILDPLATFORM golang:1.25 AS builder-deps
 3+FROM --platform=$BUILDPLATFORM golang:1.26 AS builder-deps
 4 LABEL maintainer="Pico Maintainers <hello@pico.sh>"
 5 
 6 WORKDIR /app
 7@@ -8,13 +8,13 @@ RUN apt-get install -y git ca-certificates
 8 
 9 RUN git clone https://codeberg.org/emersion/soju.git
10 
11-# COPY subscriber-change.diff .
12+COPY subscriber-change.diff .
13 
14 WORKDIR /app/soju
15 
16 RUN git checkout v0.10.1
17 
18-# RUN git apply ../subscriber-change.diff
19+RUN git apply ../subscriber-change.diff
20 
21 RUN --mount=type=cache,target=/go/pkg/,rw \
22   --mount=type=cache,target=/root/.cache/,rw \
M bouncer/subscriber-change.diff
+16, -16
 1@@ -1,8 +1,8 @@
 2 diff --git a/downstream.go b/downstream.go
 3-index 78044e1..c95a0f6 100644
 4+index b627450..b845ecd 100644
 5 --- a/downstream.go
 6 +++ b/downstream.go
 7-@@ -3102,6 +3102,9 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc.
 8+@@ -3341,6 +3341,9 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc.
 9  				network.pushTargets.Del(target)
10  			}
11  			go network.broadcastWebPush(&irc.Message{
12@@ -12,7 +12,7 @@ index 78044e1..c95a0f6 100644
13  				Command: "MARKREAD",
14  				Params:  []string{target, timestampStr},
15  			})
16-@@ -3350,6 +3353,10 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc.
17+@@ -3694,6 +3697,10 @@ func (dc *downstreamConn) handleMessageRegistered(ctx context.Context, msg *irc.
18  				}}
19  			}
20  
21@@ -24,18 +24,18 @@ index 78044e1..c95a0f6 100644
22  				Endpoint: endpoint,
23  			}
24 diff --git a/server.go b/server.go
25-index f6e1cf6..9114580 100644
26+index f1f56d7..81c8bd6 100644
27 --- a/server.go
28 +++ b/server.go
29 @@ -10,6 +10,7 @@ import (
30- 	"net"
31  	"net/http"
32+ 	"net/netip"
33  	"runtime/debug"
34 +	"strings"
35  	"sync"
36  	"sync/atomic"
37- 	"time"
38-@@ -333,6 +334,15 @@ func (s *Server) sendWebPush(ctx context.Context, sub *webpush.Subscription, vap
39+ 	"syscall"
40+@@ -340,6 +341,15 @@ func (s *Server) sendWebPush(ctx context.Context, sub *webpush.Subscription, vap
41  	ctx, cancel := context.WithTimeout(ctx, 15*time.Second)
42  	defer cancel()
43  
44@@ -51,8 +51,8 @@ index f6e1cf6..9114580 100644
45  	var urgency webpush.Urgency
46  	switch msg.Command {
47  	case "PRIVMSG", "NOTICE", "INVITE":
48-@@ -347,7 +357,7 @@ func (s *Server) sendWebPush(ctx context.Context, sub *webpush.Subscription, vap
49- 		},
50+@@ -352,7 +362,7 @@ func (s *Server) sendWebPush(ctx context.Context, sub *webpush.Subscription, vap
51+ 		HTTPClient:      webPushHTTPClient,
52  		VAPIDPublicKey:  s.webPush.VAPIDKeys.Public,
53  		VAPIDPrivateKey: s.webPush.VAPIDKeys.Private,
54 -		Subscriber:      "https://soju.im",
55@@ -61,18 +61,18 @@ index f6e1cf6..9114580 100644
56  		Urgency:         urgency,
57  		RecordSize:      2048,
58 diff --git a/upstream.go b/upstream.go
59-index ea309f4..e198dc7 100644
60+index 37cf508..8f6ff03 100644
61 --- a/upstream.go
62 +++ b/upstream.go
63-@@ -694,6 +694,7 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err
64+@@ -771,6 +771,7 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err
65  		}
66  
67- 		if !self && !detached && msg.Command != "TAGMSG" && (highlight || directMessage) {
68+ 		if sendWebPush {
69 +			msg.Tags["bouncerNetwork"] = strconv.FormatInt(uc.network.ID, 10)
70- 			go uc.network.broadcastWebPush(msg)
71- 			if timestamp, err := time.Parse(xirc.ServerTimeLayout, string(msg.Tags["time"])); err == nil {
72- 				uc.network.pushTargets.Set(bufferName, timestamp)
73-@@ -1640,6 +1641,7 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err
74+ 			timestamp, err := time.Parse(xirc.ServerTimeLayout, msg.Tags["time"])
75+ 			if err != nil {
76+ 				// Cannot fail, was set above if unset or invalid.
77+@@ -1760,6 +1761,7 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err
78  		})
79  
80  		if weAreInvited {