mirror of
				https://git.coolaj86.com/coolaj86/telebit-relay.js.git
				synced 2025-11-04 02:12:46 +00:00 
			
		
		
		
	defaults for secret and greenlock
This commit is contained in:
		
							parent
							
								
									4b38c27a71
								
							
						
					
					
						commit
						ce70c75378
					
				@ -46,7 +46,7 @@ function applyConfig(config) {
 | 
			
		||||
  state.config = config;
 | 
			
		||||
  state.servernames = config.servernames || [];
 | 
			
		||||
  state.secret = state.config.secret;
 | 
			
		||||
  if (state.secret) {
 | 
			
		||||
  if (!state.secret) {
 | 
			
		||||
    state.secret = require('crypto').randomBytes(16).toString('hex');
 | 
			
		||||
    console.info("");
 | 
			
		||||
    console.info("Secret for this session:");
 | 
			
		||||
@ -55,6 +55,12 @@ function applyConfig(config) {
 | 
			
		||||
    console.info("");
 | 
			
		||||
    console.info("");
 | 
			
		||||
  }
 | 
			
		||||
  if (!state.config.greenlock) {
 | 
			
		||||
    state.config.greenlock = {};
 | 
			
		||||
  }
 | 
			
		||||
  if (!state.config.greenlock.configDir) {
 | 
			
		||||
    state.config.greenlock.configDir = require('os').homedir() + require('path').sep + 'acme';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  function approveDomains(opts, certs, cb) {
 | 
			
		||||
    console.log('[debug] approveDomains', opts.domains);
 | 
			
		||||
@ -122,7 +128,7 @@ function applyConfig(config) {
 | 
			
		||||
 | 
			
		||||
  , approveDomains: approveDomains
 | 
			
		||||
 | 
			
		||||
  , configDir: '/root/acme'
 | 
			
		||||
  , configDir: state.config.configDir
 | 
			
		||||
  , debug: true
 | 
			
		||||
 | 
			
		||||
  //, approvedDomains: program.servernames
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user