From afc129ee5b7e6f6042e4a18bd369e85434097a0f Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 19 Aug 2024 12:52:10 -0400 Subject: [PATCH] chore(connector): disable connector flag and WS server by default (#16146) Fixes #16101 --- src/app/global/feature_flags.nim | 4 ++-- src/env_cli_vars.nim | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/global/feature_flags.nim b/src/app/global/feature_flags.nim index 54f2005216..6128ffd48d 100644 --- a/src/app/global/feature_flags.nim +++ b/src/app/global/feature_flags.nim @@ -3,9 +3,9 @@ import os const DEFAULT_FLAG_DAPPS_ENABLED = false const DEFAULT_FLAG_SWAP_ENABLED = true -const DEFAULT_FLAG_CONNECTOR_ENABLED = true +const DEFAULT_FLAG_CONNECTOR_ENABLED* = false -proc boolToEnv(defaultValue: bool): string = +proc boolToEnv*(defaultValue: bool): string = return if defaultValue: "1" else: "0" QtObject: diff --git a/src/env_cli_vars.nim b/src/env_cli_vars.nim index ebdbeff883..75d7fb84a0 100644 --- a/src/env_cli_vars.nim +++ b/src/env_cli_vars.nim @@ -1,5 +1,7 @@ import os, sequtils, strutils, stew/shims/strformat, chronicles +import app/global/feature_flags + import # vendor libs confutils @@ -261,12 +263,12 @@ type StatusDesktopConfig = object name: "USE_MOCKED_KEYCARD" abbr: "use-mocked-keycard" .}: bool httpApiEnabled* {. - defaultValue: true + defaultValue: getEnv("FLAG_CONNECTOR_ENABLED", boolToEnv(DEFAULT_FLAG_CONNECTOR_ENABLED)) != "0" desc: "Enable HTTP RPC API" name: "HTTP_API" abbr: "http-api" .}: bool wsApiEnabled* {. - defaultValue: true + defaultValue: getEnv("FLAG_CONNECTOR_ENABLED", boolToEnv(DEFAULT_FLAG_CONNECTOR_ENABLED)) != "0" desc: "Enable WebSocket RPC API" name: "WS_API" abbr: "ws-api" .}: bool