Skip to content

[WE-19] Deploy configuration overhaul and support for proxies #243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jul 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
configUpdateInterval = 0 # Update interval for re-reading config file set via -config flag. Zero disables config file re-reading.
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)
hostname = unknown-hostname # Override the hostname we get from the OS
ls = false # launch self 5 seconds later
regex = usb|acm|com # Regular expression to filter serial port list
v = true # show debug logging
appName = CreateBridge
updateUrl = http://downloads.arduino.cc/
origins = http://local.arduino.cc:8080
#httpProxy = http://your.proxy:port # Proxy server for HTTP requests
13 changes: 4 additions & 9 deletions hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func exit() {

}

func restart(path string) {
func restart(path string, args ...string) {
log.Println("called restart", path)
quitSysTray()
// relaunch ourself and exit
Expand All @@ -302,14 +302,9 @@ func restart(path string) {

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

hiberString := ""
if *hibernate == true {
hiberString = "-hibernate"
}

cmd := exec.Command(exePath, "-ls", "-regex", *regExpFilter, "-gc", *gcType, hiberString)

fmt.Println(cmd)
args = append(args, "-ls")
args = append(args, "-hibernate="+fmt.Sprint(*hibernate))
cmd := exec.Command(exePath, args...)

err := cmd.Start()
if err != nil {
Expand Down
12 changes: 6 additions & 6 deletions info.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ func infoHandler(c *gin.Context) {
host = parts[0]

c.JSON(200, gin.H{
"version": version,
"http": "http://" + host + port,
"https": "https://localhost" + portSSL,
"ws": "ws://" + host + port,
"wss": "wss://localhost" + portSSL,
"origins": origins,
"version": version,
"http": "http://" + host + port,
"https": "https://localhost" + portSSL,
"ws": "ws://" + host + port,
"wss": "wss://localhost" + portSSL,
"origins": origins,
"update_url": updateUrl,
})
}
Expand Down
Loading