Enforce hwi init (#2386)

* adding release_notes for v2.0.2

* add --enforcehwiinitialisation as click option

* chore: ENFORCE_HWI_INITIALISATION_AT_STARTUP via
This commit is contained in:
k9ert 2024-01-15 14:00:23 +01:00 committed by GitHub
parent 1f0bc602c7
commit 655e9153b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -57,6 +57,11 @@ def cli():
is_flag=True,
help="Start the hwi-bridge to use your HWWs with a remote specter.",
)
@click.option(
"--enforcehwiinitialisation",
is_flag=True,
help="calls enumerate() which is known to cause issues with certain usb-devices plugged in at startup.",
)
@click.option(
"--devstatus-threshold",
type=click.Choice(["alpha", "beta", "prod"], case_sensitive=False),
@ -83,6 +88,7 @@ def server(
filelog,
tor,
hwibridge,
enforcehwiinitialisation,
devstatus_threshold,
specter_data_folder,
config,
@ -148,6 +154,8 @@ def server(
kwargs = configure_ssl(kwargs, app.config, ssl)
app.app_context().push()
if enforcehwiinitialisation:
app.config["ENFORCE_HWI_INITIALISATION_AT_STARTUP"] = True
init_app(app, hwibridge=hwibridge)
if filelog:

View file

@ -83,7 +83,9 @@ class BaseConfig(object):
KEY = os.getenv("KEY", None)
# It might be necessary to enforce the HWI initialisation
ENFORCE_HWI_INITIALISATION_AT_STARTUP = False
ENFORCE_HWI_INITIALISATION_AT_STARTUP = _get_bool_env_var(
"ENFORCE_HWI_INITIALISATION_AT_STARTUP", False
)
# This will be used to search for a bitcoin.conf in order to enable the
# auth method "RPC password as pin"