mirror of
https://github.com/edgebox-iot/edgeboxctl.git
synced 2026-09-24 05:41:43 +02:00
Fixes to install make command, fixes to local network app url definition, run ws build on start and every 24 hours
This commit is contained in:
@@ -98,7 +98,7 @@ func GetEdgeApp(ID string) MaybeEdgeApp {
|
||||
Status: GetEdgeAppStatus(ID),
|
||||
Services: GetEdgeAppServices(ID),
|
||||
InternetAccessible: edgeAppInternetAccessible,
|
||||
NetworkURL: ID + system.GetHostname() + ".local",
|
||||
NetworkURL: ID + "." + system.GetHostname() + ".local",
|
||||
InternetURL: edgeAppInternetURL,
|
||||
},
|
||||
Valid: true,
|
||||
|
||||
@@ -100,6 +100,14 @@ func SetupCloudOptions() {
|
||||
utils.Exec("/", "rm", []string{cloudEnvFileLocationPath})
|
||||
}
|
||||
|
||||
// StartWs: Starts the webserver service for Edgeapps
|
||||
func StartWs() {
|
||||
wsPath := utils.GetPath(utils.WsPath)
|
||||
fmt.Println("Starting WS")
|
||||
cmdargs := []string{"-b"}
|
||||
utils.Exec(wsPath, "./ws", cmdargs)
|
||||
}
|
||||
|
||||
// StartService: Starts a service
|
||||
func StartService(serviceID string) {
|
||||
wsPath := utils.GetPath(utils.WsPath)
|
||||
|
||||
@@ -374,6 +374,7 @@ func ExecuteSchedules(tick int) {
|
||||
log.Println("Uptime is " + uptime + " seconds (" + system.GetUptimeFormatted() + ")")
|
||||
|
||||
log.Println(taskGetStorageDevices())
|
||||
taskStartWs()
|
||||
log.Println(taskGetEdgeApps())
|
||||
|
||||
}
|
||||
@@ -423,6 +424,12 @@ func ExecuteSchedules(tick int) {
|
||||
// Executing every 3600 ticks (1 hour)
|
||||
}
|
||||
|
||||
if tick%86400 == 0 {
|
||||
// Executing every 86400 ticks (+/1 day)
|
||||
// Ensuring we run a normal build, setting up avahi domain names fresh in the network
|
||||
taskStartWs()
|
||||
}
|
||||
|
||||
// Just add a schedule here if you need a custom one (every "tick hour", every "tick day", etc...)
|
||||
|
||||
}
|
||||
@@ -1000,3 +1007,8 @@ func taskSetupCloudOptions() {
|
||||
fmt.Println("Executing taskSetupCloudOptions")
|
||||
system.SetupCloudOptions()
|
||||
}
|
||||
|
||||
func taskStartWs() {
|
||||
fmt.Println("Executing taskStartWs")
|
||||
system.StartWs()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user