mirror of https://github.com/Aidaho12/haproxy-wi
parent
a38d2661cd
commit
689a19aa28
|
@ -18,7 +18,7 @@ def default_values():
|
||||||
{'param': 'token_ttl', 'value': '5', 'section': 'main', 'desc': 'TTL for a user token (in days)',
|
{'param': 'token_ttl', 'value': '5', 'section': 'main', 'desc': 'TTL for a user token (in days)',
|
||||||
'group': '1'},
|
'group': '1'},
|
||||||
{'param': 'tmp_config_path', 'value': '/tmp/', 'section': 'main',
|
{'param': 'tmp_config_path', 'value': '/tmp/', 'section': 'main',
|
||||||
'desc': 'Path to the directory with SSL certificates. An existing path should be specified as the value of this parameter. The directory must be owned by the user specified in SSH settings.',
|
'desc': 'Path to the temporary directory. A valid path should be specified as the value of this parameter. The directory must be owned by the user specified in SSH settings',
|
||||||
'group': '1'},
|
'group': '1'},
|
||||||
{'param': 'cert_path', 'value': '/etc/ssl/certs/', 'section': 'main',
|
{'param': 'cert_path', 'value': '/etc/ssl/certs/', 'section': 'main',
|
||||||
'desc': 'Path to SSL dir. Folder owner must be a user which set in the SSH settings. Path must exist',
|
'desc': 'Path to SSL dir. Folder owner must be a user which set in the SSH settings. Path must exist',
|
||||||
|
@ -77,19 +77,17 @@ def default_values():
|
||||||
{'param': 'ldap_port', 'value': '389', 'section': 'ldap', 'desc': 'LDAP port (port 389 or 636 is used by default)',
|
{'param': 'ldap_port', 'value': '389', 'section': 'ldap', 'desc': 'LDAP port (port 389 or 636 is used by default)',
|
||||||
'group': '1'},
|
'group': '1'},
|
||||||
{'param': 'ldap_user', 'value': '', 'section': 'ldap',
|
{'param': 'ldap_user', 'value': '', 'section': 'ldap',
|
||||||
'desc': 'Loging for connecting to LDAP server. Format: user@domain.com', 'group': '1'},
|
'desc': 'LDAP username. Format: user@domain.com', 'group': '1'},
|
||||||
{'param': 'ldap_password', 'value': '', 'section': 'ldap', 'desc': 'Password to connect to LDAP server',
|
{'param': 'ldap_password', 'value': '', 'section': 'ldap', 'desc': 'LDAP password', 'group': '1'},
|
||||||
'group': '1'},
|
|
||||||
{'param': 'ldap_base', 'value': '', 'section': 'ldap', 'desc': 'Base domain. Example: dc=domain, dc=com',
|
{'param': 'ldap_base', 'value': '', 'section': 'ldap', 'desc': 'Base domain. Example: dc=domain, dc=com',
|
||||||
'group': '1'},
|
'group': '1'},
|
||||||
{'param': 'ldap_domain', 'value': '', 'section': 'ldap', 'desc': 'LDAP domain for the login', 'group': '1'},
|
{'param': 'ldap_domain', 'value': '', 'section': 'ldap', 'desc': 'LDAP domain for logging in', 'group': '1'},
|
||||||
{'param': 'ldap_class_search', 'value': 'user', 'section': 'ldap', 'desc': 'Class for searching the user',
|
{'param': 'ldap_class_search', 'value': 'user', 'section': 'ldap', 'desc': 'Class for searching the user',
|
||||||
'group': '1'},
|
'group': '1'},
|
||||||
{'param': 'ldap_user_attribute', 'value': 'sAMAccountName', 'section': 'ldap',
|
{'param': 'ldap_user_attribute', 'value': 'sAMAccountName', 'section': 'ldap',
|
||||||
'desc': 'User attribute for search', 'group': '1'},
|
'desc': 'Attribute to search users by', 'group': '1'},
|
||||||
{'param': 'ldap_search_field', 'value': 'mail', 'section': 'ldap',
|
{'param': 'ldap_search_field', 'value': 'mail', 'section': 'ldap', 'desc': 'User\'s email address', 'group': '1'},
|
||||||
'desc': 'The field for saving the user\'s e-mail address', 'group': '1'},
|
{'param': 'ldap_type', 'value': '0', 'section': 'ldap', 'desc': 'Use LDAPS (1 - yes, 0 - no)', 'group': '1'},
|
||||||
{'param': 'ldap_type', 'value': '0', 'section': 'ldap', 'desc': 'Use LDAP (0) or LDAPS (1)', 'group': '1'},
|
|
||||||
]
|
]
|
||||||
try:
|
try:
|
||||||
Setting.insert_many(data_source).on_conflict_ignore().execute()
|
Setting.insert_many(data_source).on_conflict_ignore().execute()
|
||||||
|
@ -617,9 +615,9 @@ def update_db_v_5_0_1(**kwargs):
|
||||||
def update_db_v_5_1_2(**kwargs):
|
def update_db_v_5_1_2(**kwargs):
|
||||||
data_source = [
|
data_source = [
|
||||||
{'param': 'smon_keep_history_range', 'value': '14', 'section': 'monitoring',
|
{'param': 'smon_keep_history_range', 'value': '14', 'section': 'monitoring',
|
||||||
'desc': 'How many days to keep the history for the SMON service', 'group': '1'},
|
'desc': 'Retention period for SMON history', 'group': '1'},
|
||||||
{'param': 'checker_keep_history_range', 'value': '14', 'section': 'monitoring',
|
{'param': 'checker_keep_history_range', 'value': '14', 'section': 'monitoring',
|
||||||
'desc': 'How many days to keep the history for the Checker service', 'group': '1'}
|
'desc': 'Retention period for Checker history', 'group': '1'}
|
||||||
]
|
]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -654,7 +652,7 @@ def update_db_v_5_1_3(**kwargs):
|
||||||
def update_db_v_5_2_0(**kwargs):
|
def update_db_v_5_2_0(**kwargs):
|
||||||
try:
|
try:
|
||||||
Setting.insert(param='portscanner_keep_history_range', value=14, section='monitoring',
|
Setting.insert(param='portscanner_keep_history_range', value=14, section='monitoring',
|
||||||
desc='How many days to keep the history for the Port scanner service').execute()
|
desc='Retention period for Port scanner history').execute()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if kwargs.get('silent') != 1:
|
if kwargs.get('silent') != 1:
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -428,11 +428,11 @@ class ServiceSetting(BaseModel):
|
||||||
|
|
||||||
|
|
||||||
class ActionHistory(BaseModel):
|
class ActionHistory(BaseModel):
|
||||||
service = CharField()
|
service = CharField(null=True)
|
||||||
server_id = IntegerField()
|
server_id = IntegerField(null=True)
|
||||||
user_id = IntegerField()
|
user_id = IntegerField(null=True)
|
||||||
action = CharField()
|
action = CharField(null=True)
|
||||||
ip = CharField()
|
ip = CharField(null=True)
|
||||||
date = DateTimeField(default=datetime.now)
|
date = DateTimeField(default=datetime.now)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
@ -10,7 +10,6 @@ template = env.get_template('ovw.html')
|
||||||
|
|
||||||
print('Content-type: text/html\n')
|
print('Content-type: text/html\n')
|
||||||
|
|
||||||
# create_db.update_all_silent()
|
|
||||||
funct.check_login()
|
funct.check_login()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -99,7 +98,6 @@ except Exception as e:
|
||||||
is_checker_worker = ''
|
is_checker_worker = ''
|
||||||
is_metrics_worker = ''
|
is_metrics_worker = ''
|
||||||
token = ''
|
token = ''
|
||||||
print(str(e))
|
|
||||||
|
|
||||||
|
|
||||||
template = template.render(h2=1,
|
template = template.render(h2=1,
|
||||||
|
|
17
app/sql.py
17
app/sql.py
|
@ -130,10 +130,10 @@ def add_setting_for_new_group(group_id):
|
||||||
{'param': 'token_ttl', 'value': '5', 'section': 'main', 'desc': 'TTL for a user token (in days)',
|
{'param': 'token_ttl', 'value': '5', 'section': 'main', 'desc': 'TTL for a user token (in days)',
|
||||||
'group': group_id},
|
'group': group_id},
|
||||||
{'param': 'tmp_config_path', 'value': '/tmp/', 'section': 'main',
|
{'param': 'tmp_config_path', 'value': '/tmp/', 'section': 'main',
|
||||||
'desc': 'Path to the directory with SSL certificates. An existing path should be specified as the value of this parameter. The directory must be owned by the user specified in SSH settings.',
|
'desc': 'Path to the temporary directory. A valid path should be specified as the value of this parameter. The directory must be owned by the user specified in SSH settings',
|
||||||
'group': group_id},
|
'group': group_id},
|
||||||
{'param': 'cert_path', 'value': '/etc/ssl/certs/', 'section': 'main',
|
{'param': 'cert_path', 'value': '/etc/ssl/certs/', 'section': 'main',
|
||||||
'desc': 'Path to SSL dir. Folder owner must be a user which set in the SSH settings. Path must exist',
|
'desc': 'Path to SSL dir. Folder owner must be a user which set in the SSH settings. The path must be valid',
|
||||||
'group': group_id},
|
'group': group_id},
|
||||||
{'param': 'local_path_logs', 'value': '/var/log/haproxy.log', 'section': 'logs',
|
{'param': 'local_path_logs', 'value': '/var/log/haproxy.log', 'section': 'logs',
|
||||||
'desc': 'The default local path for saving logs', 'group': group_id},
|
'desc': 'The default local path for saving logs', 'group': group_id},
|
||||||
|
@ -179,19 +179,18 @@ def add_setting_for_new_group(group_id):
|
||||||
{'param': 'ldap_port', 'value': '389', 'section': 'ldap', 'desc': 'LDAP port (port 389 or 636 is used by default)',
|
{'param': 'ldap_port', 'value': '389', 'section': 'ldap', 'desc': 'LDAP port (port 389 or 636 is used by default)',
|
||||||
'group': group_id},
|
'group': group_id},
|
||||||
{'param': 'ldap_user', 'value': '', 'section': 'ldap',
|
{'param': 'ldap_user', 'value': '', 'section': 'ldap',
|
||||||
'desc': 'Loging for connecting to LDAP server. Format: user@domain.com', 'group': group_id},
|
'desc': 'LDAP username. Format: user@domain.com', 'group': group_id},
|
||||||
{'param': 'ldap_password', 'value': '', 'section': 'ldap', 'desc': 'Password to connect to LDAP server',
|
{'param': 'ldap_password', 'value': '', 'section': 'ldap', 'desc': 'LDAP password', 'group': group_id},
|
||||||
'group': group_id},
|
|
||||||
{'param': 'ldap_base', 'value': '', 'section': 'ldap', 'desc': 'Base domain. Example: dc=domain, dc=com',
|
{'param': 'ldap_base', 'value': '', 'section': 'ldap', 'desc': 'Base domain. Example: dc=domain, dc=com',
|
||||||
'group': group_id},
|
'group': group_id},
|
||||||
{'param': 'ldap_domain', 'value': '', 'section': 'ldap', 'desc': 'LDAP domain for the login', 'group': group_id},
|
{'param': 'ldap_domain', 'value': '', 'section': 'ldap', 'desc': 'LDAP domain for logging in', 'group': group_id},
|
||||||
{'param': 'ldap_class_search', 'value': 'user', 'section': 'ldap', 'desc': 'Class for searching the user',
|
{'param': 'ldap_class_search', 'value': 'user', 'section': 'ldap', 'desc': 'Class for searching the user',
|
||||||
'group': group_id},
|
'group': group_id},
|
||||||
{'param': 'ldap_user_attribute', 'value': 'sAMAccountName', 'section': 'ldap',
|
{'param': 'ldap_user_attribute', 'value': 'sAMAccountName', 'section': 'ldap',
|
||||||
'desc': 'User attribute for search', 'group': group_id},
|
'desc': 'Attribute to search users by', 'group': group_id},
|
||||||
{'param': 'ldap_search_field', 'value': 'mail', 'section': 'ldap',
|
{'param': 'ldap_search_field', 'value': 'mail', 'section': 'ldap',
|
||||||
'desc': 'The field for saving the user\'s e-mail address', 'group': group_id},
|
'desc': 'User\'s email address', 'group': group_id},
|
||||||
{'param': 'ldap_type', 'value': '0', 'section': 'ldap', 'desc': 'Use LDAP (0) or LDAPS (1)', 'group': group_id},
|
{'param': 'ldap_type', 'value': '0', 'section': 'ldap', 'desc': 'Use LDAPS (1 - yes, 0 - no)', 'group': group_id},
|
||||||
]
|
]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -112,7 +112,7 @@
|
||||||
<tr class="overviewHead">
|
<tr class="overviewHead">
|
||||||
<td class="padding10 first-collumn" style="width: 25%;">Service</td>
|
<td class="padding10 first-collumn" style="width: 25%;">Service</td>
|
||||||
<td>Current version</td>
|
<td>Current version</td>
|
||||||
<td class="padding10">Last version</td>
|
<td class="padding10">Latest version</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
Description
|
Description
|
||||||
|
|
|
@ -146,7 +146,7 @@ pre {
|
||||||
}
|
}
|
||||||
#logo_footer {
|
#logo_footer {
|
||||||
float: left;
|
float: left;
|
||||||
margin-left: 41%;
|
margin-left: 37%;
|
||||||
}
|
}
|
||||||
#logo_footer_img {
|
#logo_footer_img {
|
||||||
width: 35px;
|
width: 35px;
|
||||||
|
|
Loading…
Reference in New Issue