mirror of
https://github.com/edgebox-iot/edgeboxctl.git
synced 2026-09-25 06:13:03 +02:00
Added taskEnablePublicDashboard and taskDisablePublicDashboard
This commit is contained in:
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user