From 10a7be1df60940c1cff8b2cd26a49441f31be8f4 Mon Sep 17 00:00:00 2001 From: Gianluca Varisco Date: Fri, 31 May 2019 09:25:28 +0200 Subject: [PATCH] Use secure origins only --- README.md | 34 +++++++++++++++++----------------- config.ini | 2 +- design/pkgs.go | 2 +- docs/tools.md | 2 +- main.go | 2 +- tools/download_test.go | 12 ++++++------ tools/tools.go | 2 +- trayicon.go | 2 +- v2/pkgs/tools_test.go | 8 ++++---- 9 files changed, 33 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 92aeb0b3f..84639a576 100644 --- a/README.md +++ b/README.md @@ -16,18 +16,18 @@ goa gen github.com/arduino/arduino-create-agent/design Get the latest version of the Agent for all supported platforms: ### Windows -* [Windows with Edge](http://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-windows-installer-edge.exe) -* [Windows with Chrome](http://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-windows-installer-chrome.exe) -* [Windows with Firefox](http://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-windows-installer-firefox.exe) +* [Windows with Edge](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-windows-installer-edge.exe) +* [Windows with Chrome](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-windows-installer-chrome.exe) +* [Windows with Firefox](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-windows-installer-firefox.exe) ### MacOSX -* [MacOSX with Safari](http://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-osx-installer-safari.dmg) -* [MacOSX with Chrome](http://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-osx-installer-chrome.dmg) -* [MacOSX with Firefox](http://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-osx-installer-firefox.dmg) +* [MacOSX with Safari](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-osx-installer-safari.dmg) +* [MacOSX with Chrome](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-osx-installer-chrome.dmg) +* [MacOSX with Firefox](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-osx-installer-firefox.dmg) ### Linux -* [Linux x64 with Chrome](http://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-linux-x64-installer-chrome.tar.gz) -* [Linux x64 with Firefox](http://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-linux-x64-installer-firefox.tar.gz) +* [Linux x64 with Chrome](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-linux-x64-installer-chrome.tar.gz) +* [Linux x64 with Firefox](https://downloads.arduino.cc/CreateBridgeStable/ArduinoCreateAgent-1.1-linux-x64-installer-firefox.tar.gz) 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) @@ -146,18 +146,18 @@ or in the location selected during the installation Please use the current latest version: ### Windows -* [Windows with Edge dev](http://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-windows-installer-edge.exe) -* [Windows with Chrome dev](http://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-windows-installer.exe) -* [Windows with Firefox dev](http://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-windows-installer-firefox.exe) +* [Windows with Edge dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-windows-installer-edge.exe) +* [Windows with Chrome dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-windows-installer.exe) +* [Windows with Firefox dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-windows-installer-firefox.exe) ### MacOSX -* [MacOSX with Safari dev](http://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-osx-installer-safari.dmg) -* [MacOSX with Chrome dev](http://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-osx-installer-chrome.dmg) -* [MacOSX with Firefox dev](http://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-osx-installer-firefox.dmg) +* [MacOSX with Safari dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-osx-installer-safari.dmg) +* [MacOSX with Chrome dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-osx-installer-chrome.dmg) +* [MacOSX with Firefox dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-osx-installer-firefox.dmg) ### Linux -* [Linux x64 with Chrome dev](http://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-linux-x64-installer-chrome.run) -* [Linux x64 with Firefox dev](http://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-linux-x64-installer-firefox.run) +* [Linux x64 with Chrome dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-linux-x64-installer-chrome.run) +* [Linux x64 with Firefox dev](https://downloads.arduino.cc/CreateBridge/staging/ArduinoCreateAgent-1.0-linux-x64-installer-firefox.run) ## How to use it @@ -469,4 +469,4 @@ By making a contribution to this project, I certify that: ## Creating a release Just create a new release on GitHub, and our drone server will build and upload -the compiled binaries for every architecture in a zip file in the release itself. \ No newline at end of file +the compiled binaries for every architecture in a zip file in the release itself. diff --git a/config.ini b/config.ini index 17f1312db..80678555b 100644 --- a/config.ini +++ b/config.ini @@ -3,6 +3,6 @@ hostname = unknown-hostname # Override the hostname we get from the OS regex = usb|acm|com # Regular expression to filter serial port list v = true # show debug logging appName = CreateBridge -updateUrl = http://downloads.arduino.cc/ +updateUrl = https://downloads.arduino.cc/ origins = http://local.arduino.cc:8000 #httpProxy = http://your.proxy:port # Proxy server for HTTP requests diff --git a/design/pkgs.go b/design/pkgs.go index f99adb91e..2e566fdbe 100644 --- a/design/pkgs.go +++ b/design/pkgs.go @@ -84,7 +84,7 @@ var IndexPayload = Type("arduino.index", func() { TypeName("IndexPayload") Attribute("url", String, "The url of the index file", func() { - Example("http://downloads.arduino.cc/packages/package_index.json") + Example("https://downloads.arduino.cc/packages/package_index.json") }) Required("url") }) diff --git a/docs/tools.md b/docs/tools.md index f6ffd2a09..35be570c9 100644 --- a/docs/tools.md +++ b/docs/tools.md @@ -27,7 +27,7 @@ Usage: You have to instantiate the struct by passing it the required parameters: _tools := tools.Tools{ Directory: "/home/user/.arduino-create", - IndexURL: "http://downloads.arduino.cc/packages/package_index.json" + IndexURL: "https://downloads.arduino.cc/packages/package_index.json" Logger: log.Logger } diff --git a/main.go b/main.go index d25604795..0998f1d83 100755 --- a/main.go +++ b/main.go @@ -253,7 +253,7 @@ func loop() { extraOrigins := []string{ "https://create.arduino.cc", - "http://create.arduino.cc", "https://create-dev.arduino.cc", "http://create-dev.arduino.cc", "https://create-intel.arduino.cc", "http://create-intel.arduino.cc", + "https://create-dev.arduino.cc", "https://create-intel.arduino.cc", } for i := 8990; i < 9001; i++ { diff --git a/tools/download_test.go b/tools/download_test.go index 4798ed854..fcd22fd31 100644 --- a/tools/download_test.go +++ b/tools/download_test.go @@ -40,12 +40,12 @@ func Test_findBaseDir(t *testing.T) { func TestTools_DownloadAndUnpackBehaviour(t *testing.T) { urls := []string{ - "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino14-armhf-pc-linux-gnu.tar.bz2", - "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino14-aarch64-pc-linux-gnu.tar.bz2", - "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino14-i386-apple-darwin11.tar.bz2", - "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino14-x86_64-pc-linux-gnu.tar.bz2", - "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino14-i686-pc-linux-gnu.tar.bz2", - "http://downloads.arduino.cc/tools/avrdude-6.3.0-arduino14-i686-w64-mingw32.zip", + "https://downloads.arduino.cc/tools/avrdude-6.3.0-arduino14-armhf-pc-linux-gnu.tar.bz2", + "https://downloads.arduino.cc/tools/avrdude-6.3.0-arduino14-aarch64-pc-linux-gnu.tar.bz2", + "https://downloads.arduino.cc/tools/avrdude-6.3.0-arduino14-i386-apple-darwin11.tar.bz2", + "https://downloads.arduino.cc/tools/avrdude-6.3.0-arduino14-x86_64-pc-linux-gnu.tar.bz2", + "https://downloads.arduino.cc/tools/avrdude-6.3.0-arduino14-i686-pc-linux-gnu.tar.bz2", + "https://downloads.arduino.cc/tools/avrdude-6.3.0-arduino14-i686-w64-mingw32.zip", } expectedDirList := []string{"bin", "etc"} diff --git a/tools/tools.go b/tools/tools.go index 615cabf8e..2884325da 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -26,7 +26,7 @@ import ( // You have to instantiate the struct by passing it the required parameters: // _tools := tools.Tools{ // Directory: "/home/user/.arduino-create", -// IndexURL: "http://downloads.arduino.cc/packages/package_index.json" +// IndexURL: "https://downloads.arduino.cc/packages/package_index.json" // Logger: log.Logger // } type Tools struct { diff --git a/trayicon.go b/trayicon.go index c7b1d671d..b8ef0ed6a 100644 --- a/trayicon.go +++ b/trayicon.go @@ -166,7 +166,7 @@ func setupSysTrayReal() { go func() { for { <-mUrl.ClickedCh - open.Start("http://create.arduino.cc") + open.Start("https://create.arduino.cc") } }() } diff --git a/v2/pkgs/tools_test.go b/v2/pkgs/tools_test.go index 30fdb8cd0..0355d0508 100644 --- a/v2/pkgs/tools_test.go +++ b/v2/pkgs/tools_test.go @@ -144,10 +144,10 @@ func strpoint(s string) *string { func url() string { urls := map[string]string{ - "linuxamd64": "http://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-x86_64-pc-linux-gnu.tar.bz2", - "linux386": "http://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-i686-pc-linux-gnu.tar.bz2", - "darwinamd64": "http://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-i386-apple-darwin11.tar.bz2", - "windows386": "http://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-i686-mingw32.zip", + "linuxamd64": "https://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-x86_64-pc-linux-gnu.tar.bz2", + "linux386": "https://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-i686-pc-linux-gnu.tar.bz2", + "darwinamd64": "https://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-i386-apple-darwin11.tar.bz2", + "windows386": "https://downloads.arduino.cc/tools/avrdude-6.0.1-arduino2-i686-mingw32.zip", } return urls[runtime.GOOS+runtime.GOARCH]