chore: improve check for supported node js version
This commit is contained in:
		
							parent
							
								
									0baf8155bf
								
							
						
					
					
						commit
						0ccb1b26cc
					
				@ -3,8 +3,8 @@
 | 
			
		||||
	"description": "radius server for google LDAP and TTLS",
 | 
			
		||||
	"version": "0.0.1",
 | 
			
		||||
	"scripts": {
 | 
			
		||||
		"debug": "DEBUG=radius:* ../node/node dist/app.js",
 | 
			
		||||
		"start": "../node/node dist/app.js",
 | 
			
		||||
		"debug": "DEBUG=radius:* node dist/app.js",
 | 
			
		||||
		"start": "node dist/app.js",
 | 
			
		||||
		"build": "tsc",
 | 
			
		||||
		"dev": "ts-node src/app.ts",
 | 
			
		||||
		"test": "mocha -r ts-node/register __tests__/**/*.test.ts",
 | 
			
		||||
 | 
			
		||||
@ -4,11 +4,20 @@ import { RadiusService } from './radius/RadiusService';
 | 
			
		||||
import * as config from '../config';
 | 
			
		||||
import { Authentication } from './auth';
 | 
			
		||||
import { IAuthentication } from './types/Authentication';
 | 
			
		||||
import { startTLSServer } from './tls/crypt';
 | 
			
		||||
 | 
			
		||||
console.log(`Listener Port: ${config.port || 1812}`);
 | 
			
		||||
console.log(`RADIUS Secret: ${config.secret}`);
 | 
			
		||||
console.log(`Auth Mode: ${config.authentication}`);
 | 
			
		||||
 | 
			
		||||
/* test node version */
 | 
			
		||||
const testSocket = startTLSServer();
 | 
			
		||||
if (typeof (testSocket.tls as any).exportKeyingMaterial !== 'function') {
 | 
			
		||||
	console.error('UNSUPPORTED NODE VERSION FOUND!!')
 | 
			
		||||
	console.log('run "sudo npx n nightly" to get nightly build of node js.');
 | 
			
		||||
	process.exit(-1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
(async () => {
 | 
			
		||||
	/* configure auth mechansim */
 | 
			
		||||
	let auth: IAuthentication;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user