Skip to content

Commit

Permalink
set ota_version in env
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan6sha committed Jul 26, 2023
1 parent 871e993 commit f36a17d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions wap/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var (
FORCE_ACCESSPOINT string
COUNTRY string
BLOX_COMMAND string
OTA_VERSION string
)

func getEnv(key, fallback string) string {
Expand Down Expand Up @@ -58,4 +59,5 @@ func init() {
COUNTRY = getEnv("COUNTRY", "GB")
PROJECT_ROOT = getEnv("PROJECT_ROOT", "../..")
BLOX_COMMAND = getEnv("BLOX_COMMAND", "/app --authorizer %s --identity %s --initOnly --config /internal/config.yaml --storeDir /uniondrive")
OTA_VERSION = getEnv("OTA_VERSION", "3")
}
8 changes: 6 additions & 2 deletions wap/pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io"
"net"
"net/http"
"strconv"
"time"

"github.com/functionland/go-fula/blockchain"
Expand Down Expand Up @@ -87,8 +88,11 @@ func propertiesHandler(w http.ResponseWriter, r *http.Request) {
response["containerInfo_fula"] = fulaContainerInfo
response["containerInfo_fxsupport"] = fxsupportContainerInfo
response["containerInfo_node"] = nodeContainerInfo
response["ota_version"] = 3
response["ota_type"] = "rk"
ota_ver, err := strconv.Atoi(config.OTA_VERSION)
if err != nil {
ota_ver = 3
}
response["ota_version"] = ota_ver

w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
Expand Down

0 comments on commit f36a17d

Please sign in to comment.