Format utility

This commit is contained in:
vorotamoroz
2024-11-12 01:09:07 +00:00
parent 574fdf9202
commit ed5cb3e043

View File

@@ -140,33 +140,32 @@ const uri_passphrase = `${Deno.env.get("uri_passphrase") ?? friendlyString()}`;
const URIBASE = "obsidian://setuplivesync?settings="; const URIBASE = "obsidian://setuplivesync?settings=";
async function main() { async function main() {
// We need re-format this
const conf = { const conf = {
"couchDB_URI": `${Deno.env.get("hostname")}`, couchDB_URI: `${Deno.env.get("hostname")}`,
"couchDB_USER": `${Deno.env.get("username")}`, couchDB_USER: `${Deno.env.get("username")}`,
"couchDB_PASSWORD": `${Deno.env.get("password")}`, couchDB_PASSWORD: `${Deno.env.get("password")}`,
"couchDB_DBNAME": `${Deno.env.get("database")}`, couchDB_DBNAME: `${Deno.env.get("database")}`,
"syncOnStart": true, syncOnStart: true,
"gcDelay": 0, gcDelay: 0,
"periodicReplication": true, periodicReplication: true,
"syncOnFileOpen": true, syncOnFileOpen: true,
"encrypt": true, encrypt: true,
"passphrase": `${Deno.env.get("passphrase")}`, passphrase: `${Deno.env.get("passphrase")}`,
"usePathObfuscation": true, usePathObfuscation: true,
"batchSave": true, batchSave: true,
"batch_size": 50, batch_size: 50,
"batches_limit": 50, batches_limit: 50,
"useHistory": true, useHistory: true,
"disableRequestURI": true, disableRequestURI: true,
"customChunkSize": 50, customChunkSize: 50,
"syncAfterMerge": false, syncAfterMerge: false,
"concurrencyOfReadChunksOnline": 100, concurrencyOfReadChunksOnline: 100,
"minimumIntervalOfReadChunksOnline": 100, minimumIntervalOfReadChunksOnline: 100,
"handleFilenameCaseSensitive": false, handleFilenameCaseSensitive: false,
"doNotUseFixedRevisionForChunks": false, doNotUseFixedRevisionForChunks: false,
"settingVersion": 10, settingVersion: 10,
"notifyThresholdOfRemoteStorageSize": 800 notifyThresholdOfRemoteStorageSize: 800,
} };
const encryptedConf = encodeURIComponent(await encrypt(JSON.stringify(conf), uri_passphrase, false)); const encryptedConf = encodeURIComponent(await encrypt(JSON.stringify(conf), uri_passphrase, false));
const theURI = `${URIBASE}${encryptedConf}`; const theURI = `${URIBASE}${encryptedConf}`;
console.log("\nYour passphrase of Setup-URI is: ", uri_passphrase); console.log("\nYour passphrase of Setup-URI is: ", uri_passphrase);