From 645cecb17c7e59c63f3110f7c699b779de419742 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Tue, 12 Dec 2023 21:34:04 +0100 Subject: [PATCH 1/2] fix(oonimkall): make sure SoftwareName is set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While there, make sure we log the check-in request and response with `-v`, because otherwise 🤌🤌🤌🤌. Both part of https://github.com/ooni/probe/issues/2644. --- internal/ooapi/checkin.go | 2 +- pkg/oonimkall/session.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/ooapi/checkin.go b/internal/ooapi/checkin.go index 89753280fe..4eb354fa5e 100644 --- a/internal/ooapi/checkin.go +++ b/internal/ooapi/checkin.go @@ -25,7 +25,7 @@ func NewDescriptorCheckIn( AcceptEncodingGzip: true, // we want a small response Authorization: "", ContentType: httpapi.ApplicationJSON, - LogBody: false, // we don't want to log psiphon config + LogBody: true, MaxBodySize: 0, Method: http.MethodPost, Request: &httpapi.RequestDescriptor[*model.OOAPICheckInConfig]{ diff --git a/pkg/oonimkall/session.go b/pkg/oonimkall/session.go index 92c4a5cc92..b5a3ea7f92 100644 --- a/pkg/oonimkall/session.go +++ b/pkg/oonimkall/session.go @@ -467,6 +467,7 @@ func (sess *Session) CheckIn(ctx *Context, config *CheckInConfig) (*CheckInInfo, ProbeASN: info.ASNString(), ProbeCC: info.CountryCode, RunType: model.RunType(config.RunType), + SoftwareName: config.SoftwareName, SoftwareVersion: config.SoftwareVersion, WebConnectivity: config.WebConnectivity.toModel(), } From f382ed81340fef36b065322629a24d53d438b536 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Tue, 12 Dec 2023 21:43:56 +0100 Subject: [PATCH 2/2] also fix tests (always useful) --- internal/ooapi/checkin_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/ooapi/checkin_test.go b/internal/ooapi/checkin_test.go index cffeac5ccc..ca84762e2a 100644 --- a/internal/ooapi/checkin_test.go +++ b/internal/ooapi/checkin_test.go @@ -40,7 +40,7 @@ func TestNewDescriptorCheckIn(t *testing.T) { t.Fatalf("unexpected desc.%s", name) } case "LogBody": - if !field.IsZero() { + if field.IsZero() { t.Fatalf("unexpected desc.%s", name) } case "MaxBodySize":