Added taskEnablePublicDashboard and taskDisablePublicDashboard

This commit is contained in:
Paulo Truta
2021-06-17 19:53:20 +00:00
parent f52281ff1e
commit 380172f6f0
2 changed files with 72 additions and 2 deletions
+26
View File
@@ -335,6 +335,32 @@ func DisableOnline(ID string) MaybeEdgeApp {
}
func EnablePublicDashboard(InternetURL string) bool {
envFilePath := utils.GetPath("apiPath") + myEdgeAppServiceEnvFilename
env, _ := godotenv.Unmarshal("INTERNET_URL=" + InternetURL)
_ = godotenv.Write(env, envFilePath)
return true
}
func DisablePublicDashboard() bool {
envFilePath := utils.GetPath("apiPath") + myEdgeAppServiceEnvFilename
_, err := godotenv.Read(envFilePath)
if err != nil {
log.Println("myedge.app environment file for the dashboard / api not found. No need to delete.")
} else {
cmdArgs := []string{envFilePath}
utils.Exec(utils.GetPath("apiPath"), "rm", cmdArgs)
buildFrameworkContainers()
return true
}
return false
}
func buildFrameworkContainers() {
cmdArgs := []string{utils.GetPath("wsPath") + "ws", "--build"}