mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 10:40:41 +01:00
option names now follow camelCase
This commit is contained in:
@@ -21,11 +21,11 @@ async function loginSync(req) {
|
||||
|
||||
const dbVersion = req.body.dbVersion;
|
||||
|
||||
if (dbVersion !== appInfo.db_version) {
|
||||
return [400, { message: 'Non-matching db versions, local is version ' + appInfo.db_version }];
|
||||
if (dbVersion !== appInfo.dbVersion) {
|
||||
return [400, { message: 'Non-matching db versions, local is version ' + appInfo.dbVersion }];
|
||||
}
|
||||
|
||||
const documentSecret = await options.getOption('document_secret');
|
||||
const documentSecret = await options.getOption('documentSecret');
|
||||
const expectedHash = utils.hmac(documentSecret, timestampStr);
|
||||
|
||||
const givenHash = req.body.hash;
|
||||
|
||||
@@ -6,8 +6,8 @@ const appInfo = require('../../services/app_info');
|
||||
|
||||
async function getMigrationInfo() {
|
||||
return {
|
||||
db_version: parseInt(await optionService.getOption('db_version')),
|
||||
app_db_version: appInfo.db_version
|
||||
dbVersion: parseInt(await optionService.getOption('dbVersion')),
|
||||
app_dbVersion: appInfo.dbVersion
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ const sql = require('../../services/sql');
|
||||
const optionService = require('../../services/options');
|
||||
|
||||
// options allowed to be updated directly in options dialog
|
||||
const ALLOWED_OPTIONS = ['protected_session_timeout', 'note_revision_snapshot_time_interval'];
|
||||
const ALLOWED_OPTIONS = ['protectedSessionTimeout', 'noteRevisionSnapshotTimeInterval'];
|
||||
|
||||
async function getOptions() {
|
||||
const options = await sql.getMap("SELECT name, value FROM options WHERE name IN ("
|
||||
|
||||
@@ -33,7 +33,7 @@ async function addRecentNote(req) {
|
||||
|
||||
await recentNote.save();
|
||||
|
||||
await optionService.setOption('start_note_path', notePath);
|
||||
await optionService.setOption('startNotePath', notePath);
|
||||
|
||||
return await getRecentNotes();
|
||||
}
|
||||
|
||||
@@ -11,11 +11,11 @@ async function setup(req) {
|
||||
|
||||
await optionService.setOption('username', username);
|
||||
|
||||
await optionService.setOption('password_verification_salt', utils.randomSecureToken(32));
|
||||
await optionService.setOption('password_derived_key_salt', utils.randomSecureToken(32));
|
||||
await optionService.setOption('passwordVerificationSalt', utils.randomSecureToken(32));
|
||||
await optionService.setOption('passwordDerivedKeySalt', utils.randomSecureToken(32));
|
||||
|
||||
const passwordVerificationKey = utils.toBase64(await myScryptService.getVerificationHash(password));
|
||||
await optionService.setOption('password_verification_hash', passwordVerificationKey);
|
||||
await optionService.setOption('passwordVerificationHash', passwordVerificationKey);
|
||||
|
||||
await passwordEncryptionService.setDataKey(password, utils.randomSecureToken(16));
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ async function fillSyncRows() {
|
||||
}
|
||||
|
||||
async function forceFullSync() {
|
||||
await optionService.setOption('last_synced_pull', 0);
|
||||
await optionService.setOption('last_synced_push', 0);
|
||||
await optionService.setOption('lastSyncedPull', 0);
|
||||
await optionService.setOption('lastSyncedPush', 0);
|
||||
|
||||
log.info("Forcing full sync.");
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ async function getTree() {
|
||||
});
|
||||
|
||||
return {
|
||||
start_note_path: await optionService.getOption('start_note_path'),
|
||||
startNotePath: await optionService.getOption('startNotePath'),
|
||||
branches: branches,
|
||||
notes: notes
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user