2017-10-24 11:38:52 +08:00
|
|
|
"use strict";
|
|
|
|
|
2017-10-24 11:30:23 +08:00
|
|
|
const os = require('os');
|
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
const TRILIUM_DATA_DIR = process.env.TRILIUM_DATA_DIR || os.homedir() + "/trilium-data";
|
|
|
|
|
|
|
|
if (!fs.existsSync(TRILIUM_DATA_DIR)) {
|
|
|
|
fs.mkdirSync(TRILIUM_DATA_DIR, 0o700);
|
|
|
|
}
|
|
|
|
|
|
|
|
const DOCUMENT_PATH = TRILIUM_DATA_DIR + "/document.db";
|
|
|
|
const BACKUP_DIR = TRILIUM_DATA_DIR + "/backup";
|
2017-10-25 10:04:52 +08:00
|
|
|
const LOG_DIR = TRILIUM_DATA_DIR + "/log";
|
2017-12-03 10:48:22 +08:00
|
|
|
const EXPORT_DIR = TRILIUM_DATA_DIR + "/export";
|
2017-12-16 13:05:37 +08:00
|
|
|
const ANONYMIZED_DB_DIR = TRILIUM_DATA_DIR + "/anonymized-db";
|
2017-10-24 11:30:23 +08:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
TRILIUM_DATA_DIR,
|
|
|
|
DOCUMENT_PATH,
|
2017-10-25 10:04:52 +08:00
|
|
|
BACKUP_DIR,
|
2017-12-03 10:48:22 +08:00
|
|
|
LOG_DIR,
|
2017-12-16 13:05:37 +08:00
|
|
|
EXPORT_DIR,
|
|
|
|
ANONYMIZED_DB_DIR
|
2017-10-24 11:30:23 +08:00
|
|
|
};
|