diff --git a/.env.example b/.env.example index c1adb3003e..abe89b0fae 100644 --- a/.env.example +++ b/.env.example @@ -445,6 +445,7 @@ SQUID_API_THROTTLE_INTERVAL=1000 # Default: 1000; Used to throttle API calls to # Defaults to OFF if not specified TEE_MODE=OFF # LOCAL | DOCKER | PRODUCTION WALLET_SECRET_SALT= # ONLY define if you want to use TEE Plugin, otherwise it will throw errors +TEE_LOG_DB_PATH= # Custom path for TEE Log database, default: ./data/tee_log.sqlite # TEE Verifiable Log Configuration VLOG= # true/false; if you want to use TEE Verifiable Log, set this to "true" diff --git a/packages/plugin-tee-log/src/services/teeLogService.ts b/packages/plugin-tee-log/src/services/teeLogService.ts index fd804d552b..eb1a730c65 100644 --- a/packages/plugin-tee-log/src/services/teeLogService.ts +++ b/packages/plugin-tee-log/src/services/teeLogService.ts @@ -7,7 +7,7 @@ import Database from "better-sqlite3"; import path from "path"; export class TeeLogService extends Service implements ITeeLogService { - private readonly dbPath = path.resolve("agent/data/tee_log.sqlite"); + private dbPath: string; private initialized = false; private enableTeeLog = false; @@ -62,6 +62,9 @@ export class TeeLogService extends Service implements ITeeLogService { throw new Error("Invalid TEE configuration."); } + const dbPathSetting = runtime.getSetting("TEE_LOG_DB_PATH"); + this.dbPath = dbPathSetting || path.resolve("data/tee_log.sqlite"); + const db = new Database(this.dbPath); this.teeLogDAO = new SqliteTeeLogDAO(db); await this.teeLogDAO.initialize();