Skip to content

Commit 31c8d73

Browse files
authored
Merge pull request #243 from arduino/devel
Deploy configuration overhaul and support for proxies
2 parents a9815a6 + 0d99e2f commit 31c8d73

File tree

13 files changed

+283
-831
lines changed

13 files changed

+283
-831
lines changed

config.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
configUpdateInterval = 0 # Update interval for re-reading config file set via -config flag. Zero disables config file re-reading.
21
gc = std # Type of garbage collection. std = Normal garbage collection allowing system to decide (this has been known to cause a stop the world in the middle of a CNC job which can cause lost responses from the CNC controller and thus stalled jobs. use max instead to solve.), off = let memory grow unbounded (you have to send in the gc command manually to garbage collect or you will run out of RAM eventually), max = Force garbage collection on each recv or send on a serial port (this minimizes stop the world events and thus lost serial responses, but increases CPU usage)
32
hostname = unknown-hostname # Override the hostname we get from the OS
4-
ls = false # launch self 5 seconds later
53
regex = usb|acm|com # Regular expression to filter serial port list
64
v = true # show debug logging
75
appName = CreateBridge
86
updateUrl = http://downloads.arduino.cc/
7+
origins = http://local.arduino.cc:8080
8+
#httpProxy = http://your.proxy:port # Proxy server for HTTP requests

hub.go

+4-9
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ func exit() {
276276

277277
}
278278

279-
func restart(path string) {
279+
func restart(path string, args ...string) {
280280
log.Println("called restart", path)
281281
quitSysTray()
282282
// relaunch ourself and exit
@@ -302,14 +302,9 @@ func restart(path string) {
302302

303303
exePath = strings.Trim(exePath, "\n")
304304

305-
hiberString := ""
306-
if *hibernate == true {
307-
hiberString = "-hibernate"
308-
}
309-
310-
cmd := exec.Command(exePath, "-ls", "-regex", *regExpFilter, "-gc", *gcType, hiberString)
311-
312-
fmt.Println(cmd)
305+
args = append(args, "-ls")
306+
args = append(args, "-hibernate="+fmt.Sprint(*hibernate))
307+
cmd := exec.Command(exePath, args...)
313308

314309
err := cmd.Start()
315310
if err != nil {

info.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ func infoHandler(c *gin.Context) {
1313
host = parts[0]
1414

1515
c.JSON(200, gin.H{
16-
"version": version,
17-
"http": "http://" + host + port,
18-
"https": "https://localhost" + portSSL,
19-
"ws": "ws://" + host + port,
20-
"wss": "wss://localhost" + portSSL,
21-
"origins": origins,
16+
"version": version,
17+
"http": "http://" + host + port,
18+
"https": "https://localhost" + portSSL,
19+
"ws": "ws://" + host + port,
20+
"wss": "wss://localhost" + portSSL,
21+
"origins": origins,
2222
"update_url": updateUrl,
2323
})
2424
}

0 commit comments

Comments
 (0)