mirror of
https://github.com/edgebox-iot/edgeboxctl.git
synced 2026-09-24 05:41:43 +02:00
Added support for adding EDGEAPP_DESCRIPTION env var to edgebox.env edgeapps
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
type EdgeApp struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Status EdgeAppStatus `json:"status"`
|
||||
Services []EdgeAppService `json:"services"`
|
||||
InternetAccessible bool `json:"internet_accessible"`
|
||||
@@ -60,6 +61,7 @@ func GetEdgeApp(ID string) MaybeEdgeApp {
|
||||
// File exists. Start digging!
|
||||
|
||||
edgeAppName := ID
|
||||
edgeAppDescription := ""
|
||||
|
||||
edgeAppEnv, err := godotenv.Read(utils.GetPath("edgeAppsPath") + ID + envFilename)
|
||||
|
||||
@@ -69,6 +71,9 @@ func GetEdgeApp(ID string) MaybeEdgeApp {
|
||||
if edgeAppEnv["EDGEAPP_NAME"] != "" {
|
||||
edgeAppName = edgeAppEnv["EDGEAPP_NAME"]
|
||||
}
|
||||
if edgeAppEnv["EDGEAPP_DESCRIPTION"] != "" {
|
||||
edgeAppDescription = edgeAppEnv["EDGEAPP_DESCRIPTION"]
|
||||
}
|
||||
}
|
||||
|
||||
edgeAppInternetAccessible := false
|
||||
@@ -88,6 +93,7 @@ func GetEdgeApp(ID string) MaybeEdgeApp {
|
||||
EdgeApp: EdgeApp{
|
||||
ID: ID,
|
||||
Name: edgeAppName,
|
||||
Description: edgeAppDescription,
|
||||
Status: GetEdgeAppStatus(ID),
|
||||
Services: GetEdgeAppServices(ID),
|
||||
InternetAccessible: edgeAppInternetAccessible,
|
||||
@@ -123,7 +129,6 @@ func SetEdgeAppInstalled(ID string) bool {
|
||||
_, err := os.Stat(utils.GetPath("edgeAppsPath") + ID + runnableFilename)
|
||||
if os.IsNotExist(err) {
|
||||
|
||||
|
||||
_, err := os.Create(utils.GetPath("edgeAppsPath") + ID + runnableFilename)
|
||||
result = true
|
||||
|
||||
@@ -134,7 +139,6 @@ func SetEdgeAppInstalled(ID string) bool {
|
||||
|
||||
buildFrameworkContainers()
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
// Is already installed.
|
||||
|
||||
Reference in New Issue
Block a user