configurable sessions dir, exclude jsonl-sync from build, simplify db path
This commit is contained in:
1 parent
2e5e06db93
commit
807ecac7b9
3 files changed
+5
-2
No files matched your search
+1
-1
@@ -8,7 +8,7 @@ builder.Configuration.AddJsonFile("appsettings.user.json", optional: true, reloa
|
|||||||
var dbPath = builder.Configuration["DbPath"]!;
|
var dbPath = builder.Configuration["DbPath"]!;
|
||||||
|
|
||||||
builder.Services.AddSingleton<Func<SqliteConnection>>(() =>
|
builder.Services.AddSingleton<Func<SqliteConnection>>(() =>
|
||||||
new SqliteConnection($"Data Source={Path.GetFullPath(dbPath)}"));
|
new SqliteConnection($"Data Source={dbPath}"));
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import { fileURLToPath } from 'node:url';
|
|||||||
import Database from 'better-sqlite3';
|
import Database from 'better-sqlite3';
|
||||||
|
|
||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||||
const SESSIONS_DIR = '/home/node/.openclaw/agents/main/sessions';
|
import os from 'node:os';
|
||||||
|
const SESSIONS_DIR = process.env.SESSIONS_DIR || path.join(os.homedir(), '.openclaw/agents/main/sessions');
|
||||||
const DB_FILE = path.join(__dirname, 'sessions.db');
|
const DB_FILE = path.join(__dirname, 'sessions.db');
|
||||||
|
|
||||||
const db = new Database(DB_FILE);
|
const db = new Database(DB_FILE);
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Remove="publish/**" />
|
<Content Remove="publish/**" />
|
||||||
<None Remove="publish/**" />
|
<None Remove="publish/**" />
|
||||||
|
<Content Remove="jsonl-sync/**" />
|
||||||
|
<None Remove="jsonl-sync/**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in new issue
Block a user