INSERTINTOsettings(param,value,section,`desc`)values('proxy','','main','Proxy server. Use proto://ip:port');
INSERTINTOsettings(param,value,section,`desc`)values('session_ttl','5','main','Time to live users sessions. In days');
INSERTINTOsettings(param,value,section,`desc`)values('token_ttl','5','main','Time to live users tokens. In days');
INSERTINTOsettings(param,value,section,`desc`)values('tmp_config_path','/tmp/','main','A temp folder of configs, for checking. The path must exist');
INSERTINTOsettings(param,value,section,`desc`)values('cert_path','/etc/ssl/certs/','main','A path to SSL dir. The folder owner must be an user who set in the SSH settings. The path must exist');
INSERTINTOsettings(param,value,section,`desc`)values('ssl_local_path','certs','main','Path to dir for local save SSL certs. This is a relative path, begins with $HOME_HAPROXY-WI/app/');
INSERTINTOsettings(param,value,section,`desc`)values('lists_path','lists','main','Path to black/white lists. This is a relative path, begins with $HOME_HAPROXY-WI');
INSERTINTOsettings(param,value,section,`desc`)values('local_path_logs','/var/log/haproxy.log','logs','Logs save locally, enabled by default');
INSERTINTOsettings(param,value,section,`desc`)values('syslog_server_enable','0','logs','If exist syslog server for HAProxy logs, enable this option');
INSERTINTOsettings(param,value,section,`desc`)values('syslog_server','0','logs','IP address of syslog server');
INSERTINTOsettings(param,value,section,`desc`)values('log_time_storage','14','logs','Storage time for user activity logs, in days');
INSERTINTOsettings(param,value,section,`desc`)values('stats_user','admin','haproxy','Username for the HAProxy Stats web page');
INSERTINTOsettings(param,value,section,`desc`)values('stats_password','password','haproxy','Password for the HAProxy Stats web page');
INSERTINTOsettings(param,value,section,`desc`)values('stats_port','8085','haproxy','Port for the HAProxy Stats web page');
INSERTINTOsettings(param,value,section,`desc`)values('stats_page','stats','haproxy','URI for the HAProxy Stats web page');
INSERTINTOsettings(param,value,section,`desc`)values('haproxy_dir','/etc/haproxy/','haproxy','Path to HAProxy dir');
INSERTINTOsettings(param,value,section,`desc`)values('haproxy_config_path','/etc/haproxy/haproxy.cfg','haproxy','Path to HAProxy config');
INSERTINTOsettings(param,value,section,`desc`)values('server_state_file','/etc/haproxy/haproxy.state','haproxy','Path to HAProxy state file');
INSERTINTOsettings(param,value,section,`desc`)values('haproxy_sock','/var/run/haproxy.sock','haproxy','Path to HAProxy sock file');
INSERTINTOsettings(param,value,section,`desc`,`group`)values('haproxy_enterprise','0','haproxy','Use this option, if your HAProxy is enterprise. It change service name for rebooting/reloading','%s');
"""% g[0]
try:
cur.execute(sql)
con.commit()
exceptsqltool.Errorase:
ifkwargs.get('silent')!=1:
ife.args[0]=='columns param, group are not unique'ore==" 1060 (42S21): columns param, group are not unique ":
sql="""CREATE TABLE IF NOT EXISTS `geoip_codes` (`id` INTEGER NOT NULL,
`code`varchar(64),
`name`varchar(64),
UNIQUE(`code`,`name`),
PRIMARYKEY(`id`));"""
try:
cur.execute(sql)
con.commit()
exceptsqltool.Errorase:
ifkwargs.get('silent')!=1:
ife.args[0]=='duplicate column name: id'ore=="1060 (42S21): Duplicate column name 'id'":
print('Updating... go to version 4.5.0')
else:
print("Updating... go to version to 4.5.0")
cur.close()
con.close()
defupdate_db_v_4_5_8_1(**kwargs):
con,cur=get_cur()
sql=list()
sql.append("INSERT INTO geoip_codes ('code', 'name') values('RW','Rwanda');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SO','Somalia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('YE','Yemen');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('IQ','Iraq');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SA','Saudi Arabia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('IR','Iran');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CY','Cyprus');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TZ','Tanzania');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SY','Syria');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AM','Armenia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('KE','Kenya');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CD','DR Congo');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('DJ','Djibouti');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('UG','Uganda');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CF','Central African Republic');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SC','Seychelles');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('JO','Hashemite Kingdom of Jordan');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('LB','Lebanon');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('KW','Kuwait');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('OM','Oman');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('QA','Qatar');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BH','Bahrain');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AE','United Arab Emirates');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('IL','Israel');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TR','Turkey');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('ET','Ethiopia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('ER','Eritrea');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('EG','Egypt');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SD','Sudan');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GR','Greece');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BI','Burundi');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('EE','Estonia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('LV','Latvia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AZ','Azerbaijan');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('LT','Republic of Lithuania');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SJ','Svalbard and Jan Mayen');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GE','Georgia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MD','Republic of Moldova');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BY','Belarus');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('FI','Finland');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AX','Åland');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('UA','Ukraine');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MK','North Macedonia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('HU','Hungary');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BG','Bulgaria');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AL','Albania');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('PL','Poland');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('RO','Romania');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('XK','Kosovo');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('ZW','Zimbabwe');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('ZM','Zambia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('KM','Comoros');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MW','Malawi');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('LS','Lesotho');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BW','Botswana');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MU','Mauritius');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SZ','Eswatini');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('RE','Réunion');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('ZA','South Africa');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('YT','Mayotte');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MZ','Mozambique');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MG','Madagascar');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AF','Afghanistan');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('PK','Pakistan');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BD','Bangladesh');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TM','Turkmenistan');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TJ','Tajikistan');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('LK','Sri Lanka');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BT','Bhutan');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('IN','India');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MV','Maldives');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('IO','British Indian Ocean Territory');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('NP','Nepal');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MM','Myanmar');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('UZ','Uzbekistan');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('KZ','Kazakhstan');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('KG','Kyrgyzstan');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TF','French Southern Territories');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('HM','Heard Island and McDonald Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CC','Cocos [Keeling] Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('PW','Palau');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('VN','Vietnam');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TH','Thailand');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('ID','Indonesia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('LA','Laos');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TW','Taiwan');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('PH','Philippines');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MY','Malaysia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CN','China');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('HK','Hong Kong');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BN','Brunei');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MO','Macao');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('KH','Cambodia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('KR','South Korea');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('JP','Japan');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('KP','North Korea');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SG','Singapore');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CK','Cook Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TL','East Timor');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('RU','Russia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MN','Mongolia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AU','Australia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CX','Christmas Island');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MH','Marshall Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('FM','Federated States of Micronesia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('PG','Papua New Guinea');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SB','Solomon Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TV','Tuvalu');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('NR','Nauru');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('VU','Vanuatu');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('NC','New Caledonia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('NF','Norfolk Island');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('NZ','New Zealand');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('FJ','Fiji');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('LY','Libya');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CM','Cameroon');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SN','Senegal');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CG','Congo Republic');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('PT','Portugal');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('LR','Liberia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CI','Ivory Coast');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GH','Ghana');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GQ','Equatorial Guinea');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('NG','Nigeria');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BF','Burkina Faso');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TG','Togo');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GW','Guinea-Bissau');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MR','Mauritania');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BJ','Benin');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GA','Gabon');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SL','Sierra Leone');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('ST','São Tomé and Príncipe');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GI','Gibraltar');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GM','Gambia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GN','Guinea');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TD','Chad');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('NE','Niger');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('ML','Mali');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('EH','Western Sahara');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TN','Tunisia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('ES','Spain');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MA','Morocco');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MT','Malta');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('DZ','Algeria');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('FO','Faroe Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('DK','Denmark');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('IS','Iceland');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GB','United Kingdom');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CH','Switzerland');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SE','Sweden');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('NL','Netherlands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AT','Austria');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BE','Belgium');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('DE','Germany');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('LU','Luxembourg');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('IE','Ireland');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MC','Monaco');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('FR','France');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AD','Andorra');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('LI','Liechtenstein');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('JE','Jersey');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('IM','Isle of Man');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GG','Guernsey');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SK','Slovakia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CZ','Czechia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('NO','Norway');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('VA','Vatican City');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SM','San Marino');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('IT','Italy');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SI','Slovenia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('ME','Montenegro');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('HR','Croatia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BA','Bosnia and Herzegovina');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AO','Angola');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('NA','Namibia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SH','Saint Helena');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BV','Bouvet Island');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BB','Barbados');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CV','Cabo Verde');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GY','Guyana');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GF','French Guiana');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SR','Suriname');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('PM','Saint Pierre and Miquelon');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GL','Greenland');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('PY','Paraguay');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('UY','Uruguay');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BR','Brazil');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('FK','Falkland Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GS','South Georgia and the South Sandwich Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('JM','Jamaica');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('DO','Dominican Republic');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CU','Cuba');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MQ','Martinique');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BS','Bahamas');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BM','Bermuda');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AI','Anguilla');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TT','Trinidad and Tobago');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('KN','St Kitts and Nevis');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('DM','Dominica');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AG','Antigua and Barbuda');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('LC','Saint Lucia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TC','Turks and Caicos Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AW','Aruba');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('VG','British Virgin Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('VC','Saint Vincent and the Grenadines');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MS','Montserrat');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MF','Saint Martin');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BL','Saint Barthélemy');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GP','Guadeloupe');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GD','Grenada');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('KY','Cayman Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BZ','Belize');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SV','El Salvador');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GT','Guatemala');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('HN','Honduras');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('NI','Nicaragua');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CR','Costa Rica');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('VE','Venezuela');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('EC','Ecuador');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CO','Colombia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('PA','Panama');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('HT','Haiti');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AR','Argentina');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CL','Chile');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BO','Bolivia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('PE','Peru');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MX','Mexico');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('PF','French Polynesia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('PN','Pitcairn Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('KI','Kiribati');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TK','Tokelau');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('TO','Tonga');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('WF','Wallis and Futuna');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('WS','Samoa');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('NU','Niue');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('MP','Northern Mariana Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('GU','Guam');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('PR','Puerto Rico');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('VI','U.S. Virgin Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('UM','U.S. Minor Outlying Islands');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AS','American Samoa');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CA','Canada');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('US','United States');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('PS','Palestine');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('RS','Serbia');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('AQ','Antarctica');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SX','Sint Maarten');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('CW','Curaçao');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('BQ','Bonaire');")
sql.append("INSERT INTO geoip_codes ('code', 'name') values('SS','South Sudan');")
foriinsql:
try:
cur.execute(i)
con.commit()
exceptsqltool.Errorase:
pass
else:
ifkwargs.get('silent')!=1:
print('Updating... go to version 4.5.6')
cur.close()
con.close()
defupdate_db_v_4_5_8_2(**kwargs):
con,cur=get_cur()
groups=''
sql=""" select id from `groups` """
try:
cur.execute(sql)
exceptsqltool.Errorase:
funct.out_error(e)
else:
groups=cur.fetchall()
forgingroups:
sql="""
INSERTINTOsettings(param,value,section,`desc`,`group`)values('maxmind_key','','haproxy','License key for downloading to GeoLite2 DB. You can create it on maxmind.com','%s');
"""% g[0]
try:
cur.execute(sql)
con.commit()
exceptsqltool.Errorase:
ifkwargs.get('silent')!=1:
ife.args[0]=='columns param, group are not unique'ore==" 1060 (42S21): columns param, group are not unique ":
sql.append("INSERT INTO settings (param, value, section, `desc`) values('smon_keep_history_range', '14', 'monitoring', 'How many days to keep the history for the SMON service')")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('checker_keep_history_range', '14', 'monitoring', 'How many days to keep the history for the Checker service')")
foriinsql:
try:
cur.execute(i)
con.commit()
exceptsqltool.Errorase:
pass
else:
ifkwargs.get('silent')!=1:
print('Updating... DB has been updated to version 5.1.2')
sql.append("INSERT INTO settings (param, value, section, `desc`) values('portscanner_keep_history_range', '14', 'monitoring', 'How many days to keep the history for the Port scanner service')")
foriinsql:
try:
cur.execute(i)
con.commit()
exceptsqltool.Errorase:
pass
else:
ifkwargs.get('silent')!=1:
print('Updating... DB has been updated to version 5.2.0')