From cdb742053b432c1873359352356b8d957a5ca482 Mon Sep 17 00:00:00 2001 From: boufni95 Date: Thu, 10 Apr 2025 17:29:08 +0000 Subject: [PATCH] up --- env.example | 1 + src/services/storage/tlv/tlvFilesStorage.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/env.example b/env.example index d35a7c0f..6a03789b 100644 --- a/env.example +++ b/env.example @@ -103,6 +103,7 @@ LSP_MAX_FEE_BPS=100 #METRICS_TOKEN= # Disable outbound payments aka honeypot mode #DISABLE_EXTERNAL_PAYMENTS=false +#ALLOW_RESET_METRICS_STORAGES=false #WATCHDOG SECURITY # A last line of defense against 0-day drainage attacks diff --git a/src/services/storage/tlv/tlvFilesStorage.ts b/src/services/storage/tlv/tlvFilesStorage.ts index 3e005e0d..56d42228 100644 --- a/src/services/storage/tlv/tlvFilesStorage.ts +++ b/src/services/storage/tlv/tlvFilesStorage.ts @@ -35,6 +35,9 @@ export class TlvFilesStorage { } Reset = () => { + if (this.storagePath === "" && this.storagePath.startsWith("/")) { + throw new Error("cannot delete root storage path") + } clearInterval(this.interval) fs.rmSync(this.storagePath, { recursive: true, force: true }) this.init()