server-ts: Port sync_options

This commit is contained in:
Elian Doran 2024-02-17 20:24:32 +02:00
parent a029ee268a
commit 1c7532df46
No known key found for this signature in database
5 changed files with 8 additions and 8 deletions

View File

@ -8,7 +8,7 @@ const sqlInit = require('../../services/sql_init');
const optionService = require('../../services/options'); const optionService = require('../../services/options');
const contentHashService = require('../../services/content_hash.js'); const contentHashService = require('../../services/content_hash.js');
const log = require('../../services/log'); const log = require('../../services/log');
const syncOptions = require('../../services/sync_options.js'); const syncOptions = require('../../services/sync_options');
const utils = require('../../services/utils'); const utils = require('../../services/utils');
const ws = require('../../services/ws'); const ws = require('../../services/ws');

View File

@ -3,7 +3,7 @@
const utils = require('./utils'); const utils = require('./utils');
const log = require('./log'); const log = require('./log');
const url = require('url'); const url = require('url');
const syncOptions = require('./sync_options.js'); const syncOptions = require('./sync_options');
// this service provides abstraction over node's HTTP/HTTPS and electron net.client APIs // this service provides abstraction over node's HTTP/HTTPS and electron net.client APIs
// this allows supporting system proxy // this allows supporting system proxy

View File

@ -2,7 +2,7 @@ const syncService = require('./sync.js');
const log = require('./log'); const log = require('./log');
const sqlInit = require('./sql_init'); const sqlInit = require('./sql_init');
const optionService = require('./options'); const optionService = require('./options');
const syncOptions = require('./sync_options.js'); const syncOptions = require('./sync_options');
const request = require('./request.js'); const request = require('./request.js');
const appInfo = require('./app_info'); const appInfo = require('./app_info');
const utils = require('./utils'); const utils = require('./utils');

View File

@ -9,7 +9,7 @@ const dateUtils = require('./date_utils');
const syncUpdateService = require('./sync_update.js'); const syncUpdateService = require('./sync_update.js');
const contentHashService = require('./content_hash.js'); const contentHashService = require('./content_hash.js');
const appInfo = require('./app_info'); const appInfo = require('./app_info');
const syncOptions = require('./sync_options.js'); const syncOptions = require('./sync_options');
const syncMutexService = require('./sync_mutex'); const syncMutexService = require('./sync_mutex');
const cls = require('./cls'); const cls = require('./cls');
const request = require('./request.js'); const request = require('./request.js');

View File

@ -1,7 +1,7 @@
"use strict"; "use strict";
const optionService = require('./options'); import optionService = require('./options');
const config = require('./config'); import config = require('./config');
/* /*
* Primary configuration for sync is in the options (document), but we allow to override * Primary configuration for sync is in the options (document), but we allow to override
@ -10,11 +10,11 @@ const config = require('./config');
* to live sync server. * to live sync server.
*/ */
function get(name) { function get(name: string) {
return (config['Sync'] && config['Sync'][name]) || optionService.getOption(name); return (config['Sync'] && config['Sync'][name]) || optionService.getOption(name);
} }
module.exports = { export = {
// env variable is the easiest way to guarantee we won't overwrite prod data during development // env variable is the easiest way to guarantee we won't overwrite prod data during development
// after copying prod document/data directory // after copying prod document/data directory
getSyncServerHost: () => process.env.TRILIUM_SYNC_SERVER_HOST || get('syncServerHost'), getSyncServerHost: () => process.env.TRILIUM_SYNC_SERVER_HOST || get('syncServerHost'),