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]['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]['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]['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': 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'), 'SUB_ACL': config.get(section, 'SUB_ACL'),
'TG1_ACL': config.get(section, 'TGID_ACL'), 'TG1_ACL': config.get(section, 'TGID_ACL'),
'TG2_ACL': 'PERMIT:ALL', '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'), 'ENCRYPTION_KEY': bytes(config.get(section, 'ENCRYPTION_KEY'), 'utf-8'),
'OTHER_OPTIONS': config.get(section, 'OTHER_OPTIONS'), 'OTHER_OPTIONS': config.get(section, 'OTHER_OPTIONS'),
}}) }})

View File

@ -251,7 +251,7 @@ BOTH_SLOTS: True
USE_ACL: True USE_ACL: True
SUB_ACL: DENY:1 SUB_ACL: DENY:1
TGID_ACL: PERMIT:ALL TGID_ACL: PERMIT:ALL
USE_ENCRYPTION: False ENCRYPT_ALL_TRAFFIC: False
ENCRYPTION_KEY: ENCRYPTION_KEY:
OTHER_OPTIONS: 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]['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]['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]['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': if iterate_config[i]['MODE'] == 'PEER' or iterate_config[i]['MODE'] == 'XLXPEER':
@ -1702,20 +1702,21 @@ def rule_timer_loop():
del UNIT_MAP[unit] del UNIT_MAP[unit]
logger.debug('Removed unit(s) %s from UNIT_MAP', remove_list) logger.debug('Removed unit(s) %s from UNIT_MAP', remove_list)
ping(CONFIG) if CONFIG['WEB_SERVICE']['REMOTE_CONFIG_ENABLED'] == True:
send_unit_table(CONFIG, UNIT_MAP) ping(CONFIG)
send_que = send_sms_que_req(CONFIG) send_unit_table(CONFIG, UNIT_MAP)
print(UNIT_MAP) send_que = send_sms_que_req(CONFIG)
try: print(UNIT_MAP)
for i in send_que: try:
try: for i in send_que:
send_sms(False, i['rcv_id'], 9, 9, 'unit', i['msg']) try:
except Exception as e: send_sms(False, i['rcv_id'], 9, 9, 'unit', i['msg'])
logger.info('Error sending SMS in que to ' + str(i['rcv_id']) + ' - ' + i['msg']) except Exception as e:
logger.info(e) logger.info('Error sending SMS in que to ' + str(i['rcv_id']) + ' - ' + i['msg'])
except Exception as e: logger.info(e)
logger.error('Send que error') except Exception as e:
logger.error(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'), 'SUB_ACL': config.get(section, 'SUB_ACL'),
'TG1_ACL': config.get(section, 'TGID_ACL'), 'TG1_ACL': config.get(section, 'TGID_ACL'),
'TG2_ACL': 'PERMIT:ALL', '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'), 'ENCRYPTION_KEY': bytes(config.get(section, 'ENCRYPTION_KEY'), 'utf-8'),
'OTHER_OPTIONS': config.get(section, 'OTHER_OPTIONS'), 'OTHER_OPTIONS': config.get(section, 'OTHER_OPTIONS'),
}}) }})

View File

@ -162,7 +162,7 @@ SUB_ACL: DENY:1
TGID_ACL: PERMIT:ALL TGID_ACL: PERMIT:ALL
# Experimental encryption # Experimental encryption
ENCRYPTION_KEY: ENCRYPTION_KEY:
USE_ENCRYPTION: False ENCRYPT_ALL_TRAFFIC: False
# MASTER INSTANCES - DUPLICATE SECTION FOR MULTIPLE MASTERS # MASTER INSTANCES - DUPLICATE SECTION FOR MULTIPLE MASTERS
# HomeBrew Protocol Master instances go here. # 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 = b''.join([_packet[:11], self._config['NETWORK_ID'], _packet[15:]])
#_packet += hmac_new(self._config['PASSPHRASE'],_packet,sha1).digest() #_packet += hmac_new(self._config['PASSPHRASE'],_packet,sha1).digest()
_packet = b''.join([_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) _enc_pkt = encrypt_packet(self._config['ENCRYPTION_KEY'], _packet)
_packet = b'EOBP' + _enc_pkt _packet = b'EOBP' + _enc_pkt
self.transport.write(_packet, (self._config['TARGET_IP'], self._config['TARGET_PORT'])) 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, 'SUB_ACL': obp.sub_acl,
'TG1_ACL': obp.tg_acl, 'TG1_ACL': obp.tg_acl,
'TG2_ACL': 'PERMIT:ALL', 'TG2_ACL': 'PERMIT:ALL',
'USE_ENCRYPTION': obp.obp_encryption, 'ENCRYPT_ALL_TRAFFIC': obp.obp_encryption,
'ENCRYPTION_KEY': obp.encryption_key, 'ENCRYPTION_KEY': obp.encryption_key,
'OTHER_OPTIONS': obp.other_options 'OTHER_OPTIONS': obp.other_options
}}) }})