From e0a51ba0c3827f589694b168762a2236319ad7d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matja=C5=BE=20Lipu=C5=A1?= Date: Fri, 18 Jul 2025 16:42:59 +0200 Subject: [PATCH] chore: rename LOG_EVENTS env variable (#1509) * renamed config * updated configs * chore: renamed to SEND_EVENTS_TO_ALBY --- .env.example | 2 +- alby/alby_oauth_service.go | 3 +-- config/models.go | 2 +- docker-compose.yml | 1 - render.yaml | 2 -- scripts/linux-aarch64/install.sh | 2 +- scripts/linux-x86_64/install.sh | 2 +- scripts/linux-x86_64/phoenixd/docker-compose.yml | 1 - scripts/linux-x86_64/phoenixd/install.sh | 2 +- scripts/linux-x86_64/phoenixd/render.yaml | 2 -- scripts/pi-aarch64/install.sh | 1 - scripts/pi-arm/install.sh | 1 - 12 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.env.example b/.env.example index ca0bcf53..d317542c 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ # only enable event logging in production -LOG_EVENTS=false +SEND_EVENTS_TO_ALBY=false # do not link your current account when you run a dev instance (so it stays pointing at your mainnet one) AUTO_LINK_ALBY_ACCOUNT=false diff --git a/alby/alby_oauth_service.go b/alby/alby_oauth_service.go index 343f7d0d..5fab0f5d 100644 --- a/alby/alby_oauth_service.go +++ b/alby/alby_oauth_service.go @@ -806,8 +806,7 @@ func (svc *albyOAuthService) ConsumeEvent(ctx context.Context, event *events.Eve return } - // TODO: rename this config option to be specific to the alby API - if !svc.cfg.GetEnv().LogEvents { + if !svc.cfg.GetEnv().SendEventsToAlby { logger.Logger.WithField("event", event).Debug("Skipped sending to alby events API (alby event logging disabled)") return } diff --git a/config/models.go b/config/models.go index 51791dfb..0a0356dc 100644 --- a/config/models.go +++ b/config/models.go @@ -46,7 +46,7 @@ type AppConfig struct { AlbyClientSecret string `envconfig:"ALBY_OAUTH_CLIENT_SECRET" default:"rABK2n16IWjLTZ9M1uKU"` BaseUrl string `envconfig:"BASE_URL"` FrontendUrl string `envconfig:"FRONTEND_URL"` - LogEvents bool `envconfig:"LOG_EVENTS" default:"true"` + SendEventsToAlby bool `envconfig:"SEND_EVENTS_TO_ALBY" default:"true"` AutoLinkAlbyAccount bool `envconfig:"AUTO_LINK_ALBY_ACCOUNT" default:"true"` PhoenixdAddress string `envconfig:"PHOENIXD_ADDRESS"` PhoenixdAuthorization string `envconfig:"PHOENIXD_AUTHORIZATION"` diff --git a/docker-compose.yml b/docker-compose.yml index 5eb1d03d..7a7ee00e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,4 +10,3 @@ services: - "8080:8080" environment: - WORK_DIR=/data/albyhub - - LOG_EVENTS=true diff --git a/render.yaml b/render.yaml index 9c91be4d..1ddd0b8c 100644 --- a/render.yaml +++ b/render.yaml @@ -15,7 +15,5 @@ services: envVars: - key: WORK_DIR value: /data/albyhub - - key: LOG_EVENTS - value: true - key: LDK_ESPLORA_SERVER value: "https://electrs.getalbypro.com" diff --git a/scripts/linux-aarch64/install.sh b/scripts/linux-aarch64/install.sh index 926f1d3d..43147f07 100644 --- a/scripts/linux-aarch64/install.sh +++ b/scripts/linux-aarch64/install.sh @@ -51,7 +51,7 @@ tee $INSTALL_DIR/start.sh > /dev/null << EOF #!/bin/bash echo "Starting Alby Hub" -WORK_DIR="$INSTALL_DIR/data" LOG_EVENTS=true LDK_GOSSIP_SOURCE="" $INSTALL_DIR/bin/albyhub +WORK_DIR="$INSTALL_DIR/data" LDK_GOSSIP_SOURCE="" $INSTALL_DIR/bin/albyhub EOF chmod +x $INSTALL_DIR/start.sh diff --git a/scripts/linux-x86_64/install.sh b/scripts/linux-x86_64/install.sh index 2d40823e..23deace3 100644 --- a/scripts/linux-x86_64/install.sh +++ b/scripts/linux-x86_64/install.sh @@ -51,7 +51,7 @@ tee $INSTALL_DIR/start.sh > /dev/null << EOF #!/bin/bash echo "Starting Alby Hub" -WORK_DIR="$INSTALL_DIR/data" LOG_EVENTS=true LDK_GOSSIP_SOURCE="" $INSTALL_DIR/bin/albyhub +WORK_DIR="$INSTALL_DIR/data" LDK_GOSSIP_SOURCE="" $INSTALL_DIR/bin/albyhub EOF chmod +x $INSTALL_DIR/start.sh diff --git a/scripts/linux-x86_64/phoenixd/docker-compose.yml b/scripts/linux-x86_64/phoenixd/docker-compose.yml index 9f7b5ef0..629ab02b 100644 --- a/scripts/linux-x86_64/phoenixd/docker-compose.yml +++ b/scripts/linux-x86_64/phoenixd/docker-compose.yml @@ -14,7 +14,6 @@ services: - PHOENIXD_ADDRESS=http://albyhub-phoenixd:9740 - WORK_DIR=/data/albyhub - LN_BACKEND_TYPE=PHOENIX - - LOG_EVENTS=true albyhub-phoenixd: platform: linux/amd64 diff --git a/scripts/linux-x86_64/phoenixd/install.sh b/scripts/linux-x86_64/phoenixd/install.sh index 00615f1d..cb0024c0 100644 --- a/scripts/linux-x86_64/phoenixd/install.sh +++ b/scripts/linux-x86_64/phoenixd/install.sh @@ -51,7 +51,7 @@ tee $INSTALL_DIR/albyhub/start.sh > /dev/null << EOF echo "Starting Alby Hub" phoenix_config_file=$INSTALL_DIR/phoenixd/data/phoenix.conf PHOENIXD_AUTHORIZATION=\$(awk -F'=' '/^http-password/{print \$2}' "\$phoenix_config_file") -WORK_DIR="$INSTALL_DIR/albyhub/data" LN_BACKEND_TYPE=PHOENIX PHOENIXD_ADDRESS="http://localhost:9740" PHOENIXD_AUTHORIZATION=\$PHOENIXD_AUTHORIZATION LOG_EVENTS=true LDK_GOSSIP_SOURCE="" $INSTALL_DIR/albyhub/bin/albyhub +WORK_DIR="$INSTALL_DIR/albyhub/data" LN_BACKEND_TYPE=PHOENIX PHOENIXD_ADDRESS="http://localhost:9740" PHOENIXD_AUTHORIZATION=\$PHOENIXD_AUTHORIZATION LDK_GOSSIP_SOURCE="" $INSTALL_DIR/albyhub/bin/albyhub EOF tee $INSTALL_DIR/start.sh > /dev/null << EOF diff --git a/scripts/linux-x86_64/phoenixd/render.yaml b/scripts/linux-x86_64/phoenixd/render.yaml index 1b8f4c7c..8840f73c 100644 --- a/scripts/linux-x86_64/phoenixd/render.yaml +++ b/scripts/linux-x86_64/phoenixd/render.yaml @@ -15,8 +15,6 @@ services: envVars: - key: WORK_DIR value: /data/albyhub - - key: LOG_EVENTS - value: true - key: LN_BACKEND_TYPE value: PHOENIX - key: PHOENIXD_AUTHORIZATION diff --git a/scripts/pi-aarch64/install.sh b/scripts/pi-aarch64/install.sh index 3401b6f4..cae3a194 100644 --- a/scripts/pi-aarch64/install.sh +++ b/scripts/pi-aarch64/install.sh @@ -71,7 +71,6 @@ CPUQuota=90% Environment="PORT=$PORT" Environment="WORK_DIR=/opt/albyhub/data" Environment="LDK_ESPLORA_SERVER=https://electrs.getalbypro.com" -Environment="LOG_EVENTS=true" Environment="LDK_GOSSIP_SOURCE=" [Install] diff --git a/scripts/pi-arm/install.sh b/scripts/pi-arm/install.sh index 33f9e21d..135f8eac 100644 --- a/scripts/pi-arm/install.sh +++ b/scripts/pi-arm/install.sh @@ -70,7 +70,6 @@ CPUQuota=90% Environment="PORT=$PORT" Environment="WORK_DIR=/opt/albyhub/data" Environment="LDK_ESPLORA_SERVER=https://electrs.getalbypro.com" -Environment="LOG_EVENTS=true" Environment="LDK_GOSSIP_SOURCE=" [Install]