mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 03:00:41 +01:00
server-ts: Port services/anonymize
This commit is contained in:
24
src/anonymize.ts
Normal file
24
src/anonymize.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import anonymizationService = require('./services/anonymization');
|
||||
import sqlInit = require('./services/sql_init');
|
||||
require('./becca/entity_constructor');
|
||||
|
||||
sqlInit.dbReady.then(async () => {
|
||||
try {
|
||||
console.log("Starting anonymization...");
|
||||
|
||||
const resp = await anonymizationService.createAnonymizedCopy('full');
|
||||
|
||||
if (resp.success) {
|
||||
console.log(`Anonymized file has been saved to: ${resp.anonymizedFilePath}`);
|
||||
|
||||
process.exit(0);
|
||||
} else {
|
||||
console.log("Anonymization failed.");
|
||||
}
|
||||
}
|
||||
catch (e: any) {
|
||||
console.error(e.message, e.stack);
|
||||
}
|
||||
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user