mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	server-ts: Port sync_options
This commit is contained in:
		
							parent
							
								
									a029ee268a
								
							
						
					
					
						commit
						1c7532df46
					
				@ -8,7 +8,7 @@ const sqlInit = require('../../services/sql_init');
 | 
			
		||||
const optionService = require('../../services/options');
 | 
			
		||||
const contentHashService = require('../../services/content_hash.js');
 | 
			
		||||
const log = require('../../services/log');
 | 
			
		||||
const syncOptions = require('../../services/sync_options.js');
 | 
			
		||||
const syncOptions = require('../../services/sync_options');
 | 
			
		||||
const utils = require('../../services/utils');
 | 
			
		||||
const ws = require('../../services/ws');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -3,7 +3,7 @@
 | 
			
		||||
const utils = require('./utils');
 | 
			
		||||
const log = require('./log');
 | 
			
		||||
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 allows supporting system proxy
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,7 @@ const syncService = require('./sync.js');
 | 
			
		||||
const log = require('./log');
 | 
			
		||||
const sqlInit = require('./sql_init');
 | 
			
		||||
const optionService = require('./options');
 | 
			
		||||
const syncOptions = require('./sync_options.js');
 | 
			
		||||
const syncOptions = require('./sync_options');
 | 
			
		||||
const request = require('./request.js');
 | 
			
		||||
const appInfo = require('./app_info');
 | 
			
		||||
const utils = require('./utils');
 | 
			
		||||
 | 
			
		||||
@ -9,7 +9,7 @@ const dateUtils = require('./date_utils');
 | 
			
		||||
const syncUpdateService = require('./sync_update.js');
 | 
			
		||||
const contentHashService = require('./content_hash.js');
 | 
			
		||||
const appInfo = require('./app_info');
 | 
			
		||||
const syncOptions = require('./sync_options.js');
 | 
			
		||||
const syncOptions = require('./sync_options');
 | 
			
		||||
const syncMutexService = require('./sync_mutex');
 | 
			
		||||
const cls = require('./cls');
 | 
			
		||||
const request = require('./request.js');
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,7 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
const optionService = require('./options');
 | 
			
		||||
const config = require('./config');
 | 
			
		||||
import optionService = require('./options');
 | 
			
		||||
import config = require('./config');
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * 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.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
function get(name) {
 | 
			
		||||
function get(name: string) {
 | 
			
		||||
    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
 | 
			
		||||
    // after copying prod document/data directory
 | 
			
		||||
    getSyncServerHost: () => process.env.TRILIUM_SYNC_SERVER_HOST || get('syncServerHost'),
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user