|
@ -154,7 +154,7 @@ def get_config(is_local): |
|
|
print_help(is_local) |
|
|
print_help(is_local) |
|
|
sys.exit(2) |
|
|
sys.exit(2) |
|
|
|
|
|
|
|
|
config['password'] = config.get('password', None) |
|
|
config['password'] = config.get('password', '') |
|
|
config['method'] = config.get('method', 'aes-256-cfb') |
|
|
config['method'] = config.get('method', 'aes-256-cfb') |
|
|
config['port_password'] = config.get('port_password', None) |
|
|
config['port_password'] = config.get('port_password', None) |
|
|
config['timeout'] = int(config.get('timeout', 300)) |
|
|
config['timeout'] = int(config.get('timeout', 300)) |
|
@ -172,11 +172,23 @@ def get_config(is_local): |
|
|
config['server'] = config.get('server', '0.0.0.0') |
|
|
config['server'] = config.get('server', '0.0.0.0') |
|
|
config['server_port'] = config.get('server_port', 8388) |
|
|
config['server_port'] = config.get('server_port', 8388) |
|
|
|
|
|
|
|
|
if not ('password' in config and config['password']): |
|
|
if is_local and not config.get('password', None): |
|
|
logging.error('password not specified') |
|
|
logging.error('password not specified') |
|
|
print_help(is_local) |
|
|
print_help(is_local) |
|
|
sys.exit(2) |
|
|
sys.exit(2) |
|
|
|
|
|
|
|
|
|
|
|
if not is_local and not config.get('password', None) \ |
|
|
|
|
|
and not config.get('port_password', None): |
|
|
|
|
|
logging.error('password or port_password not specified') |
|
|
|
|
|
print_help(is_local) |
|
|
|
|
|
sys.exit(2) |
|
|
|
|
|
|
|
|
|
|
|
if 'local_port' in config: |
|
|
|
|
|
config['local_port'] = int(config['local_port']) |
|
|
|
|
|
|
|
|
|
|
|
if 'server_port' in config: |
|
|
|
|
|
config['server_port'] = int(config['server_port']) |
|
|
|
|
|
|
|
|
logging.getLogger('').handlers = [] |
|
|
logging.getLogger('').handlers = [] |
|
|
logging.addLevelName(VERBOSE_LEVEL, 'VERBOSE') |
|
|
logging.addLevelName(VERBOSE_LEVEL, 'VERBOSE') |
|
|
if config['verbose'] >= 2: |
|
|
if config['verbose'] >= 2: |
|
|