Skip to content

Commit 14a407c

Browse files
batudowtfsayo
andauthored
chore: allow custom TEE log path (#2616)
* Fix TEE log db path * Enable custom TEE log path --------- Co-authored-by: Sayo <hi@sayo.wtf>
1 parent 30b22ab commit 14a407c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ SQUID_API_THROTTLE_INTERVAL=1000 # Default: 1000; Used to throttle API calls to
445445
# Defaults to OFF if not specified
446446
TEE_MODE=OFF # LOCAL | DOCKER | PRODUCTION
447447
WALLET_SECRET_SALT= # ONLY define if you want to use TEE Plugin, otherwise it will throw errors
448+
TEE_LOG_DB_PATH= # Custom path for TEE Log database, default: ./data/tee_log.sqlite
448449

449450
# TEE Verifiable Log Configuration
450451
VLOG= # true/false; if you want to use TEE Verifiable Log, set this to "true"

packages/plugin-tee-log/src/services/teeLogService.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Database from "better-sqlite3";
77
import path from "path";
88

99
export class TeeLogService extends Service implements ITeeLogService {
10-
private readonly dbPath = path.resolve("agent/data/tee_log.sqlite");
10+
private dbPath: string;
1111

1212
private initialized = false;
1313
private enableTeeLog = false;
@@ -62,6 +62,9 @@ export class TeeLogService extends Service implements ITeeLogService {
6262
throw new Error("Invalid TEE configuration.");
6363
}
6464

65+
const dbPathSetting = runtime.getSetting("TEE_LOG_DB_PATH");
66+
this.dbPath = dbPathSetting || path.resolve("data/tee_log.sqlite");
67+
6568
const db = new Database(this.dbPath);
6669
this.teeLogDAO = new SqliteTeeLogDAO(db);
6770
await this.teeLogDAO.initialize();

0 commit comments

Comments
 (0)