From 6cbc955fba968519cdfdc756b5a6a19b744a91cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 14:41:49 +0200 Subject: [PATCH 01/42] Bump golang.org/x/sys from 0.19.0 to 0.20.0 (#947) * Bump golang.org/x/sys from 0.19.0 to 0.20.0 Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.19.0 to 0.20.0. - [Commits](https://github.com/golang/sys/compare/v0.19.0...v0.20.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update licenses --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: MatteoPologruto --- .../arduino-create-agent/go/golang.org/x/sys/unix.dep.yml | 6 +++--- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.licenses/arduino-create-agent/go/golang.org/x/sys/unix.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/sys/unix.dep.yml index 9e39a68f..8c6dd955 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/sys/unix.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/sys/unix.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/sys/unix -version: v0.19.0 +version: v0.20.0 type: go summary: Package unix contains an interface to the low-level operating system primitives. homepage: https://pkg.go.dev/golang.org/x/sys/unix license: bsd-3-clause licenses: -- sources: sys@v0.19.0/LICENSE +- sources: sys@v0.20.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: sys@v0.19.0/PATENTS +- sources: sys@v0.20.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/go.mod b/go.mod index 98f31a0f..52ce382b 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/xrash/smetrics v0.0.0-20170218160415-a3153f7040e9 go.bug.st/serial v1.6.1 goa.design/goa/v3 v3.16.1 - golang.org/x/sys v0.19.0 + golang.org/x/sys v0.20.0 gopkg.in/inconshreveable/go-update.v0 v0.0.0-20150814200126-d8b0b1d421aa ) diff --git a/go.sum b/go.sum index 0af64eff..18a9e17a 100644 --- a/go.sum +++ b/go.sum @@ -181,8 +181,8 @@ golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= From bf5b8e4bfadd5902180f64a1ebdaf577e57f4c25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 15:29:58 +0200 Subject: [PATCH 02/42] Bump github.com/gin-gonic/gin from 1.9.1 to 1.10.0 (#948) * Bump github.com/gin-gonic/gin from 1.9.1 to 1.10.0 Bumps [github.com/gin-gonic/gin](https://github.com/gin-gonic/gin) from 1.9.1 to 1.10.0. - [Release notes](https://github.com/gin-gonic/gin/releases) - [Changelog](https://github.com/gin-gonic/gin/blob/master/CHANGELOG.md) - [Commits](https://github.com/gin-gonic/gin/compare/v1.9.1...v1.10.0) --- updated-dependencies: - dependency-name: github.com/gin-gonic/gin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update licenses --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: MatteoPologruto --- .../go/github.com/gin-gonic/gin.dep.yml | 2 +- .../github.com/gin-gonic/gin/binding.dep.yml | 6 ++-- .../gin-gonic/gin/internal/bytesconv.dep.yml | 6 ++-- .../gin-gonic/gin/internal/json.dep.yml | 6 ++-- .../github.com/gin-gonic/gin/render.dep.yml | 6 ++-- .../github.com/pelletier/go-toml/v2.dep.yml | 2 +- .../go-toml/v2/internal/characters.dep.yml | 8 +++--- .../go-toml/v2/internal/danger.dep.yml | 8 +++--- .../go-toml/v2/internal/tracker.dep.yml | 8 +++--- .../pelletier/go-toml/v2/unstable.dep.yml | 6 ++-- .../go/golang.org/x/crypto/argon2.dep.yml | 6 ++-- .../go/golang.org/x/crypto/blake2b.dep.yml | 6 ++-- .../go/golang.org/x/crypto/cast5.dep.yml | 6 ++-- .../go/golang.org/x/crypto/sha3.dep.yml | 6 ++-- .../go/golang.org/x/net/html.dep.yml | 6 ++-- .../go/golang.org/x/net/html/atom.dep.yml | 6 ++-- .../go/golang.org/x/net/http2.dep.yml | 6 ++-- .../go/golang.org/x/net/http2/h2c.dep.yml | 6 ++-- .../golang.org/x/net/internal/socks.dep.yml | 6 ++-- .../go/golang.org/x/net/proxy.dep.yml | 6 ++-- .../x/text/internal/language.dep.yml | 8 +++--- .../x/text/internal/language/compact.dep.yml | 6 ++-- .../go/golang.org/x/text/internal/tag.dep.yml | 6 ++-- .../go/golang.org/x/text/language.dep.yml | 6 ++-- .../protobuf/encoding/protowire.dep.yml | 6 ++-- .../protobuf/internal/detrand.dep.yml | 6 ++-- .../internal/encoding/messageset.dep.yml | 6 ++-- .../protobuf/internal/errors.dep.yml | 6 ++-- .../protobuf/internal/flags.dep.yml | 6 ++-- .../protobuf/internal/genid.dep.yml | 6 ++-- .../protobuf/internal/order.dep.yml | 6 ++-- .../protobuf/internal/pragma.dep.yml | 6 ++-- .../protobuf/internal/strs.dep.yml | 6 ++-- .../google.golang.org/protobuf/proto.dep.yml | 6 ++-- .../protobuf/reflect/protoreflect.dep.yml | 6 ++-- .../protobuf/reflect/protoregistry.dep.yml | 6 ++-- .../protobuf/runtime/protoiface.dep.yml | 6 ++-- go.mod | 14 +++++----- go.sum | 28 +++++++++---------- 39 files changed, 132 insertions(+), 132 deletions(-) diff --git a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin.dep.yml index 00b9d694..7d4960e6 100644 --- a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin.dep.yml @@ -1,6 +1,6 @@ --- name: github.com/gin-gonic/gin -version: v1.9.1 +version: v1.10.0 type: go summary: Package gin implements a HTTP web framework called gin. homepage: https://pkg.go.dev/github.com/gin-gonic/gin diff --git a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/binding.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/binding.dep.yml index 00c113b4..6801615f 100644 --- a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/binding.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/binding.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/gin-gonic/gin/binding -version: v1.9.1 +version: v1.10.0 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/gin-gonic/gin/binding license: mit licenses: -- sources: gin@v1.9.1/LICENSE +- sources: gin@v1.10.0/LICENSE text: | The MIT License (MIT) diff --git a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/bytesconv.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/bytesconv.dep.yml index 35101452..c9d7afd9 100644 --- a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/bytesconv.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/bytesconv.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/gin-gonic/gin/internal/bytesconv -version: v1.9.1 +version: v1.10.0 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/gin-gonic/gin/internal/bytesconv license: mit licenses: -- sources: gin@v1.9.1/LICENSE +- sources: gin@v1.10.0/LICENSE text: | The MIT License (MIT) diff --git a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/json.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/json.dep.yml index 22d75578..57739599 100644 --- a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/json.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/json.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/gin-gonic/gin/internal/json -version: v1.9.1 +version: v1.10.0 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/gin-gonic/gin/internal/json license: mit licenses: -- sources: gin@v1.9.1/LICENSE +- sources: gin@v1.10.0/LICENSE text: | The MIT License (MIT) diff --git a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/render.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/render.dep.yml index 3ad37b2e..5b0dc5bb 100644 --- a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/render.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/render.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/gin-gonic/gin/render -version: v1.9.1 +version: v1.10.0 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/gin-gonic/gin/render license: mit licenses: -- sources: gin@v1.9.1/LICENSE +- sources: gin@v1.10.0/LICENSE text: | The MIT License (MIT) diff --git a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2.dep.yml b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2.dep.yml index 5ac1d339..44cb1418 100644 --- a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2.dep.yml @@ -1,6 +1,6 @@ --- name: github.com/pelletier/go-toml/v2 -version: v2.2.1 +version: v2.2.2 type: go summary: Package toml is a library to read and write TOML documents. homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2 diff --git a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/characters.dep.yml b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/characters.dep.yml index 43981e2c..afddf80f 100644 --- a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/characters.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/characters.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/pelletier/go-toml/v2/internal/characters -version: v2.2.1 +version: v2.2.2 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/internal/characters license: other licenses: -- sources: v2@v2.2.1/LICENSE +- sources: v2@v2.2.2/LICENSE text: | The MIT License (MIT) @@ -30,6 +30,6 @@ licenses: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- sources: v2@v2.2.1/README.md +- sources: v2@v2.2.2/README.md text: The MIT License (MIT). Read [LICENSE](LICENSE). notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/danger.dep.yml b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/danger.dep.yml index d176af23..5fe64d01 100644 --- a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/danger.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/danger.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/pelletier/go-toml/v2/internal/danger -version: v2.2.1 +version: v2.2.2 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/internal/danger license: other licenses: -- sources: v2@v2.2.1/LICENSE +- sources: v2@v2.2.2/LICENSE text: | The MIT License (MIT) @@ -30,6 +30,6 @@ licenses: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- sources: v2@v2.2.1/README.md +- sources: v2@v2.2.2/README.md text: The MIT License (MIT). Read [LICENSE](LICENSE). notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/tracker.dep.yml b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/tracker.dep.yml index cd81b379..6b73e51e 100644 --- a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/tracker.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/tracker.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/pelletier/go-toml/v2/internal/tracker -version: v2.2.1 +version: v2.2.2 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/internal/tracker license: other licenses: -- sources: v2@v2.2.1/LICENSE +- sources: v2@v2.2.2/LICENSE text: | The MIT License (MIT) @@ -30,6 +30,6 @@ licenses: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- sources: v2@v2.2.1/README.md +- sources: v2@v2.2.2/README.md text: The MIT License (MIT). Read [LICENSE](LICENSE). notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/unstable.dep.yml b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/unstable.dep.yml index 40881d13..4fc5a61c 100644 --- a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/unstable.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/unstable.dep.yml @@ -1,13 +1,13 @@ --- name: github.com/pelletier/go-toml/v2/unstable -version: v2.2.1 +version: v2.2.2 type: go summary: Package unstable provides APIs that do not meet the backward compatibility guarantees yet. homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/unstable license: other licenses: -- sources: v2@v2.2.1/LICENSE +- sources: v2@v2.2.2/LICENSE text: | The MIT License (MIT) @@ -31,6 +31,6 @@ licenses: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- sources: v2@v2.2.1/README.md +- sources: v2@v2.2.2/README.md text: The MIT License (MIT). Read [LICENSE](LICENSE). notices: [] diff --git a/.licenses/arduino-create-agent/go/golang.org/x/crypto/argon2.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/crypto/argon2.dep.yml index 0829f634..cc73f399 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/crypto/argon2.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/crypto/argon2.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/crypto/argon2 -version: v0.22.0 +version: v0.23.0 type: go summary: Package argon2 implements the key derivation function Argon2. homepage: https://pkg.go.dev/golang.org/x/crypto/argon2 license: bsd-3-clause licenses: -- sources: crypto@v0.22.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: crypto@v0.22.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/golang.org/x/crypto/blake2b.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/crypto/blake2b.dep.yml index 6d6d92d2..ef8816c5 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/crypto/blake2b.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/crypto/blake2b.dep.yml @@ -1,13 +1,13 @@ --- name: golang.org/x/crypto/blake2b -version: v0.22.0 +version: v0.23.0 type: go summary: Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 and the extendable output function (XOF) BLAKE2Xb. homepage: https://pkg.go.dev/golang.org/x/crypto/blake2b license: bsd-3-clause licenses: -- sources: crypto@v0.22.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: crypto@v0.22.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/golang.org/x/crypto/cast5.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/crypto/cast5.dep.yml index fa791187..369aae2e 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/crypto/cast5.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/crypto/cast5.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/crypto/cast5 -version: v0.22.0 +version: v0.23.0 type: go summary: Package cast5 implements CAST5, as defined in RFC 2144. homepage: https://pkg.go.dev/golang.org/x/crypto/cast5 license: bsd-3-clause licenses: -- sources: crypto@v0.22.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: crypto@v0.22.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/golang.org/x/crypto/sha3.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/crypto/sha3.dep.yml index b8a9b9c4..1ef1c7c9 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/crypto/sha3.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/crypto/sha3.dep.yml @@ -1,13 +1,13 @@ --- name: golang.org/x/crypto/sha3 -version: v0.22.0 +version: v0.23.0 type: go summary: Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202. homepage: https://pkg.go.dev/golang.org/x/crypto/sha3 license: bsd-3-clause licenses: -- sources: crypto@v0.22.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: crypto@v0.22.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/golang.org/x/net/html.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/net/html.dep.yml index 26dfe21d..be34abd7 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/net/html.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/net/html.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/net/html -version: v0.24.0 +version: v0.25.0 type: go summary: Package html implements an HTML5-compliant tokenizer and parser. homepage: https://pkg.go.dev/golang.org/x/net/html license: other licenses: -- sources: net@v0.24.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: net@v0.24.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/golang.org/x/net/html/atom.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/net/html/atom.dep.yml index f929ee97..49ddaa0f 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/net/html/atom.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/net/html/atom.dep.yml @@ -1,6 +1,6 @@ --- name: golang.org/x/net/html/atom -version: v0.24.0 +version: v0.25.0 type: go summary: 'Package atom provides integer codes (also known as atoms) for a fixed set of frequently occurring HTML strings: tag names and attribute keys such as "p" and @@ -8,7 +8,7 @@ summary: 'Package atom provides integer codes (also known as atoms) for a fixed homepage: https://pkg.go.dev/golang.org/x/net/html/atom license: other licenses: -- sources: net@v0.24.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -37,7 +37,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: net@v0.24.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/golang.org/x/net/http2.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/net/http2.dep.yml index 0bc41da6..4e442b81 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/net/http2.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/net/http2.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/net/http2 -version: v0.24.0 +version: v0.25.0 type: go summary: Package http2 implements the HTTP/2 protocol. homepage: https://pkg.go.dev/golang.org/x/net/http2 license: bsd-3-clause licenses: -- sources: net@v0.24.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: net@v0.24.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/golang.org/x/net/http2/h2c.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/net/http2/h2c.dep.yml index c80f2b83..38586be2 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/net/http2/h2c.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/net/http2/h2c.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/net/http2/h2c -version: v0.24.0 +version: v0.25.0 type: go summary: Package h2c implements the unencrypted "h2c" form of HTTP/2. homepage: https://pkg.go.dev/golang.org/x/net/http2/h2c license: bsd-3-clause licenses: -- sources: net@v0.24.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: net@v0.24.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/golang.org/x/net/internal/socks.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/net/internal/socks.dep.yml index 58a7adef..5e49f37c 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/net/internal/socks.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/net/internal/socks.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/net/internal/socks -version: v0.24.0 +version: v0.25.0 type: go summary: Package socks provides a SOCKS version 5 client implementation. homepage: https://pkg.go.dev/golang.org/x/net/internal/socks license: other licenses: -- sources: net@v0.24.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: net@v0.24.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/golang.org/x/net/proxy.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/net/proxy.dep.yml index 702446e6..a87c7e35 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/net/proxy.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/net/proxy.dep.yml @@ -1,13 +1,13 @@ --- name: golang.org/x/net/proxy -version: v0.24.0 +version: v0.25.0 type: go summary: Package proxy provides support for a variety of protocols to proxy network data. homepage: https://pkg.go.dev/golang.org/x/net/proxy license: other licenses: -- sources: net@v0.24.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: net@v0.24.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language.dep.yml index 42b866d4..988bad3c 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/text/internal/language -version: v0.14.0 +version: v0.15.0 type: go -summary: +summary: homepage: https://pkg.go.dev/golang.org/x/text/internal/language license: bsd-3-clause licenses: -- sources: text@v0.14.0/LICENSE +- sources: text@v0.15.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: text@v0.14.0/PATENTS +- sources: text@v0.15.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language/compact.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language/compact.dep.yml index 8c839abc..d6e0022d 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language/compact.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language/compact.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/text/internal/language/compact -version: v0.14.0 +version: v0.15.0 type: go summary: Package compact defines a compact representation of language tags. homepage: https://pkg.go.dev/golang.org/x/text/internal/language/compact license: bsd-3-clause licenses: -- sources: text@v0.14.0/LICENSE +- sources: text@v0.15.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: text@v0.14.0/PATENTS +- sources: text@v0.15.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/golang.org/x/text/internal/tag.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/text/internal/tag.dep.yml index ee82cf38..f5b00b4e 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/text/internal/tag.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/text/internal/tag.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/text/internal/tag -version: v0.14.0 +version: v0.15.0 type: go summary: Package tag contains functionality handling tags and related data. homepage: https://pkg.go.dev/golang.org/x/text/internal/tag license: bsd-3-clause licenses: -- sources: text@v0.14.0/LICENSE +- sources: text@v0.15.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: text@v0.14.0/PATENTS +- sources: text@v0.15.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/golang.org/x/text/language.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/text/language.dep.yml index 31167ba6..ee9e1f0d 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/text/language.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/text/language.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/text/language -version: v0.14.0 +version: v0.15.0 type: go summary: Package language implements BCP 47 language tags and related functionality. homepage: https://pkg.go.dev/golang.org/x/text/language license: bsd-3-clause licenses: -- sources: text@v0.14.0/LICENSE +- sources: text@v0.15.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: text@v0.14.0/PATENTS +- sources: text@v0.15.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/encoding/protowire.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/encoding/protowire.dep.yml index 70d4d397..d935d1df 100644 --- a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/encoding/protowire.dep.yml +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/encoding/protowire.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/encoding/protowire -version: v1.34.0 +version: v1.34.1 type: go summary: Package protowire parses and formats the raw wire encoding. homepage: https://pkg.go.dev/google.golang.org/protobuf/encoding/protowire license: bsd-3-clause licenses: -- sources: protobuf@v1.34.0/LICENSE +- sources: protobuf@v1.34.1/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.34.0/PATENTS +- sources: protobuf@v1.34.1/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/detrand.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/detrand.dep.yml index 7307e0c1..1b4a97a5 100644 --- a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/detrand.dep.yml +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/detrand.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/detrand -version: v1.34.0 +version: v1.34.1 type: go summary: Package detrand provides deterministically random functionality. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/detrand license: bsd-3-clause licenses: -- sources: protobuf@v1.34.0/LICENSE +- sources: protobuf@v1.34.1/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.34.0/PATENTS +- sources: protobuf@v1.34.1/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/encoding/messageset.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/encoding/messageset.dep.yml index a8e4900e..8cf22dde 100644 --- a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/encoding/messageset.dep.yml +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/encoding/messageset.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/encoding/messageset -version: v1.34.0 +version: v1.34.1 type: go summary: Package messageset encodes and decodes the obsolete MessageSet wire format. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/encoding/messageset license: bsd-3-clause licenses: -- sources: protobuf@v1.34.0/LICENSE +- sources: protobuf@v1.34.1/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.34.0/PATENTS +- sources: protobuf@v1.34.1/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/errors.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/errors.dep.yml index b62dc7db..ee63cc3d 100644 --- a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/errors.dep.yml +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/errors.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/errors -version: v1.34.0 +version: v1.34.1 type: go summary: Package errors implements functions to manipulate errors. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/errors license: bsd-3-clause licenses: -- sources: protobuf@v1.34.0/LICENSE +- sources: protobuf@v1.34.1/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.34.0/PATENTS +- sources: protobuf@v1.34.1/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/flags.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/flags.dep.yml index b81d78dd..4ad5ad85 100644 --- a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/flags.dep.yml +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/flags.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/flags -version: v1.34.0 +version: v1.34.1 type: go summary: Package flags provides a set of flags controlled by build tags. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/flags license: bsd-3-clause licenses: -- sources: protobuf@v1.34.0/LICENSE +- sources: protobuf@v1.34.1/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.34.0/PATENTS +- sources: protobuf@v1.34.1/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/genid.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/genid.dep.yml index f89f5f63..74669222 100644 --- a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/genid.dep.yml +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/genid.dep.yml @@ -1,13 +1,13 @@ --- name: google.golang.org/protobuf/internal/genid -version: v1.34.0 +version: v1.34.1 type: go summary: Package genid contains constants for declarations in descriptor.proto and the well-known types. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/genid license: bsd-3-clause licenses: -- sources: protobuf@v1.34.0/LICENSE +- sources: protobuf@v1.34.1/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.34.0/PATENTS +- sources: protobuf@v1.34.1/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/order.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/order.dep.yml index 8bcc0919..43e239a6 100644 --- a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/order.dep.yml +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/order.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/order -version: v1.34.0 +version: v1.34.1 type: go summary: Package order provides ordered access to messages and maps. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/order license: bsd-3-clause licenses: -- sources: protobuf@v1.34.0/LICENSE +- sources: protobuf@v1.34.1/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.34.0/PATENTS +- sources: protobuf@v1.34.1/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/pragma.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/pragma.dep.yml index cbfd5321..b8f4d4e9 100644 --- a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/pragma.dep.yml +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/pragma.dep.yml @@ -1,13 +1,13 @@ --- name: google.golang.org/protobuf/internal/pragma -version: v1.34.0 +version: v1.34.1 type: go summary: Package pragma provides types that can be embedded into a struct to statically enforce or prevent certain language properties. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/pragma license: bsd-3-clause licenses: -- sources: protobuf@v1.34.0/LICENSE +- sources: protobuf@v1.34.1/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.34.0/PATENTS +- sources: protobuf@v1.34.1/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/strs.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/strs.dep.yml index 61207028..a2137bf6 100644 --- a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/strs.dep.yml +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/internal/strs.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/strs -version: v1.34.0 +version: v1.34.1 type: go summary: Package strs provides string manipulation functionality specific to protobuf. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/strs license: bsd-3-clause licenses: -- sources: protobuf@v1.34.0/LICENSE +- sources: protobuf@v1.34.1/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.34.0/PATENTS +- sources: protobuf@v1.34.1/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/proto.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/proto.dep.yml index fa722dbd..bcbae244 100644 --- a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/proto.dep.yml +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/proto.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/proto -version: v1.34.0 +version: v1.34.1 type: go summary: Package proto provides functions operating on protocol buffer messages. homepage: https://pkg.go.dev/google.golang.org/protobuf/proto license: bsd-3-clause licenses: -- sources: protobuf@v1.34.0/LICENSE +- sources: protobuf@v1.34.1/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.34.0/PATENTS +- sources: protobuf@v1.34.1/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/reflect/protoreflect.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/reflect/protoreflect.dep.yml index 14e51616..d3829449 100644 --- a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/reflect/protoreflect.dep.yml +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/reflect/protoreflect.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/reflect/protoreflect -version: v1.34.0 +version: v1.34.1 type: go summary: Package protoreflect provides interfaces to dynamically manipulate messages. homepage: https://pkg.go.dev/google.golang.org/protobuf/reflect/protoreflect license: bsd-3-clause licenses: -- sources: protobuf@v1.34.0/LICENSE +- sources: protobuf@v1.34.1/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.34.0/PATENTS +- sources: protobuf@v1.34.1/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/reflect/protoregistry.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/reflect/protoregistry.dep.yml index e10cc774..73747419 100644 --- a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/reflect/protoregistry.dep.yml +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/reflect/protoregistry.dep.yml @@ -1,13 +1,13 @@ --- name: google.golang.org/protobuf/reflect/protoregistry -version: v1.34.0 +version: v1.34.1 type: go summary: Package protoregistry provides data structures to register and lookup protobuf descriptor types. homepage: https://pkg.go.dev/google.golang.org/protobuf/reflect/protoregistry license: bsd-3-clause licenses: -- sources: protobuf@v1.34.0/LICENSE +- sources: protobuf@v1.34.1/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.34.0/PATENTS +- sources: protobuf@v1.34.1/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/runtime/protoiface.dep.yml b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/runtime/protoiface.dep.yml index 06f700b4..559ff53f 100644 --- a/.licenses/arduino-create-agent/go/google.golang.org/protobuf/runtime/protoiface.dep.yml +++ b/.licenses/arduino-create-agent/go/google.golang.org/protobuf/runtime/protoiface.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/runtime/protoiface -version: v1.34.0 +version: v1.34.1 type: go summary: Package protoiface contains types referenced or implemented by messages. homepage: https://pkg.go.dev/google.golang.org/protobuf/runtime/protoiface license: bsd-3-clause licenses: -- sources: protobuf@v1.34.0/LICENSE +- sources: protobuf@v1.34.1/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.34.0/PATENTS +- sources: protobuf@v1.34.1/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/go.mod b/go.mod index 52ce382b..b1f0f8fd 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/blang/semver v3.5.1+incompatible github.com/codeclysm/extract/v3 v3.1.1 github.com/gin-contrib/cors v1.7.2 - github.com/gin-gonic/gin v1.9.1 + github.com/gin-gonic/gin v1.10.0 github.com/go-ini/ini v1.62.0 github.com/googollee/go-socket.io v0.0.0-20181101151912-c8aeb1ed9b49 github.com/mattn/go-shellwords v1.0.12 @@ -63,7 +63,7 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.2.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/sergi/go-diff v1.3.1 // indirect @@ -72,14 +72,14 @@ require ( github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go v1.1.6 // indirect github.com/ulikunitz/xz v0.5.11 // indirect - golang.org/x/arch v0.7.0 // indirect - golang.org/x/crypto v0.22.0 // indirect + golang.org/x/arch v0.8.0 // indirect + golang.org/x/crypto v0.23.0 // indirect golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.24.0 // indirect + golang.org/x/net v0.25.0 // indirect golang.org/x/sync v0.7.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/tools v0.20.0 // indirect - google.golang.org/protobuf v1.34.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 18a9e17a..278446a6 100644 --- a/go.sum +++ b/go.sum @@ -42,8 +42,8 @@ github.com/gin-contrib/cors v1.7.2 h1:oLDHxdg8W/XDoN/8zamqk/Drgt4oVZDvaV0YmvVICQ github.com/gin-contrib/cors v1.7.2/go.mod h1:SUJVARKgQ40dmrzgXEVxj2m7Ig1v1qIboQkPDTQ9t2E= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU= +github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s= github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-ini/ini v1.62.0 h1:7VJT/ZXjzqSrvtraFp4ONq80hTcRQth1c9ZnQ3uNQvU= @@ -115,8 +115,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/pelletier/go-toml/v2 v2.2.1 h1:9TA9+T8+8CUCO2+WYnDLCgrYi9+omqKXyjDtosvtEhg= -github.com/pelletier/go-toml/v2 v2.2.1/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -164,16 +164,16 @@ go.bug.st/serial v1.6.1/go.mod h1:UABfsluHAiaNI+La2iESysd9Vetq7VRdpxvjx7CmmOE= goa.design/goa/v3 v3.16.1 h1:yZwbKrfMpE8+sz0uf+n+BtArVOFQ0kNSC0twQKwQb04= goa.design/goa/v3 v3.16.1/go.mod h1:Yd42LR0PYDbHSbsbF3vNd4YY/O+LG20Jb7+IyNdkQic= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.7.0 h1:pskyeJh/3AmoQ8CPE95vxHLqp1G1GfGNXTmcl9NEKTc= -golang.org/x/arch v0.7.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= +golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -184,13 +184,13 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= -google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4= -google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From 222a50545708dcce9478cfae10242af434025614 Mon Sep 17 00:00:00 2001 From: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com> Date: Wed, 8 May 2024 15:43:01 +0200 Subject: [PATCH 03/42] Manage the HTTPS certificate from the menu and ask Safari users to install it at startup (#941) * Add function to retrieve certificates expiration date * Check the certificate expiration date * Obtain certificates info using the systray icon * Manage errors that may occur retrieving certificates expiration date * Obtain default browser name on macOS * Prompt Safari users to install HTTPS certificates and check if they are outdated when the Agent is started * Skip some tests on macOS because the user is prompted to install certificates * Set installCerts value in config.ini if certicates are manually installed * Always set installCerts if the certificates exist * Add "Arduino Agent" to the title of dialogs * Fix check for pressed buttons * Move osascript execution function to Utilities to avoid code duplication * Modify certificate management from the systray menu * Install certificates if they are missing and the flag inside the config is set to true * Avoid code duplication * Fix button order and title * Do not restart the Agent if no action is performed on the certificate * Do not modify the config if the default browser is not Safari * Small messages/titles fixes --------- Co-authored-by: Xayton <30591904+Xayton@users.noreply.github.com> --- certificates/certificates.go | 48 +++++++++++++++++ certificates/install_darwin.go | 94 ++++++++++++++++++++++++++++++--- certificates/install_default.go | 12 +++++ config/config.go | 18 +++++++ main.go | 63 +++++++++++++++++++--- systray/systray_real.go | 59 +++++++++++++-------- tests/test_info.py | 6 +++ tests/test_v2.py | 6 +++ tests/test_ws.py | 9 ++++ utilities/utilities.go | 7 +++ 10 files changed, 285 insertions(+), 37 deletions(-) diff --git a/certificates/certificates.go b/certificates/certificates.go index 990fa2e0..baac7c33 100644 --- a/certificates/certificates.go +++ b/certificates/certificates.go @@ -30,8 +30,10 @@ import ( "math/big" "net" "os" + "strings" "time" + "github.com/arduino/arduino-create-agent/utilities" "github.com/arduino/go-paths-helper" log "github.com/sirupsen/logrus" ) @@ -267,3 +269,49 @@ func DeleteCertificates(certDir *paths.Path) { certDir.Join("cert.pem").Remove() certDir.Join("cert.cer").Remove() } + +// isExpired checks if a certificate is expired or about to expire (less than 1 month) +func isExpired() (bool, error) { + bound := time.Now().AddDate(0, 1, 0) + dateS, err := GetExpirationDate() + if err != nil { + return false, err + } + date, _ := time.Parse(time.DateTime, dateS) + return date.Before(bound), nil +} + +// PromptInstallCertsSafari prompts the user to install the HTTPS certificates if they are using Safari +func PromptInstallCertsSafari() bool { + buttonPressed := utilities.UserPrompt("display dialog \"The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nIf you use Safari, you need to install it.\" buttons {\"Do not install\", \"Install the certificate for Safari\"} default button 2 with title \"Arduino Agent: Install certificate\"") + return strings.Contains(string(buttonPressed), "button returned:Install the certificate for Safari") +} + +// PromptExpiredCerts prompts the user to update the HTTPS certificates if they are using Safari +func PromptExpiredCerts(certDir *paths.Path) { + if expired, err := isExpired(); err != nil { + log.Errorf("cannot check if certificates are expired something went wrong: %s", err) + } else if expired { + buttonPressed := utilities.UserPrompt("display dialog \"The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nYour certificate is expired or close to expiration. Do you want to update it?\" buttons {\"Do not update\", \"Update the certificate for Safari\"} default button 2 with title \"Arduino Agent: Update certificate\"") + if strings.Contains(string(buttonPressed), "button returned:Update the certificate for Safari") { + err := UninstallCertificates() + if err != nil { + log.Errorf("cannot uninstall certificates something went wrong: %s", err) + } else { + DeleteCertificates(certDir) + GenerateAndInstallCertificates(certDir) + } + } + } +} + +// GenerateAndInstallCertificates generates and installs the certificates +func GenerateAndInstallCertificates(certDir *paths.Path) { + GenerateCertificates(certDir) + err := InstallCertificate(certDir.Join("ca.cert.cer")) + // if something goes wrong during the cert install we remove them, so the user is able to retry + if err != nil { + log.Errorf("cannot install certificates something went wrong: %s", err) + DeleteCertificates(certDir) + } +} diff --git a/certificates/install_darwin.go b/certificates/install_darwin.go index 2c84d7dc..892c390b 100644 --- a/certificates/install_darwin.go +++ b/certificates/install_darwin.go @@ -89,15 +89,77 @@ const char *uninstallCert() { } return ""; } + +const char *getExpirationDate(char *expirationDate){ + // Create a key-value dictionary used to query the Keychain and look for the "Arduino" root certificate. + NSDictionary *getquery = @{ + (id)kSecClass: (id)kSecClassCertificate, + (id)kSecAttrLabel: @"Arduino", + (id)kSecReturnRef: @YES, + }; + + OSStatus err = noErr; + SecCertificateRef cert = NULL; + + // Use this function to check for errors + err = SecItemCopyMatching((CFDictionaryRef)getquery, (CFTypeRef *)&cert); + + if (err != noErr){ + NSString *errString = [@"Error: " stringByAppendingFormat:@"%d", err]; + NSLog(@"%@", errString); + return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } + + // Get data from the certificate. We just need the "invalidity date" property. + CFDictionaryRef valuesDict = SecCertificateCopyValues(cert, (__bridge CFArrayRef)@[(__bridge id)kSecOIDInvalidityDate], NULL); + + id expirationDateValue; + if(valuesDict){ + CFDictionaryRef invalidityDateDictionaryRef = CFDictionaryGetValue(valuesDict, kSecOIDInvalidityDate); + if(invalidityDateDictionaryRef){ + CFTypeRef invalidityRef = CFDictionaryGetValue(invalidityDateDictionaryRef, kSecPropertyKeyValue); + if(invalidityRef){ + expirationDateValue = CFBridgingRelease(invalidityRef); + } + } + CFRelease(valuesDict); + } + + NSString *outputString = [@"" stringByAppendingFormat:@"%@", expirationDateValue]; + if([outputString isEqualToString:@""]){ + NSString *errString = @"Error: the expiration date of the certificate could not be found"; + NSLog(@"%@", errString); + return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } + + // This workaround allows to obtain the expiration date alongside the error message + strncpy(expirationDate, [outputString cStringUsingEncoding:[NSString defaultCStringEncoding]], 32); + expirationDate[32-1] = 0; + + return ""; +} + +const char *getDefaultBrowserName() { + NSURL *defaultBrowserURL = [[NSWorkspace sharedWorkspace] URLForApplicationToOpenURL:[NSURL URLWithString:@"http://"]]; + if (defaultBrowserURL) { + NSBundle *defaultBrowserBundle = [NSBundle bundleWithURL:defaultBrowserURL]; + NSString *defaultBrowser = [defaultBrowserBundle objectForInfoDictionaryKey:@"CFBundleDisplayName"]; + + return [defaultBrowser cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } + + return ""; +} */ import "C" import ( "errors" - "os/exec" + "strings" "unsafe" log "github.com/sirupsen/logrus" + "github.com/arduino/arduino-create-agent/utilities" "github.com/arduino/go-paths-helper" ) @@ -110,9 +172,8 @@ func InstallCertificate(cert *paths.Path) error { p := C.installCert(ccert) s := C.GoString(p) if len(s) != 0 { - oscmd := exec.Command("osascript", "-e", "display dialog \""+s+"\" buttons \"OK\" with title \"Arduino Agent: Error installing certificates\"") - _ = oscmd.Run() - _ = UninstallCertificates() + utilities.UserPrompt("display dialog \"" + s + "\" buttons \"OK\" with title \"Arduino Agent: Error installing certificates\"") + UninstallCertificates() return errors.New(s) } return nil @@ -125,9 +186,30 @@ func UninstallCertificates() error { p := C.uninstallCert() s := C.GoString(p) if len(s) != 0 { - oscmd := exec.Command("osascript", "-e", "display dialog \""+s+"\" buttons \"OK\" with title \"Arduino Agent: Error uninstalling certificates\"") - _ = oscmd.Run() + utilities.UserPrompt("display dialog \"" + s + "\" buttons \"OK\" with title \"Arduino Agent: Error uninstalling certificates\"") return errors.New(s) } return nil } + +// GetExpirationDate returns the expiration date of a certificate stored in the keychain +func GetExpirationDate() (string, error) { + log.Infof("Retrieving certificate's expiration date") + dateString := C.CString("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") // 32 characters string + defer C.free(unsafe.Pointer(dateString)) + p := C.getExpirationDate(dateString) + s := C.GoString(p) + if len(s) != 0 { + utilities.UserPrompt("display dialog \"" + s + "\" buttons \"OK\" with title \"Arduino Agent: Error retrieving expiration date\"") + return "", errors.New(s) + } + date := C.GoString(dateString) + return strings.ReplaceAll(date, " +0000", ""), nil +} + +// GetDefaultBrowserName returns the name of the default browser +func GetDefaultBrowserName() string { + log.Infof("Retrieving default browser name") + p := C.getDefaultBrowserName() + return C.GoString(p) +} diff --git a/certificates/install_default.go b/certificates/install_default.go index 1b7f24bb..8013c018 100644 --- a/certificates/install_default.go +++ b/certificates/install_default.go @@ -36,3 +36,15 @@ func UninstallCertificates() error { log.Warn("platform not supported for the certificates uninstall") return errors.New("platform not supported for the certificates uninstall") } + +// GetExpirationDate won't do anything on unsupported Operative Systems +func GetExpirationDate() (string, error) { + log.Warn("platform not supported for retrieving certificates expiration date") + return "", errors.New("platform not supported for retrieving certificates expiration date") +} + +// GetDefaultBrowserName won't do anything on unsupported Operative Systems +func GetDefaultBrowserName() string { + log.Warn("platform not supported for retrieving default browser name") + return "" +} diff --git a/config/config.go b/config/config.go index 437437e5..69d29eee 100644 --- a/config/config.go +++ b/config/config.go @@ -21,6 +21,7 @@ import ( "os" "github.com/arduino/go-paths-helper" + "github.com/go-ini/ini" log "github.com/sirupsen/logrus" ) @@ -124,3 +125,20 @@ func GenerateConfig(destDir *paths.Path) *paths.Path { log.Infof("generated config in %s", configPath) return configPath } + +// SetInstallCertsIni sets installCerts value to true in the config +func SetInstallCertsIni(filename string, value string) error { + cfg, err := ini.LoadSources(ini.LoadOptions{IgnoreInlineComment: false, AllowPythonMultilineValues: true}, filename) + if err != nil { + return err + } + _, err = cfg.Section("").NewKey("installCerts", value) + if err != nil { + return err + } + err = cfg.SaveTo(filename) + if err != nil { + return err + } + return nil +} diff --git a/main.go b/main.go index 45ae5259..0231548d 100755 --- a/main.go +++ b/main.go @@ -25,7 +25,6 @@ import ( "html/template" "io" "os" - "os/exec" "regexp" "runtime" "runtime/debug" @@ -40,6 +39,7 @@ import ( "github.com/arduino/arduino-create-agent/systray" "github.com/arduino/arduino-create-agent/tools" "github.com/arduino/arduino-create-agent/updater" + "github.com/arduino/arduino-create-agent/utilities" v2 "github.com/arduino/arduino-create-agent/v2" paths "github.com/arduino/go-paths-helper" cors "github.com/gin-contrib/cors" @@ -86,6 +86,7 @@ var ( verbose = iniConf.Bool("v", true, "show debug logging") crashreport = iniConf.Bool("crashreport", false, "enable crashreport logging") autostartMacOS = iniConf.Bool("autostartMacOS", true, "the Arduino Create Agent is able to start automatically after login on macOS (launchd agent)") + installCerts = iniConf.Bool("installCerts", false, "install the HTTPS certificate for Safari and keep it updated") ) // the ports filter provided by the user via the -regex flag, if any @@ -177,7 +178,7 @@ func loop() { // If we are updating manually from 1.2.7 to 1.3.0 we have to uninstall the old agent manually first. // This check will inform the user if he needs to run the uninstall first if runtime.GOOS == "darwin" && oldInstallExists() { - printDialog("Old agent installation of the Arduino Create Agent found, please uninstall it before launching the new one") + utilities.UserPrompt("display dialog \"Old agent installation of the Arduino Create Agent found, please uninstall it before launching the new one\" buttons \"OK\" with title \"Error\"") os.Exit(0) } @@ -220,6 +221,32 @@ func loop() { configPath = config.GenerateConfig(configDir) } + // if the default browser is Safari, prompt the user to install HTTPS certificates + // and eventually install them + if runtime.GOOS == "darwin" && cert.GetDefaultBrowserName() == "Safari" { + if exist, err := installCertsKeyExists(configPath.String()); err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) + } else if !exist { + if config.CertsExist() { + err = config.SetInstallCertsIni(configPath.String(), "true") + if err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) + } + } else if cert.PromptInstallCertsSafari() { + err = config.SetInstallCertsIni(configPath.String(), "true") + if err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) + } + cert.GenerateAndInstallCertificates(config.GetCertificatesDir()) + } else { + err = config.SetInstallCertsIni(configPath.String(), "false") + if err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) + } + } + } + } + // Parse the config.ini args, err := parseIni(configPath.String()) if err != nil { @@ -342,6 +369,24 @@ func loop() { } } + // check if the HTTPS certificates are expired and prompt the user to update them on macOS + if runtime.GOOS == "darwin" && cert.GetDefaultBrowserName() == "Safari" { + if *installCerts { + if config.CertsExist() { + cert.PromptExpiredCerts(config.GetCertificatesDir()) + } else if cert.PromptInstallCertsSafari() { + // installing the certificates from scratch at this point should only happen if + // something went wrong during previous installation attempts + cert.GenerateAndInstallCertificates(config.GetCertificatesDir()) + } else { + err = config.SetInstallCertsIni(configPath.String(), "false") + if err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) + } + } + } + } + // launch the discoveries for the running system go serialPorts.Run() // launch the hub routine which is the singleton for the websocket server @@ -457,12 +502,6 @@ func oldInstallExists() bool { return oldAgentPath.Join("ArduinoCreateAgent.app").Exist() } -// printDialog will print a GUI error dialog on macos -func printDialog(dialogText string) { - oscmd := exec.Command("osascript", "-e", "display dialog \""+dialogText+"\" buttons \"OK\" with title \"Error\"") - _ = oscmd.Run() -} - func parseIni(filename string) (args []string, err error) { cfg, err := ini.LoadSources(ini.LoadOptions{IgnoreInlineComment: false, AllowPythonMultilineValues: true}, filename) if err != nil { @@ -487,3 +526,11 @@ func parseIni(filename string) (args []string, err error) { return args, nil } + +func installCertsKeyExists(filename string) (bool, error) { + cfg, err := ini.LoadSources(ini.LoadOptions{IgnoreInlineComment: false, AllowPythonMultilineValues: true}, filename) + if err != nil { + return false, err + } + return cfg.Section("").HasKey("installCerts"), nil +} diff --git a/systray/systray_real.go b/systray/systray_real.go index 62e52e21..503373d8 100644 --- a/systray/systray_real.go +++ b/systray/systray_real.go @@ -22,11 +22,13 @@ package systray import ( "os" "runtime" + "strings" "fyne.io/systray" cert "github.com/arduino/arduino-create-agent/certificates" "github.com/arduino/arduino-create-agent/config" "github.com/arduino/arduino-create-agent/icon" + "github.com/arduino/arduino-create-agent/utilities" "github.com/go-ini/ini" log "github.com/sirupsen/logrus" "github.com/skratchdot/open-golang/open" @@ -63,16 +65,11 @@ func (s *Systray) start() { mRmCrashes := systray.AddMenuItem("Remove crash reports", "") s.updateMenuItem(mRmCrashes, config.LogsIsEmpty()) - mGenCerts := systray.AddMenuItem("Generate and Install HTTPS certificates", "HTTPS Certs") - mRemoveCerts := systray.AddMenuItem("Remove HTTPS certificates", "") + mManageCerts := systray.AddMenuItem("Manage HTTPS certificate", "HTTPS Certs") // On linux/windows chrome/firefox/edge(chromium) the agent works without problems on plain HTTP, // so we disable the menuItem to generate/install the certificates if runtime.GOOS != "darwin" { - s.updateMenuItem(mGenCerts, true) - s.updateMenuItem(mRemoveCerts, true) - } else { - s.updateMenuItem(mGenCerts, config.CertsExist()) - s.updateMenuItem(mRemoveCerts, !config.CertsExist()) + s.updateMenuItem(mManageCerts, true) } // Add pause/quit @@ -96,25 +93,41 @@ func (s *Systray) start() { case <-mRmCrashes.ClickedCh: RemoveCrashes() s.updateMenuItem(mRmCrashes, config.LogsIsEmpty()) - case <-mGenCerts.ClickedCh: + case <-mManageCerts.ClickedCh: + infoMsg := "The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\n\nYour HTTPS certificate status:\n" + buttons := "{\"Install the certificate for Safari\", \"OK\"} default button \"OK\"" certDir := config.GetCertificatesDir() - cert.GenerateCertificates(certDir) - err := cert.InstallCertificate(certDir.Join("ca.cert.cer")) - // if something goes wrong during the cert install we remove them, so the user is able to retry - if err != nil { - log.Errorf("cannot install certificates something went wrong: %s", err) - cert.DeleteCertificates(certDir) - } - s.Restart() - case <-mRemoveCerts.ClickedCh: - err := cert.UninstallCertificates() - if err != nil { - log.Errorf("cannot uninstall certificates something went wrong: %s", err) + if config.CertsExist() { + expDate, err := cert.GetExpirationDate() + if err != nil { + log.Errorf("cannot get certificates expiration date, something went wrong: %s", err) + } + infoMsg = infoMsg + "- Certificate installed: Yes\n- Certificate trusted: Yes\n- Certificate expiration date: " + expDate + buttons = "{\"Uninstall the certificate for Safari\", \"OK\"} default button \"OK\"" } else { - certDir := config.GetCertificatesDir() - cert.DeleteCertificates(certDir) + infoMsg = infoMsg + "- Certificate installed: No\n- Certificate trusted: N/A\n- Certificate expiration date: N/A" + } + pressedButton := utilities.UserPrompt("display dialog \"" + infoMsg + "\" buttons " + buttons + " with title \"Arduino Agent: Manage HTTPS certificate\"") + if strings.Contains(pressedButton, "Install certificate for Safari") { + cert.GenerateAndInstallCertificates(certDir) + err := config.SetInstallCertsIni(s.currentConfigFilePath.String(), "true") + if err != nil { + log.Errorf("cannot set installCerts value in config.ini: %s", err) + } + s.Restart() + } else if strings.Contains(pressedButton, "Uninstall certificate for Safari") { + err := cert.UninstallCertificates() + if err != nil { + log.Errorf("cannot uninstall certificates something went wrong: %s", err) + } else { + cert.DeleteCertificates(certDir) + err = config.SetInstallCertsIni(s.currentConfigFilePath.String(), "false") + if err != nil { + log.Errorf("cannot set installCerts value in config.ini: %s", err) + } + } + s.Restart() } - s.Restart() case <-mPause.ClickedCh: s.Pause() case <-mQuit.ClickedCh: diff --git a/tests/test_info.py b/tests/test_info.py index 6982ca35..efda3bce 100644 --- a/tests/test_info.py +++ b/tests/test_info.py @@ -15,8 +15,14 @@ import re import requests +import pytest +from sys import platform +@pytest.mark.skipif( + platform == "darwin", + reason="on macOS the user is prompted to install certificates", +) def test_version(base_url, agent): resp = requests.get(f"{base_url}/info") diff --git a/tests/test_v2.py b/tests/test_v2.py index 9a377802..5fa44034 100644 --- a/tests/test_v2.py +++ b/tests/test_v2.py @@ -14,8 +14,14 @@ # along with this program. If not, see . import requests +import pytest +from sys import platform +@pytest.mark.skipif( + platform == "darwin", + reason="on macOS the user is prompted to install certificates", +) def test_get_tools(base_url, agent): resp = requests.get(f"{base_url}/v2/pkgs/tools/installed") diff --git a/tests/test_ws.py b/tests/test_ws.py index c2623da5..b8004649 100644 --- a/tests/test_ws.py +++ b/tests/test_ws.py @@ -17,16 +17,25 @@ import json import base64 import pytest +from sys import platform from common import running_on_ci message = [] +@pytest.mark.skipif( + platform == "darwin", + reason="on macOS the user is prompted to install certificates", +) def test_ws_connection(socketio): print('my sid is', socketio.sid) assert socketio.sid is not None +@pytest.mark.skipif( + platform == "darwin", + reason="on macOS the user is prompted to install certificates", +) def test_list(socketio, message): socketio.emit('command', 'list') time.sleep(.2) diff --git a/utilities/utilities.go b/utilities/utilities.go index 4f40aaf7..63f09103 100644 --- a/utilities/utilities.go +++ b/utilities/utilities.go @@ -149,3 +149,10 @@ func VerifyInput(input string, signature string) error { d := h.Sum(nil) return rsa.VerifyPKCS1v15(rsaKey, crypto.SHA256, d, sign) } + +// UserPrompt executes an osascript and returns the pressed button +func UserPrompt(dialog string) string { + oscmd := exec.Command("osascript", "-e", dialog) + pressedButton, _ := oscmd.Output() + return string(pressedButton) +} From 3190a1a1326bd841454d5fbb7efd7adc2f6d697e Mon Sep 17 00:00:00 2001 From: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com> Date: Mon, 13 May 2024 15:51:29 +0200 Subject: [PATCH 04/42] Fix buttons and improve handling of certificates when Safari is not the default browser (#949) * Fix check on buttons returning the correct message * Update certificates regardless of the default browser * Set installCerts when the certificate is installed from previous versions of the Agent regardless of the default browser * Do not set installCerts to false if the default browser is not Safari * Do not ask again to update the certificate if the user refuses once * Fix user script on macOS * Check for the presence of the certificate in the keychain to determine if it is installed * Fix getExpirationDate breaking when the certificate is expired * Fix return value in case of error * getExpirationDate rewritten to use the correct expiration field. * Separate osascript default button from the one to press * Fix leftover buttons * Small text fixes in the "manage certificate" dialog * Simplify error management in getExpirationDate * Fix compiler warnings and move obj-c code into a separate file. * certInKeychain returns a bool * Fix building errors caused by objective-c files on Ubuntu and Windows * Build objective-c files only on Darwin * Remove -ld_classic library because XCode is not up to date on the CI --------- Co-authored-by: Xayton <30591904+Xayton@users.noreply.github.com> --- certificates/certificates.go | 34 +----- certificates/certificates_darwin.h | 7 ++ certificates/certificates_darwin.m | 137 +++++++++++++++++++++++ certificates/install_darwin.go | 172 +++++------------------------ certificates/install_default.go | 11 +- main.go | 75 ++++++++----- systray/systray_real.go | 50 +++++---- utilities/utilities.go | 6 +- 8 files changed, 264 insertions(+), 228 deletions(-) create mode 100644 certificates/certificates_darwin.h create mode 100644 certificates/certificates_darwin.m diff --git a/certificates/certificates.go b/certificates/certificates.go index baac7c33..8a8c50d8 100644 --- a/certificates/certificates.go +++ b/certificates/certificates.go @@ -30,16 +30,13 @@ import ( "math/big" "net" "os" - "strings" "time" - "github.com/arduino/arduino-create-agent/utilities" "github.com/arduino/go-paths-helper" log "github.com/sirupsen/logrus" ) var ( - host = "localhost" validFrom = "" validFor = 365 * 24 * time.Hour * 2 // 2 years rsaBits = 2048 @@ -270,41 +267,16 @@ func DeleteCertificates(certDir *paths.Path) { certDir.Join("cert.cer").Remove() } -// isExpired checks if a certificate is expired or about to expire (less than 1 month) -func isExpired() (bool, error) { +// IsExpired checks if a certificate is expired or about to expire (less than 1 month) +func IsExpired() (bool, error) { bound := time.Now().AddDate(0, 1, 0) - dateS, err := GetExpirationDate() + date, err := GetExpirationDate() if err != nil { return false, err } - date, _ := time.Parse(time.DateTime, dateS) return date.Before(bound), nil } -// PromptInstallCertsSafari prompts the user to install the HTTPS certificates if they are using Safari -func PromptInstallCertsSafari() bool { - buttonPressed := utilities.UserPrompt("display dialog \"The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nIf you use Safari, you need to install it.\" buttons {\"Do not install\", \"Install the certificate for Safari\"} default button 2 with title \"Arduino Agent: Install certificate\"") - return strings.Contains(string(buttonPressed), "button returned:Install the certificate for Safari") -} - -// PromptExpiredCerts prompts the user to update the HTTPS certificates if they are using Safari -func PromptExpiredCerts(certDir *paths.Path) { - if expired, err := isExpired(); err != nil { - log.Errorf("cannot check if certificates are expired something went wrong: %s", err) - } else if expired { - buttonPressed := utilities.UserPrompt("display dialog \"The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nYour certificate is expired or close to expiration. Do you want to update it?\" buttons {\"Do not update\", \"Update the certificate for Safari\"} default button 2 with title \"Arduino Agent: Update certificate\"") - if strings.Contains(string(buttonPressed), "button returned:Update the certificate for Safari") { - err := UninstallCertificates() - if err != nil { - log.Errorf("cannot uninstall certificates something went wrong: %s", err) - } else { - DeleteCertificates(certDir) - GenerateAndInstallCertificates(certDir) - } - } - } -} - // GenerateAndInstallCertificates generates and installs the certificates func GenerateAndInstallCertificates(certDir *paths.Path) { GenerateCertificates(certDir) diff --git a/certificates/certificates_darwin.h b/certificates/certificates_darwin.h new file mode 100644 index 00000000..78ba0ae5 --- /dev/null +++ b/certificates/certificates_darwin.h @@ -0,0 +1,7 @@ +const char *getDefaultBrowserName(); + +const char *installCert(const char *path); +const char *uninstallCert(); +const bool certInKeychain(); + +const char *getExpirationDate(long *expirationDate); \ No newline at end of file diff --git a/certificates/certificates_darwin.m b/certificates/certificates_darwin.m new file mode 100644 index 00000000..0ac51183 --- /dev/null +++ b/certificates/certificates_darwin.m @@ -0,0 +1,137 @@ +#import +#import +#include "certificates_darwin.h" + +// Used to return error strings (as NSString) as a C-string to the Go code. +const char *toErrorString(NSString *errString) { + NSLog(@"%@", errString); + return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; +} + +// Returns a string describing the name of the default browser set for the user, nil in case of error. +const char *getDefaultBrowserName() { + NSURL *defaultBrowserURL = [[NSWorkspace sharedWorkspace] URLForApplicationToOpenURL:[NSURL URLWithString:@"http://"]]; + if (defaultBrowserURL) { + NSBundle *defaultBrowserBundle = [NSBundle bundleWithURL:defaultBrowserURL]; + NSString *defaultBrowser = [defaultBrowserBundle objectForInfoDictionaryKey:@"CFBundleDisplayName"]; + + return [defaultBrowser cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } + + return ""; +} + +// inspired by https://stackoverflow.com/questions/12798950/ios-install-ssl-certificate-programmatically +const char *installCert(const char *path) { + NSURL *url = [NSURL fileURLWithPath:@(path) isDirectory:NO]; + NSData *rootCertData = [NSData dataWithContentsOfURL:url]; + + OSStatus err = noErr; + SecCertificateRef rootCert = SecCertificateCreateWithData(kCFAllocatorDefault, (CFDataRef) rootCertData); + + CFTypeRef result; + + NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: + (id)kSecClassCertificate, kSecClass, + rootCert, kSecValueRef, + nil]; + + err = SecItemAdd((CFDictionaryRef)dict, &result); + + if (err == noErr) { + NSLog(@"Install root certificate success"); + } else if (err == errSecDuplicateItem) { + NSString *errString = [@"duplicate root certificate entry. Error: " stringByAppendingFormat:@"%d", err]; + NSLog(@"%@", errString); + return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } else { + NSString *errString = [@"install root certificate failure. Error: " stringByAppendingFormat:@"%d", err]; + NSLog(@"%@", errString); + return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } + + NSDictionary *newTrustSettings = @{(id)kSecTrustSettingsResult: [NSNumber numberWithInt:kSecTrustSettingsResultTrustRoot]}; + err = SecTrustSettingsSetTrustSettings(rootCert, kSecTrustSettingsDomainUser, (__bridge CFTypeRef)(newTrustSettings)); + if (err != errSecSuccess) { + NSString *errString = [@"Could not change the trust setting for a certificate. Error: " stringByAppendingFormat:@"%d", err]; + NSLog(@"%@", errString); + return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } + + return ""; +} + +const char *uninstallCert() { + // Each line is a key-value of the dictionary. Note: the the inverted order, value first then key. + NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: + (id)kSecClassCertificate, kSecClass, + CFSTR("Arduino"), kSecAttrLabel, + kSecMatchLimitOne, kSecMatchLimit, + kCFBooleanTrue, kSecReturnAttributes, + nil]; + + OSStatus err = noErr; + // Use this function to check for errors + err = SecItemCopyMatching((CFDictionaryRef)dict, nil); + if (err == noErr) { + err = SecItemDelete((CFDictionaryRef)dict); + if (err != noErr) { + NSString *errString = [@"Could not delete the certificates. Error: " stringByAppendingFormat:@"%d", err]; + NSLog(@"%@", errString); + return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } + } else if (err != errSecItemNotFound){ + NSString *errString = [@"Error: " stringByAppendingFormat:@"%d", err]; + NSLog(@"%@", errString); + return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; + } + return ""; +} + +const bool certInKeychain() { + // Create a key-value dictionary used to query the Keychain and look for the "Arduino" root certificate. + NSDictionary *getquery = @{ + (id)kSecClass: (id)kSecClassCertificate, + (id)kSecAttrLabel: @"Arduino", + (id)kSecReturnRef: @YES, + }; + + OSStatus err = SecItemCopyMatching((CFDictionaryRef)getquery, nil); + return (err == noErr); // No error means the certificate was found, otherwise err will be "errSecItemNotFound". +} + +// Returns the expiration date "kSecOIDX509V1ValidityNotAfter" of the Arduino certificate. +// The value is returned as a CFAbsoluteTime: a long number of seconds from the date of 1 Jan 2001 00:00:00 GMT. +const char *getExpirationDate(long *expirationDate) { + // Create a key-value dictionary used to query the Keychain and look for the "Arduino" root certificate. + NSDictionary *getquery = @{ + (id)kSecClass: (id)kSecClassCertificate, + (id)kSecAttrLabel: @"Arduino", + (id)kSecReturnRef: @YES, + }; + + SecCertificateRef cert = NULL; + + // Search the keychain for certificates matching the query above. + OSStatus err = SecItemCopyMatching((CFDictionaryRef)getquery, (CFTypeRef *)&cert); + if (err != noErr) return toErrorString([@"Error getting the certificate: " stringByAppendingFormat:@"%d", err]); + + // Get data from the certificate, as a dictionary of properties. We just need the "invalidity not after" property. + CFDictionaryRef certDict = SecCertificateCopyValues(cert, + (__bridge CFArrayRef)@[(__bridge id)kSecOIDX509V1ValidityNotAfter], NULL); + if (certDict == NULL) return toErrorString(@"SecCertificateCopyValues failed"); + + + // Get the "validity not after" property as a dictionary, and get the "value" key (that is a number). + CFDictionaryRef validityNotAfterDict = CFDictionaryGetValue(certDict, kSecOIDX509V1ValidityNotAfter); + if (validityNotAfterDict == NULL) return toErrorString(@"CFDictionaryGetValue (validity) failed"); + + CFNumberRef number = (CFNumberRef)CFDictionaryGetValue(validityNotAfterDict, kSecPropertyKeyValue); + if (number == NULL) return toErrorString(@"CFDictionaryGetValue (keyValue) failed"); + + CFNumberGetValue(number, kCFNumberSInt64Type, expirationDate); + // NSLog(@"Certificate validity not after: %ld", *expirationDate); + + CFRelease(certDict); + return ""; // No error. +} \ No newline at end of file diff --git a/certificates/install_darwin.go b/certificates/install_darwin.go index 892c390b..515c9f7d 100644 --- a/certificates/install_darwin.go +++ b/certificates/install_darwin.go @@ -15,146 +15,20 @@ package certificates -//inspired by https://stackoverflow.com/questions/12798950/ios-install-ssl-certificate-programmatically - /* // Explicitly tell the GCC compiler that the language is Objective-C. #cgo CFLAGS: -x objective-c -// Pass the list of macOS frameworks needed by this piece of Objective-C code. -#cgo LDFLAGS: -framework Cocoa -#import - -const char *installCert(const char *path) { - NSURL *url = [NSURL fileURLWithPath:@(path) isDirectory:NO]; - NSData *rootCertData = [NSData dataWithContentsOfURL:url]; - - OSStatus err = noErr; - SecCertificateRef rootCert = SecCertificateCreateWithData(kCFAllocatorDefault, (CFDataRef) rootCertData); - - CFTypeRef result; - - NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: - (id)kSecClassCertificate, kSecClass, - rootCert, kSecValueRef, - nil]; - - err = SecItemAdd((CFDictionaryRef)dict, &result); - - if (err == noErr) { - NSLog(@"Install root certificate success"); - } else if (err == errSecDuplicateItem) { - NSString *errString = [@"duplicate root certificate entry. Error: " stringByAppendingFormat:@"%d", err]; - NSLog(@"%@", errString); - return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]];; - } else { - NSString *errString = [@"install root certificate failure. Error: " stringByAppendingFormat:@"%d", err]; - NSLog(@"%@", errString); - return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; - } - - NSDictionary *newTrustSettings = @{(id)kSecTrustSettingsResult: [NSNumber numberWithInt:kSecTrustSettingsResultTrustRoot]}; - err = SecTrustSettingsSetTrustSettings(rootCert, kSecTrustSettingsDomainUser, (__bridge CFTypeRef)(newTrustSettings)); - if (err != errSecSuccess) { - NSString *errString = [@"Could not change the trust setting for a certificate. Error: " stringByAppendingFormat:@"%d", err]; - NSLog(@"%@", errString); - return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; - } - - return ""; -} - -const char *uninstallCert() { - // Each line is a key-value of the dictionary. Note: the the inverted order, value first then key. - NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: - (id)kSecClassCertificate, kSecClass, - CFSTR("Arduino"), kSecAttrLabel, - kSecMatchLimitOne, kSecMatchLimit, - kCFBooleanTrue, kSecReturnAttributes, - nil]; - - OSStatus err = noErr; - // Use this function to check for errors - err = SecItemCopyMatching((CFDictionaryRef)dict, nil); - if (err == noErr) { - err = SecItemDelete((CFDictionaryRef)dict); - if (err != noErr) { - NSString *errString = [@"Could not delete the certificates. Error: " stringByAppendingFormat:@"%d", err]; - NSLog(@"%@", errString); - return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]];; - } - } else if (err != errSecItemNotFound){ - NSString *errString = [@"Error: " stringByAppendingFormat:@"%d", err]; - NSLog(@"%@", errString); - return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]];; - } - return ""; -} - -const char *getExpirationDate(char *expirationDate){ - // Create a key-value dictionary used to query the Keychain and look for the "Arduino" root certificate. - NSDictionary *getquery = @{ - (id)kSecClass: (id)kSecClassCertificate, - (id)kSecAttrLabel: @"Arduino", - (id)kSecReturnRef: @YES, - }; - - OSStatus err = noErr; - SecCertificateRef cert = NULL; - - // Use this function to check for errors - err = SecItemCopyMatching((CFDictionaryRef)getquery, (CFTypeRef *)&cert); - - if (err != noErr){ - NSString *errString = [@"Error: " stringByAppendingFormat:@"%d", err]; - NSLog(@"%@", errString); - return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; - } - // Get data from the certificate. We just need the "invalidity date" property. - CFDictionaryRef valuesDict = SecCertificateCopyValues(cert, (__bridge CFArrayRef)@[(__bridge id)kSecOIDInvalidityDate], NULL); - - id expirationDateValue; - if(valuesDict){ - CFDictionaryRef invalidityDateDictionaryRef = CFDictionaryGetValue(valuesDict, kSecOIDInvalidityDate); - if(invalidityDateDictionaryRef){ - CFTypeRef invalidityRef = CFDictionaryGetValue(invalidityDateDictionaryRef, kSecPropertyKeyValue); - if(invalidityRef){ - expirationDateValue = CFBridgingRelease(invalidityRef); - } - } - CFRelease(valuesDict); - } - - NSString *outputString = [@"" stringByAppendingFormat:@"%@", expirationDateValue]; - if([outputString isEqualToString:@""]){ - NSString *errString = @"Error: the expiration date of the certificate could not be found"; - NSLog(@"%@", errString); - return [errString cStringUsingEncoding:[NSString defaultCStringEncoding]]; - } - - // This workaround allows to obtain the expiration date alongside the error message - strncpy(expirationDate, [outputString cStringUsingEncoding:[NSString defaultCStringEncoding]], 32); - expirationDate[32-1] = 0; - - return ""; -} - -const char *getDefaultBrowserName() { - NSURL *defaultBrowserURL = [[NSWorkspace sharedWorkspace] URLForApplicationToOpenURL:[NSURL URLWithString:@"http://"]]; - if (defaultBrowserURL) { - NSBundle *defaultBrowserBundle = [NSBundle bundleWithURL:defaultBrowserURL]; - NSString *defaultBrowser = [defaultBrowserBundle objectForInfoDictionaryKey:@"CFBundleDisplayName"]; - - return [defaultBrowser cStringUsingEncoding:[NSString defaultCStringEncoding]]; - } +// Pass the list of macOS frameworks needed by this piece of Objective-C code. +#cgo LDFLAGS: -framework Foundation -framework Security -framework AppKit - return ""; -} +#import +#include "certificates_darwin.h" */ import "C" import ( "errors" - "strings" + "time" "unsafe" log "github.com/sirupsen/logrus" @@ -172,7 +46,7 @@ func InstallCertificate(cert *paths.Path) error { p := C.installCert(ccert) s := C.GoString(p) if len(s) != 0 { - utilities.UserPrompt("display dialog \"" + s + "\" buttons \"OK\" with title \"Arduino Agent: Error installing certificates\"") + utilities.UserPrompt(s, "\"OK\"", "OK", "OK", "Arduino Agent: Error installing certificates") UninstallCertificates() return errors.New(s) } @@ -186,25 +60,29 @@ func UninstallCertificates() error { p := C.uninstallCert() s := C.GoString(p) if len(s) != 0 { - utilities.UserPrompt("display dialog \"" + s + "\" buttons \"OK\" with title \"Arduino Agent: Error uninstalling certificates\"") + utilities.UserPrompt(s, "\"OK\"", "OK", "OK", "Arduino Agent: Error uninstalling certificates") return errors.New(s) } return nil } // GetExpirationDate returns the expiration date of a certificate stored in the keychain -func GetExpirationDate() (string, error) { +func GetExpirationDate() (time.Time, error) { log.Infof("Retrieving certificate's expiration date") - dateString := C.CString("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") // 32 characters string - defer C.free(unsafe.Pointer(dateString)) - p := C.getExpirationDate(dateString) - s := C.GoString(p) - if len(s) != 0 { - utilities.UserPrompt("display dialog \"" + s + "\" buttons \"OK\" with title \"Arduino Agent: Error retrieving expiration date\"") - return "", errors.New(s) + + expirationDateLong := C.long(0) + + err := C.getExpirationDate(&expirationDateLong) + errString := C.GoString(err) + if len(errString) > 0 { + utilities.UserPrompt(errString, "\"OK\"", "OK", "OK", "Arduino Agent: Error retrieving expiration date") + return time.Time{}, errors.New(errString) } - date := C.GoString(dateString) - return strings.ReplaceAll(date, " +0000", ""), nil + + // The expirationDate is the number of seconds from the date of 1 Jan 2001 00:00:00 GMT. + // Add 31 years to convert it to Unix Epoch. + expirationDate := int64(expirationDateLong) + return time.Unix(expirationDate, 0).AddDate(31, 0, 0), nil } // GetDefaultBrowserName returns the name of the default browser @@ -213,3 +91,11 @@ func GetDefaultBrowserName() string { p := C.getDefaultBrowserName() return C.GoString(p) } + +// CertInKeychain checks if the certificate is stored inside the keychain +func CertInKeychain() bool { + log.Infof("Checking if the Arduino certificate is in the keychain") + + certInKeychain := C.certInKeychain() + return bool(certInKeychain) +} diff --git a/certificates/install_default.go b/certificates/install_default.go index 8013c018..533574d6 100644 --- a/certificates/install_default.go +++ b/certificates/install_default.go @@ -19,6 +19,7 @@ package certificates import ( "errors" + "time" log "github.com/sirupsen/logrus" @@ -38,9 +39,9 @@ func UninstallCertificates() error { } // GetExpirationDate won't do anything on unsupported Operative Systems -func GetExpirationDate() (string, error) { +func GetExpirationDate() (time.Time, error) { log.Warn("platform not supported for retrieving certificates expiration date") - return "", errors.New("platform not supported for retrieving certificates expiration date") + return time.Time{}, errors.New("platform not supported for retrieving certificates expiration date") } // GetDefaultBrowserName won't do anything on unsupported Operative Systems @@ -48,3 +49,9 @@ func GetDefaultBrowserName() string { log.Warn("platform not supported for retrieving default browser name") return "" } + +// CertInKeychain won't do anything on unsupported Operative Systems +func CertInKeychain() bool { + log.Warn("platform not supported for verifying the certificate existence") + return false +} diff --git a/main.go b/main.go index 0231548d..1ca857b0 100755 --- a/main.go +++ b/main.go @@ -178,7 +178,7 @@ func loop() { // If we are updating manually from 1.2.7 to 1.3.0 we have to uninstall the old agent manually first. // This check will inform the user if he needs to run the uninstall first if runtime.GOOS == "darwin" && oldInstallExists() { - utilities.UserPrompt("display dialog \"Old agent installation of the Arduino Create Agent found, please uninstall it before launching the new one\" buttons \"OK\" with title \"Error\"") + utilities.UserPrompt("Old agent installation of the Arduino Create Agent found, please uninstall it before launching the new one", "\"OK\"", "OK", "OK", "Error") os.Exit(0) } @@ -223,25 +223,27 @@ func loop() { // if the default browser is Safari, prompt the user to install HTTPS certificates // and eventually install them - if runtime.GOOS == "darwin" && cert.GetDefaultBrowserName() == "Safari" { + if runtime.GOOS == "darwin" { if exist, err := installCertsKeyExists(configPath.String()); err != nil { log.Panicf("config.ini cannot be parsed: %s", err) } else if !exist { - if config.CertsExist() { - err = config.SetInstallCertsIni(configPath.String(), "true") - if err != nil { - log.Panicf("config.ini cannot be parsed: %s", err) - } - } else if cert.PromptInstallCertsSafari() { + if cert.CertInKeychain() || config.CertsExist() { err = config.SetInstallCertsIni(configPath.String(), "true") if err != nil { log.Panicf("config.ini cannot be parsed: %s", err) } - cert.GenerateAndInstallCertificates(config.GetCertificatesDir()) - } else { - err = config.SetInstallCertsIni(configPath.String(), "false") - if err != nil { - log.Panicf("config.ini cannot be parsed: %s", err) + } else if cert.GetDefaultBrowserName() == "Safari" { + if promptInstallCertsSafari() { + err = config.SetInstallCertsIni(configPath.String(), "true") + if err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) + } + cert.GenerateAndInstallCertificates(config.GetCertificatesDir()) + } else { + err = config.SetInstallCertsIni(configPath.String(), "false") + if err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) + } } } } @@ -369,21 +371,38 @@ func loop() { } } - // check if the HTTPS certificates are expired and prompt the user to update them on macOS - if runtime.GOOS == "darwin" && cert.GetDefaultBrowserName() == "Safari" { - if *installCerts { - if config.CertsExist() { - cert.PromptExpiredCerts(config.GetCertificatesDir()) - } else if cert.PromptInstallCertsSafari() { - // installing the certificates from scratch at this point should only happen if - // something went wrong during previous installation attempts - cert.GenerateAndInstallCertificates(config.GetCertificatesDir()) - } else { - err = config.SetInstallCertsIni(configPath.String(), "false") - if err != nil { - log.Panicf("config.ini cannot be parsed: %s", err) + // check if the HTTPS certificates are expired or expiring and prompt the user to update them on macOS + if runtime.GOOS == "darwin" && *installCerts { + if cert.CertInKeychain() || config.CertsExist() { + certDir := config.GetCertificatesDir() + if expired, err := cert.IsExpired(); err != nil { + log.Errorf("cannot check if certificates are expired something went wrong: %s", err) + } else if expired { + buttonPressed := utilities.UserPrompt("The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nYour certificate is expired or close to expiration. Do you want to update it?", "{\"Do not update\", \"Update the certificate for Safari\"}", "Update the certificate for Safari", "Update the certificate for Safari", "Arduino Agent: Update certificate") + if buttonPressed { + err := cert.UninstallCertificates() + if err != nil { + log.Errorf("cannot uninstall certificates something went wrong: %s", err) + } else { + cert.DeleteCertificates(certDir) + cert.GenerateAndInstallCertificates(certDir) + } + } else { + err = config.SetInstallCertsIni(configPath.String(), "false") + if err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) + } } } + } else if promptInstallCertsSafari() { + // installing the certificates from scratch at this point should only happen if + // something went wrong during previous installation attempts + cert.GenerateAndInstallCertificates(config.GetCertificatesDir()) + } else { + err = config.SetInstallCertsIni(configPath.String(), "false") + if err != nil { + log.Panicf("config.ini cannot be parsed: %s", err) + } } } @@ -534,3 +553,7 @@ func installCertsKeyExists(filename string) (bool, error) { } return cfg.Section("").HasKey("installCerts"), nil } + +func promptInstallCertsSafari() bool { + return utilities.UserPrompt("The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\nIf you use Safari, you need to install it.", "{\"Do not install\", \"Install the certificate for Safari\"}", "Install the certificate for Safari", "Install the certificate for Safari", "Arduino Agent: Install certificate") +} diff --git a/systray/systray_real.go b/systray/systray_real.go index 503373d8..5ae79f08 100644 --- a/systray/systray_real.go +++ b/systray/systray_real.go @@ -22,7 +22,7 @@ package systray import ( "os" "runtime" - "strings" + "time" "fyne.io/systray" cert "github.com/arduino/arduino-create-agent/certificates" @@ -95,38 +95,42 @@ func (s *Systray) start() { s.updateMenuItem(mRmCrashes, config.LogsIsEmpty()) case <-mManageCerts.ClickedCh: infoMsg := "The Arduino Agent needs a local HTTPS certificate to work correctly with Safari.\n\nYour HTTPS certificate status:\n" - buttons := "{\"Install the certificate for Safari\", \"OK\"} default button \"OK\"" + buttons := "{\"Install the certificate for Safari\", \"OK\"}" + toPress := "Install the certificate for Safari" certDir := config.GetCertificatesDir() - if config.CertsExist() { + if cert.CertInKeychain() || config.CertsExist() { expDate, err := cert.GetExpirationDate() if err != nil { log.Errorf("cannot get certificates expiration date, something went wrong: %s", err) } - infoMsg = infoMsg + "- Certificate installed: Yes\n- Certificate trusted: Yes\n- Certificate expiration date: " + expDate - buttons = "{\"Uninstall the certificate for Safari\", \"OK\"} default button \"OK\"" - } else { - infoMsg = infoMsg + "- Certificate installed: No\n- Certificate trusted: N/A\n- Certificate expiration date: N/A" - } - pressedButton := utilities.UserPrompt("display dialog \"" + infoMsg + "\" buttons " + buttons + " with title \"Arduino Agent: Manage HTTPS certificate\"") - if strings.Contains(pressedButton, "Install certificate for Safari") { - cert.GenerateAndInstallCertificates(certDir) - err := config.SetInstallCertsIni(s.currentConfigFilePath.String(), "true") - if err != nil { - log.Errorf("cannot set installCerts value in config.ini: %s", err) + infoMsg = infoMsg + "- Certificate installed:\t\tYes\n- Certificate trusted:\t\tYes\n- Certificate expiration:\t" + expDate.Format(time.DateTime) + buttons = "{\"Uninstall the certificate for Safari\", \"OK\"}" + toPress = "Uninstall the certificate for Safari" + pressedButton := utilities.UserPrompt(infoMsg, buttons, "OK", toPress, "Arduino Agent: Manage HTTPS certificate") + if pressedButton { + err := cert.UninstallCertificates() + if err != nil { + log.Errorf("cannot uninstall certificates something went wrong: %s", err) + } else { + cert.DeleteCertificates(certDir) + err = config.SetInstallCertsIni(s.currentConfigFilePath.String(), "false") + if err != nil { + log.Errorf("cannot set installCerts value in config.ini: %s", err) + } + } + s.Restart() } - s.Restart() - } else if strings.Contains(pressedButton, "Uninstall certificate for Safari") { - err := cert.UninstallCertificates() - if err != nil { - log.Errorf("cannot uninstall certificates something went wrong: %s", err) - } else { - cert.DeleteCertificates(certDir) - err = config.SetInstallCertsIni(s.currentConfigFilePath.String(), "false") + } else { + infoMsg = infoMsg + "- Certificate installed:\t\tNo\n- Certificate trusted:\t\tN/A\n- Certificate expiration:\tN/A" + pressedButton := utilities.UserPrompt(infoMsg, buttons, "OK", toPress, "Arduino Agent: Manage HTTPS certificate") + if pressedButton { + cert.GenerateAndInstallCertificates(certDir) + err := config.SetInstallCertsIni(s.currentConfigFilePath.String(), "true") if err != nil { log.Errorf("cannot set installCerts value in config.ini: %s", err) } + s.Restart() } - s.Restart() } case <-mPause.ClickedCh: s.Pause() diff --git a/utilities/utilities.go b/utilities/utilities.go index 63f09103..5979732d 100644 --- a/utilities/utilities.go +++ b/utilities/utilities.go @@ -151,8 +151,8 @@ func VerifyInput(input string, signature string) error { } // UserPrompt executes an osascript and returns the pressed button -func UserPrompt(dialog string) string { - oscmd := exec.Command("osascript", "-e", dialog) +func UserPrompt(dialog string, buttons string, defaultButton string, toPress string, title string) bool { + oscmd := exec.Command("osascript", "-e", "display dialog \""+dialog+"\" buttons "+buttons+" default button\""+defaultButton+"\" with title \""+title+"\"") pressedButton, _ := oscmd.Output() - return string(pressedButton) + return strings.Contains(string(pressedButton), "button returned:"+toPress) } From 2fa738f147f149ec208f6c10c30095d6b90f789f Mon Sep 17 00:00:00 2001 From: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com> Date: Wed, 15 May 2024 09:49:44 +0200 Subject: [PATCH 05/42] Show message to the user after a successful certificate installation (#951) * Show message to the user after a successful certificate installation * Show a simplified message (different for install and uninstall cases) --------- Co-authored-by: Xayton <30591904+Xayton@users.noreply.github.com> --- certificates/certificates.go | 2 ++ systray/systray_real.go | 1 + 2 files changed, 3 insertions(+) diff --git a/certificates/certificates.go b/certificates/certificates.go index 8a8c50d8..ae2843d2 100644 --- a/certificates/certificates.go +++ b/certificates/certificates.go @@ -32,6 +32,7 @@ import ( "os" "time" + "github.com/arduino/arduino-create-agent/utilities" "github.com/arduino/go-paths-helper" log "github.com/sirupsen/logrus" ) @@ -286,4 +287,5 @@ func GenerateAndInstallCertificates(certDir *paths.Path) { log.Errorf("cannot install certificates something went wrong: %s", err) DeleteCertificates(certDir) } + utilities.UserPrompt("The HTTPS certificate has been installed correctly.", "{\"OK\"}", "OK", "OK", "Arduino Agent: HTTPS certificate installation") } diff --git a/systray/systray_real.go b/systray/systray_real.go index 5ae79f08..b070f22a 100644 --- a/systray/systray_real.go +++ b/systray/systray_real.go @@ -117,6 +117,7 @@ func (s *Systray) start() { if err != nil { log.Errorf("cannot set installCerts value in config.ini: %s", err) } + utilities.UserPrompt("The HTTPS certificate has been uninstalled.", "{\"OK\"}", "OK", "OK", "Arduino Agent: HTTPS certificate installation") } s.Restart() } From fc0a137a0953f8e07ed00f763aadcae9992593a5 Mon Sep 17 00:00:00 2001 From: Umberto Baldi <34278123+umbynos@users.noreply.github.com> Date: Thu, 16 May 2024 11:29:44 +0200 Subject: [PATCH 06/42] use eToken for signing (#950) * fix typo * use eToken for signing, create a dedicated step for signing * update workflow, we have a certificate and no longer a container for win * env var $GITHUB_REF not expanded in step input causing workflow to fail * bump runner, so that we get an updated version of openssl OpenSSL 1.1.1f-1ubuntu2.22 in Ubuntu 20.04 https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2004-Readme.md OpenSSL 3.0.2-0ubuntu1.15 in Ubuntu 22.04 https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md * add flag to correctly recognize the algorithm see https://github.com/openssl/openssl/discussions/23089 * remove double quotes, they cause errors with new version of openssl: `Could not read certificate from ` --- .github/workflows/check-certificates.yml | 69 +++++++++++++++--------- .github/workflows/release.yml | 59 +++++++++++++++----- 2 files changed, 92 insertions(+), 36 deletions(-) diff --git a/.github/workflows/check-certificates.yml b/.github/workflows/check-certificates.yml index 28e8297c..694792dc 100644 --- a/.github/workflows/check-certificates.yml +++ b/.github/workflows/check-certificates.yml @@ -26,7 +26,7 @@ jobs: if: > (github.event_name != 'pull_request' && github.repository == 'arduino/arduino-create-agent') || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'arduino/arduino-create-agent') - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -37,9 +37,11 @@ jobs: - identifier: macOS signing certificate # Text used to identify certificate in notifications. certificate-secret: INSTALLER_CERT_MAC_P12 # Name of the secret that contains the certificate. password-secret: INSTALLER_CERT_MAC_PASSWORD # Name of the secret that contains the certificate password. + type: pkcs12 - identifier: Windows signing certificate - certificate-secret: INSTALLER_CERT_WINDOWS_PFX - password-secret: INSTALLER_CERT_WINDOWS_PASSWORD + certificate-secret: INSTALLER_CERT_WINDOWS_CER + # The password for the Windows certificate is not needed, because its not a container, but a single certificate. + type: x509 steps: - name: Set certificate path environment variable @@ -58,9 +60,10 @@ jobs: CERTIFICATE_PASSWORD: ${{ secrets[matrix.certificate.password-secret] }} run: | ( - openssl pkcs12 \ + openssl ${{ matrix.certificate.type }} \ -in "${{ env.CERTIFICATE_PATH }}" \ - -noout -passin env:CERTIFICATE_PASSWORD + -noout -passin env:CERTIFICATE_PASSWORD \ + -legacy ) || ( echo "::error::Verification of ${{ matrix.certificate.identifier }} failed!!!" exit 1 @@ -83,25 +86,43 @@ jobs: CERTIFICATE_PASSWORD: ${{ secrets[matrix.certificate.password-secret] }} id: get-days-before-expiration run: | - EXPIRATION_DATE="$( - ( - openssl pkcs12 \ - -in "${{ env.CERTIFICATE_PATH }}" \ - -clcerts \ - -nodes \ - -passin env:CERTIFICATE_PASSWORD - ) | ( - openssl x509 \ - -noout \ - -enddate - ) | ( - grep \ - --max-count=1 \ - --only-matching \ - --perl-regexp \ - 'notAfter=(\K.*)' - ) - )" + if [[ ${{ matrix.certificate.type }} == "pkcs12" ]]; then + EXPIRATION_DATE="$( + ( + openssl pkcs12 \ + -in ${{ env.CERTIFICATE_PATH }} \ + -clcerts \ + -nodes \ + -passin env:CERTIFICATE_PASSWORD \ + -legacy + ) | ( + openssl x509 \ + -noout \ + -enddate + ) | ( + grep \ + --max-count=1 \ + --only-matching \ + --perl-regexp \ + 'notAfter=(\K.*)' + ) + )" + elif [[ ${{ matrix.certificate.type }} == "x509" ]]; then + EXPIRATION_DATE="$( + ( + openssl x509 \ + -in ${{ env.CERTIFICATE_PATH }} \ + -noout \ + -enddate + ) | ( + grep \ + --max-count=1 \ + --only-matching \ + --perl-regexp \ + 'notAfter=(\K.*)' + ) + )" + fi DAYS_BEFORE_EXPIRATION="$((($(date --utc --date="$EXPIRATION_DATE" +%s) - $(date --utc +%s)) / 60 / 60 / 24))" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2ae2cf4e..33fe2b7e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: run: shell: bash -# by default disable CGO, it's not needed (except on macos) + # by default disable CGO, it's not needed (except on macos) env: CGO_ENABLED: 0 @@ -157,7 +157,7 @@ jobs: create-macos-bundle: needs: build - # for not they are exaclty the same + # for now they are exaclty the same strategy: matrix: arch: [amd64, arm64] @@ -371,9 +371,6 @@ jobs: # vars used by installbuilder INSTALLBUILDER_PATH: "/opt/installbuilder-23.11.0/bin/builder" INSTALLER_VARS: "project.outputDirectory=$PWD project.version=${GITHUB_REF##*/} workspace=$PWD realname=Arduino_Create_Agent" - # installbuilder will read this vars automatically (defined in installer.xml): - INSTALLER_CERT_WINDOWS_PASSWORD: ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }} - INSTALLER_CERT_WINDOWS_PFX: "/tmp/ArduinoCerts2020.pfx" strategy: fail-fast: false # if one os is failing continue nonetheless @@ -424,11 +421,6 @@ jobs: - name: Save InstallBuilder license to file run: echo "${{ secrets.INSTALLER_LICENSE }}" > /tmp/license.xml - - name: Save Win signing certificate to file - run: echo "${{ secrets.INSTALLER_CERT_WINDOWS_PFX }}" | base64 --decode > ${{ env.INSTALLER_CERT_WINDOWS_PFX}} - if: matrix.os == 'windows-2019' - - # installbuilder reads the env vars with certs paths and use it to sign the installer. - name: Launch Bitrock installbuilder run: ${{ env.INSTALLBUILDER_PATH }} build installer.xml ${{ matrix.installbuilder-name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} architecture=${{ matrix.arch }} @@ -443,6 +435,49 @@ jobs: path: ArduinoCreateAgent* if-no-files-found: error + # This job will sign the Windows installer + sign-windows: + runs-on: [self-hosted, windows-sign-pc] + needs: package + + defaults: + run: + shell: bash + + env: + INSTALLER_CERT_WINDOWS_CER: "/tmp/cert.cer" + # We are hardcoding the path for signtool because is not present on the windows PATH env var by default. + # Keep in mind that this path could change when upgrading to a new runner version + SIGNTOOL_PATH: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86/signtool.exe" + + strategy: + matrix: + arch: [amd64, 386] + + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: ArduinoCreateAgent-windows-${{ matrix.arch }} + + - name: Save Win signing certificate to file + run: echo "${{ secrets.INSTALLER_CERT_WINDOWS_CER }}" | base64 --decode > ${{ env.INSTALLER_CERT_WINDOWS_CER}} + + - name: Sign EXE + env: + CERT_PASSWORD: ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }} + CONTAINER_NAME: ${{ secrets.INSTALLER_CERT_WINDOWS_CONTAINER }} + # https://stackoverflow.com/questions/17927895/automate-extended-validation-ev-code-signing-with-safenet-etoken + run: | + "${{ env.SIGNTOOL_PATH }}" sign -d "Arduino Create Agent" -f ${{ env.INSTALLER_CERT_WINDOWS_CER}} -csp "eToken Base Cryptographic Provider" -k "[{{${{ env.CERT_PASSWORD }}}}]=${{ env.CONTAINER_NAME }}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "ArduinoCreateAgent-${GITHUB_REF##*/}-windows-${{ matrix.arch }}-installer.exe" + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + if-no-files-found: error + name: ArduinoCreateAgent-windows-${{ matrix.arch }}-signed + path: ArduinoCreateAgent-*-windows-${{ matrix.arch }}-installer.exe + # This job will generate a dmg mac installer, sign/notarize it. generate-sign-dmg: needs: notarize-macos @@ -544,7 +579,7 @@ jobs: create-release: runs-on: ubuntu-20.04 environment: production - needs: [build, package, generate-sign-dmg] + needs: [build, generate-sign-dmg, sign-windows] steps: - name: Checkout @@ -563,7 +598,7 @@ jobs: mv -v ArduinoCreateAgent-linux-amd64/* release/ cat ArduinoCreateAgent-osx-amd64/*.tar | tar -xvf - -i -C release/ rm -v release/._ArduinoCreateAgent*.dmg - mv -v ArduinoCreateAgent-windows*/* release/ + mv -v ArduinoCreateAgent-windows*-signed/* release/ - name: VirusTotal Scan id: virustotal_step From 7e79dfd1f96e7a2523244e02bcd08b234fce3a09 Mon Sep 17 00:00:00 2001 From: Umberto Baldi <34278123+umbynos@users.noreply.github.com> Date: Thu, 16 May 2024 11:41:32 +0200 Subject: [PATCH 07/42] Bump actions/upload and actions/download (#952) * Bump actions/download-artifact from 3 to 4 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Bump actions/download-artifact in new step * Bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Bump actions/upload-artifact in new step * Migrate sync workflow to actions/[upload-download] to v4 See https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md#multiple-uploads-to-the-same-named-artifact --------- Signed-off-by: dependabot[bot] --- .../workflows/check-go-dependencies-task.yml | 2 +- .github/workflows/publish-go-tester-task.yml | 2 +- .github/workflows/release.yml | 24 +++++++++---------- .github/workflows/sync-labels.yml | 9 +++---- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index 1d640ed4..4983e0db 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -105,7 +105,7 @@ jobs: # Some might find it convenient to have CI generate the cache rather than setting up for it locally - name: Upload cache to workflow artifact if: failure() && steps.diff.outcome == 'failure' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error name: dep-licenses-cache diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index 5ba56a6f..66b38164 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -128,7 +128,7 @@ jobs: if: runner.os == 'macOS' - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }} path: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33fe2b7e..ce3caa1b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -147,7 +147,7 @@ jobs: if: steps.prerelease.outputs.IS_PRE != 'true' - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ env.PROJECT_NAME }}-${{ matrix.os }}-${{ matrix.arch }} path: | @@ -174,7 +174,7 @@ jobs: token: ${{ secrets.ARDUINO_CREATE_AGENT_CI_PAT }} - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.PROJECT_NAME }}-macos-12-amd64 # if we want to support darwin-arm64 in the future for real this has to change. path: ${{ env.EXE_PATH }} @@ -218,7 +218,7 @@ jobs: run: tar -cvf ArduinoCreateAgent.app_${{ matrix.arch }}.tar -C skel/ . - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error name: ArduinoCreateAgent.app_${{ matrix.arch }} @@ -241,7 +241,7 @@ jobs: steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ArduinoCreateAgent.app_${{ matrix.arch }} @@ -356,7 +356,7 @@ jobs: if: ${{ needs.build.outputs.prerelease != 'true' }} - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ArduinoCreateAgent.app_${{ matrix.arch }}_notarized path: ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip @@ -405,7 +405,7 @@ jobs: token: ${{ secrets.ARDUINO_CREATE_AGENT_CI_PAT }} - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.PROJECT_NAME }}-${{ matrix.os }}-${{ matrix.arch }} path: artifacts/${{ matrix.platform-name }}/ # path expected by installbuilder @@ -429,7 +429,7 @@ jobs: if: matrix.os == 'ubuntu-20.04' - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ArduinoCreateAgent-${{ matrix.platform-name }}-${{ matrix.arch }} path: ArduinoCreateAgent* @@ -456,7 +456,7 @@ jobs: steps: - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ArduinoCreateAgent-windows-${{ matrix.arch }} @@ -472,7 +472,7 @@ jobs: "${{ env.SIGNTOOL_PATH }}" sign -d "Arduino Create Agent" -f ${{ env.INSTALLER_CERT_WINDOWS_CER}} -csp "eToken Base Cryptographic Provider" -k "[{{${{ env.CERT_PASSWORD }}}}]=${{ env.CONTAINER_NAME }}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "ArduinoCreateAgent-${GITHUB_REF##*/}-windows-${{ matrix.arch }}-installer.exe" - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error name: ArduinoCreateAgent-windows-${{ matrix.arch }}-signed @@ -494,7 +494,7 @@ jobs: token: ${{ secrets.ARDUINO_CREATE_AGENT_CI_PAT }} - name: Download artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ArduinoCreateAgent.app_${{ matrix.arch }}_notarized path: ArduinoCreateAgent.app @@ -570,7 +570,7 @@ jobs: run: tar -cvf ArduinoCreateAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.tar ArduinoCreateAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.dmg - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ArduinoCreateAgent-osx-${{ matrix.arch }} path: ArduinoCreateAgent*.tar @@ -588,7 +588,7 @@ jobs: fetch-depth: 0 # fetch all history for the create changelog step to work properly - name: Download artifact - uses: actions/download-artifact@v3 # download all the artifacts + uses: actions/download-artifact@v4 # download all the artifacts # mandatory step because upload-release-action does not support multiple folders - name: prepare artifacts for the release diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index d0a55352..184a4207 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -71,13 +71,13 @@ jobs: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} - name: Pass configuration files to next job via workflow artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: | *.yaml *.yml if-no-files-found: error - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + name: ${{ env.CONFIGURATIONS_ARTIFACT }}-${{ matrix.filename }} sync: needs: download @@ -109,10 +109,11 @@ jobs: uses: actions/checkout@v4 - name: Download configuration files artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + pattern: ${{ env.CONFIGURATIONS_ARTIFACT }}-* # Download all configuration files path: ${{ env.CONFIGURATIONS_FOLDER }} + merge-multiple: true - name: Remove unneeded artifact uses: geekyeggo/delete-artifact@v5 From 0b9b35e40e8cd10eb376bdc53c691d6786e98d9b Mon Sep 17 00:00:00 2001 From: David Anson Date: Sat, 18 May 2024 17:50:49 -0700 Subject: [PATCH 08/42] Fix spelling of the word "development" in README.md. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f7100b5..7356117d 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ The documentation has been moved to the [wiki](https://github.com/arduino/arduin - [Advanced usage](https://github.com/arduino/arduino-create-agent/wiki/Advanced-usage): explaining how to use multiple configurations and how to use the agent with a proxy. - [Agent Beta Program](https://github.com/arduino/arduino-create-agent/wiki/Agent-Beta-Program) -- [Developement](https://github.com/arduino/arduino-create-agent/wiki/Developement): containing useful info to help in development +- [Development](https://github.com/arduino/arduino-create-agent/wiki/Developement): containing useful info to help in development - [Disable Autostart](https://github.com/arduino/arduino-create-agent/wiki/Disable-Autostart) - [How to compile on Raspberry Pi](https://github.com/arduino/arduino-create-agent/wiki/How-to-compile-on-Raspberry-Pi) - [How to use crashreport functionality](https://github.com/arduino/arduino-create-agent/wiki/How-to-use-crashreport-functionality) From 6220828536b2de00eb2f7daabfffe45183e75234 Mon Sep 17 00:00:00 2001 From: Alby <30591904+Xayton@users.noreply.github.com> Date: Thu, 23 May 2024 18:07:26 +0200 Subject: [PATCH 09/42] Update README.md "Development" link (#959) Update a wrong link (https://github.com/arduino/arduino-create-agent/wiki/Development), so that we can remove the wrong page in the Wiki. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7356117d..5c97939b 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ The documentation has been moved to the [wiki](https://github.com/arduino/arduin - [Advanced usage](https://github.com/arduino/arduino-create-agent/wiki/Advanced-usage): explaining how to use multiple configurations and how to use the agent with a proxy. - [Agent Beta Program](https://github.com/arduino/arduino-create-agent/wiki/Agent-Beta-Program) -- [Development](https://github.com/arduino/arduino-create-agent/wiki/Developement): containing useful info to help in development +- [Development](https://github.com/arduino/arduino-create-agent/wiki/Development): containing useful info to help in development - [Disable Autostart](https://github.com/arduino/arduino-create-agent/wiki/Disable-Autostart) - [How to compile on Raspberry Pi](https://github.com/arduino/arduino-create-agent/wiki/How-to-compile-on-Raspberry-Pi) - [How to use crashreport functionality](https://github.com/arduino/arduino-create-agent/wiki/How-to-use-crashreport-functionality) From b02967edac710a5690857bd0fa8dbf6cd503dbf8 Mon Sep 17 00:00:00 2001 From: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com> Date: Mon, 17 Jun 2024 09:31:22 +0200 Subject: [PATCH 10/42] Add step to delete the signed exe on the self-hosted runner (#965) --- .github/workflows/release.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce3caa1b..f149c8eb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -132,7 +132,7 @@ jobs: - name: Create autoupdate files for win32 run: go-selfupdate -platform windows-${{ matrix.arch }} ${{ env.PROJECT_NAME }}${{ matrix.ext }} ${TAG_VERSION} if: matrix.arch == '386' && matrix.os == 'windows-2019' && steps.prerelease.outputs.IS_PRE != 'true' - + - name: configure aws credentials uses: aws-actions/configure-aws-credentials@v4 with: @@ -311,7 +311,7 @@ jobs: run: | wget -q https://github.com/Bearer/gon/releases/download/v0.0.27/gon_macos.zip unzip gon_macos.zip -d /usr/local/bin - + - name: Write gon config to file run: | cat > "${{ env.GON_CONFIG_PATH }}" < ${{ env.INSTALLER_CERT_WINDOWS_CER}} @@ -468,7 +468,7 @@ jobs: CERT_PASSWORD: ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }} CONTAINER_NAME: ${{ secrets.INSTALLER_CERT_WINDOWS_CONTAINER }} # https://stackoverflow.com/questions/17927895/automate-extended-validation-ev-code-signing-with-safenet-etoken - run: | + run: | "${{ env.SIGNTOOL_PATH }}" sign -d "Arduino Create Agent" -f ${{ env.INSTALLER_CERT_WINDOWS_CER}} -csp "eToken Base Cryptographic Provider" -k "[{{${{ env.CERT_PASSWORD }}}}]=${{ env.CONTAINER_NAME }}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "ArduinoCreateAgent-${GITHUB_REF##*/}-windows-${{ matrix.arch }}-installer.exe" - name: Upload artifacts @@ -478,6 +478,10 @@ jobs: name: ArduinoCreateAgent-windows-${{ matrix.arch }}-signed path: ArduinoCreateAgent-*-windows-${{ matrix.arch }}-installer.exe + # This step is needed because the self hosted runner does not delete files automatically + - name: Clean up EXE + run: rm ArduinoCreateAgent-*-windows-${{ matrix.arch }}-installer.exe + # This job will generate a dmg mac installer, sign/notarize it. generate-sign-dmg: needs: notarize-macos From 04414e26c0d8cf0795d02c364637c3bb3f218bd4 Mon Sep 17 00:00:00 2001 From: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com> Date: Tue, 2 Jul 2024 09:31:09 +0200 Subject: [PATCH 11/42] Check if a signed URL is specified and use it download tools (#953) * Wrap v2 tools install function inside tools.Download * Download tools defaulting to the replace behaviour * Improve archive renamer and fix failing tests * Find the correct tool and system when `version=latest` is specified * Reintroduce caching option when downloading tools --- tools/download.go | 170 ++++------------------------------------- tools/download_test.go | 24 +++--- tools/tools.go | 12 --- v2/http.go | 2 +- v2/pkgs/tools.go | 137 ++++++++++++++++++++++++++------- v2/pkgs/tools_test.go | 8 +- 6 files changed, 142 insertions(+), 211 deletions(-) diff --git a/tools/download.go b/tools/download.go index 360d6e4c..6e5fa8b7 100644 --- a/tools/download.go +++ b/tools/download.go @@ -16,43 +16,18 @@ package tools import ( - "bytes" "context" - "crypto/sha256" - "encoding/hex" - "encoding/json" "errors" - "fmt" - "io" - "net/http" "os" "os/exec" "path/filepath" "runtime" + "github.com/arduino/arduino-create-agent/gen/tools" + "github.com/arduino/arduino-create-agent/utilities" "github.com/arduino/arduino-create-agent/v2/pkgs" - "github.com/arduino/go-paths-helper" - "github.com/blang/semver" - "github.com/codeclysm/extract/v3" ) -// public vars to allow override in the tests -var ( - OS = runtime.GOOS - Arch = runtime.GOARCH -) - -func pathExists(path string) bool { - _, err := os.Stat(path) - if err == nil { - return true - } - if os.IsNotExist(err) { - return false - } - return true -} - // Download will parse the index at the indexURL for the tool to download. // It will extract it in a folder in .arduino-create, and it will update the // Installed map. @@ -70,97 +45,21 @@ func pathExists(path string) bool { // if it already exists. func (t *Tools) Download(pack, name, version, behaviour string) error { - body, err := t.index.Read() - if err != nil { - return err - } - - var data pkgs.Index - json.Unmarshal(body, &data) - - // Find the tool by name - correctTool, correctSystem := findTool(pack, name, version, data) - - if correctTool.Name == "" || correctSystem.URL == "" { - t.logger("We couldn't find a tool with the name " + name + " and version " + version + " packaged by " + pack) - return nil - } - - key := correctTool.Name + "-" + correctTool.Version - - // Check if it already exists - if behaviour == "keep" { - location, ok := t.getMapValue(key) - if ok && pathExists(location) { - // overwrite the default tool with this one - t.setMapValue(correctTool.Name, location) - t.logger("The tool is already present on the system") - return t.writeMap() - } - } - - // Download the tool - t.logger("Downloading tool " + name + " from " + correctSystem.URL) - resp, err := http.Get(correctSystem.URL) + tool := pkgs.New(t.index, t.directory.String(), behaviour) + _, err := tool.Install(context.Background(), &tools.ToolPayload{Name: name, Version: version, Packager: pack}) if err != nil { return err } - defer resp.Body.Close() - - // Read the body - body, err = io.ReadAll(resp.Body) - if err != nil { - return err - } - - // Checksum - checksum := sha256.Sum256(body) - checkSumString := "SHA-256:" + hex.EncodeToString(checksum[:sha256.Size]) - - if checkSumString != correctSystem.Checksum { - return errors.New("checksum doesn't match") - } - - tempPath := paths.TempDir() - // Create a temporary dir to extract package - if err := tempPath.MkdirAll(); err != nil { - return fmt.Errorf("creating temp dir for extraction: %s", err) - } - tempDir, err := tempPath.MkTempDir("package-") - if err != nil { - return fmt.Errorf("creating temp dir for extraction: %s", err) - } - defer tempDir.RemoveAll() - t.logger("Unpacking tool " + name) - ctx := context.Background() - reader := bytes.NewReader(body) - // Extract into temp directory - if err := extract.Archive(ctx, reader, tempDir.String(), nil); err != nil { - return fmt.Errorf("extracting archive: %s", err) - } - - location := t.directory.Join(pack, correctTool.Name, correctTool.Version) - err = location.RemoveAll() + path := filepath.Join(pack, name, version) + safePath, err := utilities.SafeJoin(t.directory.String(), path) if err != nil { return err } - // Check package content and find package root dir - root, err := findPackageRoot(tempDir) - if err != nil { - return fmt.Errorf("searching package root dir: %s", err) - } - - if err := root.Rename(location); err != nil { - if err := root.CopyDirTo(location); err != nil { - return fmt.Errorf("moving extracted archive to destination dir: %s", err) - } - } - // if the tool contains a post_install script, run it: it means it is a tool that needs to install drivers // AFAIK this is only the case for the windows-driver tool - err = t.installDrivers(location.String()) + err = t.installDrivers(safePath) if err != nil { return err } @@ -169,55 +68,12 @@ func (t *Tools) Download(pack, name, version, behaviour string) error { t.logger("Ensure that the files are executable") // Update the tool map - t.logger("Updating map with location " + location.String()) - - t.setMapValue(name, location.String()) - t.setMapValue(name+"-"+correctTool.Version, location.String()) - return t.writeMap() -} + t.logger("Updating map with location " + safePath) -func findPackageRoot(parent *paths.Path) (*paths.Path, error) { - files, err := parent.ReadDir() - if err != nil { - return nil, fmt.Errorf("reading package root dir: %s", err) - } - files.FilterOutPrefix("__MACOSX") + t.setMapValue(name, safePath) + t.setMapValue(name+"-"+version, safePath) - // if there is only one dir, it is the root dir - if len(files) == 1 && files[0].IsDir() { - return files[0], nil - } - return parent, nil -} - -func findTool(pack, name, version string, data pkgs.Index) (pkgs.Tool, pkgs.System) { - var correctTool pkgs.Tool - correctTool.Version = "0.0" - - for _, p := range data.Packages { - if p.Name != pack { - continue - } - for _, t := range p.Tools { - if version != "latest" { - if t.Name == name && t.Version == version { - correctTool = t - } - } else { - // Find latest - v1, _ := semver.Make(t.Version) - v2, _ := semver.Make(correctTool.Version) - if t.Name == name && v1.Compare(v2) > 0 { - correctTool = t - } - } - } - } - - // Find the url based on system - correctSystem := correctTool.GetFlavourCompatibleWith(OS, Arch) - - return correctTool, correctSystem + return nil } func (t *Tools) installDrivers(location string) error { @@ -225,7 +81,7 @@ func (t *Tools) installDrivers(location string) error { extension := ".bat" // add .\ to force locality preamble := ".\\" - if OS != "windows" { + if runtime.GOOS != "windows" { extension = ".sh" // add ./ to force locality preamble = "./" @@ -237,7 +93,7 @@ func (t *Tools) installDrivers(location string) error { os.Chdir(location) t.logger(preamble + "post_install" + extension) oscmd := exec.Command(preamble + "post_install" + extension) - if OS != "linux" { + if runtime.GOOS != "linux" { // spawning a shell could be the only way to let the user type his password TellCommandNotToSpawnShell(oscmd) } diff --git a/tools/download_test.go b/tools/download_test.go index c45914b5..1e958de9 100644 --- a/tools/download_test.go +++ b/tools/download_test.go @@ -42,8 +42,8 @@ func TestDownloadCorrectPlatform(t *testing.T) { {"linux", "arm", "arm-linux-gnueabihf"}, } defer func() { - OS = runtime.GOOS // restore `runtime.OS` - Arch = runtime.GOARCH // restore `runtime.ARCH` + pkgs.OS = runtime.GOOS // restore `runtime.OS` + pkgs.Arch = runtime.GOARCH // restore `runtime.ARCH` }() testIndex := paths.New("testdata", "test_tool_index.json") buf, err := testIndex.ReadFile() @@ -54,10 +54,11 @@ func TestDownloadCorrectPlatform(t *testing.T) { require.NoError(t, err) for _, tc := range testCases { t.Run(tc.hostOS+tc.hostArch, func(t *testing.T) { - OS = tc.hostOS // override `runtime.OS` for testing purposes - Arch = tc.hostArch // override `runtime.ARCH` for testing purposes + pkgs.OS = tc.hostOS // override `runtime.OS` for testing purposes + pkgs.Arch = tc.hostArch // override `runtime.ARCH` for testing purposes // Find the tool by name - correctTool, correctSystem := findTool("arduino-test", "arduino-fwuploader", "2.2.2", data) + correctTool, correctSystem, found := pkgs.FindTool("arduino-test", "arduino-fwuploader", "2.2.2", data) + require.True(t, found) require.NotNil(t, correctTool) require.NotNil(t, correctSystem) require.Equal(t, correctTool.Name, "arduino-fwuploader") @@ -78,8 +79,8 @@ func TestDownloadFallbackPlatform(t *testing.T) { {"windows", "amd64", "i686-mingw32"}, } defer func() { - OS = runtime.GOOS // restore `runtime.OS` - Arch = runtime.GOARCH // restore `runtime.ARCH` + pkgs.OS = runtime.GOOS // restore `runtime.OS` + pkgs.Arch = runtime.GOARCH // restore `runtime.ARCH` }() testIndex := paths.New("testdata", "test_tool_index.json") buf, err := testIndex.ReadFile() @@ -90,10 +91,11 @@ func TestDownloadFallbackPlatform(t *testing.T) { require.NoError(t, err) for _, tc := range testCases { t.Run(tc.hostOS+tc.hostArch, func(t *testing.T) { - OS = tc.hostOS // override `runtime.OS` for testing purposes - Arch = tc.hostArch // override `runtime.ARCH` for testing purposes + pkgs.OS = tc.hostOS // override `runtime.OS` for testing purposes + pkgs.Arch = tc.hostArch // override `runtime.ARCH` for testing purposes // Find the tool by name - correctTool, correctSystem := findTool("arduino-test", "arduino-fwuploader", "2.2.0", data) + correctTool, correctSystem, found := pkgs.FindTool("arduino-test", "arduino-fwuploader", "2.2.0", data) + require.True(t, found) require.NotNil(t, correctTool) require.NotNil(t, correctSystem) require.Equal(t, correctTool.Name, "arduino-fwuploader") @@ -145,7 +147,7 @@ func TestDownload(t *testing.T) { if filePath.IsDir() { require.DirExists(t, filePath.String()) } else { - if OS == "windows" { + if runtime.GOOS == "windows" { require.FileExists(t, filePath.String()+".exe") } else { require.FileExists(t, filePath.String()) diff --git a/tools/tools.go b/tools/tools.go index e641db35..cb9efc78 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -78,18 +78,6 @@ func (t *Tools) getMapValue(key string) (string, bool) { return value, ok } -// writeMap() writes installed map to the json file "installed.json" -func (t *Tools) writeMap() error { - t.mutex.RLock() - defer t.mutex.RUnlock() - b, err := json.Marshal(t.installed) - if err != nil { - return err - } - filePath := t.directory.Join("installed.json") - return filePath.WriteFile(b) -} - // readMap() reads the installed map from json file "installed.json" func (t *Tools) readMap() error { t.mutex.Lock() diff --git a/v2/http.go b/v2/http.go index bcfbc82a..390ec398 100644 --- a/v2/http.go +++ b/v2/http.go @@ -40,7 +40,7 @@ func Server(directory string, index *index.Resource) http.Handler { logAdapter := LogAdapter{Logger: logger} // Mount tools - toolsSvc := pkgs.New(index, directory) + toolsSvc := pkgs.New(index, directory, "replace") toolsEndpoints := toolssvc.NewEndpoints(toolsSvc) toolsServer := toolssvr.New(toolsEndpoints, mux, CustomRequestDecoder, goahttp.ResponseEncoder, errorHandler(logger), nil) toolssvr.Mount(mux, toolsServer) diff --git a/v2/pkgs/tools.go b/v2/pkgs/tools.go index 55ff6c2e..b0daaaae 100644 --- a/v2/pkgs/tools.go +++ b/v2/pkgs/tools.go @@ -33,9 +33,16 @@ import ( "github.com/arduino/arduino-create-agent/gen/tools" "github.com/arduino/arduino-create-agent/index" "github.com/arduino/arduino-create-agent/utilities" + "github.com/blang/semver" "github.com/codeclysm/extract/v3" ) +// public vars to allow override in the tests +var ( + OS = runtime.GOOS + Arch = runtime.GOARCH +) + // Tools is a client that implements github.com/arduino/arduino-create-agent/gen/tools.Service interface. // It saves tools in a specified folder with this structure: packager/name/version // For example: @@ -50,17 +57,19 @@ import ( // // It requires an Index Resource to search for tools type Tools struct { - index *index.Resource - folder string + index *index.Resource + folder string + behaviour string } // New will return a Tool object, allowing the caller to execute operations on it. // The New function will accept an index as parameter (used to download the indexes) // and a folder used to download the indexes -func New(index *index.Resource, folder string) *Tools { +func New(index *index.Resource, folder, behaviour string) *Tools { return &Tools{ - index: index, - folder: folder, + index: index, + folder: folder, + behaviour: behaviour, } } @@ -166,21 +175,28 @@ func (t *Tools) Install(ctx context.Context, payload *tools.ToolPayload) (*tools var index Index json.Unmarshal(body, &index) - for _, packager := range index.Packages { - if packager.Name != payload.Packager { - continue - } - - for _, tool := range packager.Tools { - if tool.Name == payload.Name && - tool.Version == payload.Version { - - sys := tool.GetFlavourCompatibleWith(runtime.GOOS, runtime.GOARCH) + correctTool, correctSystem, found := FindTool(payload.Packager, payload.Name, payload.Version, index) + path = filepath.Join(payload.Packager, correctTool.Name, correctTool.Version) - return t.install(ctx, path, sys.URL, sys.Checksum) + key := correctTool.Name + "-" + correctTool.Version + // Check if it already exists + if t.behaviour == "keep" && pathExists(t.folder) { + location, ok, err := checkInstalled(t.folder, key) + if err != nil { + return nil, err + } + if ok && pathExists(location) { + // overwrite the default tool with this one + err := writeInstalled(t.folder, path) + if err != nil { + return nil, err } + return &tools.Operation{Status: "ok"}, nil } } + if found { + return t.install(ctx, path, correctSystem.URL, correctSystem.Checksum) + } return nil, tools.MakeNotFound( fmt.Errorf("tool not found with packager '%s', name '%s', version '%s'", @@ -256,27 +272,51 @@ func (t *Tools) Remove(ctx context.Context, payload *tools.ToolPayload) (*tools. func rename(base string) extract.Renamer { return func(path string) string { parts := strings.Split(filepath.ToSlash(path), "/") - path = strings.Join(parts[1:], "/") - path = filepath.Join(base, path) + newPath := strings.Join(parts[1:], "/") + if newPath == "" { + newPath = filepath.Join(newPath, path) + } + path = filepath.Join(base, newPath) return path } } -func writeInstalled(folder, path string) error { +func readInstalled(installedFile string) (map[string]string, error) { // read installed.json installed := map[string]string{} - - installedFile, err := utilities.SafeJoin(folder, "installed.json") - if err != nil { - return err - } data, err := os.ReadFile(installedFile) if err == nil { err = json.Unmarshal(data, &installed) if err != nil { - return err + return nil, err } } + return installed, nil +} + +func checkInstalled(folder, key string) (string, bool, error) { + installedFile, err := utilities.SafeJoin(folder, "installed.json") + if err != nil { + return "", false, err + } + installed, err := readInstalled(installedFile) + if err != nil { + return "", false, err + } + location, ok := installed[key] + return location, ok, err +} + +func writeInstalled(folder, path string) error { + // read installed.json + installedFile, err := utilities.SafeJoin(folder, "installed.json") + if err != nil { + return err + } + installed, err := readInstalled(installedFile) + if err != nil { + return err + } parts := strings.Split(path, string(filepath.Separator)) tool := parts[len(parts)-2] @@ -288,10 +328,55 @@ func writeInstalled(folder, path string) error { installed[tool] = toolFile installed[toolWithVersion] = toolFile - data, err = json.Marshal(installed) + data, err := json.Marshal(installed) if err != nil { return err } return os.WriteFile(installedFile, data, 0644) } + +func pathExists(path string) bool { + _, err := os.Stat(path) + if err == nil { + return true + } + if os.IsNotExist(err) { + return false + } + return true +} + +// FindTool searches the index for the correct tool and system that match the specified tool name and version +func FindTool(pack, name, version string, data Index) (Tool, System, bool) { + var correctTool Tool + correctTool.Version = "0.0" + found := false + + for _, p := range data.Packages { + if p.Name != pack { + continue + } + for _, t := range p.Tools { + if version != "latest" { + if t.Name == name && t.Version == version { + correctTool = t + found = true + } + } else { + // Find latest + v1, _ := semver.Make(t.Version) + v2, _ := semver.Make(correctTool.Version) + if t.Name == name && v1.Compare(v2) > 0 { + correctTool = t + found = true + } + } + } + } + + // Find the url based on system + correctSystem := correctTool.GetFlavourCompatibleWith(OS, Arch) + + return correctTool, correctSystem, found +} diff --git a/v2/pkgs/tools_test.go b/v2/pkgs/tools_test.go index 78c56398..be4d5e4d 100644 --- a/v2/pkgs/tools_test.go +++ b/v2/pkgs/tools_test.go @@ -45,7 +45,7 @@ func TestTools(t *testing.T) { // Instantiate Index Index := index.Init(indexURL, config.GetDataDir()) - service := pkgs.New(Index, tmp) + service := pkgs.New(Index, tmp, "replace") ctx := context.Background() @@ -126,7 +126,7 @@ func TestEvilFilename(t *testing.T) { // Instantiate Index Index := index.Init(indexURL, config.GetDataDir()) - service := pkgs.New(Index, tmp) + service := pkgs.New(Index, tmp, "replace") ctx := context.Background() @@ -195,7 +195,7 @@ func TestInstalledHead(t *testing.T) { // Instantiate Index Index := index.Init(indexURL, config.GetDataDir()) - service := pkgs.New(Index, tmp) + service := pkgs.New(Index, tmp, "replace") ctx := context.Background() @@ -216,7 +216,7 @@ func TestInstall(t *testing.T) { LastRefresh: time.Now(), } - tool := pkgs.New(testIndex, tmp) + tool := pkgs.New(testIndex, tmp, "replace") ctx := context.Background() From da1fa2e1dfc896754901087bddfd7e8b3a3efc03 Mon Sep 17 00:00:00 2001 From: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:05:54 +0200 Subject: [PATCH 12/42] Create a single universal executable for macOS (#964) * Create a single universal executable for macos * Update docs on macOS support * Add macos-arm64 to the test builds * Check that the new executable exists and is in the right path before proceding with the update --- .github/workflows/publish-go-tester-task.yml | 29 +++++++++++++++++--- .github/workflows/release.yml | 25 +++++++++++++++-- README.md | 4 +-- Taskfile.yml | 3 +- updater/updater_darwin.go | 2 +- 5 files changed, 51 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index 66b38164..54d9c04f 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -30,6 +30,7 @@ on: repository_dispatch: env: + PROJECT_NAME: arduino-create-agent GO_VERSION: "1.21" jobs: @@ -119,18 +120,38 @@ jobs: run: task go:build-win # GOARCH=amd64 by default on the runners if: runner.os == 'Windows' && matrix.arch == '-amd64' - - name: Build the Agent for macos + - name: Build the Agent for macos amd 64 env: MACOSX_DEPLOYMENT_TARGET: 10.15 # minimum supported version for mac CGO_CFLAGS: -mmacosx-version-min=10.15 CGO_LDFLAGS: -mmacosx-version-min=10.15 - run: task go:build + run: | + task go:build + mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME}}_amd64 + if: runner.os == 'macOS' + + - name: Build the Agent for macos amd 64 + env: + MACOSX_DEPLOYMENT_TARGET: 10.15 # minimum supported version for mac + CGO_CFLAGS: -mmacosx-version-min=10.15 + CGO_LDFLAGS: -mmacosx-version-min=10.15 + GOARCH: arm64 + CGO_ENABLED: 1 + run: | + task go:build + mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME}}_arm64 + if: runner.os == 'macOS' + + - name: Create universal macos executable + run: | + lipo -create -output ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME}}_amd64 ${{ env.PROJECT_NAME}}_arm64 + rm ${{ env.PROJECT_NAME}}_amd64 ${{ env.PROJECT_NAME}}_arm64 if: runner.os == 'macOS' - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }} + name: ${{ env.PROJECT_NAME}}-${{ matrix.os }}${{ matrix.arch }} path: | - arduino-create-agent* + ${{ env.PROJECT_NAME}}* if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f149c8eb..72b07c46 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -107,13 +107,33 @@ jobs: run: task go:build-win # GOARCH=amd64 by default on the runners if: matrix.os == 'windows-2019' && matrix.arch == 'amd64' - - name: Build the Agent for macos + - name: Build the Agent for macos amd64 env: CGO_ENABLED: 1 MACOSX_DEPLOYMENT_TARGET: 10.15 # minimum supported version for mac CGO_CFLAGS: -mmacosx-version-min=10.15 CGO_LDFLAGS: -mmacosx-version-min=10.15 - run: task go:build + run: | + task go:build + mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_amd64 + if: matrix.os == 'macos-12' + + - name: Build the Agent for macos arm64 + env: + CGO_ENABLED: 1 + MACOSX_DEPLOYMENT_TARGET: 10.15 # minimum supported version for mac + CGO_CFLAGS: -mmacosx-version-min=10.15 + CGO_LDFLAGS: -mmacosx-version-min=10.15 + GOARCH: arm64 + run: | + task go:build + mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_arm64 + if: matrix.os == 'macos-12' + + - name: Create universal macos executable + run: | + lipo -create -output ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_amd64 ${{ env.PROJECT_NAME }}_arm64 + rm ${{ env.PROJECT_NAME }}_amd64 ${{ env.PROJECT_NAME }}_arm64 if: matrix.os == 'macos-12' # this will create `public/` dir with compressed full bin (/-.gz) and a json file @@ -121,7 +141,6 @@ jobs: run: go-selfupdate ${{ env.PROJECT_NAME }}${{ matrix.ext }} ${TAG_VERSION} if: matrix.arch != '386' && steps.prerelease.outputs.IS_PRE != 'true' - # for now we do not distribute m1 build, this is a workaround for now - name: Copy autoupdate file for darwin-arm64 (m1 arch) working-directory: public/ run: | diff --git a/README.md b/README.md index 5c97939b..a2efe270 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Get the [latest version](https://github.com/arduino/arduino-create-agent/release ## Apple silicon support The Arduino Agent is supported both on Intel and Apple silicon computers. This includes devices with the M1, M2 and M3 processors. -At the moment the Arduino Agent is only built for Intel architectures, but Apple silicon devices can run it thanks to the [Rosetta 2](https://support.apple.com/en-us/HT211861) translation layer by Apple. +The Arduino Agent is built both for Intel architectures and Apple silicon devices, but distributed as a single universal executable for macOS. ## Documentation @@ -50,7 +50,7 @@ The documentation has been moved to the [wiki](https://github.com/arduino/arduin ### Submitting an issue -When submitting a new issue please search for duplicates before creating a new one. Help us by providing useful context and information. Please attach the output of the commands running at the debug console or attach [crash reports](https://github.com/arduino/arduino-create-agent/wiki/How-to-use-crashreport-functionality) if useful. +When submitting a new issue please search for duplicates before creating a new one. Help us by providing useful context and information. Please attach the output of the commands running at the debug console or attach [crash reports](https://github.com/arduino/arduino-create-agent/wiki/How-to-use-crashreport-functionality) if useful. #### Security diff --git a/Taskfile.yml b/Taskfile.yml index 6b785276..603a2ce9 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -84,7 +84,7 @@ tasks: cmds: - poetry run pytest tests - # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml poetry:install-deps: desc: Install dependencies managed by Poetry cmds: @@ -138,7 +138,6 @@ tasks: - task: go:vet - task: go:lint - vars: # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/release-go-task/Taskfile.yml PROJECT_NAME: arduino-create-agent diff --git a/updater/updater_darwin.go b/updater/updater_darwin.go index ec00f88c..105a529e 100644 --- a/updater/updater_darwin.go +++ b/updater/updater_darwin.go @@ -143,7 +143,7 @@ func checkForUpdates(currentVersion string, updateURL string, cmdName string) (s // Install new app logrus.WithField("from", tmpAppPath).WithField("to", currentAppPath).Info("Copying updated app") - if err := tmpAppPath.CopyDirTo(currentAppPath); err != nil { + if err := tmpAppPath.CopyDirTo(currentAppPath); err != nil || !paths.New(executablePath).Exist() { // Try rollback changes _ = currentAppPath.RemoveAll() _ = oldAppPath.Rename(currentAppPath) From 46fbb343ee66a5a38bd716e59a1a96c43454b6a2 Mon Sep 17 00:00:00 2001 From: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com> Date: Wed, 17 Jul 2024 11:35:02 +0200 Subject: [PATCH 13/42] Rename executable and releases to `Arduino Cloud Agent` (#961) * Change name in the docs * Change executable's name * Change debug console's name * Update name in test release workflow * Update name in release workflow * Change name used in the installer * Rename .app to Cloud Agent * Check that either the Create Agent or the Cloud Agent exist when autoupdating on macos * Fix typo * Revert changes on the zipped notarized app bundle uploaded to s3 We are keeping it this way because it is used by the autoupdate procedure on macos --- .github/workflows/publish-go-tester-task.yml | 2 +- .github/workflows/release.yml | 89 +-- .gitignore | 4 +- README.md | 8 +- Taskfile.yml | 8 +- home.html | 627 ++++++++++--------- tests/conftest.py | 4 +- updater/updater_darwin.go | 4 +- 8 files changed, 387 insertions(+), 359 deletions(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index 54d9c04f..aa2949e1 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -30,7 +30,7 @@ on: repository_dispatch: env: - PROJECT_NAME: arduino-create-agent + PROJECT_NAME: arduino-cloud-agent GO_VERSION: "1.21" jobs: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 72b07c46..fe60ec8f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ permissions: env: # As defined by the Taskfile's PROJECT_NAME variable - PROJECT_NAME: arduino-create-agent + PROJECT_NAME: arduino-cloud-agent TARGET: "/CreateAgent/Stable/" VERSION_TARGET: "arduino-create-static/agent-metadata/" AWS_REGION: "us-east-1" # or https://github.com/aws/aws-cli/issues/5623 @@ -183,7 +183,7 @@ jobs: runs-on: macos-12 env: - EXE_PATH: "skel/ArduinoCreateAgent.app/Contents/MacOS/" + EXE_PATH: "skel/ArduinoCloudAgent.app/Contents/MacOS/" steps: - name: Checkout @@ -205,21 +205,21 @@ jobs: - name: Make executable run: chmod -v +x ${{ env.EXE_PATH }}${{ env.PROJECT_NAME }} - - name: Rename executable to Arduino_Create_Agent - run: mv -v ${{ env.EXE_PATH }}${{ env.PROJECT_NAME }} ${{ env.EXE_PATH }}Arduino_Create_Agent + - name: Rename executable to Arduino_Cloud_Agent + run: mv -v ${{ env.EXE_PATH }}${{ env.PROJECT_NAME }} ${{ env.EXE_PATH }}Arduino_Cloud_Agent - name: get year run: echo "YEAR=$(date "+%Y")" >> $GITHUB_ENV - name: Generate Info.plist for MacOS run: | - cat > skel/ArduinoCreateAgent.app/Contents/Info.plist < skel/ArduinoCloudAgent.app/Contents/Info.plist <CFBundlePackageTypeAPPLCFBundleInfoDictionaryVersion6.0 CFBundleIconFile AppIcon.icns - CFBundleName Arduino Create Agent - CFBundleExecutable Arduino_Create_Agent + CFBundleName Arduino Cloud Agent + CFBundleExecutable Arduino_Cloud_Agent CFBundleIdentifier create.arduino.cc CFBundleVersion ${GITHUB_REF##*/} @@ -234,14 +234,14 @@ jobs: EOF - name: Tar bundle to keep permissions - run: tar -cvf ArduinoCreateAgent.app_${{ matrix.arch }}.tar -C skel/ . + run: tar -cvf ArduinoCloudAgent.app_${{ matrix.arch }}.tar -C skel/ . - name: Upload artifacts uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ArduinoCreateAgent.app_${{ matrix.arch }} - path: ArduinoCreateAgent.app_${{ matrix.arch }}.tar + name: ArduinoCloudAgent.app_${{ matrix.arch }} + path: ArduinoCloudAgent.app_${{ matrix.arch }}.tar # The notarize-macos job will download the macos bundle from the previous job, sign, notarize and re-upload it, uploading it also on s3 download servers for the autoupdate. notarize-macos: @@ -262,10 +262,10 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - name: ArduinoCreateAgent.app_${{ matrix.arch }} + name: ArduinoCloudAgent.app_${{ matrix.arch }} - name: un-Tar bundle - run: tar -xvf ArduinoCreateAgent.app_${{ matrix.arch }}.tar + run: tar -xvf ArduinoCloudAgent.app_${{ matrix.arch }}.tar - name: Import Code-Signing Certificates run: | @@ -305,7 +305,7 @@ jobs: run: | cat > "${{ env.GON_CONFIG_PATH }}" < /tmp/license.xml @@ -444,14 +445,14 @@ jobs: run: ${{ env.INSTALLBUILDER_PATH }} build installer.xml ${{ matrix.installbuilder-name }} --verbose --license /tmp/license.xml --setvars ${{ env.INSTALLER_VARS }} architecture=${{ matrix.arch }} - name: Generate archive - run: tar -czvf ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.platform-name }}-${{ matrix.arch }}-installer.tar.gz ArduinoCreateAgent-${GITHUB_REF##*/}-${{ matrix.platform-name }}-${{ matrix.arch }}-installer${{matrix.installer-extension}} + run: tar -czvf ArduinoCloudAgent-${GITHUB_REF##*/}-${{ matrix.platform-name }}-${{ matrix.arch }}-installer.tar.gz ArduinoCloudAgent-${GITHUB_REF##*/}-${{ matrix.platform-name }}-${{ matrix.arch }}-installer${{matrix.installer-extension}} if: matrix.os == 'ubuntu-20.04' - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: ArduinoCreateAgent-${{ matrix.platform-name }}-${{ matrix.arch }} - path: ArduinoCreateAgent* + name: ArduinoCloudAgent-${{ matrix.platform-name }}-${{ matrix.arch }} + path: ArduinoCloudAgent* if-no-files-found: error # This job will sign the Windows installer @@ -477,7 +478,7 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - name: ArduinoCreateAgent-windows-${{ matrix.arch }} + name: ArduinoCloudAgent-windows-${{ matrix.arch }} - name: Save Win signing certificate to file run: echo "${{ secrets.INSTALLER_CERT_WINDOWS_CER }}" | base64 --decode > ${{ env.INSTALLER_CERT_WINDOWS_CER}} @@ -488,18 +489,18 @@ jobs: CONTAINER_NAME: ${{ secrets.INSTALLER_CERT_WINDOWS_CONTAINER }} # https://stackoverflow.com/questions/17927895/automate-extended-validation-ev-code-signing-with-safenet-etoken run: | - "${{ env.SIGNTOOL_PATH }}" sign -d "Arduino Create Agent" -f ${{ env.INSTALLER_CERT_WINDOWS_CER}} -csp "eToken Base Cryptographic Provider" -k "[{{${{ env.CERT_PASSWORD }}}}]=${{ env.CONTAINER_NAME }}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "ArduinoCreateAgent-${GITHUB_REF##*/}-windows-${{ matrix.arch }}-installer.exe" + "${{ env.SIGNTOOL_PATH }}" sign -d "Arduino Cloud Agent" -f ${{ env.INSTALLER_CERT_WINDOWS_CER}} -csp "eToken Base Cryptographic Provider" -k "[{{${{ env.CERT_PASSWORD }}}}]=${{ env.CONTAINER_NAME }}" -fd sha256 -tr http://timestamp.digicert.com -td SHA256 -v "ArduinoCloudAgent-${GITHUB_REF##*/}-windows-${{ matrix.arch }}-installer.exe" - name: Upload artifacts uses: actions/upload-artifact@v4 with: if-no-files-found: error - name: ArduinoCreateAgent-windows-${{ matrix.arch }}-signed - path: ArduinoCreateAgent-*-windows-${{ matrix.arch }}-installer.exe + name: ArduinoCloudAgent-windows-${{ matrix.arch }}-signed + path: ArduinoCloudAgent-*-windows-${{ matrix.arch }}-installer.exe # This step is needed because the self hosted runner does not delete files automatically - name: Clean up EXE - run: rm ArduinoCreateAgent-*-windows-${{ matrix.arch }}-installer.exe + run: rm ArduinoCloudAgent-*-windows-${{ matrix.arch }}-installer.exe # This job will generate a dmg mac installer, sign/notarize it. generate-sign-dmg: @@ -519,11 +520,11 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - name: ArduinoCreateAgent.app_${{ matrix.arch }}_notarized - path: ArduinoCreateAgent.app + name: ArduinoCloudAgent.app_${{ matrix.arch }}_notarized + path: ArduinoCloudAgent.app - name: unzip artifact - working-directory: ArduinoCreateAgent.app + working-directory: ArduinoCloudAgent.app run: | unzip ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip rm ArduinoCreateAgent.app_${{ matrix.arch }}_notarized.zip @@ -531,18 +532,18 @@ jobs: - name: Install create-dmg run: brew install create-dmg - - name: Genarate DMG + - name: Generate DMG run: | create-dmg \ - --volname "ArduinoCreateAgent" \ + --volname "ArduinoCloudAgent" \ --background "installer_icons/background.tiff" \ --window-pos 200 120 \ --window-size 500 320 \ --icon-size 80 \ - --icon "ArduinoCreateAgent.app" 125 150 \ + --icon "ArduinoCloudAgent.app" 125 150 \ --app-drop-link 375 150 \ - "ArduinoCreateAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.dmg" \ - "ArduinoCreateAgent.app" + "ArduinoCloudAgent-${GITHUB_REF##*/}-osx-${{ matrix.arch }}-installer.dmg" \ + "ArduinoCloudAgent.app" - name: Import Code-Signing Certificates run: | @@ -572,7 +573,7 @@ jobs: # gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20) run: | cat > gon.config_installer.hcl <| +------------>| | -| | | | | Arduino Create Agent | | Arduino Board | +| | | | | Arduino Cloud Agent | | Arduino Board | | | Arduino Create Web Editor | +--------------->| |<------------+ | | | | | REST API +----------------------+ serial +---------------+ | +---------------------------+ | @@ -74,7 +74,7 @@ By signing off your commits, you agree to the following agreement, also known as ## Authors and acknowledgment -arduino-create-agent is a fork of @[johnlauer](https://github.com/johnlauer)'s [serial-port-json-server](https://github.com/johnlauer/serial-port-json-server) (which we really want to thank for his kindness and great work) +arduino-cloud-agent is a fork of @[johnlauer](https://github.com/johnlauer)'s [serial-port-json-server](https://github.com/johnlauer/serial-port-json-server) (which we really want to thank for his kindness and great work) The history has been rewritten to keep the repo small (thus removing all binaries committed in the past) diff --git a/Taskfile.yml b/Taskfile.yml index 603a2ce9..b64b12bb 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -37,7 +37,7 @@ tasks: cmds: - task: go:build vars: - PROJECT_NAME: arduino-create-agent_cli + PROJECT_NAME: arduino-cloud-agent_cli ADDITIONAL_FLAGS: -tags cli go:build-win: @@ -46,7 +46,7 @@ tasks: - rsrc -arch {{.GOARCH}} -manifest manifest.xml # GOARCH shoud be either amd64 or 386 - task: go:build vars: - PROJECT_NAME: arduino-create-agent.exe + PROJECT_NAME: arduino-cloud-agent.exe WIN_FLAGS: -H=windowsgui - rm *.syso # rm file to avoid compilation problems on other platforms vars: @@ -58,7 +58,7 @@ tasks: cmds: - task: go:build vars: - PROJECT_NAME: arduino-create-agent_cli.exe + PROJECT_NAME: arduino-cloud-agent_cli.exe ADDITIONAL_FLAGS: -tags cli # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/test-go-task/Taskfile.yml @@ -140,7 +140,7 @@ tasks: vars: # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/release-go-task/Taskfile.yml - PROJECT_NAME: arduino-create-agent + PROJECT_NAME: arduino-cloud-agent # build vars COMMIT: sh: echo "$(git log --no-show-signature -n 1 --format=%h)" diff --git a/home.html b/home.html index e66b7c97..ee523981 100644 --- a/home.html +++ b/home.html @@ -1,321 +1,346 @@ - - - Arduino Create Agent Debug Console - - - + + Arduino Cloud Agent Debug Console + + + - - + - +
-
-

-            

-        
- - - - \ No newline at end of file + + diff --git a/tests/conftest.py b/tests/conftest.py index 622965b6..0e81d76f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -27,9 +27,9 @@ @pytest.fixture(scope="function") def agent(pytestconfig): if platform.system() == "Windows": - agent = str(Path(pytestconfig.rootdir) / "arduino-create-agent_cli.exe") + agent = str(Path(pytestconfig.rootdir) / "arduino-cloud-agent_cli.exe") else: - agent = str(Path(pytestconfig.rootdir) / "arduino-create-agent") + agent = str(Path(pytestconfig.rootdir) / "arduino-cloud-agent") env = { # "ARDUINO_DATA_DIR": data_dir, # "ARDUINO_DOWNLOADS_DIR": downloads_dir, diff --git a/updater/updater_darwin.go b/updater/updater_darwin.go index 105a529e..c4eb5070 100644 --- a/updater/updater_darwin.go +++ b/updater/updater_darwin.go @@ -143,7 +143,9 @@ func checkForUpdates(currentVersion string, updateURL string, cmdName string) (s // Install new app logrus.WithField("from", tmpAppPath).WithField("to", currentAppPath).Info("Copying updated app") - if err := tmpAppPath.CopyDirTo(currentAppPath); err != nil || !paths.New(executablePath).Exist() { + createPath := currentAppPath.Join("Contents", "MacOS", "Arduino_Create_Agent") + cloudPath := currentAppPath.Join("Contents", "MacOS", "Arduino_Cloud_Agent") + if err := tmpAppPath.CopyDirTo(currentAppPath); err != nil || (!createPath.Exist() && !cloudPath.Exist()) { // Try rollback changes _ = currentAppPath.RemoveAll() _ = oldAppPath.Rename(currentAppPath) From 6287df1e7a1611bf28569df49f493593b598cb4e Mon Sep 17 00:00:00 2001 From: Umberto Baldi <34278123+umbynos@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:01:59 +0200 Subject: [PATCH 14/42] Fix agent not able to install `esptool` after 1.6.0 (#986) * fix link * drop test on old tool not used anymore, and introduce again `arduino-fwuploader` * add tests to install esptool to verify https://github.com/arduino/arduino-create-agent/issues/980 * implement properly rename function to fix extraction issue with esptool * fix test * Update v2/pkgs/tools_test.go Co-authored-by: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com> --------- Co-authored-by: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com> --- main_test.go | 13 +++++++ tools/download_test.go | 1 - tools/testdata/test_tool_index.json | 55 --------------------------- v2/pkgs/pkgs.go | 8 ++-- v2/pkgs/testdata/test_tool_index.json | 55 --------------------------- v2/pkgs/tools.go | 14 ++++--- v2/pkgs/tools_test.go | 12 +++--- 7 files changed, 32 insertions(+), 126 deletions(-) diff --git a/main_test.go b/main_test.go index c8276bba..56855695 100644 --- a/main_test.go +++ b/main_test.go @@ -116,6 +116,18 @@ func TestInstallToolV2(t *testing.T) { Signature: &bossacSignature, } + esptoolURL := "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/x86_64-linux-gnu.esptool-f80ae31.tar.gz" + esptoolChecksum := "SHA-256:bded1dca953377838b6086a9bcd40a1dc5286ba5f69f2372c22a1d1819baad24" + esptoolSignature := "852b58871419ce5e5633ecfaa72c0f0fa890ceb51164b362b8133bc0e3e003a21cec48935b8cdc078f4031219cbf17fb7edd9d7c9ca8ed85492911c9ca6353c9aa4691eb91fda99563a6bd49aeca0d9981fb05ec76e45c6024f8a6822862ad1e34ddc652fbbf4fa909887a255d4f087398ec386577efcec523c21203be3d10fc9e9b0f990a7536875a77dc2bc5cbffea7734b62238e31719111b718bacccebffc9be689545540e81d23b81caa66214376f58a0d6a45cf7efc5d3af62ab932b371628162fffe403906f41d5534921e5be081c5ac2ecc9db5caec03a105cc44b00ce19a95ad079843501eb8182e0717ce327867380c0e39d2b48698547fc1d0d66" + esptoolInstallURLOK := tools.ToolPayload{ + Name: "esptool", + Version: "2.5.0-3-20ed2b9", + Packager: "esp8266", + URL: &esptoolURL, + Checksum: &esptoolChecksum, + Signature: &esptoolSignature, + } + wrongSignature := "wr0ngs1gn4tur3" bossacInstallWrongSig := tools.ToolPayload{ Name: "bossac", @@ -147,6 +159,7 @@ func TestInstallToolV2(t *testing.T) { {bossacInstallWrongSig, http.StatusInternalServerError, "verification error"}, {bossacInstallWrongCheck, http.StatusInternalServerError, "checksum of downloaded file doesn't match"}, {bossacInstallNoURL, http.StatusOK, "ok"}, + {esptoolInstallURLOK, http.StatusOK, "ok"}, } for _, test := range tests { diff --git a/tools/download_test.go b/tools/download_test.go index 1e958de9..8863a09d 100644 --- a/tools/download_test.go +++ b/tools/download_test.go @@ -120,7 +120,6 @@ func TestDownload(t *testing.T) { {"rp2040tools", "1.0.6", []string{"elf2uf2", "picotool", "pioasm", "rp2040load"}}, {"esptool_py", "4.5.1", []string{"esptool"}}, {"arduino-fwuploader", "2.2.2", []string{"arduino-fwuploader"}}, - {"fwupdater", "0.1.12", []string{"firmwares", "FirmwareUploader"}}, // old legacy tool } // prepare the test environment tempDir := t.TempDir() diff --git a/tools/testdata/test_tool_index.json b/tools/testdata/test_tool_index.json index fdee1cc9..b7f8b87d 100644 --- a/tools/testdata/test_tool_index.json +++ b/tools/testdata/test_tool_index.json @@ -514,61 +514,6 @@ "size": "6829396" } ] - }, - { - "name": "fwupdater", - "version": "0.1.12", - "systems": [ - { - "host": "i686-linux-gnu", - "url": "http://downloads.arduino.cc/tools/FirmwareUploader_0.1.12_Linux_32bit.tar.bz2", - "archiveFileName": "FirmwareUploader_0.1.12_Linux_32bit.tar.bz2", - "checksum": "SHA-256:2fec2bdfd20ad4950bc9ba37108dc2a7c152f569174279c0697efe1f5a0db781", - "size": "26097546" - }, - { - "host": "x86_64-pc-linux-gnu", - "url": "http://downloads.arduino.cc/tools/FirmwareUploader_0.1.12_Linux_64bit.tar.bz2", - "archiveFileName": "FirmwareUploader_0.1.12_Linux_64bit.tar.bz2", - "checksum": "SHA-256:ce57d0afef30cb7d3513f5da326346c99d6bf4923bbc2200634086811f3fb31e", - "size": "26073327" - }, - { - "host": "i686-mingw32", - "url": "http://downloads.arduino.cc/tools/FirmwareUploader_0.1.12_Windows_32bit.zip", - "archiveFileName": "FirmwareUploader_0.1.12_Windows_32bit.zip", - "checksum": "SHA-256:558568b453caa1c821def8cc6d34555d0c910eb7e7e871de3ae1c39ae6f01bdd", - "size": "25743641" - }, - { - "host": "x86_64-mingw32", - "url": "http://downloads.arduino.cc/tools/FirmwareUploader_0.1.12_Windows_64bit.zip", - "archiveFileName": "FirmwareUploader_0.1.12_Windows_64bit.zip", - "checksum": "SHA-256:ec16de33620985434280c92c3c322257b89bb67adf8fd4d5dd5f9467ea1e9e40", - "size": "25851428" - }, - { - "host": "i386-apple-darwin11", - "url": "http://downloads.arduino.cc/tools/FirmwareUploader_0.1.12_macOS_64bit.tar.bz2", - "archiveFileName": "FirmwareUploader_0.1.12_macOS_64bit.tar.bz2", - "checksum": "SHA-256:a470361b57f86ddfcaecd274d844af51ee1d23a71cd6c26e30fcef2152d1a03f", - "size": "25792860" - }, - { - "host": "arm-linux-gnueabihf", - "url": "http://downloads.arduino.cc/tools/FirmwareUploader_0.1.12_Linux_ARM.tar.bz2", - "archiveFileName": "FirmwareUploader_0.1.12_Linux_ARM.tar.bz2", - "checksum": "SHA-256:855fa0a9b942c3ee18906efc510bdfe30bf3334ff28ffbb476e648ff30033847", - "size": "25936245" - }, - { - "host": "aarch64-linux-gnu", - "url": "http://downloads.arduino.cc/tools/FirmwareUploader_0.1.12_Linux_ARM64.tar.bz2", - "archiveFileName": "FirmwareUploader_0.1.12_Linux_ARM64.tar.bz2", - "checksum": "SHA-256:691461e64fe075e9a79801347c2bd895fb72f8f2c45a7cd49056c6ad9efe8fc4", - "size": "25967430" - } - ] } ] } diff --git a/v2/pkgs/pkgs.go b/v2/pkgs/pkgs.go index f4965117..07e392b2 100644 --- a/v2/pkgs/pkgs.go +++ b/v2/pkgs/pkgs.go @@ -50,7 +50,7 @@ type System struct { Checksum string `json:"checksum"` } -// Source: https://github.com/arduino/arduino-cli/blob/master/arduino/cores/tools.go#L129-L142 +// Source: https://github.com/arduino/arduino-cli/blob/master/internal/arduino/cores/tools.go#L129-L142 var ( regexpLinuxArm = regexp.MustCompile("arm.*-linux-gnueabihf") regexpLinuxArm64 = regexp.MustCompile("(aarch64|arm64)-linux-gnu") @@ -66,7 +66,7 @@ var ( regexpFreeBSD64 = regexp.MustCompile("amd64-freebsd[0-9]*") ) -// Source: https://github.com/arduino/arduino-cli/blob/master/arduino/cores/tools.go#L144-L176 +// Source: https://github.com/arduino/arduino-cli/blob/master/internal/arduino/cores/tools.go#L144-L176 func (s *System) isExactMatchWith(osName, osArch string) bool { if s.Host == "all" { return true @@ -101,7 +101,7 @@ func (s *System) isExactMatchWith(osName, osArch string) bool { return false } -// Source: https://github.com/arduino/arduino-cli/blob/master/arduino/cores/tools.go#L178-L198 +// Source: https://github.com/arduino/arduino-cli/blob/master/internal/arduino/cores/tools.go#L178-L198 func (s *System) isCompatibleWith(osName, osArch string) (bool, int) { if s.isExactMatchWith(osName, osArch) { return true, 1000 @@ -125,7 +125,7 @@ func (s *System) isCompatibleWith(osName, osArch string) (bool, int) { } // GetFlavourCompatibleWith returns the downloadable resource (System) compatible with the specified OS/Arch -// Source: https://github.com/arduino/arduino-cli/blob/master/arduino/cores/tools.go#L206-L216 +// Source: https://github.com/arduino/arduino-cli/blob/master/internal/arduino/cores/tools.go#L206-L216 func (t *Tool) GetFlavourCompatibleWith(osName, osArch string) System { var correctSystem System maxSimilarity := -1 diff --git a/v2/pkgs/testdata/test_tool_index.json b/v2/pkgs/testdata/test_tool_index.json index fdee1cc9..b7f8b87d 100644 --- a/v2/pkgs/testdata/test_tool_index.json +++ b/v2/pkgs/testdata/test_tool_index.json @@ -514,61 +514,6 @@ "size": "6829396" } ] - }, - { - "name": "fwupdater", - "version": "0.1.12", - "systems": [ - { - "host": "i686-linux-gnu", - "url": "http://downloads.arduino.cc/tools/FirmwareUploader_0.1.12_Linux_32bit.tar.bz2", - "archiveFileName": "FirmwareUploader_0.1.12_Linux_32bit.tar.bz2", - "checksum": "SHA-256:2fec2bdfd20ad4950bc9ba37108dc2a7c152f569174279c0697efe1f5a0db781", - "size": "26097546" - }, - { - "host": "x86_64-pc-linux-gnu", - "url": "http://downloads.arduino.cc/tools/FirmwareUploader_0.1.12_Linux_64bit.tar.bz2", - "archiveFileName": "FirmwareUploader_0.1.12_Linux_64bit.tar.bz2", - "checksum": "SHA-256:ce57d0afef30cb7d3513f5da326346c99d6bf4923bbc2200634086811f3fb31e", - "size": "26073327" - }, - { - "host": "i686-mingw32", - "url": "http://downloads.arduino.cc/tools/FirmwareUploader_0.1.12_Windows_32bit.zip", - "archiveFileName": "FirmwareUploader_0.1.12_Windows_32bit.zip", - "checksum": "SHA-256:558568b453caa1c821def8cc6d34555d0c910eb7e7e871de3ae1c39ae6f01bdd", - "size": "25743641" - }, - { - "host": "x86_64-mingw32", - "url": "http://downloads.arduino.cc/tools/FirmwareUploader_0.1.12_Windows_64bit.zip", - "archiveFileName": "FirmwareUploader_0.1.12_Windows_64bit.zip", - "checksum": "SHA-256:ec16de33620985434280c92c3c322257b89bb67adf8fd4d5dd5f9467ea1e9e40", - "size": "25851428" - }, - { - "host": "i386-apple-darwin11", - "url": "http://downloads.arduino.cc/tools/FirmwareUploader_0.1.12_macOS_64bit.tar.bz2", - "archiveFileName": "FirmwareUploader_0.1.12_macOS_64bit.tar.bz2", - "checksum": "SHA-256:a470361b57f86ddfcaecd274d844af51ee1d23a71cd6c26e30fcef2152d1a03f", - "size": "25792860" - }, - { - "host": "arm-linux-gnueabihf", - "url": "http://downloads.arduino.cc/tools/FirmwareUploader_0.1.12_Linux_ARM.tar.bz2", - "archiveFileName": "FirmwareUploader_0.1.12_Linux_ARM.tar.bz2", - "checksum": "SHA-256:855fa0a9b942c3ee18906efc510bdfe30bf3334ff28ffbb476e648ff30033847", - "size": "25936245" - }, - { - "host": "aarch64-linux-gnu", - "url": "http://downloads.arduino.cc/tools/FirmwareUploader_0.1.12_Linux_ARM64.tar.bz2", - "archiveFileName": "FirmwareUploader_0.1.12_Linux_ARM64.tar.bz2", - "checksum": "SHA-256:691461e64fe075e9a79801347c2bd895fb72f8f2c45a7cd49056c6ad9efe8fc4", - "size": "25967430" - } - ] } ] } diff --git a/v2/pkgs/tools.go b/v2/pkgs/tools.go index b0daaaae..14f853e9 100644 --- a/v2/pkgs/tools.go +++ b/v2/pkgs/tools.go @@ -269,15 +269,19 @@ func (t *Tools) Remove(ctx context.Context, payload *tools.ToolPayload) (*tools. return &tools.Operation{Status: "ok"}, nil } +// rename function is used to rename the path of the extracted files func rename(base string) extract.Renamer { + // "Rename" the given path adding the "base" and removing the root folder in "path" (if present). return func(path string) string { parts := strings.Split(filepath.ToSlash(path), "/") - newPath := strings.Join(parts[1:], "/") - if newPath == "" { - newPath = filepath.Join(newPath, path) + if len(parts) <= 1 { + // The path does not contain a root folder. This might happen for tool packages (zip files) + // that have an invalid structure. Do not try to remove the root folder in these cases. + return filepath.Join(base, path) } - path = filepath.Join(base, newPath) - return path + // Removes the first part of the path (the root folder). + path = strings.Join(parts[1:], "/") + return filepath.Join(base, path) } } diff --git a/v2/pkgs/tools_test.go b/v2/pkgs/tools_test.go index be4d5e4d..edd575fc 100644 --- a/v2/pkgs/tools_test.go +++ b/v2/pkgs/tools_test.go @@ -230,9 +230,9 @@ func TestInstall(t *testing.T) { {Name: "dfu-util", Version: "0.10.0-arduino1", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, {Name: "rp2040tools", Version: "1.0.6", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, {Name: "esptool_py", Version: "4.5.1", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, - // At the moment we don't install these ones because they are packaged in a different way: they do not have a top level dir, causing the rename funcion to behave incorrectly - // {Name: "fwupdater", Version: "0.1.12", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, - // {Name: "arduino-fwuploader", Version: "2.2.2", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, + {Name: "arduino-fwuploader", Version: "2.2.2", Packager: "arduino-test", URL: nil, Checksum: nil, Signature: nil}, + // test download of a tool not present in index. the same archive is downloaded on linux/win/mac See https://github.com/arduino/arduino-create-agent/issues/980 + {Name: "esptool", Version: "2.5.0-3-20ed2b9", Packager: "esp8266", URL: strpoint("https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/x86_64-linux-gnu.esptool-f80ae31.tar.gz"), Checksum: strpoint("SHA-256:bded1dca953377838b6086a9bcd40a1dc5286ba5f69f2372c22a1d1819baad24"), Signature: strpoint("852b58871419ce5e5633ecfaa72c0f0fa890ceb51164b362b8133bc0e3e003a21cec48935b8cdc078f4031219cbf17fb7edd9d7c9ca8ed85492911c9ca6353c9aa4691eb91fda99563a6bd49aeca0d9981fb05ec76e45c6024f8a6822862ad1e34ddc652fbbf4fa909887a255d4f087398ec386577efcec523c21203be3d10fc9e9b0f990a7536875a77dc2bc5cbffea7734b62238e31719111b718bacccebffc9be689545540e81d23b81caa66214376f58a0d6a45cf7efc5d3af62ab932b371628162fffe403906f41d5534921e5be081c5ac2ecc9db5caec03a105cc44b00ce19a95ad079843501eb8182e0717ce327867380c0e39d2b48698547fc1d0d66")}, } expectedFiles := map[string][]string{ @@ -244,8 +244,8 @@ func TestInstall(t *testing.T) { "dfu-util-0.10.0-arduino1": {"dfu-prefix", "dfu-suffix", "dfu-util"}, "rp2040tools-1.0.6": {"elf2uf2", "picotool", "pioasm", "rp2040load"}, "esptool_py-4.5.1": {"esptool"}, - // "fwupdater-0.1.12": {"firmwares", "FirmwareUploader"}, // old legacy tool - // "arduino-fwuploader-2.2.2": {"arduino-fwuploader"}, + "arduino-fwuploader-2.2.2": {"arduino-fwuploader"}, + // "esptool-2.5.0-3-20ed2b9": {"esptool"}, // we don't check if there is esptool in the archive because it's the same archive even on windows (no extension) } for _, tc := range testCases { t.Run(tc.Name+"-"+tc.Version, func(t *testing.T) { @@ -254,7 +254,7 @@ func TestInstall(t *testing.T) { require.NoError(t, err) // Check that the tool has been downloaded - toolDir := paths.New(tmp).Join("arduino-test", tc.Name, tc.Version) + toolDir := paths.New(tmp).Join(tc.Packager, tc.Name, tc.Version) require.DirExists(t, toolDir.String()) // Check that the files have been created From a679bf359c17749c056648ef1b0c66d50d418e0f Mon Sep 17 00:00:00 2001 From: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:38:05 +0200 Subject: [PATCH 15/42] Improve `installed.json` handling in `v2/tools` (#983) * Introduce mutex policy to the v2 tools and use it to write the installed.json * Use a map to store installed.json information * Use the correct lock for reading and writing * Include the v2.Tools constructor in the old Tools struct * Add corrupted json test --- tools/download.go | 5 ++- tools/download_test.go | 20 +++++++++++ tools/tools.go | 3 ++ v2/pkgs/tools.go | 76 ++++++++++++++++++++---------------------- 4 files changed, 61 insertions(+), 43 deletions(-) diff --git a/tools/download.go b/tools/download.go index 6e5fa8b7..8c4a37a6 100644 --- a/tools/download.go +++ b/tools/download.go @@ -25,7 +25,6 @@ import ( "github.com/arduino/arduino-create-agent/gen/tools" "github.com/arduino/arduino-create-agent/utilities" - "github.com/arduino/arduino-create-agent/v2/pkgs" ) // Download will parse the index at the indexURL for the tool to download. @@ -45,8 +44,8 @@ import ( // if it already exists. func (t *Tools) Download(pack, name, version, behaviour string) error { - tool := pkgs.New(t.index, t.directory.String(), behaviour) - _, err := tool.Install(context.Background(), &tools.ToolPayload{Name: name, Version: version, Packager: pack}) + t.tools.SetBehaviour(behaviour) + _, err := t.tools.Install(context.Background(), &tools.ToolPayload{Name: name, Version: version, Packager: pack}) if err != nil { return err } diff --git a/tools/download_test.go b/tools/download_test.go index 8863a09d..7cf2fab0 100644 --- a/tools/download_test.go +++ b/tools/download_test.go @@ -160,3 +160,23 @@ func TestDownload(t *testing.T) { }) } } + +func TestCorruptedInstalled(t *testing.T) { + // prepare the test environment + tempDir := t.TempDir() + tempDirPath := paths.New(tempDir) + testIndex := index.Resource{ + IndexFile: *paths.New("testdata", "test_tool_index.json"), + LastRefresh: time.Now(), + } + corruptedJSON := tempDirPath.Join("installed.json") + fileJSON, err := corruptedJSON.Create() + require.NoError(t, err) + defer fileJSON.Close() + _, err = fileJSON.Write([]byte("Hello")) + require.NoError(t, err) + testTools := New(tempDirPath, &testIndex, func(msg string) { t.Log(msg) }) + // Download the tool + err = testTools.Download("arduino-test", "avrdude", "6.3.0-arduino17", "keep") + require.NoError(t, err) +} diff --git a/tools/tools.go b/tools/tools.go index cb9efc78..5cecc508 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -22,6 +22,7 @@ import ( "sync" "github.com/arduino/arduino-create-agent/index" + "github.com/arduino/arduino-create-agent/v2/pkgs" "github.com/arduino/go-paths-helper" "github.com/xrash/smetrics" ) @@ -47,6 +48,7 @@ type Tools struct { logger func(msg string) installed map[string]string mutex sync.RWMutex + tools *pkgs.Tools } // New will return a Tool object, allowing the caller to execute operations on it. @@ -60,6 +62,7 @@ func New(directory *paths.Path, index *index.Resource, logger func(msg string)) logger: logger, installed: map[string]string{}, mutex: sync.RWMutex{}, + tools: pkgs.New(index, directory.String(), "replace"), } _ = t.readMap() return t diff --git a/v2/pkgs/tools.go b/v2/pkgs/tools.go index 14f853e9..c84d207f 100644 --- a/v2/pkgs/tools.go +++ b/v2/pkgs/tools.go @@ -29,6 +29,7 @@ import ( "path/filepath" "runtime" "strings" + "sync" "github.com/arduino/arduino-create-agent/gen/tools" "github.com/arduino/arduino-create-agent/index" @@ -60,17 +61,23 @@ type Tools struct { index *index.Resource folder string behaviour string + installed map[string]string + mutex sync.RWMutex } // New will return a Tool object, allowing the caller to execute operations on it. // The New function will accept an index as parameter (used to download the indexes) // and a folder used to download the indexes func New(index *index.Resource, folder, behaviour string) *Tools { - return &Tools{ + t := &Tools{ index: index, folder: folder, behaviour: behaviour, + installed: map[string]string{}, + mutex: sync.RWMutex{}, } + t.readInstalled() + return t } // Installedhead is here only because it was required by the front-end. @@ -181,13 +188,10 @@ func (t *Tools) Install(ctx context.Context, payload *tools.ToolPayload) (*tools key := correctTool.Name + "-" + correctTool.Version // Check if it already exists if t.behaviour == "keep" && pathExists(t.folder) { - location, ok, err := checkInstalled(t.folder, key) - if err != nil { - return nil, err - } + location, ok := t.installed[key] if ok && pathExists(location) { // overwrite the default tool with this one - err := writeInstalled(t.folder, path) + err := t.writeInstalled(path) if err != nil { return nil, err } @@ -245,7 +249,7 @@ func (t *Tools) install(ctx context.Context, path, url, checksum string) (*tools } // Write installed.json for retrocompatibility with v1 - err = writeInstalled(t.folder, path) + err = t.writeInstalled(path) if err != nil { return nil, err } @@ -285,54 +289,41 @@ func rename(base string) extract.Renamer { } } -func readInstalled(installedFile string) (map[string]string, error) { +func (t *Tools) readInstalled() error { + t.mutex.RLock() + defer t.mutex.RUnlock() // read installed.json - installed := map[string]string{} - data, err := os.ReadFile(installedFile) - if err == nil { - err = json.Unmarshal(data, &installed) - if err != nil { - return nil, err - } - } - return installed, nil -} - -func checkInstalled(folder, key string) (string, bool, error) { - installedFile, err := utilities.SafeJoin(folder, "installed.json") - if err != nil { - return "", false, err - } - installed, err := readInstalled(installedFile) - if err != nil { - return "", false, err - } - location, ok := installed[key] - return location, ok, err -} - -func writeInstalled(folder, path string) error { - // read installed.json - installedFile, err := utilities.SafeJoin(folder, "installed.json") + installedFile, err := utilities.SafeJoin(t.folder, "installed.json") if err != nil { return err } - installed, err := readInstalled(installedFile) + data, err := os.ReadFile(installedFile) if err != nil { return err } + return json.Unmarshal(data, &t.installed) +} + +func (t *Tools) writeInstalled(path string) error { + t.mutex.Lock() + defer t.mutex.Unlock() parts := strings.Split(path, string(filepath.Separator)) tool := parts[len(parts)-2] toolWithVersion := fmt.Sprint(tool, "-", parts[len(parts)-1]) - toolFile, err := utilities.SafeJoin(folder, path) + toolFile, err := utilities.SafeJoin(t.folder, path) if err != nil { return err } - installed[tool] = toolFile - installed[toolWithVersion] = toolFile + t.installed[tool] = toolFile + t.installed[toolWithVersion] = toolFile - data, err := json.Marshal(installed) + data, err := json.Marshal(t.installed) + if err != nil { + return err + } + + installedFile, err := utilities.SafeJoin(t.folder, "installed.json") if err != nil { return err } @@ -340,6 +331,11 @@ func writeInstalled(folder, path string) error { return os.WriteFile(installedFile, data, 0644) } +// SetBehaviour sets the download behaviour to either keep or replace +func (t *Tools) SetBehaviour(behaviour string) { + t.behaviour = behaviour +} + func pathExists(path string) bool { _, err := os.Stat(path) if err == nil { From 1561223e52c891127a5f4645c0023699a804c043 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:39:07 +0200 Subject: [PATCH 16/42] Bump golang.org/x/sys from 0.20.0 to 0.23.0 (#985) * Bump golang.org/x/sys from 0.20.0 to 0.23.0 Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.20.0 to 0.23.0. - [Commits](https://github.com/golang/sys/compare/v0.20.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * update license --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Umberto Baldi --- .licensed.yml | 1 + .../go/golang.org/x/sys/unix.dep.yml | 12 ++++++------ go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.licensed.yml b/.licensed.yml index f0c02a90..10413519 100644 --- a/.licensed.yml +++ b/.licensed.yml @@ -10,6 +10,7 @@ reviewed: - golang.org/x/net/html - golang.org/x/net/html/atom - golang.org/x/crypto/curve25519 + - golang.org/x/sys/unix - github.com/ProtonMail/go-crypto/bitcurves - github.com/ProtonMail/go-crypto/brainpool - github.com/ProtonMail/go-crypto/eax diff --git a/.licenses/arduino-create-agent/go/golang.org/x/sys/unix.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/sys/unix.dep.yml index 8c6dd955..5c4780a8 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/sys/unix.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/sys/unix.dep.yml @@ -1,14 +1,14 @@ --- name: golang.org/x/sys/unix -version: v0.20.0 +version: v0.23.0 type: go summary: Package unix contains an interface to the low-level operating system primitives. homepage: https://pkg.go.dev/golang.org/x/sys/unix -license: bsd-3-clause +license: other licenses: -- sources: sys@v0.20.0/LICENSE +- sources: sys@v0.23.0/LICENSE text: | - Copyright (c) 2009 The Go Authors. All rights reserved. + Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -20,7 +20,7 @@ licenses: copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: sys@v0.20.0/PATENTS +- sources: sys@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/go.mod b/go.mod index b1f0f8fd..4b92a257 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/xrash/smetrics v0.0.0-20170218160415-a3153f7040e9 go.bug.st/serial v1.6.1 goa.design/goa/v3 v3.16.1 - golang.org/x/sys v0.20.0 + golang.org/x/sys v0.23.0 gopkg.in/inconshreveable/go-update.v0 v0.0.0-20150814200126-d8b0b1d421aa ) diff --git a/go.sum b/go.sum index 278446a6..2e8a4422 100644 --- a/go.sum +++ b/go.sum @@ -181,8 +181,8 @@ golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= +golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= From 3ebca0a054b2451a2a5ddc962bac3ae133f6bcfa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:41:54 +0200 Subject: [PATCH 17/42] Bump github.com/ProtonMail/go-crypto from 1.1.0-alpha.2 to 1.1.0-alpha.5-proton (#974) * Bump github.com/ProtonMail/go-crypto Bumps [github.com/ProtonMail/go-crypto](https://github.com/ProtonMail/go-crypto) from 1.1.0-alpha.2 to 1.1.0-alpha.5-proton. - [Release notes](https://github.com/ProtonMail/go-crypto/releases) - [Commits](https://github.com/ProtonMail/go-crypto/compare/v1.1.0-alpha.2...v1.1.0-alpha.5-proton) --- updated-dependencies: - dependency-name: github.com/ProtonMail/go-crypto dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * update licenses --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Umberto Baldi --- .licensed.yml | 3 + .../ProtonMail/go-crypto/bitcurves.dep.yml | 6 +- .../ProtonMail/go-crypto/brainpool.dep.yml | 6 +- .../ProtonMail/go-crypto/eax.dep.yml | 6 +- .../go-crypto/internal/byteutil.dep.yml | 6 +- .../ProtonMail/go-crypto/ocb.dep.yml | 6 +- .../ProtonMail/go-crypto/openpgp.dep.yml | 6 +- .../go-crypto/openpgp/aes/keywrap.dep.yml | 6 +- .../go-crypto/openpgp/armor.dep.yml | 6 +- .../ProtonMail/go-crypto/openpgp/ecdh.dep.yml | 6 +- .../go-crypto/openpgp/ecdsa.dep.yml | 6 +- .../go-crypto/openpgp/ed25519.dep.yml | 6 +- .../go-crypto/openpgp/ed448.dep.yml | 6 +- .../go-crypto/openpgp/eddsa.dep.yml | 6 +- .../go-crypto/openpgp/elgamal.dep.yml | 6 +- .../go-crypto/openpgp/errors.dep.yml | 6 +- .../openpgp/internal/algorithm.dep.yml | 6 +- .../go-crypto/openpgp/internal/ecc.dep.yml | 6 +- .../openpgp/internal/ecc/curve25519.dep.yml | 63 +++++++++++++++++++ .../internal/ecc/curve25519/field.dep.yml | 62 ++++++++++++++++++ .../openpgp/internal/encoding.dep.yml | 6 +- .../go-crypto/openpgp/packet.dep.yml | 6 +- .../ProtonMail/go-crypto/openpgp/s2k.dep.yml | 6 +- .../go-crypto/openpgp/symmetric.dep.yml | 62 ++++++++++++++++++ .../go-crypto/openpgp/x25519.dep.yml | 6 +- .../ProtonMail/go-crypto/openpgp/x448.dep.yml | 6 +- go.mod | 2 +- go.sum | 4 +- 28 files changed, 259 insertions(+), 69 deletions(-) create mode 100644 .licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519.dep.yml create mode 100644 .licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519/field.dep.yml create mode 100644 .licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/symmetric.dep.yml diff --git a/.licensed.yml b/.licensed.yml index 10413519..12e7395a 100644 --- a/.licensed.yml +++ b/.licensed.yml @@ -28,9 +28,12 @@ reviewed: - github.com/ProtonMail/go-crypto/openpgp/errors - github.com/ProtonMail/go-crypto/openpgp/internal/algorithm - github.com/ProtonMail/go-crypto/openpgp/internal/ecc + - github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519 + - github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519/field - github.com/ProtonMail/go-crypto/openpgp/internal/encoding - github.com/ProtonMail/go-crypto/openpgp/packet - github.com/ProtonMail/go-crypto/openpgp/s2k + - github.com/ProtonMail/go-crypto/openpgp/symmetric - github.com/ProtonMail/go-crypto/openpgp/x25519 - github.com/ProtonMail/go-crypto/openpgp/x448 - github.com/cloudflare/circl/dh/x25519 diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/bitcurves.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/bitcurves.dep.yml index 08606aa3..ff1d983d 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/bitcurves.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/bitcurves.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/ProtonMail/go-crypto/bitcurves -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/bitcurves license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/brainpool.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/brainpool.dep.yml index 5cc5c293..9ec1b1ce 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/brainpool.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/brainpool.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/ProtonMail/go-crypto/brainpool -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package brainpool implements Brainpool elliptic curves. homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/brainpool license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/eax.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/eax.dep.yml index 24d186b3..e086227d 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/eax.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/eax.dep.yml @@ -1,6 +1,6 @@ --- name: github.com/ProtonMail/go-crypto/eax -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: 'Package eax provides an implementation of the EAX (encrypt-authenticate-translate) mode of operation, as described in Bellare, Rogaway, and Wagner "THE EAX MODE OF @@ -9,7 +9,7 @@ summary: 'Package eax provides an implementation of the EAX (encrypt-authenticat homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/eax license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -38,7 +38,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/internal/byteutil.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/internal/byteutil.dep.yml index a3835acb..1d0b837c 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/internal/byteutil.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/internal/byteutil.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/ProtonMail/go-crypto/internal/byteutil -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/internal/byteutil license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/ocb.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/ocb.dep.yml index 4ca8e6a7..f24f78fe 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/ocb.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/ocb.dep.yml @@ -1,6 +1,6 @@ --- name: github.com/ProtonMail/go-crypto/ocb -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: 'Package ocb provides an implementation of the OCB (offset codebook) mode of operation, as described in RFC-7253 of the IRTF and in Rogaway, Bellare, Black @@ -9,7 +9,7 @@ summary: 'Package ocb provides an implementation of the OCB (offset codebook) mo homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/ocb license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -38,7 +38,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp.dep.yml index b2cfe5b0..af72530c 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/ProtonMail/go-crypto/openpgp -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package openpgp implements high level operations on OpenPGP messages. homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap.dep.yml index c8b82bc4..7cc6fb0d 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/aes/keywrap -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package keywrap is an implementation of the RFC 3394 AES key wrapping algorithm. homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/armor.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/armor.dep.yml index 5d827c6f..982a1450 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/armor.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/armor.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/armor -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package armor implements OpenPGP ASCII Armor, see RFC 4880. homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/armor license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ecdh.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ecdh.dep.yml index 19bbd5b3..9107dd71 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ecdh.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ecdh.dep.yml @@ -1,13 +1,13 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/ecdh -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package ecdh implements ECDH encryption, suitable for OpenPGP, as specified in RFC 6637, section 8. homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/ecdh license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ecdsa.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ecdsa.dep.yml index 6d493536..26ae39b9 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ecdsa.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ecdsa.dep.yml @@ -1,13 +1,13 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/ecdsa -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package ecdsa implements ECDSA signature, suitable for OpenPGP, as specified in RFC 6637, section 5. homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/ecdsa license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ed25519.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ed25519.dep.yml index 619142d7..b98f3d6f 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ed25519.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ed25519.dep.yml @@ -1,13 +1,13 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/ed25519 -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package ed25519 implements the ed25519 signature algorithm for OpenPGP as defined in the Open PGP crypto refresh. homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/ed25519 license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ed448.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ed448.dep.yml index ba001ce3..a3ec2359 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ed448.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/ed448.dep.yml @@ -1,13 +1,13 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/ed448 -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package ed448 implements the ed448 signature algorithm for OpenPGP as defined in the Open PGP crypto refresh. homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/ed448 license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/eddsa.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/eddsa.dep.yml index a197e12e..77cb4464 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/eddsa.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/eddsa.dep.yml @@ -1,13 +1,13 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/eddsa -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package eddsa implements EdDSA signature, suitable for OpenPGP, as specified in https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-13.7 homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/eddsa license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/elgamal.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/elgamal.dep.yml index 01278f3d..30c4e465 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/elgamal.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/elgamal.dep.yml @@ -1,6 +1,6 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/elgamal -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package elgamal implements ElGamal encryption, suitable for OpenPGP, as specified in "A Public-Key Cryptosystem and a Signature Scheme Based on Discrete Logarithms," @@ -8,7 +8,7 @@ summary: Package elgamal implements ElGamal encryption, suitable for OpenPGP, as homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/elgamal license: bsd-3-clause licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -37,7 +37,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/errors.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/errors.dep.yml index cb6ba944..81688cd2 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/errors.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/errors.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/errors -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package errors contains common error types for the OpenPGP packages. homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/errors license: bsd-3-clause licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm.dep.yml index 9671f997..6d96f444 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/internal/algorithm -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc.dep.yml index 080c67ae..81e8f7cb 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/internal/ecc -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA. homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/internal/ecc license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519.dep.yml new file mode 100644 index 00000000..ce6e3efe --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519.dep.yml @@ -0,0 +1,63 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519 +version: v1.1.0-alpha.5-proton +type: go +summary: Package curve25519 implements custom field operations without clamping for + forwarding. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519 +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519/field.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519/field.dep.yml new file mode 100644 index 00000000..8df0ed08 --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519/field.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519/field +version: v1.1.0-alpha.5-proton +type: go +summary: Package field implements fast arithmetic modulo 2^255-19. +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519/field +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/encoding.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/encoding.dep.yml index 871478be..990da1aa 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/encoding.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/internal/encoding.dep.yml @@ -1,13 +1,13 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/internal/encoding -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package encoding implements openpgp packet field encodings as specified in RFC 4880 and 6637. homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/internal/encoding license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/packet.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/packet.dep.yml index 990c817b..c470a9e2 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/packet.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/packet.dep.yml @@ -1,13 +1,13 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/packet -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package packet implements parsing and serialization of OpenPGP packets, as specified in RFC 4880. homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/packet license: bsd-3-clause licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/s2k.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/s2k.dep.yml index 3ec86e4b..a1a554e6 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/s2k.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/s2k.dep.yml @@ -1,6 +1,6 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/s2k -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: Package s2k implements the various OpenPGP string-to-key transforms as specified in RFC 4800 section 3.7.1, and Argon2 specified in draft-ietf-openpgp-crypto-refresh-08 @@ -8,7 +8,7 @@ summary: Package s2k implements the various OpenPGP string-to-key transforms as homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/s2k license: bsd-3-clause licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -37,7 +37,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/symmetric.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/symmetric.dep.yml new file mode 100644 index 00000000..581db5cb --- /dev/null +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/symmetric.dep.yml @@ -0,0 +1,62 @@ +--- +name: github.com/ProtonMail/go-crypto/openpgp/symmetric +version: v1.1.0-alpha.5-proton +type: go +summary: +homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/symmetric +license: other +licenses: +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE + text: | + Copyright (c) 2009 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google hereby grants to You a perpetual, worldwide, non-exclusive, + no-charge, royalty-free, irrevocable (except as stated in this section) + patent license to make, have made, use, offer to sell, sell, import, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/x25519.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/x25519.dep.yml index 79e3c7c8..16798ee8 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/x25519.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/x25519.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/x25519 -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/x25519 license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/x448.dep.yml b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/x448.dep.yml index 21d2d9e9..27acdb02 100644 --- a/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/x448.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ProtonMail/go-crypto/openpgp/x448.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/ProtonMail/go-crypto/openpgp/x448 -version: v1.1.0-alpha.2 +version: v1.1.0-alpha.5-proton type: go summary: homepage: https://pkg.go.dev/github.com/ProtonMail/go-crypto/openpgp/x448 license: other licenses: -- sources: go-crypto@v1.1.0-alpha.2/LICENSE +- sources: go-crypto@v1.1.0-alpha.5-proton/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: go-crypto@v1.1.0-alpha.2/PATENTS +- sources: go-crypto@v1.1.0-alpha.5-proton/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/go.mod b/go.mod index 4b92a257..356b5110 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( fyne.io/systray v1.10.0 - github.com/ProtonMail/go-crypto v1.1.0-alpha.2 + github.com/ProtonMail/go-crypto v1.1.0-alpha.5-proton github.com/arduino/go-paths-helper v1.12.0 github.com/arduino/go-serial-utils v0.1.2 github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.0 diff --git a/go.sum b/go.sum index 2e8a4422..1481506d 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ fyne.io/systray v1.10.0 h1:Yr1D9Lxeiw3+vSuZWPlaHC8BMjIHZXJKkek706AfYQk= fyne.io/systray v1.10.0/go.mod h1:oM2AQqGJ1AMo4nNqZFYU8xYygSBZkW2hmdJ7n4yjedE= github.com/AnatolyRugalev/goregen v0.1.0 h1:xrdXkLaskMnbxW0x4FWNj2yoednv0X2bcTBWpuJGYfE= github.com/AnatolyRugalev/goregen v0.1.0/go.mod h1:sVlY1tjcirqLBRZnCcIq1+7/Lwmqz5g7IK8AStjOVzI= -github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg= -github.com/ProtonMail/go-crypto v1.1.0-alpha.2/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= +github.com/ProtonMail/go-crypto v1.1.0-alpha.5-proton h1:KVBEgU3CJpmzLChnLiSuEyCuhGhcMt3eOST+7A+ckto= +github.com/ProtonMail/go-crypto v1.1.0-alpha.5-proton/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= github.com/arduino/go-paths-helper v1.12.0 h1:xizOQtI9iHdl19qXd1EmWg5i9W//2bOCOYwlNv8F61E= github.com/arduino/go-paths-helper v1.12.0/go.mod h1:jcpW4wr0u69GlXhTYydsdsqAjLaYK5n7oWHfKqOG6LM= From a945e56092413ccae8339879487912092552ac4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:54:02 +0200 Subject: [PATCH 18/42] Bump github.com/arduino/go-paths-helper from 1.12.0 to 1.12.1 (#962) * Bump github.com/arduino/go-paths-helper from 1.12.0 to 1.12.1 Bumps [github.com/arduino/go-paths-helper](https://github.com/arduino/go-paths-helper) from 1.12.0 to 1.12.1. - [Release notes](https://github.com/arduino/go-paths-helper/releases) - [Commits](https://github.com/arduino/go-paths-helper/compare/v1.12.0...v1.12.1) --- updated-dependencies: - dependency-name: github.com/arduino/go-paths-helper dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * update license --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Umberto Baldi --- .../go/github.com/arduino/go-paths-helper.dep.yml | 2 +- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.licenses/arduino-create-agent/go/github.com/arduino/go-paths-helper.dep.yml b/.licenses/arduino-create-agent/go/github.com/arduino/go-paths-helper.dep.yml index 1de189b7..21d102e9 100644 --- a/.licenses/arduino-create-agent/go/github.com/arduino/go-paths-helper.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/arduino/go-paths-helper.dep.yml @@ -1,6 +1,6 @@ --- name: github.com/arduino/go-paths-helper -version: v1.12.0 +version: v1.12.1 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/go-paths-helper diff --git a/go.mod b/go.mod index 356b5110..9c4e3a03 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( fyne.io/systray v1.10.0 github.com/ProtonMail/go-crypto v1.1.0-alpha.5-proton - github.com/arduino/go-paths-helper v1.12.0 + github.com/arduino/go-paths-helper v1.12.1 github.com/arduino/go-serial-utils v0.1.2 github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.0 github.com/blang/semver v3.5.1+incompatible diff --git a/go.sum b/go.sum index 1481506d..1551328e 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,8 @@ github.com/AnatolyRugalev/goregen v0.1.0/go.mod h1:sVlY1tjcirqLBRZnCcIq1+7/Lwmqz github.com/ProtonMail/go-crypto v1.1.0-alpha.5-proton h1:KVBEgU3CJpmzLChnLiSuEyCuhGhcMt3eOST+7A+ckto= github.com/ProtonMail/go-crypto v1.1.0-alpha.5-proton/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= -github.com/arduino/go-paths-helper v1.12.0 h1:xizOQtI9iHdl19qXd1EmWg5i9W//2bOCOYwlNv8F61E= -github.com/arduino/go-paths-helper v1.12.0/go.mod h1:jcpW4wr0u69GlXhTYydsdsqAjLaYK5n7oWHfKqOG6LM= +github.com/arduino/go-paths-helper v1.12.1 h1:WkxiVUxBjKWlLMiMuYy8DcmVrkxdP7aKxQOAq7r2lVM= +github.com/arduino/go-paths-helper v1.12.1/go.mod h1:jcpW4wr0u69GlXhTYydsdsqAjLaYK5n7oWHfKqOG6LM= github.com/arduino/go-properties-orderedmap v1.8.0 h1:wEfa6hHdpezrVOh787OmClsf/Kd8qB+zE3P2Xbrn0CQ= github.com/arduino/go-properties-orderedmap v1.8.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk= github.com/arduino/go-serial-utils v0.1.2 h1:MRFwME4w/uaVkJ1R+wzz4KSbI9cF9IDVrYorazvjpTk= From fb06ef3746e769925505948b0a8c77080d6b8b92 Mon Sep 17 00:00:00 2001 From: MatteoPologruto <109663225+MatteoPologruto@users.noreply.github.com> Date: Mon, 5 Aug 2024 17:48:10 +0200 Subject: [PATCH 19/42] Insert lock while reading from the installed map (#987) --- v2/pkgs/tools.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/v2/pkgs/tools.go b/v2/pkgs/tools.go index c84d207f..1623d6a6 100644 --- a/v2/pkgs/tools.go +++ b/v2/pkgs/tools.go @@ -188,7 +188,7 @@ func (t *Tools) Install(ctx context.Context, payload *tools.ToolPayload) (*tools key := correctTool.Name + "-" + correctTool.Version // Check if it already exists if t.behaviour == "keep" && pathExists(t.folder) { - location, ok := t.installed[key] + location, ok := t.getInstalledValue(key) if ok && pathExists(location) { // overwrite the default tool with this one err := t.writeInstalled(path) @@ -336,6 +336,13 @@ func (t *Tools) SetBehaviour(behaviour string) { t.behaviour = behaviour } +func (t *Tools) getInstalledValue(key string) (string, bool) { + t.mutex.RLock() + defer t.mutex.RUnlock() + location, ok := t.installed[key] + return location, ok +} + func pathExists(path string) bool { _, err := os.Stat(path) if err == nil { From 6f9025e14d57c8a53faa51262bfd23339f981f0a Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 29 Aug 2024 11:25:04 +0200 Subject: [PATCH 20/42] Update `extract` to 4.0.0 and golang to 1.23 (#990) * Update extract to v4.0.0 * Update go version to 1.22 * Upgrade go to 1.23.0 --- .../workflows/check-go-dependencies-task.yml | 2 +- .github/workflows/check-go-task.yml | 2 +- .github/workflows/publish-go-tester-task.yml | 2 +- .github/workflows/release.yml | 2 +- .../workflows/test-go-integration-task.yml | 2 +- .github/workflows/test-go-task.yml | 2 +- .../extract/{v3.dep.yml => v4.dep.yml} | 6 +- .../go/github.com/ulikunitz/xz.dep.yml | 2 +- .../ulikunitz/xz/internal/hash.dep.yml | 4 +- .../ulikunitz/xz/internal/xlog.dep.yml | 4 +- .../go/github.com/ulikunitz/xz/lzma.dep.yml | 4 +- .../go/golang.org/x/crypto/sha3.dep.yml | 63 ------------------- go.mod | 6 +- go.sum | 8 +-- updater/updater_darwin.go | 2 +- v2/pkgs/tools.go | 2 +- 16 files changed, 25 insertions(+), 88 deletions(-) rename .licenses/arduino-create-agent/go/github.com/codeclysm/extract/{v3.dep.yml => v4.dep.yml} (91%) delete mode 100644 .licenses/arduino-create-agent/go/golang.org/x/crypto/sha3.dep.yml diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index 4983e0db..a179ee99 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -3,7 +3,7 @@ name: Check Go Dependencies env: # See: https://github.com/actions/setup-go/tree/v3#readme - GO_VERSION: "1.21" + GO_VERSION: "1.23" # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows on: diff --git a/.github/workflows/check-go-task.yml b/.github/workflows/check-go-task.yml index 7ea76eb4..6981f26c 100644 --- a/.github/workflows/check-go-task.yml +++ b/.github/workflows/check-go-task.yml @@ -3,7 +3,7 @@ name: Check Go env: # See: https://github.com/actions/setup-go/tree/main#supported-version-syntax - GO_VERSION: "1.21" + GO_VERSION: "1.23" # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows on: diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index aa2949e1..864f21c5 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -31,7 +31,7 @@ on: env: PROJECT_NAME: arduino-cloud-agent - GO_VERSION: "1.21" + GO_VERSION: "1.23" jobs: run-determination: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe60ec8f..af37a9b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ env: AC_PASSWORD: ${{ secrets.AC_PASSWORD }} # used by gon AC_PROVIDER: ${{ secrets.AC_PROVIDER }} # used by gon # See: https://github.com/actions/setup-go/tree/v3#readme - GO_VERSION: "1.21" + GO_VERSION: "1.23" jobs: # The build job is responsible for: configuring the environment, testing and compiling process diff --git a/.github/workflows/test-go-integration-task.yml b/.github/workflows/test-go-integration-task.yml index 79766b08..7eeb8e55 100644 --- a/.github/workflows/test-go-integration-task.yml +++ b/.github/workflows/test-go-integration-task.yml @@ -3,7 +3,7 @@ name: Test Integration env: # See: https://github.com/actions/setup-go/tree/v2#readme - GO_VERSION: "1.21" + GO_VERSION: "1.23" # See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python PYTHON_VERSION: "3.9" diff --git a/.github/workflows/test-go-task.yml b/.github/workflows/test-go-task.yml index 8a7c733b..cbb95655 100644 --- a/.github/workflows/test-go-task.yml +++ b/.github/workflows/test-go-task.yml @@ -3,7 +3,7 @@ name: Test Go env: # See: https://github.com/actions/setup-go/tree/v2#readme - GO_VERSION: "1.21" + GO_VERSION: "1.23" # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows on: diff --git a/.licenses/arduino-create-agent/go/github.com/codeclysm/extract/v3.dep.yml b/.licenses/arduino-create-agent/go/github.com/codeclysm/extract/v4.dep.yml similarity index 91% rename from .licenses/arduino-create-agent/go/github.com/codeclysm/extract/v3.dep.yml rename to .licenses/arduino-create-agent/go/github.com/codeclysm/extract/v4.dep.yml index 0c6f9974..9defe5f8 100644 --- a/.licenses/arduino-create-agent/go/github.com/codeclysm/extract/v3.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/codeclysm/extract/v4.dep.yml @@ -1,10 +1,10 @@ --- -name: github.com/codeclysm/extract/v3 -version: v3.1.1 +name: github.com/codeclysm/extract/v4 +version: v4.0.0 type: go summary: Package extract allows to extract archives in zip, tar.gz or tar.bz2 formats easily. -homepage: https://pkg.go.dev/github.com/codeclysm/extract/v3 +homepage: https://pkg.go.dev/github.com/codeclysm/extract/v4 license: mit licenses: - sources: LICENSE diff --git a/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz.dep.yml b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz.dep.yml index 0b3c4e2b..b02e158f 100644 --- a/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz.dep.yml @@ -1,6 +1,6 @@ --- name: github.com/ulikunitz/xz -version: v0.5.11 +version: v0.5.12 type: go summary: Package xz supports the compression and decompression of xz files. homepage: https://pkg.go.dev/github.com/ulikunitz/xz diff --git a/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/internal/hash.dep.yml b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/internal/hash.dep.yml index 470737fb..c9a34e7a 100644 --- a/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/internal/hash.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/internal/hash.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/ulikunitz/xz/internal/hash -version: v0.5.11 +version: v0.5.12 type: go summary: Package hash provides rolling hashes. homepage: https://pkg.go.dev/github.com/ulikunitz/xz/internal/hash license: bsd-3-clause licenses: -- sources: xz@v0.5.11/LICENSE +- sources: xz@v0.5.12/LICENSE text: | Copyright (c) 2014-2022 Ulrich Kunitz All rights reserved. diff --git a/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/internal/xlog.dep.yml b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/internal/xlog.dep.yml index 5fc1e57f..a5ec3008 100644 --- a/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/internal/xlog.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/internal/xlog.dep.yml @@ -1,13 +1,13 @@ --- name: github.com/ulikunitz/xz/internal/xlog -version: v0.5.11 +version: v0.5.12 type: go summary: Package xlog provides a simple logging package that allows to disable certain message categories. homepage: https://pkg.go.dev/github.com/ulikunitz/xz/internal/xlog license: bsd-3-clause licenses: -- sources: xz@v0.5.11/LICENSE +- sources: xz@v0.5.12/LICENSE text: | Copyright (c) 2014-2022 Ulrich Kunitz All rights reserved. diff --git a/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/lzma.dep.yml b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/lzma.dep.yml index b30f1859..66a937e5 100644 --- a/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/lzma.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/ulikunitz/xz/lzma.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/ulikunitz/xz/lzma -version: v0.5.11 +version: v0.5.12 type: go summary: Package lzma supports the decoding and encoding of LZMA streams. homepage: https://pkg.go.dev/github.com/ulikunitz/xz/lzma license: bsd-3-clause licenses: -- sources: xz@v0.5.11/LICENSE +- sources: xz@v0.5.12/LICENSE text: | Copyright (c) 2014-2022 Ulrich Kunitz All rights reserved. diff --git a/.licenses/arduino-create-agent/go/golang.org/x/crypto/sha3.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/crypto/sha3.dep.yml deleted file mode 100644 index 1ef1c7c9..00000000 --- a/.licenses/arduino-create-agent/go/golang.org/x/crypto/sha3.dep.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -name: golang.org/x/crypto/sha3 -version: v0.23.0 -type: go -summary: Package sha3 implements the SHA-3 fixed-output-length hash functions and - the SHAKE variable-output-length hash functions defined by FIPS-202. -homepage: https://pkg.go.dev/golang.org/x/crypto/sha3 -license: bsd-3-clause -licenses: -- sources: crypto@v0.23.0/LICENSE - text: | - Copyright (c) 2009 The Go Authors. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: crypto@v0.23.0/PATENTS - text: | - Additional IP Rights Grant (Patents) - - "This implementation" means the copyrightable works distributed by - Google as part of the Go project. - - Google hereby grants to You a perpetual, worldwide, non-exclusive, - no-charge, royalty-free, irrevocable (except as stated in this section) - patent license to make, have made, use, offer to sell, sell, import, - transfer and otherwise run, modify and propagate the contents of this - implementation of Go, where such license applies only to those patent - claims, both currently owned or controlled by Google and acquired in - the future, licensable by Google that are necessarily infringed by this - implementation of Go. This grant does not include claims that would be - infringed only as a consequence of further modification of this - implementation. If you or your agent or exclusive licensee institute or - order or agree to the institution of patent litigation against any - entity (including a cross-claim or counterclaim in a lawsuit) alleging - that this implementation of Go or any code incorporated within this - implementation of Go constitutes direct or contributory patent - infringement, or inducement of patent infringement, then any patent - rights granted to you under this License for this implementation of Go - shall terminate as of the date such litigation is filed. -notices: [] diff --git a/go.mod b/go.mod index 9c4e3a03..82ee1017 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/arduino/arduino-create-agent -go 1.21 +go 1.23.0 require ( fyne.io/systray v1.10.0 @@ -9,7 +9,7 @@ require ( github.com/arduino/go-serial-utils v0.1.2 github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.0 github.com/blang/semver v3.5.1+incompatible - github.com/codeclysm/extract/v3 v3.1.1 + github.com/codeclysm/extract/v4 v4.0.0 github.com/gin-contrib/cors v1.7.2 github.com/gin-gonic/gin v1.10.0 github.com/go-ini/ini v1.62.0 @@ -71,7 +71,7 @@ require ( github.com/tevino/abool v1.2.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go v1.1.6 // indirect - github.com/ulikunitz/xz v0.5.11 // indirect + github.com/ulikunitz/xz v0.5.12 // indirect golang.org/x/arch v0.8.0 // indirect golang.org/x/crypto v0.23.0 // indirect golang.org/x/mod v0.17.0 // indirect diff --git a/go.sum b/go.sum index 1551328e..bee2988a 100644 --- a/go.sum +++ b/go.sum @@ -25,8 +25,8 @@ github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/ github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= -github.com/codeclysm/extract/v3 v3.1.1 h1:iHZtdEAwSTqPrd+1n4jfhr1qBhUWtHlMTjT90+fJVXg= -github.com/codeclysm/extract/v3 v3.1.1/go.mod h1:ZJi80UG2JtfHqJI+lgJSCACttZi++dHxfWuPaMhlOfQ= +github.com/codeclysm/extract/v4 v4.0.0 h1:H87LFsUNaJTu2e/8p/oiuiUsOK/TaPQ5wxsjPnwPEIY= +github.com/codeclysm/extract/v4 v4.0.0/go.mod h1:SFju1lj6as7FvUgalpSct7torJE0zttbJUWtryPRG6s= github.com/creack/goselect v0.1.2 h1:2DNy14+JPjRBgPzAd1thbQp4BSIihxcBf0IXhQXDRa0= github.com/creack/goselect v0.1.2/go.mod h1:a/NhLweNvqIYMuxcMOuWY516Cimucms3DglDzQP3hKY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -155,8 +155,8 @@ github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.1.6 h1:zoJUBK8kLIUDNJ9LGB04qOQRfoDRoWBBpl0X7pZyi5I= github.com/ugorji/go v1.1.6/go.mod h1:RaaajvHwnCbhlqWLTIB78hyPWp24YUXhQ3YXM7Hg7os= -github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= -github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= +github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/xrash/smetrics v0.0.0-20170218160415-a3153f7040e9 h1:w8V9v0qVympSF6GjdjIyeqR7+EVhAF9CBQmkmW7Zw0w= github.com/xrash/smetrics v0.0.0-20170218160415-a3153f7040e9/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= go.bug.st/serial v1.6.1 h1:VSSWmUxlj1T/YlRo2J104Zv3wJFrjHIl/T3NeruWAHY= diff --git a/updater/updater_darwin.go b/updater/updater_darwin.go index c4eb5070..82946635 100644 --- a/updater/updater_darwin.go +++ b/updater/updater_darwin.go @@ -26,7 +26,7 @@ import ( "strings" "github.com/arduino/go-paths-helper" - "github.com/codeclysm/extract/v3" + "github.com/codeclysm/extract/v4" "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus" ) diff --git a/v2/pkgs/tools.go b/v2/pkgs/tools.go index 1623d6a6..f09dc3f0 100644 --- a/v2/pkgs/tools.go +++ b/v2/pkgs/tools.go @@ -35,7 +35,7 @@ import ( "github.com/arduino/arduino-create-agent/index" "github.com/arduino/arduino-create-agent/utilities" "github.com/blang/semver" - "github.com/codeclysm/extract/v3" + "github.com/codeclysm/extract/v4" ) // public vars to allow override in the tests From 63ef1111488408f5549f6918a5ee62c2814bb6d7 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 3 Sep 2024 12:21:07 -0700 Subject: [PATCH 21/42] [skip-changelog] Configure actions/upload-artifact action to upload required hidden files A breaking change was made in the 3.2.1 release of the "actions/upload-artifact" action, without doing a major version bump as would be done in a responsibly maintained project. The action now defaults to not uploading "hidden" files. This project's "Check Go Dependencies" workflow uses the "Licensed" tool to check for incompatible dependency licenses. The dependencies license metadata cache used by Licensed is stored in a folder named `.licensed`. In order to facilitate updates, the workflow uploads the generated dependencies license metadata cache as a workflow artifact when the current cache is found to be outdated. The `.` at the start of the `.licensed` folder name causes it to now not be uploaded to the workflow artifact. In order to catch such problems, the workflow configures the "actions/upload-artifact" action to fail if no files were uploaded. So in addition to not uploading the artifact, the change in the "actions/upload-artifact" action's behavior also resulted in the workflow runs failing: Error: No files were found with the provided path: .licenses/. No artifacts will be uploaded. The problem is fixed by disabling the "actions/upload-artifact" action's new behavior via the `include-hidden-files` input. After this change, the workflow can once more upload the dependencies license metadata cache to a workflow artifact as needed. --- .github/workflows/check-go-dependencies-task.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index a179ee99..5b78888b 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -108,6 +108,7 @@ jobs: uses: actions/upload-artifact@v4 with: if-no-files-found: error + include-hidden-files: true name: dep-licenses-cache path: ${{ env.CACHE_PATH }} From d36d0e142b8b46c0cde117f94b37b37422b806d7 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Thu, 24 Oct 2024 14:11:20 +0200 Subject: [PATCH 22/42] upload: don't ignore BindJSON errors (#999) * upload: don't ignore BindJSON errors --- conn.go | 6 ++++-- main_test.go | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/conn.go b/conn.go index 727a5cad..b6e03268 100644 --- a/conn.go +++ b/conn.go @@ -80,9 +80,11 @@ type Upload struct { var uploadStatusStr = "ProgrammerStatus" func uploadHandler(c *gin.Context) { - data := new(Upload) - c.BindJSON(data) + if err := c.BindJSON(data); err != nil { + c.String(http.StatusBadRequest, fmt.Sprintf("err with the payload. %v", err.Error())) + return + } log.Printf("%+v %+v %+v %+v %+v %+v", data.Port, data.Board, data.Rewrite, data.Commandline, data.Extra, data.Filename) diff --git a/main_test.go b/main_test.go index 56855695..d6f23fce 100644 --- a/main_test.go +++ b/main_test.go @@ -18,6 +18,7 @@ package main import ( "bytes" "crypto/x509" + "encoding/base64" "encoding/json" "encoding/pem" "fmt" @@ -87,6 +88,30 @@ func TestUploadHandlerAgainstEvilFileNames(t *testing.T) { } } +func TestUploadHandlerAgainstBase64WithoutPaddingMustFail(t *testing.T) { + r := gin.New() + r.POST("/", uploadHandler) + ts := httptest.NewServer(r) + defer ts.Close() + + // When calling the `BindJSON` func, when a json field will be Unmarshaled + // in a []byte type, we expect to receive a base64 padded string in input. + // In case we receive a base64 unpadded string BindJSON fails. + // The expectation here is that the upload handler won't continue with the + // upload operation. + base64ContentWithoutPadding := base64.RawStdEncoding.EncodeToString([]byte("test")) + payload := fmt.Sprintf(`{"hex": "%s"}`, base64ContentWithoutPadding) + + resp, err := http.Post(ts.URL, "encoding/json", bytes.NewBufferString(payload)) + require.NoError(t, err) + require.Equal(t, http.StatusBadRequest, resp.StatusCode) + + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + require.Contains(t, string(body), "err with the payload. illegal base64 data at input") +} + func TestInstallToolV2(t *testing.T) { indexURL := "https://downloads.arduino.cc/packages/package_index.json" From 84a3854a3fe479a9da1151a61b234199113d82e0 Mon Sep 17 00:00:00 2001 From: Davide Date: Fri, 10 Jan 2025 11:13:00 +0100 Subject: [PATCH 23/42] docs: update references from Arduino Create Web Editor to Arduino Cloud (#1001) * docs: update references from Arduino Create Web Editor to Arduino Cloud in README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fc88205a..db5e92c6 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Check Go Dependencies status](https://github.com/arduino/arduino-create-agent/actions/workflows/check-go-dependencies-task.yml/badge.svg)](https://github.com/arduino/arduino-create-agent/actions/workflows/check-go-dependencies-task.yml) [![Check Go status](https://github.com/arduino/arduino-create-agent/actions/workflows/check-go-task.yml/badge.svg)](https://github.com/arduino/arduino-create-agent/actions/workflows/check-go-task.yml) -The Arduino Cloud Agent is a single binary that will sit on the traybar and work in the background. It allows you to use the [Arduino Create applications](https://create.arduino.cc) to seamlessly upload code to any USB connected Arduino board (or YĂşn in LAN) directly from the browser. +The Arduino Cloud Agent is a single binary that will sit on the traybar and work in the background. It allows you to use the [Arduino Cloud](https://app.arduino.cc/) to seamlessly upload code to any USB connected Arduino board (or YĂşn in LAN) directly from the browser. ## Architecture @@ -18,8 +18,8 @@ The Arduino Cloud Agent is a single binary that will sit on the traybar and work | Browser | | | Web socket +----------------------+ flashes +---------------+ | +---------------------------+ |<-------------->| +------------>| | -| | | | | Arduino Cloud Agent | | Arduino Board | -| | Arduino Create Web Editor | +--------------->| |<------------+ | +| | | | | Arduino Cloud Agent | | Arduino Board | +| | Arduino Cloud | +--------------->| |<------------+ | | | | | REST API +----------------------+ serial +---------------+ | +---------------------------+ | +-------------------------------+ @@ -27,11 +27,11 @@ The Arduino Cloud Agent is a single binary that will sit on the traybar and work ## Installation -Get the [latest version](https://github.com/arduino/arduino-create-agent/releases) of the Agent for all supported platforms or complete the [Getting Started](https://create.arduino.cc/getting-started/plugin/welcome). +Get the [latest version](https://github.com/arduino/arduino-create-agent/releases) of the Agent for all supported platforms or complete the [Getting Started](https://cloud.arduino.cc/download-agent/). ## Apple silicon support -The Arduino Agent is supported both on Intel and Apple silicon computers. This includes devices with the M1, M2 and M3 processors. +The Arduino Agent is supported both on Intel and Apple silicon computers. This includes devices with the M1, M2 and M3 processors. The Arduino Agent is built both for Intel architectures and Apple silicon devices, but distributed as a single universal executable for macOS. ## Documentation From 2cb53d3defa3fa19f50d6bccafe55935598ffd3b Mon Sep 17 00:00:00 2001 From: Davide Date: Fri, 10 Jan 2025 14:50:30 +0100 Subject: [PATCH 24/42] fix: update libwebkit2gtk package version in workflow (#1004) --- .github/workflows/check-go-task.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-go-task.yml b/.github/workflows/check-go-task.yml index 6981f26c..21478d23 100644 --- a/.github/workflows/check-go-task.yml +++ b/.github/workflows/check-go-task.yml @@ -82,7 +82,7 @@ jobs: version: 3.x - name: Install Dependencies - run: sudo apt update && sudo apt install -y --no-install-recommends build-essential libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev + run: sudo apt update && sudo apt install -y --no-install-recommends build-essential libgtk-3-dev libwebkit2gtk-4.1-0 libappindicator3-dev - name: Check for errors env: From 67db428c24bbcb33e70c0bebbb97c57addd53131 Mon Sep 17 00:00:00 2001 From: Davide Date: Fri, 10 Jan 2025 15:38:01 +0100 Subject: [PATCH 25/42] ci(Taskfile): add install and run tasks for local development with auto-reload (#1003) --- Taskfile.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index b64b12bb..bba07548 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,6 +1,17 @@ version: "3" tasks: + + install: + desc: Install dependencies for local development + cmds: + - go install github.com/githubnemo/CompileDaemon@v1.4.0 + + run: + desc: Run the project locally with auto-reload and data race detector + cmds: + - CompileDaemon -build="go build -race" -command="./arduino-create-agent" -graceful-kill=true + # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies-task/Taskfile.yml general:cache-dep-licenses: desc: Cache dependency license metadata From 1eb1d343d708ea334eadbac4519754c6ef3cda9f Mon Sep 17 00:00:00 2001 From: Davide Date: Thu, 16 Jan 2025 17:44:05 +0100 Subject: [PATCH 26/42] fix: name of arch macos build (#1008) --- .github/workflows/publish-go-tester-task.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index 864f21c5..1c1a73ba 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -130,7 +130,7 @@ jobs: mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME}}_amd64 if: runner.os == 'macOS' - - name: Build the Agent for macos amd 64 + - name: Build the Agent for macos arm 64 env: MACOSX_DEPLOYMENT_TARGET: 10.15 # minimum supported version for mac CGO_CFLAGS: -mmacosx-version-min=10.15 From f1ca3c9305d8875bf337dcabd62194f365d603e7 Mon Sep 17 00:00:00 2001 From: Davide Date: Fri, 17 Jan 2025 12:23:29 +0100 Subject: [PATCH 27/42] ci: update macOS version in publish workflow to macos-13 (#1007) * ci: update macOS version in workflows from macos-13 --- .github/workflows/publish-go-tester-task.yml | 2 +- .github/workflows/release.yml | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index 1c1a73ba..8e72c351 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -65,7 +65,7 @@ jobs: #use the strategy instead because we still use the native build strategy: matrix: - os: [ubuntu-20.04, windows-2019, macos-12] + os: [ubuntu-20.04, windows-2019, macos-13] arch: [-amd64] include: - os: windows-2019 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af37a9b8..3b2a210d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: prerelease: ${{ steps.prerelease.outputs.IS_PRE }} strategy: matrix: - os: [ubuntu-20.04, windows-2019, macos-12] + os: [ubuntu-20.04, windows-2019, macos-13] arch: [amd64] include: - os: windows-2019 @@ -116,7 +116,7 @@ jobs: run: | task go:build mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_amd64 - if: matrix.os == 'macos-12' + if: matrix.os == 'macos-13' - name: Build the Agent for macos arm64 env: @@ -128,13 +128,13 @@ jobs: run: | task go:build mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_arm64 - if: matrix.os == 'macos-12' + if: matrix.os == 'macos-13' - name: Create universal macos executable run: | lipo -create -output ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME }}_amd64 ${{ env.PROJECT_NAME }}_arm64 rm ${{ env.PROJECT_NAME }}_amd64 ${{ env.PROJECT_NAME }}_arm64 - if: matrix.os == 'macos-12' + if: matrix.os == 'macos-13' # this will create `public/` dir with compressed full bin (/-.gz) and a json file - name: Create autoupdate files @@ -146,7 +146,7 @@ jobs: run: | cp darwin-amd64.json darwin-arm64.json cp ${TAG_VERSION}/darwin-amd64.gz ${TAG_VERSION}/darwin-arm64.gz - if: matrix.os == 'macos-12' && steps.prerelease.outputs.IS_PRE != 'true' + if: matrix.os == 'macos-13' && steps.prerelease.outputs.IS_PRE != 'true' - name: Create autoupdate files for win32 run: go-selfupdate -platform windows-${{ matrix.arch }} ${{ env.PROJECT_NAME }}${{ matrix.ext }} ${TAG_VERSION} @@ -181,7 +181,7 @@ jobs: matrix: arch: [amd64, arm64] - runs-on: macos-12 + runs-on: macos-13 env: EXE_PATH: "skel/ArduinoCloudAgent.app/Contents/MacOS/" @@ -195,7 +195,7 @@ jobs: - name: Download artifact uses: actions/download-artifact@v4 with: - name: ${{ env.PROJECT_NAME }}-macos-12-amd64 # if we want to support darwin-arm64 in the future for real this has to change. + name: ${{ env.PROJECT_NAME }}-macos-13-amd64 # if we want to support darwin-arm64 in the future for real this has to change. path: ${{ env.EXE_PATH }} - name: Remove placeholder file @@ -252,7 +252,7 @@ jobs: matrix: arch: [amd64, arm64] - runs-on: macos-12 + runs-on: macos-13 env: GON_PATH: ${{ github.workspace }}/gon needs: [build, create-macos-bundle] @@ -509,7 +509,7 @@ jobs: matrix: arch: [amd64] - runs-on: macos-12 + runs-on: macos-13 steps: - name: Checkout repo with icons/background uses: actions/checkout@v4 From 1b94cccb9865c34bb10a80e505eab8700e06cda0 Mon Sep 17 00:00:00 2001 From: Davide Date: Tue, 21 Jan 2025 09:28:50 +0100 Subject: [PATCH 28/42] fix(serialport): data race on the `isClosing` bool status of the serial port (#1009) * fix: use atomic boolean for thread-safe isClosing flag --- serialport.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/serialport.go b/serialport.go index a11483f6..0d386bbf 100755 --- a/serialport.go +++ b/serialport.go @@ -20,6 +20,7 @@ import ( "encoding/base64" "io" "strconv" + "sync/atomic" "time" "unicode/utf8" @@ -43,7 +44,7 @@ type serport struct { // Keep track of whether we're being actively closed // just so we don't show scary error messages - isClosing bool + isClosing atomic.Bool isClosingDueToError bool @@ -85,7 +86,7 @@ func (p *serport) reader(buftype string) { bufferPart := serialBuffer[:n] //if we detect that port is closing, break out of this for{} loop. - if p.isClosing { + if p.isClosing.Load() { strmsg := "Shutting down reader on " + p.portConf.Name log.Println(strmsg) h.broadcastSys <- []byte(strmsg) @@ -348,7 +349,8 @@ func spHandlerOpen(portname string, baud int, buftype string) { } func (p *serport) Close() { - p.isClosing = true + p.isClosing.Store(true) + p.bufferwatcher.Close() p.portIo.Close() serialPorts.MarkPortAsClosed(p.portName) From f0857f0c65a5178b5798d92365310f01c78da766 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 1 Mar 2025 20:35:55 -0800 Subject: [PATCH 29/42] Use canonical github/setup-licensed action in dependencies license check workflow This GitHub Actions action is used by the dependencies license check workflow to install the "Licensed" tool in the runner workspace. At the time the workflow was developed, the action was owned by GitHub user `jonabc`, and so the action was referenced as `jonabc/setup-licensed` in the workflow. Since that time, the action was transferred to the `github` GitHub organization. Making things more confusing is the fact that GitHub user `jonabc` now has a development fork of the `github/setup-licensed` repository, meaning that the redirect GitHub provides from the old to the new repository after a transfer does not exist for this action. This resulted in the workflow referencing an outdated copy of the action not intended for production use. The workflow is hereby updated to use the canonical "github/setup-licensed" action. --- .github/workflows/check-go-dependencies-task.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index 5b78888b..183899c2 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -124,7 +124,7 @@ jobs: submodules: recursive - name: Install licensed - uses: jonabc/setup-licensed@v1 + uses: github/setup-licensed@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} version: 3.x From 2bf6e95284d1ff223feff780d4858310d3b128d6 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 1 Mar 2025 20:39:20 -0800 Subject: [PATCH 30/42] Use latest version of "github/setup-licensed" action The "github/setup-licensed" action is used by the dependencies license check workflow to install the "Licensed" tool in the runner machine. Previously the `v1` major version ref of the action was specified in the workflow. This approach is used in order to allow the workflow to automatically always use the latest minor version of the action, only requiring the project maintainers to perform a bump of the action after each major version release. In a competently maintained action project, the major version ref will be updated after each release within that major version series so that it always points to the latest release version. Unfortunately that was not done by the "github/setup-licensed" action maintainers. This means that the use of the `v1` ref in the workflow causes an outdated version of the action to be used. This has been reported to the action maintainers, but unfortunately instead of fixing the problem they archived the repository, so there is no hope of it being resolved. The solution is to replace the major version ref with the ref for the latest release tag. This won't result in an increased maintenance burden because the action repository is archived and thus there won't be any bumps. --- .github/workflows/check-go-dependencies-task.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index 183899c2..a72d247a 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -124,7 +124,7 @@ jobs: submodules: recursive - name: Install licensed - uses: github/setup-licensed@v1 + uses: github/setup-licensed@v1.3.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} version: 3.x From 26bd5667ba31bb2b5e7e19bfa4a33ad6bbf0802f Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 2 Mar 2025 02:11:53 -0800 Subject: [PATCH 31/42] Use maintained fork of "setup-licensed" action in dependencies license check workflow This GitHub Actions action is used by the dependencies license check workflow to install the "Licensed" tool in the runner workspace. The action has a convoluted history: the repository was originally owned by GitHub user `jonabc`. It was later transferred to the `github` organization. Then GitHub abandoned the project, archiving the repository. The `licensee` organization has now created a hard fork of the action, which is recommended in the readme of the `github/setup-licensed` repository. The `licensee` organization has also taken over the management of the "Licensed" tool, and their `licensee` Ruby gem is a significant dependency of "Licensed". So they will be best equipped to maintain the action going forward. The workflow is hereby updated to use the canonical "licensee/setup-licensed" action. The "licensee/setup-licensed" action maintainers have not provided a major version ref, so it is necessary to pin the action to the latest release tag. --- .github/workflows/check-go-dependencies-task.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index a72d247a..aa7b26e3 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -73,7 +73,7 @@ jobs: submodules: recursive - name: Install licensed - uses: jonabc/setup-licensed@v1 + uses: licensee/setup-licensed@v1.3.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} version: 3.x @@ -124,7 +124,7 @@ jobs: submodules: recursive - name: Install licensed - uses: github/setup-licensed@v1.3.1 + uses: licensee/setup-licensed@v1.3.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} version: 3.x From 1f89384366920359c063e18ef704f6d39413b6a8 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 2 Mar 2025 02:43:13 -0800 Subject: [PATCH 32/42] Configure dependency license check workflows to allow "Licensed" install via Gem The "Licensed" tool is used to check the project's compatibility with the licensing of its dependencies. This tool is installed by the dependency license check GitHub Actions workflow using the `licensee/setup-licensed` GitHub Actions action. This action attempts the installation according to the following procedure: 1. Install the Ruby gem. 2. If gem installation fails, install the pre-built executable from the GitHub release asset in the `licensee/licensed` repo. Previously, the first of these installation methods was failing: ```text /usr/bin/gem install licensed -v 3.9.1 ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /var/lib/gems/3.2.0 directory. /usr/lib/ruby/vendor_ruby/rubygems/installer.rb:713:in `verify_gem_home' /usr/lib/ruby/vendor_ruby/rubygems/installer.rb:903:in `pre_install_checks' /usr/lib/ruby/vendor_ruby/rubygems/installer.rb:303:in `install' /usr/lib/ruby/vendor_ruby/rubygems/resolver/specification.rb:105:in `install' /usr/lib/ruby/vendor_ruby/rubygems/request_set.rb:195:in `block in install' /usr/lib/ruby/vendor_ruby/rubygems/request_set.rb:183:in `each' /usr/lib/ruby/vendor_ruby/rubygems/request_set.rb:183:in `install' /usr/lib/ruby/vendor_ruby/rubygems/commands/install_command.rb:215:in `install_gem' /usr/lib/ruby/vendor_ruby/rubygems/commands/install_command.rb:231:in `block in install_gems' /usr/lib/ruby/vendor_ruby/rubygems/commands/install_command.rb:224:in `each' /usr/lib/ruby/vendor_ruby/rubygems/commands/install_command.rb:224:in `install_gems' /usr/lib/ruby/vendor_ruby/rubygems/commands/install_command.rb:170:in `execute' /usr/lib/ruby/vendor_ruby/rubygems/command.rb:328:in `invoke_with_build_args' /usr/lib/ruby/vendor_ruby/rubygems/command_manager.rb:253:in `invoke_command' /usr/lib/ruby/vendor_ruby/rubygems/command_manager.rb:193:in `process_args' /usr/lib/ruby/vendor_ruby/rubygems/command_manager.rb:151:in `run' /usr/lib/ruby/vendor_ruby/rubygems/gem_runner.rb:52:in `run' /usr/bin/gem:12:in `
' gem installation was not successful ``` So it falls back on the second installation method. That method works fine when using a version of "Licensed" <4.0.0. However, starting from version 4.0.0, pre-built executable are no longer provided, so the only available installation method for modern versions of "Licensed" is via the Ruby gem. The gem failure can be avoided by setting up an accessible installation of Ruby in the runner machine, which is accomplished using the "ruby/setup-ruby" action in a step preceding the `licensee/setup-licensed` step in the workflow. --- .github/workflows/check-go-dependencies-task.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index aa7b26e3..67a2944e 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -72,6 +72,12 @@ jobs: with: submodules: recursive + # This is required to allow licensee/setup-licensed to install Licensed via Ruby gem. + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ruby # Install latest version + - name: Install licensed uses: licensee/setup-licensed@v1.3.2 with: @@ -123,6 +129,12 @@ jobs: with: submodules: recursive + # This is required to allow licensee/setup-licensed to install Licensed via Ruby gem. + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ruby # Install latest version + - name: Install licensed uses: licensee/setup-licensed@v1.3.2 with: From b2e28c0345cf4043daa2f011884ecbb1b144b292 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 2 Mar 2025 02:37:28 -0800 Subject: [PATCH 33/42] Bump "Licensed" version in dependencies license check workflow The version of the "Licensed" tool for use in the GitHub Actions workflow is defined via the "licensee/setup-licensed" action's `version` input. Previously the action was configured to install version 3.x of the action. That version is significantly outdated. The workflow is hereby updated to use the latest version of Licensed. --- .github/workflows/check-go-dependencies-task.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index 67a2944e..417c525e 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -82,7 +82,7 @@ jobs: uses: licensee/setup-licensed@v1.3.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} - version: 3.x + version: 5.x - name: Install Go uses: actions/setup-go@v5 @@ -139,7 +139,7 @@ jobs: uses: licensee/setup-licensed@v1.3.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} - version: 3.x + version: 5.x - name: Install Go uses: actions/setup-go@v5 From 0fae57e21178bfb6c6f60ea626f08349d453c2ea Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 2 Mar 2025 03:39:06 -0800 Subject: [PATCH 34/42] Remove trailing space from dependency license metadata The dependency license metadata is generated by the "Licensed" tool. Previous versions of this tool added a trailing space on the `summary` key. Although trailing whitespace in human produced content is not permitted, machine generated content is used as-is, and so these trailing spaces were left in the metadata files. It seems that the defect in the "Licensed" tool that caused the trailing space was fixed in a recent version because it is now absent in the metadata files produced by the tool. The metadata files are hereby updated to use the format of the version of the "Licensed" tool currently in use. --- .../go/github.com/arduino/go-serial-utils.dep.yml | 2 +- .../arduino-create-agent/go/github.com/blang/semver.dep.yml | 2 +- .../arduino-create-agent/go/github.com/creack/goselect.dep.yml | 2 +- .../arduino-create-agent/go/github.com/gin-contrib/sse.dep.yml | 2 +- .../go/github.com/gin-gonic/gin/binding.dep.yml | 2 +- .../go/github.com/gin-gonic/gin/internal/bytesconv.dep.yml | 2 +- .../go/github.com/gin-gonic/gin/internal/json.dep.yml | 2 +- .../go/github.com/gin-gonic/gin/render.dep.yml | 2 +- .../go/github.com/googollee/go-engine.io.dep.yml | 2 +- .../go/github.com/googollee/go-engine.io/message.dep.yml | 2 +- .../go/github.com/googollee/go-engine.io/parser.dep.yml | 2 +- .../go/github.com/googollee/go-engine.io/polling.dep.yml | 2 +- .../go/github.com/googollee/go-engine.io/transport.dep.yml | 2 +- .../go/github.com/googollee/go-engine.io/websocket.dep.yml | 2 +- .../arduino-create-agent/go/github.com/h2non/filetype.dep.yml | 2 +- .../go/github.com/h2non/filetype/matchers.dep.yml | 2 +- .../go/github.com/h2non/filetype/matchers/isobmff.dep.yml | 2 +- .../go/github.com/h2non/filetype/types.dep.yml | 2 +- .../go/github.com/mattn/go-shellwords.dep.yml | 2 +- .../github.com/pelletier/go-toml/v2/internal/characters.dep.yml | 2 +- .../go/github.com/pelletier/go-toml/v2/internal/danger.dep.yml | 2 +- .../go/github.com/pelletier/go-toml/v2/internal/tracker.dep.yml | 2 +- .../arduino-create-agent/go/github.com/xrash/smetrics.dep.yml | 2 +- .../arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml | 2 +- .../go/golang.org/x/text/internal/language.dep.yml | 2 +- .../go/gopkg.in/inconshreveable/go-update.v0/download.dep.yml | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.licenses/arduino-create-agent/go/github.com/arduino/go-serial-utils.dep.yml b/.licenses/arduino-create-agent/go/github.com/arduino/go-serial-utils.dep.yml index d80310c7..fb7fa6ea 100644 --- a/.licenses/arduino-create-agent/go/github.com/arduino/go-serial-utils.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/arduino/go-serial-utils.dep.yml @@ -2,7 +2,7 @@ name: github.com/arduino/go-serial-utils version: v0.1.2 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/arduino/go-serial-utils license: gpl-3.0 licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/blang/semver.dep.yml b/.licenses/arduino-create-agent/go/github.com/blang/semver.dep.yml index 3ef4e43f..d1655fec 100644 --- a/.licenses/arduino-create-agent/go/github.com/blang/semver.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/blang/semver.dep.yml @@ -2,7 +2,7 @@ name: github.com/blang/semver version: v3.5.1+incompatible type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/blang/semver license: mit licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/creack/goselect.dep.yml b/.licenses/arduino-create-agent/go/github.com/creack/goselect.dep.yml index 2ebe1829..65e69c4c 100644 --- a/.licenses/arduino-create-agent/go/github.com/creack/goselect.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/creack/goselect.dep.yml @@ -2,7 +2,7 @@ name: github.com/creack/goselect version: v0.1.2 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/creack/goselect license: mit licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/gin-contrib/sse.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-contrib/sse.dep.yml index 4895be7a..c888d59a 100644 --- a/.licenses/arduino-create-agent/go/github.com/gin-contrib/sse.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/gin-contrib/sse.dep.yml @@ -2,7 +2,7 @@ name: github.com/gin-contrib/sse version: v0.1.0 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/gin-contrib/sse license: mit licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/binding.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/binding.dep.yml index 6801615f..a99238ac 100644 --- a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/binding.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/binding.dep.yml @@ -2,7 +2,7 @@ name: github.com/gin-gonic/gin/binding version: v1.10.0 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/gin-gonic/gin/binding license: mit licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/bytesconv.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/bytesconv.dep.yml index c9d7afd9..97e8d6cb 100644 --- a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/bytesconv.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/bytesconv.dep.yml @@ -2,7 +2,7 @@ name: github.com/gin-gonic/gin/internal/bytesconv version: v1.10.0 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/gin-gonic/gin/internal/bytesconv license: mit licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/json.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/json.dep.yml index 57739599..2551fb8d 100644 --- a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/json.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/internal/json.dep.yml @@ -2,7 +2,7 @@ name: github.com/gin-gonic/gin/internal/json version: v1.10.0 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/gin-gonic/gin/internal/json license: mit licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/render.dep.yml b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/render.dep.yml index 5b0dc5bb..deb06fb3 100644 --- a/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/render.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/gin-gonic/gin/render.dep.yml @@ -2,7 +2,7 @@ name: github.com/gin-gonic/gin/render version: v1.10.0 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/gin-gonic/gin/render license: mit licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io.dep.yml b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io.dep.yml index a798ca46..3d65daba 100644 --- a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io.dep.yml @@ -2,7 +2,7 @@ name: github.com/googollee/go-engine.io version: v0.0.0-20180829091931-e2f255711dcb type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/googollee/go-engine.io license: bsd-3-clause licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/message.dep.yml b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/message.dep.yml index ccf2355f..55490cf0 100644 --- a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/message.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/message.dep.yml @@ -2,7 +2,7 @@ name: github.com/googollee/go-engine.io/message version: v0.0.0-20180829091931-e2f255711dcb type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/googollee/go-engine.io/message license: bsd-3-clause licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/parser.dep.yml b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/parser.dep.yml index 0a08396a..718fadad 100644 --- a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/parser.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/parser.dep.yml @@ -2,7 +2,7 @@ name: github.com/googollee/go-engine.io/parser version: v0.0.0-20180829091931-e2f255711dcb type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/googollee/go-engine.io/parser license: bsd-3-clause licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/polling.dep.yml b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/polling.dep.yml index ccc32fe6..5692db01 100644 --- a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/polling.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/polling.dep.yml @@ -2,7 +2,7 @@ name: github.com/googollee/go-engine.io/polling version: v0.0.0-20180829091931-e2f255711dcb type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/googollee/go-engine.io/polling license: bsd-3-clause licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/transport.dep.yml b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/transport.dep.yml index d48516a8..430ab5ad 100644 --- a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/transport.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/transport.dep.yml @@ -2,7 +2,7 @@ name: github.com/googollee/go-engine.io/transport version: v0.0.0-20180829091931-e2f255711dcb type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/googollee/go-engine.io/transport license: bsd-3-clause licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/websocket.dep.yml b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/websocket.dep.yml index 9eb8de2c..3718a69b 100644 --- a/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/websocket.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/googollee/go-engine.io/websocket.dep.yml @@ -2,7 +2,7 @@ name: github.com/googollee/go-engine.io/websocket version: v0.0.0-20180829091931-e2f255711dcb type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/googollee/go-engine.io/websocket license: bsd-3-clause licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/h2non/filetype.dep.yml b/.licenses/arduino-create-agent/go/github.com/h2non/filetype.dep.yml index 02102b9e..ce88ad73 100644 --- a/.licenses/arduino-create-agent/go/github.com/h2non/filetype.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/h2non/filetype.dep.yml @@ -2,7 +2,7 @@ name: github.com/h2non/filetype version: v1.1.3 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/h2non/filetype license: mit licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/h2non/filetype/matchers.dep.yml b/.licenses/arduino-create-agent/go/github.com/h2non/filetype/matchers.dep.yml index e9421e1f..e441102a 100644 --- a/.licenses/arduino-create-agent/go/github.com/h2non/filetype/matchers.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/h2non/filetype/matchers.dep.yml @@ -2,7 +2,7 @@ name: github.com/h2non/filetype/matchers version: v1.1.3 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/h2non/filetype/matchers license: mit licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/h2non/filetype/matchers/isobmff.dep.yml b/.licenses/arduino-create-agent/go/github.com/h2non/filetype/matchers/isobmff.dep.yml index 0a398496..d18a56f5 100644 --- a/.licenses/arduino-create-agent/go/github.com/h2non/filetype/matchers/isobmff.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/h2non/filetype/matchers/isobmff.dep.yml @@ -2,7 +2,7 @@ name: github.com/h2non/filetype/matchers/isobmff version: v1.1.3 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/h2non/filetype/matchers/isobmff license: mit licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/h2non/filetype/types.dep.yml b/.licenses/arduino-create-agent/go/github.com/h2non/filetype/types.dep.yml index f8fe4165..6a3e9ff8 100644 --- a/.licenses/arduino-create-agent/go/github.com/h2non/filetype/types.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/h2non/filetype/types.dep.yml @@ -2,7 +2,7 @@ name: github.com/h2non/filetype/types version: v1.1.3 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/h2non/filetype/types license: mit licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/mattn/go-shellwords.dep.yml b/.licenses/arduino-create-agent/go/github.com/mattn/go-shellwords.dep.yml index afff9982..742e6604 100644 --- a/.licenses/arduino-create-agent/go/github.com/mattn/go-shellwords.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/mattn/go-shellwords.dep.yml @@ -2,7 +2,7 @@ name: github.com/mattn/go-shellwords version: v1.0.12 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/mattn/go-shellwords license: mit licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/characters.dep.yml b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/characters.dep.yml index afddf80f..59a3269b 100644 --- a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/characters.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/characters.dep.yml @@ -2,7 +2,7 @@ name: github.com/pelletier/go-toml/v2/internal/characters version: v2.2.2 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/internal/characters license: other licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/danger.dep.yml b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/danger.dep.yml index 5fe64d01..36075df8 100644 --- a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/danger.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/danger.dep.yml @@ -2,7 +2,7 @@ name: github.com/pelletier/go-toml/v2/internal/danger version: v2.2.2 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/internal/danger license: other licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/tracker.dep.yml b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/tracker.dep.yml index 6b73e51e..95401118 100644 --- a/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/tracker.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/pelletier/go-toml/v2/internal/tracker.dep.yml @@ -2,7 +2,7 @@ name: github.com/pelletier/go-toml/v2/internal/tracker version: v2.2.2 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/pelletier/go-toml/v2/internal/tracker license: other licenses: diff --git a/.licenses/arduino-create-agent/go/github.com/xrash/smetrics.dep.yml b/.licenses/arduino-create-agent/go/github.com/xrash/smetrics.dep.yml index f2795524..cbd322a2 100644 --- a/.licenses/arduino-create-agent/go/github.com/xrash/smetrics.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/xrash/smetrics.dep.yml @@ -2,7 +2,7 @@ name: github.com/xrash/smetrics version: v0.0.0-20170218160415-a3153f7040e9 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/xrash/smetrics license: mit licenses: diff --git a/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml b/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml index b744d252..d81d7857 100644 --- a/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml +++ b/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml @@ -2,7 +2,7 @@ name: go.bug.st/serial/unixutils version: v1.6.1 type: go -summary: +summary: homepage: https://pkg.go.dev/go.bug.st/serial/unixutils license: bsd-3-clause licenses: diff --git a/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language.dep.yml b/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language.dep.yml index 988bad3c..4a392d8c 100644 --- a/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language.dep.yml +++ b/.licenses/arduino-create-agent/go/golang.org/x/text/internal/language.dep.yml @@ -2,7 +2,7 @@ name: golang.org/x/text/internal/language version: v0.15.0 type: go -summary: +summary: homepage: https://pkg.go.dev/golang.org/x/text/internal/language license: bsd-3-clause licenses: diff --git a/.licenses/arduino-create-agent/go/gopkg.in/inconshreveable/go-update.v0/download.dep.yml b/.licenses/arduino-create-agent/go/gopkg.in/inconshreveable/go-update.v0/download.dep.yml index 5894a761..12e0b1dc 100644 --- a/.licenses/arduino-create-agent/go/gopkg.in/inconshreveable/go-update.v0/download.dep.yml +++ b/.licenses/arduino-create-agent/go/gopkg.in/inconshreveable/go-update.v0/download.dep.yml @@ -2,7 +2,7 @@ name: gopkg.in/inconshreveable/go-update.v0/download version: v0.0.0-20150814200126-d8b0b1d421aa type: go -summary: +summary: homepage: https://pkg.go.dev/gopkg.in/inconshreveable/go-update.v0/download license: apache-2.0 licenses: From bfab101eddb16374c6f97e29a0a240e15e5a5af7 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 2 Mar 2025 03:42:05 -0800 Subject: [PATCH 35/42] Add generated YAML document end markers to dependency license metadata cache The dependency license metadata is generated by the "Licensed" tool. The version of the tool now in use adds YAML document end markers to some metadata files, which were not present in the files generated by the tool at the time the cache was established. I don't know why it adds these markers to only some of the metadata files, but they are valid (though optional so the files without are also correct) and machine generated content is used as-is. The metadata files are hereby updated to use the format produced by the version of the "Licensed" tool currently in use. --- .../arduino-create-agent/go/github.com/blang/semver.dep.yml | 1 + .../arduino-create-agent/go/github.com/creack/goselect.dep.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.licenses/arduino-create-agent/go/github.com/blang/semver.dep.yml b/.licenses/arduino-create-agent/go/github.com/blang/semver.dep.yml index d1655fec..39cce428 100644 --- a/.licenses/arduino-create-agent/go/github.com/blang/semver.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/blang/semver.dep.yml @@ -33,3 +33,4 @@ licenses: - sources: README.md text: See [LICENSE](LICENSE) file. notices: [] +... diff --git a/.licenses/arduino-create-agent/go/github.com/creack/goselect.dep.yml b/.licenses/arduino-create-agent/go/github.com/creack/goselect.dep.yml index 65e69c4c..0785cd02 100644 --- a/.licenses/arduino-create-agent/go/github.com/creack/goselect.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/creack/goselect.dep.yml @@ -33,3 +33,4 @@ licenses: - sources: README.md text: Released under the [MIT license](LICENSE). notices: [] +... From 5fcb7c47f666bdb2f85188e7968ccde698b44c40 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 19 Mar 2025 10:08:36 +0100 Subject: [PATCH 36/42] Updated go-serial and pluggable-discovery-protocol-handler (#1023) --- .../pluggable-discovery-protocol-handler/v2.dep.yml | 2 +- .../arduino-create-agent/go/go.bug.st/serial.dep.yml | 6 +++--- .../go/go.bug.st/serial/enumerator.dep.yml | 10 +++++----- .../go/go.bug.st/serial/unixutils.dep.yml | 12 ++++++------ go.mod | 4 ++-- go.sum | 8 ++++---- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.licenses/arduino-create-agent/go/github.com/arduino/pluggable-discovery-protocol-handler/v2.dep.yml b/.licenses/arduino-create-agent/go/github.com/arduino/pluggable-discovery-protocol-handler/v2.dep.yml index 2fdbca21..0825582b 100644 --- a/.licenses/arduino-create-agent/go/github.com/arduino/pluggable-discovery-protocol-handler/v2.dep.yml +++ b/.licenses/arduino-create-agent/go/github.com/arduino/pluggable-discovery-protocol-handler/v2.dep.yml @@ -1,6 +1,6 @@ --- name: github.com/arduino/pluggable-discovery-protocol-handler/v2 -version: v2.2.0 +version: v2.2.1 type: go summary: Package discovery is a library for handling the Arduino Pluggable-Discovery protocol (https://github.com/arduino/tooling-rfcs/blob/main/RFCs/0002-pluggable-discovery.md#pluggable-discovery-api-via-stdinstdout) diff --git a/.licenses/arduino-create-agent/go/go.bug.st/serial.dep.yml b/.licenses/arduino-create-agent/go/go.bug.st/serial.dep.yml index c55d351d..3c29440d 100644 --- a/.licenses/arduino-create-agent/go/go.bug.st/serial.dep.yml +++ b/.licenses/arduino-create-agent/go/go.bug.st/serial.dep.yml @@ -1,6 +1,6 @@ --- name: go.bug.st/serial -version: v1.6.1 +version: v1.6.3 type: go summary: Package serial is a cross-platform serial library for the go language. homepage: https://pkg.go.dev/go.bug.st/serial @@ -9,7 +9,7 @@ licenses: - sources: LICENSE text: |2+ - Copyright (c) 2014-2023, Cristian Maglie. + Copyright (c) 2014-2024, Cristian Maglie. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -43,7 +43,7 @@ licenses: - sources: README.md text: |- - The software is release under a [BSD 3-clause license] + This software is released under the [BSD 3-clause license]. [contributors]: https://github.com/bugst/go-serial/graphs/contributors [BSD 3-clause license]: https://github.com/bugst/go-serial/blob/master/LICENSE diff --git a/.licenses/arduino-create-agent/go/go.bug.st/serial/enumerator.dep.yml b/.licenses/arduino-create-agent/go/go.bug.st/serial/enumerator.dep.yml index 7743f09d..4b562e2a 100644 --- a/.licenses/arduino-create-agent/go/go.bug.st/serial/enumerator.dep.yml +++ b/.licenses/arduino-create-agent/go/go.bug.st/serial/enumerator.dep.yml @@ -1,16 +1,16 @@ --- name: go.bug.st/serial/enumerator -version: v1.6.1 +version: v1.6.3 type: go summary: Package enumerator is a golang cross-platform library for USB serial port discovery. homepage: https://pkg.go.dev/go.bug.st/serial/enumerator license: bsd-3-clause licenses: -- sources: serial@v1.6.1/LICENSE +- sources: serial@v1.6.3/LICENSE text: |2+ - Copyright (c) 2014-2023, Cristian Maglie. + Copyright (c) 2014-2024, Cristian Maglie. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -42,9 +42,9 @@ licenses: ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: serial@v1.6.1/README.md +- sources: serial@v1.6.3/README.md text: |- - The software is release under a [BSD 3-clause license] + This software is released under the [BSD 3-clause license]. [contributors]: https://github.com/bugst/go-serial/graphs/contributors [BSD 3-clause license]: https://github.com/bugst/go-serial/blob/master/LICENSE diff --git a/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml b/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml index d81d7857..0e2d5f7d 100644 --- a/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml +++ b/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml @@ -1,15 +1,15 @@ --- name: go.bug.st/serial/unixutils -version: v1.6.1 +version: v1.6.3 type: go -summary: +summary: homepage: https://pkg.go.dev/go.bug.st/serial/unixutils license: bsd-3-clause licenses: -- sources: serial@v1.6.1/LICENSE +- sources: serial@v1.6.3/LICENSE text: |2+ - Copyright (c) 2014-2023, Cristian Maglie. + Copyright (c) 2014-2024, Cristian Maglie. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -41,9 +41,9 @@ licenses: ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: serial@v1.6.1/README.md +- sources: serial@v1.6.3/README.md text: |- - The software is release under a [BSD 3-clause license] + This software is released under the [BSD 3-clause license]. [contributors]: https://github.com/bugst/go-serial/graphs/contributors [BSD 3-clause license]: https://github.com/bugst/go-serial/blob/master/LICENSE diff --git a/go.mod b/go.mod index 82ee1017..19d0eae0 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/ProtonMail/go-crypto v1.1.0-alpha.5-proton github.com/arduino/go-paths-helper v1.12.1 github.com/arduino/go-serial-utils v0.1.2 - github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.0 + github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.1 github.com/blang/semver v3.5.1+incompatible github.com/codeclysm/extract/v4 v4.0.0 github.com/gin-contrib/cors v1.7.2 @@ -21,7 +21,7 @@ require ( github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 github.com/stretchr/testify v1.9.0 github.com/xrash/smetrics v0.0.0-20170218160415-a3153f7040e9 - go.bug.st/serial v1.6.1 + go.bug.st/serial v1.6.3 goa.design/goa/v3 v3.16.1 golang.org/x/sys v0.23.0 gopkg.in/inconshreveable/go-update.v0 v0.0.0-20150814200126-d8b0b1d421aa diff --git a/go.sum b/go.sum index bee2988a..a46d0bad 100644 --- a/go.sum +++ b/go.sum @@ -11,8 +11,8 @@ github.com/arduino/go-properties-orderedmap v1.8.0 h1:wEfa6hHdpezrVOh787OmClsf/K github.com/arduino/go-properties-orderedmap v1.8.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk= github.com/arduino/go-serial-utils v0.1.2 h1:MRFwME4w/uaVkJ1R+wzz4KSbI9cF9IDVrYorazvjpTk= github.com/arduino/go-serial-utils v0.1.2/go.mod h1:kzIsNPgz8DFAd1sAFKve4ubxrdGcwQ4XzvRLlztsgnE= -github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.0 h1:v7og6LpskewFabmaShKVzWXl5MXbmsxaRP3yo4dJta8= -github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.0/go.mod h1:1dgblsmK2iBx3L5iNTyRIokeaxbTLUrYiUbHBK6yC3Y= +github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.1 h1:Fw8zKj1b/FkcQrWgN7aBw3ubSxpKIUtdANLXvd1Qdzw= +github.com/arduino/pluggable-discovery-protocol-handler/v2 v2.2.1/go.mod h1:1dgblsmK2iBx3L5iNTyRIokeaxbTLUrYiUbHBK6yC3Y= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= @@ -159,8 +159,8 @@ github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/xrash/smetrics v0.0.0-20170218160415-a3153f7040e9 h1:w8V9v0qVympSF6GjdjIyeqR7+EVhAF9CBQmkmW7Zw0w= github.com/xrash/smetrics v0.0.0-20170218160415-a3153f7040e9/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -go.bug.st/serial v1.6.1 h1:VSSWmUxlj1T/YlRo2J104Zv3wJFrjHIl/T3NeruWAHY= -go.bug.st/serial v1.6.1/go.mod h1:UABfsluHAiaNI+La2iESysd9Vetq7VRdpxvjx7CmmOE= +go.bug.st/serial v1.6.3 h1:S3OG1bH+IDyokVndKrzwxI9ywiGBd8sWOn08dzSqEQI= +go.bug.st/serial v1.6.3/go.mod h1:nofMJxTeNVny/m6+KaafC6vJGj3miwQZ6vW4BZUGJPI= goa.design/goa/v3 v3.16.1 h1:yZwbKrfMpE8+sz0uf+n+BtArVOFQ0kNSC0twQKwQb04= goa.design/goa/v3 v3.16.1/go.mod h1:Yd42LR0PYDbHSbsbF3vNd4YY/O+LG20Jb7+IyNdkQic= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= From 5063c6c5fa0afa2f553b11f582f3f9b2921aa766 Mon Sep 17 00:00:00 2001 From: Davide Date: Wed, 26 Mar 2025 14:30:46 +0100 Subject: [PATCH 37/42] fix(release.yml) install go step for gon (#1025) --- .github/workflows/release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b2a210d..6275922c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -259,6 +259,11 @@ jobs: environment: production steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + - name: Download artifact uses: actions/download-artifact@v4 with: From 901728dadac8e48dc8acdc8692ee70d9d13ddb65 Mon Sep 17 00:00:00 2001 From: Davide Date: Thu, 27 Mar 2025 09:54:39 +0100 Subject: [PATCH 38/42] fix: allow to specify custom `signatureKey` in the `config.ini` (#1024) * make the signaturePubKey overwritable * Add debug logging for signature key parsing and handle newline escape sequences * Add MustParseRsaPublicKey function for parsing PEM formatted public keys * Remove debug print statement for signature key and fix comment typo in key parsing logic * Add error logging for command verification and update comment for public key usage * refactor(main.go) remove unnecessary print statement in parseIni function * refactor(utilities): improve formatting in ParseRsaPublicKey function * style(tools): align field declarations for improved readability --------- Co-authored-by: Luca Rinaldi --- conn.go | 158 +++++++++++++++++++++-------------------- globals/globals.go | 13 +++- main.go | 16 +++-- main_test.go | 10 +-- tools/download_test.go | 6 +- tools/tools.go | 5 +- utilities/utilities.go | 45 ++++++++---- v2/http.go | 5 +- v2/pkgs/tools.go | 27 +++---- v2/pkgs/tools_test.go | 10 +-- 10 files changed, 172 insertions(+), 123 deletions(-) diff --git a/conn.go b/conn.go index b6e03268..8c71c54c 100644 --- a/conn.go +++ b/conn.go @@ -19,6 +19,7 @@ package main import ( "bytes" + "crypto/rsa" "encoding/json" "errors" "fmt" @@ -79,111 +80,114 @@ type Upload struct { var uploadStatusStr = "ProgrammerStatus" -func uploadHandler(c *gin.Context) { - data := new(Upload) - if err := c.BindJSON(data); err != nil { - c.String(http.StatusBadRequest, fmt.Sprintf("err with the payload. %v", err.Error())) - return - } - - log.Printf("%+v %+v %+v %+v %+v %+v", data.Port, data.Board, data.Rewrite, data.Commandline, data.Extra, data.Filename) - - if data.Port == "" { - c.String(http.StatusBadRequest, "port is required") - return - } - - if data.Board == "" { - c.String(http.StatusBadRequest, "board is required") - log.Error("board is required") - return - } - - if !data.Extra.Network { - if data.Signature == "" { - c.String(http.StatusBadRequest, "signature is required") +func uploadHandler(pubKey *rsa.PublicKey) func(*gin.Context) { + return func(c *gin.Context) { + data := new(Upload) + if err := c.BindJSON(data); err != nil { + c.String(http.StatusBadRequest, fmt.Sprintf("err with the payload. %v", err.Error())) return } - if data.Commandline == "" { - c.String(http.StatusBadRequest, "commandline is required for local board") + log.Printf("%+v %+v %+v %+v %+v %+v", data.Port, data.Board, data.Rewrite, data.Commandline, data.Extra, data.Filename) + + if data.Port == "" { + c.String(http.StatusBadRequest, "port is required") return } - err := utilities.VerifyInput(data.Commandline, data.Signature) - - if err != nil { - c.String(http.StatusBadRequest, "signature is invalid") + if data.Board == "" { + c.String(http.StatusBadRequest, "board is required") + log.Error("board is required") return } - } - buffer := bytes.NewBuffer(data.Hex) + if !data.Extra.Network { + if data.Signature == "" { + c.String(http.StatusBadRequest, "signature is required") + return + } - filePath, err := utilities.SaveFileonTempDir(data.Filename, buffer) - if err != nil { - c.String(http.StatusBadRequest, err.Error()) - return - } + if data.Commandline == "" { + c.String(http.StatusBadRequest, "commandline is required for local board") + return + } - tmpdir, err := os.MkdirTemp("", "extrafiles") - if err != nil { - c.String(http.StatusBadRequest, err.Error()) - return - } + err := utilities.VerifyInput(data.Commandline, data.Signature, pubKey) - for _, extraFile := range data.ExtraFiles { - path, err := utilities.SafeJoin(tmpdir, extraFile.Filename) - if err != nil { - c.String(http.StatusBadRequest, err.Error()) - return + if err != nil { + log.WithField("err", err).Error("Error verifying the command") + c.String(http.StatusBadRequest, "signature is invalid") + return + } } - log.Printf("Saving %s on %s", extraFile.Filename, path) - err = os.MkdirAll(filepath.Dir(path), 0744) - if err != nil { - c.String(http.StatusBadRequest, err.Error()) - return - } + buffer := bytes.NewBuffer(data.Hex) - err = os.WriteFile(path, extraFile.Hex, 0644) + filePath, err := utilities.SaveFileonTempDir(data.Filename, buffer) if err != nil { c.String(http.StatusBadRequest, err.Error()) return } - } - if data.Rewrite != "" { - data.Board = data.Rewrite - } - - go func() { - // Resolve commandline - commandline, err := upload.PartiallyResolve(data.Board, filePath, tmpdir, data.Commandline, data.Extra, Tools) + tmpdir, err := os.MkdirTemp("", "extrafiles") if err != nil { - send(map[string]string{uploadStatusStr: "Error", "Msg": err.Error()}) + c.String(http.StatusBadRequest, err.Error()) return } - l := PLogger{Verbose: true} - - // Upload - if data.Extra.Network { - err = errors.New("network upload is not supported anymore, pease use OTA instead") - } else { - send(map[string]string{uploadStatusStr: "Starting", "Cmd": "Serial"}) - err = upload.Serial(data.Port, commandline, data.Extra, l) + for _, extraFile := range data.ExtraFiles { + path, err := utilities.SafeJoin(tmpdir, extraFile.Filename) + if err != nil { + c.String(http.StatusBadRequest, err.Error()) + return + } + log.Printf("Saving %s on %s", extraFile.Filename, path) + + err = os.MkdirAll(filepath.Dir(path), 0744) + if err != nil { + c.String(http.StatusBadRequest, err.Error()) + return + } + + err = os.WriteFile(path, extraFile.Hex, 0644) + if err != nil { + c.String(http.StatusBadRequest, err.Error()) + return + } } - // Handle result - if err != nil { - send(map[string]string{uploadStatusStr: "Error", "Msg": err.Error()}) - return + if data.Rewrite != "" { + data.Board = data.Rewrite } - send(map[string]string{uploadStatusStr: "Done", "Flash": "Ok"}) - }() - c.String(http.StatusAccepted, "") + go func() { + // Resolve commandline + commandline, err := upload.PartiallyResolve(data.Board, filePath, tmpdir, data.Commandline, data.Extra, Tools) + if err != nil { + send(map[string]string{uploadStatusStr: "Error", "Msg": err.Error()}) + return + } + + l := PLogger{Verbose: true} + + // Upload + if data.Extra.Network { + err = errors.New("network upload is not supported anymore, pease use OTA instead") + } else { + send(map[string]string{uploadStatusStr: "Starting", "Cmd": "Serial"}) + err = upload.Serial(data.Port, commandline, data.Extra, l) + } + + // Handle result + if err != nil { + send(map[string]string{uploadStatusStr: "Error", "Msg": err.Error()}) + return + } + send(map[string]string{uploadStatusStr: "Done", "Flash": "Ok"}) + }() + + c.String(http.StatusAccepted, "") + } } // PLogger sends the info from the upload to the websocket diff --git a/globals/globals.go b/globals/globals.go index d7cb09a1..ac4c1466 100644 --- a/globals/globals.go +++ b/globals/globals.go @@ -15,8 +15,15 @@ package globals -// DefaultIndexURL is the default index url var ( - // SignatureKey is the public key used to verify commands and url sent by the builder - SignatureKey = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvc0yZr1yUSen7qmE3cxF\nIE12rCksDnqR+Hp7o0nGi9123eCSFcJ7CkIRC8F+8JMhgI3zNqn4cUEn47I3RKD1\nZChPUCMiJCvbLbloxfdJrUi7gcSgUXrlKQStOKF5Iz7xv1M4XOP3JtjXLGo3EnJ1\npFgdWTOyoSrA8/w1rck4c/ISXZSinVAggPxmLwVEAAln6Itj6giIZHKvA2fL2o8z\nCeK057Lu8X6u2CG8tRWSQzVoKIQw/PKK6CNXCAy8vo4EkXudRutnEYHEJlPkVgPn\n2qP06GI+I+9zKE37iqj0k1/wFaCVXHXIvn06YrmjQw6I0dDj/60Wvi500FuRVpn9\ntwIDAQAB\n-----END PUBLIC KEY-----" + // ArduinoSignaturePubKey is the public key used to verify commands and url sent by the builder + ArduinoSignaturePubKey = `-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvc0yZr1yUSen7qmE3cxF +IE12rCksDnqR+Hp7o0nGi9123eCSFcJ7CkIRC8F+8JMhgI3zNqn4cUEn47I3RKD1 +ZChPUCMiJCvbLbloxfdJrUi7gcSgUXrlKQStOKF5Iz7xv1M4XOP3JtjXLGo3EnJ1 +pFgdWTOyoSrA8/w1rck4c/ISXZSinVAggPxmLwVEAAln6Itj6giIZHKvA2fL2o8z +CeK057Lu8X6u2CG8tRWSQzVoKIQw/PKK6CNXCAy8vo4EkXudRutnEYHEJlPkVgPn +2qP06GI+I+9zKE37iqj0k1/wFaCVXHXIvn06YrmjQw6I0dDj/60Wvi500FuRVpn9 +twIDAQAB +-----END PUBLIC KEY-----` ) diff --git a/main.go b/main.go index 1ca857b0..41f824b1 100755 --- a/main.go +++ b/main.go @@ -81,7 +81,7 @@ var ( logDump = iniConf.String("log", "off", "off = (default)") origins = iniConf.String("origins", "", "Allowed origin list for CORS") portsFilterRegexp = iniConf.String("regex", "usb|acm|com", "Regular expression to filter serial port list") - signatureKey = iniConf.String("signatureKey", globals.SignatureKey, "Pem-encoded public key to verify signed commandlines") + signatureKey = iniConf.String("signatureKey", globals.ArduinoSignaturePubKey, "Pem-encoded public key to verify signed commandlines") updateURL = iniConf.String("updateUrl", "", "") verbose = iniConf.Bool("v", true, "show debug logging") crashreport = iniConf.Bool("crashreport", false, "enable crashreport logging") @@ -278,9 +278,17 @@ func loop() { } } + if signatureKey == nil || len(*signatureKey) == 0 { + log.Panicf("signature public key should be set") + } + signaturePubKey, err := utilities.ParseRsaPublicKey([]byte(*signatureKey)) + if err != nil { + log.Panicf("cannot parse signature key '%s'. %s", *signatureKey, err) + } + // Instantiate Index and Tools Index = index.Init(*indexURL, config.GetDataDir()) - Tools = tools.New(config.GetDataDir(), Index, logger) + Tools = tools.New(config.GetDataDir(), Index, logger, signaturePubKey) // see if we are supposed to wait 5 seconds if *isLaunchSelf { @@ -454,7 +462,7 @@ func loop() { r.LoadHTMLFiles("templates/nofirefox.html") r.GET("/", homeHandler) - r.POST("/upload", uploadHandler) + r.POST("/upload", uploadHandler(signaturePubKey)) r.GET("/socket.io/", socketHandler) r.POST("/socket.io/", socketHandler) r.Handle("WS", "/socket.io/", socketHandler) @@ -464,7 +472,7 @@ func loop() { r.POST("/update", updateHandler) // Mount goa handlers - goa := v2.Server(config.GetDataDir().String(), Index) + goa := v2.Server(config.GetDataDir().String(), Index, signaturePubKey) r.Any("/v2/*path", gin.WrapH(goa)) go func() { diff --git a/main_test.go b/main_test.go index d6f23fce..1387fd22 100644 --- a/main_test.go +++ b/main_test.go @@ -30,8 +30,10 @@ import ( "github.com/arduino/arduino-create-agent/config" "github.com/arduino/arduino-create-agent/gen/tools" + "github.com/arduino/arduino-create-agent/globals" "github.com/arduino/arduino-create-agent/index" "github.com/arduino/arduino-create-agent/upload" + "github.com/arduino/arduino-create-agent/utilities" v2 "github.com/arduino/arduino-create-agent/v2" "github.com/gin-gonic/gin" "github.com/stretchr/testify/require" @@ -54,7 +56,7 @@ func TestValidSignatureKey(t *testing.T) { func TestUploadHandlerAgainstEvilFileNames(t *testing.T) { r := gin.New() - r.POST("/", uploadHandler) + r.POST("/", uploadHandler(utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey)))) ts := httptest.NewServer(r) uploadEvilFileName := Upload{ @@ -90,7 +92,7 @@ func TestUploadHandlerAgainstEvilFileNames(t *testing.T) { func TestUploadHandlerAgainstBase64WithoutPaddingMustFail(t *testing.T) { r := gin.New() - r.POST("/", uploadHandler) + r.POST("/", uploadHandler(utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey)))) ts := httptest.NewServer(r) defer ts.Close() @@ -119,7 +121,7 @@ func TestInstallToolV2(t *testing.T) { Index := index.Init(indexURL, config.GetDataDir()) r := gin.New() - goa := v2.Server(config.GetDataDir().String(), Index) + goa := v2.Server(config.GetDataDir().String(), Index, utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) r.Any("/v2/*path", gin.WrapH(goa)) ts := httptest.NewServer(r) @@ -213,7 +215,7 @@ func TestInstalledHead(t *testing.T) { Index := index.Init(indexURL, config.GetDataDir()) r := gin.New() - goa := v2.Server(config.GetDataDir().String(), Index) + goa := v2.Server(config.GetDataDir().String(), Index, utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) r.Any("/v2/*path", gin.WrapH(goa)) ts := httptest.NewServer(r) diff --git a/tools/download_test.go b/tools/download_test.go index 7cf2fab0..96a105fd 100644 --- a/tools/download_test.go +++ b/tools/download_test.go @@ -21,7 +21,9 @@ import ( "testing" "time" + "github.com/arduino/arduino-create-agent/globals" "github.com/arduino/arduino-create-agent/index" + "github.com/arduino/arduino-create-agent/utilities" "github.com/arduino/arduino-create-agent/v2/pkgs" "github.com/arduino/go-paths-helper" "github.com/stretchr/testify/require" @@ -128,7 +130,7 @@ func TestDownload(t *testing.T) { IndexFile: *paths.New("testdata", "test_tool_index.json"), LastRefresh: time.Now(), } - testTools := New(tempDirPath, &testIndex, func(msg string) { t.Log(msg) }) + testTools := New(tempDirPath, &testIndex, func(msg string) { t.Log(msg) }, utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) for _, tc := range testCases { t.Run(tc.name+"-"+tc.version, func(t *testing.T) { @@ -175,7 +177,7 @@ func TestCorruptedInstalled(t *testing.T) { defer fileJSON.Close() _, err = fileJSON.Write([]byte("Hello")) require.NoError(t, err) - testTools := New(tempDirPath, &testIndex, func(msg string) { t.Log(msg) }) + testTools := New(tempDirPath, &testIndex, func(msg string) { t.Log(msg) }, utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) // Download the tool err = testTools.Download("arduino-test", "avrdude", "6.3.0-arduino17", "keep") require.NoError(t, err) diff --git a/tools/tools.go b/tools/tools.go index 5cecc508..f371126b 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -16,6 +16,7 @@ package tools import ( + "crypto/rsa" "encoding/json" "path/filepath" "strings" @@ -55,14 +56,14 @@ type Tools struct { // The New functions accept the directory to use to host the tools, // an index (used to download the tools), // and a logger to log the operations -func New(directory *paths.Path, index *index.Resource, logger func(msg string)) *Tools { +func New(directory *paths.Path, index *index.Resource, logger func(msg string), signPubKey *rsa.PublicKey) *Tools { t := &Tools{ directory: directory, index: index, logger: logger, installed: map[string]string{}, mutex: sync.RWMutex{}, - tools: pkgs.New(index, directory.String(), "replace"), + tools: pkgs.New(index, directory.String(), "replace", signPubKey), } _ = t.readMap() return t diff --git a/utilities/utilities.go b/utilities/utilities.go index 5979732d..662672da 100644 --- a/utilities/utilities.go +++ b/utilities/utilities.go @@ -30,8 +30,6 @@ import ( "os/exec" "path/filepath" "strings" - - "github.com/arduino/arduino-create-agent/globals" ) // SaveFileonTempDir creates a temp directory and saves the file data as the @@ -131,23 +129,44 @@ func SafeJoin(parent, subdir string) (string, error) { return res, nil } -// VerifyInput will verify an input against a signature +// VerifyInput will verify an input against a signature using the public key. // A valid signature is indicated by returning a nil error. -func VerifyInput(input string, signature string) error { +func VerifyInput(input string, signature string, pubKey *rsa.PublicKey) error { sign, _ := hex.DecodeString(signature) - block, _ := pem.Decode([]byte(globals.SignatureKey)) + h := sha256.New() + h.Write([]byte(input)) + d := h.Sum(nil) + return rsa.VerifyPKCS1v15(pubKey, crypto.SHA256, d, sign) +} + +// ParseRsaPublicKey parses a public key in PEM format and returns the rsa.PublicKey object. +// Returns an error if the key is invalid. +func ParseRsaPublicKey(key []byte) (*rsa.PublicKey, error) { + block, _ := pem.Decode(key) if block == nil { - return errors.New("invalid key") + return nil, errors.New("invalid key") } - key, err := x509.ParsePKIXPublicKey(block.Bytes) + + parsedKey, err := x509.ParsePKIXPublicKey(block.Bytes) if err != nil { - return err + return nil, err } - rsaKey := key.(*rsa.PublicKey) - h := sha256.New() - h.Write([]byte(input)) - d := h.Sum(nil) - return rsa.VerifyPKCS1v15(rsaKey, crypto.SHA256, d, sign) + + publicKey, ok := parsedKey.(*rsa.PublicKey) + if !ok { + return nil, fmt.Errorf("not an rsa key") + } + return publicKey, nil +} + +// MustParseRsaPublicKey parses a public key in PEM format and returns the rsa.PublicKey object. +// Panics if the key is invalid. +func MustParseRsaPublicKey(key []byte) *rsa.PublicKey { + parsedKey, err := ParseRsaPublicKey(key) + if err != nil { + panic(err) + } + return parsedKey } // UserPrompt executes an osascript and returns the pressed button diff --git a/v2/http.go b/v2/http.go index 390ec398..2b47b93a 100644 --- a/v2/http.go +++ b/v2/http.go @@ -17,6 +17,7 @@ package v2 import ( "context" + "crypto/rsa" "encoding/json" "net/http" @@ -31,7 +32,7 @@ import ( ) // Server is the actual server -func Server(directory string, index *index.Resource) http.Handler { +func Server(directory string, index *index.Resource, pubKey *rsa.PublicKey) http.Handler { mux := goahttp.NewMuxer() // Instantiate logger @@ -40,7 +41,7 @@ func Server(directory string, index *index.Resource) http.Handler { logAdapter := LogAdapter{Logger: logger} // Mount tools - toolsSvc := pkgs.New(index, directory, "replace") + toolsSvc := pkgs.New(index, directory, "replace", pubKey) toolsEndpoints := toolssvc.NewEndpoints(toolsSvc) toolsServer := toolssvr.New(toolsEndpoints, mux, CustomRequestDecoder, goahttp.ResponseEncoder, errorHandler(logger), nil) toolssvr.Mount(mux, toolsServer) diff --git a/v2/pkgs/tools.go b/v2/pkgs/tools.go index f09dc3f0..7f34e3d0 100644 --- a/v2/pkgs/tools.go +++ b/v2/pkgs/tools.go @@ -18,6 +18,7 @@ package pkgs import ( "bytes" "context" + "crypto/rsa" "crypto/sha256" "encoding/hex" "encoding/json" @@ -58,23 +59,25 @@ var ( // // It requires an Index Resource to search for tools type Tools struct { - index *index.Resource - folder string - behaviour string - installed map[string]string - mutex sync.RWMutex + index *index.Resource + folder string + behaviour string + installed map[string]string + mutex sync.RWMutex + verifySignaturePubKey *rsa.PublicKey // public key used to verify the signature of a command sent to the boards } // New will return a Tool object, allowing the caller to execute operations on it. // The New function will accept an index as parameter (used to download the indexes) // and a folder used to download the indexes -func New(index *index.Resource, folder, behaviour string) *Tools { +func New(index *index.Resource, folder, behaviour string, verifySignaturePubKey *rsa.PublicKey) *Tools { t := &Tools{ - index: index, - folder: folder, - behaviour: behaviour, - installed: map[string]string{}, - mutex: sync.RWMutex{}, + index: index, + folder: folder, + behaviour: behaviour, + installed: map[string]string{}, + mutex: sync.RWMutex{}, + verifySignaturePubKey: verifySignaturePubKey, } t.readInstalled() return t @@ -166,7 +169,7 @@ func (t *Tools) Install(ctx context.Context, payload *tools.ToolPayload) (*tools //if URL is defined and is signed we verify the signature and override the name, payload, version parameters if payload.URL != nil && payload.Signature != nil && payload.Checksum != nil { - err := utilities.VerifyInput(*payload.URL, *payload.Signature) + err := utilities.VerifyInput(*payload.URL, *payload.Signature, t.verifySignaturePubKey) if err != nil { return nil, err } diff --git a/v2/pkgs/tools_test.go b/v2/pkgs/tools_test.go index edd575fc..7bf0ff0e 100644 --- a/v2/pkgs/tools_test.go +++ b/v2/pkgs/tools_test.go @@ -25,7 +25,9 @@ import ( "github.com/arduino/arduino-create-agent/config" "github.com/arduino/arduino-create-agent/gen/tools" + "github.com/arduino/arduino-create-agent/globals" "github.com/arduino/arduino-create-agent/index" + "github.com/arduino/arduino-create-agent/utilities" "github.com/arduino/arduino-create-agent/v2/pkgs" "github.com/arduino/go-paths-helper" "github.com/stretchr/testify/require" @@ -45,7 +47,7 @@ func TestTools(t *testing.T) { // Instantiate Index Index := index.Init(indexURL, config.GetDataDir()) - service := pkgs.New(Index, tmp, "replace") + service := pkgs.New(Index, tmp, "replace", utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) ctx := context.Background() @@ -126,7 +128,7 @@ func TestEvilFilename(t *testing.T) { // Instantiate Index Index := index.Init(indexURL, config.GetDataDir()) - service := pkgs.New(Index, tmp, "replace") + service := pkgs.New(Index, tmp, "replace", utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) ctx := context.Background() @@ -195,7 +197,7 @@ func TestInstalledHead(t *testing.T) { // Instantiate Index Index := index.Init(indexURL, config.GetDataDir()) - service := pkgs.New(Index, tmp, "replace") + service := pkgs.New(Index, tmp, "replace", utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) ctx := context.Background() @@ -216,7 +218,7 @@ func TestInstall(t *testing.T) { LastRefresh: time.Now(), } - tool := pkgs.New(testIndex, tmp, "replace") + tool := pkgs.New(testIndex, tmp, "replace", utilities.MustParseRsaPublicKey([]byte(globals.ArduinoSignaturePubKey))) ctx := context.Background() From 87f097b862ae2e98179fd216a132712493777543 Mon Sep 17 00:00:00 2001 From: Davide Date: Fri, 28 Mar 2025 16:41:53 +0100 Subject: [PATCH 39/42] fix: update go.bug.st/serial to v1.6.4 to fix windows issue (#1027) * fix: update go.bug.st/serial to v1.6.4 * Updated license cache --------- Co-authored-by: Cristian Maglie --- .licenses/arduino-create-agent/go/go.bug.st/serial.dep.yml | 2 +- .../go/go.bug.st/serial/enumerator.dep.yml | 6 +++--- .../go/go.bug.st/serial/unixutils.dep.yml | 6 +++--- go.mod | 2 +- go.sum | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.licenses/arduino-create-agent/go/go.bug.st/serial.dep.yml b/.licenses/arduino-create-agent/go/go.bug.st/serial.dep.yml index 3c29440d..73d43410 100644 --- a/.licenses/arduino-create-agent/go/go.bug.st/serial.dep.yml +++ b/.licenses/arduino-create-agent/go/go.bug.st/serial.dep.yml @@ -1,6 +1,6 @@ --- name: go.bug.st/serial -version: v1.6.3 +version: v1.6.4 type: go summary: Package serial is a cross-platform serial library for the go language. homepage: https://pkg.go.dev/go.bug.st/serial diff --git a/.licenses/arduino-create-agent/go/go.bug.st/serial/enumerator.dep.yml b/.licenses/arduino-create-agent/go/go.bug.st/serial/enumerator.dep.yml index 4b562e2a..d7b0b63e 100644 --- a/.licenses/arduino-create-agent/go/go.bug.st/serial/enumerator.dep.yml +++ b/.licenses/arduino-create-agent/go/go.bug.st/serial/enumerator.dep.yml @@ -1,13 +1,13 @@ --- name: go.bug.st/serial/enumerator -version: v1.6.3 +version: v1.6.4 type: go summary: Package enumerator is a golang cross-platform library for USB serial port discovery. homepage: https://pkg.go.dev/go.bug.st/serial/enumerator license: bsd-3-clause licenses: -- sources: serial@v1.6.3/LICENSE +- sources: serial@v1.6.4/LICENSE text: |2+ Copyright (c) 2014-2024, Cristian Maglie. @@ -42,7 +42,7 @@ licenses: ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: serial@v1.6.3/README.md +- sources: serial@v1.6.4/README.md text: |- This software is released under the [BSD 3-clause license]. diff --git a/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml b/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml index 0e2d5f7d..ac5bb6bb 100644 --- a/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml +++ b/.licenses/arduino-create-agent/go/go.bug.st/serial/unixutils.dep.yml @@ -1,12 +1,12 @@ --- name: go.bug.st/serial/unixutils -version: v1.6.3 +version: v1.6.4 type: go summary: homepage: https://pkg.go.dev/go.bug.st/serial/unixutils license: bsd-3-clause licenses: -- sources: serial@v1.6.3/LICENSE +- sources: serial@v1.6.4/LICENSE text: |2+ Copyright (c) 2014-2024, Cristian Maglie. @@ -41,7 +41,7 @@ licenses: ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: serial@v1.6.3/README.md +- sources: serial@v1.6.4/README.md text: |- This software is released under the [BSD 3-clause license]. diff --git a/go.mod b/go.mod index 19d0eae0..3bffc09e 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 github.com/stretchr/testify v1.9.0 github.com/xrash/smetrics v0.0.0-20170218160415-a3153f7040e9 - go.bug.st/serial v1.6.3 + go.bug.st/serial v1.6.4 goa.design/goa/v3 v3.16.1 golang.org/x/sys v0.23.0 gopkg.in/inconshreveable/go-update.v0 v0.0.0-20150814200126-d8b0b1d421aa diff --git a/go.sum b/go.sum index a46d0bad..676649d5 100644 --- a/go.sum +++ b/go.sum @@ -159,8 +159,8 @@ github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/xrash/smetrics v0.0.0-20170218160415-a3153f7040e9 h1:w8V9v0qVympSF6GjdjIyeqR7+EVhAF9CBQmkmW7Zw0w= github.com/xrash/smetrics v0.0.0-20170218160415-a3153f7040e9/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -go.bug.st/serial v1.6.3 h1:S3OG1bH+IDyokVndKrzwxI9ywiGBd8sWOn08dzSqEQI= -go.bug.st/serial v1.6.3/go.mod h1:nofMJxTeNVny/m6+KaafC6vJGj3miwQZ6vW4BZUGJPI= +go.bug.st/serial v1.6.4 h1:7FmqNPgVp3pu2Jz5PoPtbZ9jJO5gnEnZIvnI1lzve8A= +go.bug.st/serial v1.6.4/go.mod h1:nofMJxTeNVny/m6+KaafC6vJGj3miwQZ6vW4BZUGJPI= goa.design/goa/v3 v3.16.1 h1:yZwbKrfMpE8+sz0uf+n+BtArVOFQ0kNSC0twQKwQb04= goa.design/goa/v3 v3.16.1/go.mod h1:Yd42LR0PYDbHSbsbF3vNd4YY/O+LG20Jb7+IyNdkQic= golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= From b7174301c1983cf2593643b5789e01d3d50d1089 Mon Sep 17 00:00:00 2001 From: Davide Date: Tue, 1 Apr 2025 15:42:28 +0200 Subject: [PATCH 40/42] fix: update workflow to use ubuntu-22.04 instead of ubuntu-20.04 (#1028) --- .github/workflows/publish-go-tester-task.yml | 2 +- .github/workflows/release.yml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-go-tester-task.yml b/.github/workflows/publish-go-tester-task.yml index 8e72c351..89d5c2b4 100644 --- a/.github/workflows/publish-go-tester-task.yml +++ b/.github/workflows/publish-go-tester-task.yml @@ -65,7 +65,7 @@ jobs: #use the strategy instead because we still use the native build strategy: matrix: - os: [ubuntu-20.04, windows-2019, macos-13] + os: [ubuntu-22.04, windows-2019, macos-13] arch: [-amd64] include: - os: windows-2019 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6275922c..12b3781b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: prerelease: ${{ steps.prerelease.outputs.IS_PRE }} strategy: matrix: - os: [ubuntu-20.04, windows-2019, macos-13] + os: [ubuntu-22.04, windows-2019, macos-13] arch: [amd64] include: - os: windows-2019 @@ -88,7 +88,7 @@ jobs: - name: Build the Agent for linux run: task go:build - if: matrix.os == 'ubuntu-20.04' + if: matrix.os == 'ubuntu-22.04' # the manifest is required by windows GUI apps, otherwise the binary will crash with: "Unable to create main window: TTM_ADDTOOL failed" (for reference https://github.com/lxn/walk/issues/28) # rsrc will produce a *.syso file that should get automatically recognized by go build command and linked into an executable. @@ -390,7 +390,7 @@ jobs: # This job is responsible for generating the installers (using installbuilder) package: needs: build - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: # vars used by installbuilder @@ -400,10 +400,10 @@ jobs: strategy: fail-fast: false # if one os is failing continue nonetheless matrix: # used to generate installers for different OS and not for runs-on - os: [ubuntu-20.04, windows-2019] + os: [ubuntu-22.04, windows-2019] arch: [amd64] include: - - os: ubuntu-20.04 + - os: ubuntu-22.04 platform-name: linux installbuilder-name: linux-x64 installer-extension: .run @@ -438,7 +438,7 @@ jobs: # zip artifacts do not mantain executable permission - name: Make executable run: chmod -v +x artifacts/${{ matrix.platform-name }}/${{ env.PROJECT_NAME }}* - if: matrix.os == 'ubuntu-20.04' + if: matrix.os == 'ubuntu-22.04' - name: Rename executable to Arduino_Cloud_Agent run: mv -v artifacts/${{ matrix.platform-name }}/${{ env.PROJECT_NAME }}${{ matrix.extension }} artifacts/${{ matrix.platform-name }}/Arduino_Cloud_Agent${{ matrix.extension }} @@ -451,7 +451,7 @@ jobs: - name: Generate archive run: tar -czvf ArduinoCloudAgent-${GITHUB_REF##*/}-${{ matrix.platform-name }}-${{ matrix.arch }}-installer.tar.gz ArduinoCloudAgent-${GITHUB_REF##*/}-${{ matrix.platform-name }}-${{ matrix.arch }}-installer${{matrix.installer-extension}} - if: matrix.os == 'ubuntu-20.04' + if: matrix.os == 'ubuntu-22.04' - name: Upload artifacts uses: actions/upload-artifact@v4 @@ -606,7 +606,7 @@ jobs: if-no-files-found: error create-release: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: production needs: [build, generate-sign-dmg, sign-windows] From e7ea3763ff3d4db6a84c207afd562790a38dc3b5 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 24 Apr 2025 16:45:22 +0200 Subject: [PATCH 41/42] fix: Serial Monitor corrupted output in some rare cases (#1032) * Synchronize multiple open commands coming together. * Allow re-opening of already opened ports * Renamed mutex var and added comment * Error out if baudrate and buftype of already opened port do not match --- serial.go | 19 ++++++------------- serialport.go | 31 +++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/serial.go b/serial.go index 64e5b8f7..1a43f364 100755 --- a/serial.go +++ b/serial.go @@ -31,7 +31,7 @@ import ( type serialhub struct { // Opened serial ports. - ports map[*serport]bool + ports map[string]*serport mu sync.Mutex } @@ -60,7 +60,7 @@ type SpPortItem struct { var serialPorts SerialPortList var sh = serialhub{ - ports: make(map[*serport]bool), + ports: make(map[string]*serport), } // Register serial ports from the connections. @@ -68,7 +68,7 @@ func (sh *serialhub) Register(port *serport) { sh.mu.Lock() //log.Print("Registering a port: ", p.portConf.Name) h.broadcastSys <- []byte("{\"Cmd\":\"Open\",\"Desc\":\"Got register/open on port.\",\"Port\":\"" + port.portConf.Name + "\",\"Baud\":" + strconv.Itoa(port.portConf.Baud) + ",\"BufferType\":\"" + port.BufferType + "\"}") - sh.ports[port] = true + sh.ports[port.portName] = port sh.mu.Unlock() } @@ -77,7 +77,7 @@ func (sh *serialhub) Unregister(port *serport) { sh.mu.Lock() //log.Print("Unregistering a port: ", p.portConf.Name) h.broadcastSys <- []byte("{\"Cmd\":\"Close\",\"Desc\":\"Got unregister/close on port.\",\"Port\":\"" + port.portConf.Name + "\",\"Baud\":" + strconv.Itoa(port.portConf.Baud) + "}") - delete(sh.ports, port) + delete(sh.ports, port.portName) close(port.sendBuffered) close(port.sendNoBuf) sh.mu.Unlock() @@ -86,15 +86,8 @@ func (sh *serialhub) Unregister(port *serport) { func (sh *serialhub) FindPortByName(portname string) (*serport, bool) { sh.mu.Lock() defer sh.mu.Unlock() - - for port := range sh.ports { - if strings.EqualFold(port.portConf.Name, portname) { - // we found our port - //spHandlerClose(port) - return port, true - } - } - return nil, false + port, ok := sh.ports[portname] + return port, ok } // List broadcasts a Json representation of the ports found diff --git a/serialport.go b/serialport.go index 0d386bbf..b3418fe5 100755 --- a/serialport.go +++ b/serialport.go @@ -20,6 +20,7 @@ import ( "encoding/base64" "io" "strconv" + "sync" "sync/atomic" "time" "unicode/utf8" @@ -273,7 +274,13 @@ func (p *serport) writerRaw() { h.broadcastSys <- []byte(msgstr) } +// This lock is used to prevent multiple threads from trying to open the same port at the same time. +// It presents issues with the serial port driver on some OS's: https://github.com/arduino/arduino-create-agent/issues/1031 +var spHandlerOpenLock sync.Mutex + func spHandlerOpen(portname string, baud int, buftype string) { + spHandlerOpenLock.Lock() + defer spHandlerOpenLock.Unlock() log.Print("Inside spHandler") @@ -295,11 +302,14 @@ func spHandlerOpen(portname string, baud int, buftype string) { sp, err := serial.Open(portname, mode) log.Print("Just tried to open port") if err != nil { - //log.Fatal(err) - log.Print("Error opening port " + err.Error()) - //h.broadcastSys <- []byte("Error opening port. " + err.Error()) - h.broadcastSys <- []byte("{\"Cmd\":\"OpenFail\",\"Desc\":\"Error opening port. " + err.Error() + "\",\"Port\":\"" + conf.Name + "\",\"Baud\":" + strconv.Itoa(conf.Baud) + "}") - + existingPort, ok := sh.FindPortByName(portname) + if ok && existingPort.portConf.Baud == baud && existingPort.BufferType == buftype { + log.Print("Port already opened") + h.broadcastSys <- []byte("{\"Cmd\":\"Open\",\"Desc\":\"Port already opened.\",\"Port\":\"" + existingPort.portConf.Name + "\",\"Baud\":" + strconv.Itoa(existingPort.portConf.Baud) + ",\"BufferType\":\"" + existingPort.BufferType + "\"}") + } else { + log.Print("Error opening port " + err.Error()) + h.broadcastSys <- []byte("{\"Cmd\":\"OpenFail\",\"Desc\":\"Error opening port. " + err.Error() + "\",\"Port\":\"" + conf.Name + "\",\"Baud\":" + strconv.Itoa(conf.Baud) + "}") + } return } log.Print("Opened port successfully") @@ -331,7 +341,6 @@ func spHandlerOpen(portname string, baud int, buftype string) { p.bufferwatcher = bw sh.Register(p) - defer sh.Unregister(p) serialPorts.MarkPortAsOpened(portname) serialPorts.List() @@ -342,10 +351,12 @@ func spHandlerOpen(portname string, baud int, buftype string) { go p.writerNoBuf() // this is thread to send to serial port but with base64 decoding go p.writerRaw() - - p.reader(buftype) - - serialPorts.List() + // this is the thread that reads from the serial port + go func() { + p.reader(buftype) + serialPorts.List() + sh.Unregister(p) + }() } func (p *serport) Close() { From b2b98877d93b0e762c50145971d45b5a97cc6d44 Mon Sep 17 00:00:00 2001 From: Davide Date: Thu, 15 May 2025 15:51:25 +0200 Subject: [PATCH 42/42] ci(Taskfile): add a command to test autoupdate (#1033) * feat: add demo task for local auto-update workflow of the Agent * fix: update autoupdate demo description and improve server wait logic * fix: remove unnecessary blank lines in Taskfile.yml * fix: clarify the importance of the 'CreateAgent/Stable' path in update file search --- Taskfile.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index bba07548..681c8274 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -149,6 +149,20 @@ tasks: - task: go:vet - task: go:lint + autoupdate:demo: + desc: Demo the local auto-update workflow for the Agent (for linux and mac user) + prompt: Before continuing, please make sure you’ve opened the "Open Configuration" option from the Agent menu and set the updateUrl=http://127.0.0.1:3000/ + cmds: + - task: go:build + - go install github.com/sanbornm/go-selfupdate/...@latest + # NOTE: the path 'CreateAgent/Stable' is important to keep as is + # because agent searches the update files into "CreateAgent/Stable/{platform}.json" and "https://downloads.arduino.cc/CreateAgent/Stable/{version}/{platform}.gz" + - go-selfupdate -o public/CreateAgent/Stable ./arduino-cloud-agent {{.VERSION}} + - docker rm -f agent-static-server + - docker run --rm -d -v "$PWD/public:/usr/share/nginx/html:ro" -p 3000:80 --name agent-static-server nginx:alpine + - sleep 5 # wait the server is up before starting the update + - curl -X POST http://127.0.0.1:8991/update + vars: # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/release-go-task/Taskfile.yml PROJECT_NAME: arduino-cloud-agent