1 Commits
Author SHA1 Message Date
Paulo Truta e80aaf7d18 Release/1.3.0 (#40)
* Implemented scaffolding for BrowserDev tasks and implemented taskGetBrowserDevPassword

* Added SetBrowserDevPasswordFile and ReplaceTextInFile funcs

* Added browserDevProxyPath

* Polished code and added missing pieces

* Improved Makefile with info and install + build processes

* Added vscode tasks support

* Added run command and reverted build-all to old logic, added run vscode task

* Added GetBrowserDevStatus task and into schedules

* Fixed check for tasks.GetBrowserStatus()

* Reverted to no result log in Exec command
2024-12-07 01:26:45 +01:00
+23
View File
@@ -530,6 +530,7 @@ func ExecuteSchedules(tick int) {
log.Println("Fetching Browser Dev Environment Information")
taskGetBrowserDevPassword()
taskGetBrowserDevStatus()
ip := taskGetSystemIP()
log.Println("System IP is: " + ip)
@@ -608,7 +609,9 @@ func ExecuteSchedules(tick int) {
if tick%3600 == 0 {
// Executing every 3600 ticks (1 hour)
taskGetBrowserDevStatus()
taskCheckSystemUpdates()
}
if tick%86400 == 0 {
@@ -1135,6 +1138,26 @@ func taskStopShell() string {
}
func taskGetBrowserDevStatus() string {
fmt.Println("Executing taskGetBrowserDevStatus")
// Read status from systemctl status code-server@root
browserDevStatus := utils.Exec(
utils.GetPath(utils.WsPath),
"sh",
[]string{"-c", "systemctl --quiet is-active code-server@root && echo 'active' || echo 'inactive'"},
)
if browserDevStatus == "active" {
fmt.Println("Browser Dev Environment is running")
utils.WriteOption("BROWSERDEV_STATUS", "running")
return "{\"status\": \"running\"}"
} else {
fmt.Println("Browser Dev Environment is not running")
utils.WriteOption("BROWSERDEV_STATUS", "not_running")
return "{\"status\": \"not_running\"}"
}
}
func taskActivateBrowserDev() string {
fmt.Println("Executing taskActivateBrowserDev")
wsPath := utils.GetPath(utils.WsPath)