rename config option

This commit is contained in:
Eric 2021-11-28 08:59:54 -08:00
parent fe38910258
commit a6a3687d07
8 changed files with 23 additions and 22 deletions

View File

@ -222,7 +222,7 @@ def download_config(L_CONFIG_FILE, cli_file):
corrected_config['SYSTEMS'][i]['BOTH_SLOTS'] = iterate_config[i]['BOTH_SLOTS']
corrected_config['SYSTEMS'][i]['TARGET_SOCK'] = (gethostbyname(iterate_config[i]['TARGET_IP']), iterate_config[i]['TARGET_PORT'])
corrected_config['SYSTEMS'][i]['ENCRYPTION_KEY'] = bytes(iterate_config[i]['ENCRYPTION_KEY'], 'utf-8')
corrected_config['SYSTEMS'][i]['USE_ENCRYPTION'] = iterate_config[i]['USE_ENCRYPTION']
corrected_config['SYSTEMS'][i]['ENCRYPT_ALL_TRAFFIC'] = iterate_config[i]['ENCRYPT_ALL_TRAFFIC']
if iterate_config[i]['MODE'] == 'PEER' or iterate_config[i]['MODE'] == 'XLXPEER':

View File

@ -308,7 +308,7 @@ def build_config(_config_file):
'SUB_ACL': config.get(section, 'SUB_ACL'),
'TG1_ACL': config.get(section, 'TGID_ACL'),
'TG2_ACL': 'PERMIT:ALL',
'USE_ENCRYPTION': config.getboolean(section, 'USE_ENCRYPTION'),
'ENCRYPT_ALL_TRAFFIC': config.getboolean(section, 'ENCRYPT_ALL_TRAFFIC'),
'ENCRYPTION_KEY': bytes(config.get(section, 'ENCRYPTION_KEY'), 'utf-8'),
'OTHER_OPTIONS': config.get(section, 'OTHER_OPTIONS'),
}})

View File

@ -251,7 +251,7 @@ BOTH_SLOTS: True
USE_ACL: True
SUB_ACL: DENY:1
TGID_ACL: PERMIT:ALL
USE_ENCRYPTION: False
ENCRYPT_ALL_TRAFFIC: False
ENCRYPTION_KEY:
OTHER_OPTIONS:

View File

@ -366,7 +366,7 @@ def download_config(CONFIG_FILE, cli_file):
corrected_config['SYSTEMS'][i]['BOTH_SLOTS'] = iterate_config[i]['BOTH_SLOTS']
corrected_config['SYSTEMS'][i]['TARGET_SOCK'] = (gethostbyname(iterate_config[i]['TARGET_IP']), iterate_config[i]['TARGET_PORT'])
corrected_config['SYSTEMS'][i]['ENCRYPTION_KEY'] = bytes(iterate_config[i]['ENCRYPTION_KEY'], 'utf-8')
corrected_config['SYSTEMS'][i]['USE_ENCRYPTION'] = iterate_config[i]['USE_ENCRYPTION']
corrected_config['SYSTEMS'][i]['ENCRYPT_ALL_TRAFFIC'] = iterate_config[i]['ENCRYPT_ALL_TRAFFIC']
if iterate_config[i]['MODE'] == 'PEER' or iterate_config[i]['MODE'] == 'XLXPEER':
@ -1702,20 +1702,21 @@ def rule_timer_loop():
del UNIT_MAP[unit]
logger.debug('Removed unit(s) %s from UNIT_MAP', remove_list)
ping(CONFIG)
send_unit_table(CONFIG, UNIT_MAP)
send_que = send_sms_que_req(CONFIG)
print(UNIT_MAP)
try:
for i in send_que:
try:
send_sms(False, i['rcv_id'], 9, 9, 'unit', i['msg'])
except Exception as e:
logger.info('Error sending SMS in que to ' + str(i['rcv_id']) + ' - ' + i['msg'])
logger.info(e)
except Exception as e:
logger.error('Send que error')
logger.error(e)
if CONFIG['WEB_SERVICE']['REMOTE_CONFIG_ENABLED'] == True:
ping(CONFIG)
send_unit_table(CONFIG, UNIT_MAP)
send_que = send_sms_que_req(CONFIG)
print(UNIT_MAP)
try:
for i in send_que:
try:
send_sms(False, i['rcv_id'], 9, 9, 'unit', i['msg'])
except Exception as e:
logger.info('Error sending SMS in que to ' + str(i['rcv_id']) + ' - ' + i['msg'])
logger.info(e)
except Exception as e:
logger.error('Send que error')
logger.error(e)

View File

@ -338,7 +338,7 @@ def build_config(_config_file):
'SUB_ACL': config.get(section, 'SUB_ACL'),
'TG1_ACL': config.get(section, 'TGID_ACL'),
'TG2_ACL': 'PERMIT:ALL',
'USE_ENCRYPTION': config.getboolean(section, 'USE_ENCRYPTION'),
'ENCRYPT_ALL_TRAFFIC': config.getboolean(section, 'ENCRYPT_ALL_TRAFFIC'),
'ENCRYPTION_KEY': bytes(config.get(section, 'ENCRYPTION_KEY'), 'utf-8'),
'OTHER_OPTIONS': config.get(section, 'OTHER_OPTIONS'),
}})

View File

@ -162,7 +162,7 @@ SUB_ACL: DENY:1
TGID_ACL: PERMIT:ALL
# Experimental encryption
ENCRYPTION_KEY:
USE_ENCRYPTION: False
ENCRYPT_ALL_TRAFFIC: False
# MASTER INSTANCES - DUPLICATE SECTION FOR MULTIPLE MASTERS
# HomeBrew Protocol Master instances go here.

View File

@ -169,7 +169,7 @@ class OPENBRIDGE(DatagramProtocol):
_packet = b''.join([_packet[:11], self._config['NETWORK_ID'], _packet[15:]])
#_packet += hmac_new(self._config['PASSPHRASE'],_packet,sha1).digest()
_packet = b''.join([_packet, (hmac_new(self._config['PASSPHRASE'],_packet,sha1).digest())])
if self._config['USE_ENCRYPTION'] == True or _packet[:4] == EOBP:
if self._config['ENCRYPT_ALL_TRAFFIC'] == True or _packet[:4] == EOBP:
_enc_pkt = encrypt_packet(self._config['ENCRYPTION_KEY'], _packet)
_packet = b'EOBP' + _enc_pkt
self.transport.write(_packet, (self._config['TARGET_IP'], self._config['TARGET_PORT']))

View File

@ -3848,7 +3848,7 @@ Name: <strong>''' + p.name + '''</strong>&nbsp; -&nbsp; Port: <strong>''' + str(
'SUB_ACL': obp.sub_acl,
'TG1_ACL': obp.tg_acl,
'TG2_ACL': 'PERMIT:ALL',
'USE_ENCRYPTION': obp.obp_encryption,
'ENCRYPT_ALL_TRAFFIC': obp.obp_encryption,
'ENCRYPTION_KEY': obp.encryption_key,
'OTHER_OPTIONS': obp.other_options
}})