| Line 72... |
Line 72... |
| 72 |
$l_field = "Champ";
|
72 |
$l_field = "Champ";
|
| 73 |
$l_go_network_conf_page = "Allez sur la page de configuration réseau.";
|
73 |
$l_go_network_conf_page = "Allez sur la page de configuration réseau.";
|
| 74 |
$l_host_name = "Nom d'hôte";
|
74 |
$l_host_name = "Nom d'hôte";
|
| 75 |
$l_hosts_settings = "Paramètres de réplication des hôtes distants";
|
75 |
$l_hosts_settings = "Paramètres de réplication des hôtes distants";
|
| 76 |
$l_import_ssh_key = "Importez ici les clés publiques des secondaires";
|
76 |
$l_import_ssh_key = "Importez ici les clés publiques des secondaires";
|
| - |
|
77 |
$l_in_progress = "En cours ...";
|
| 77 |
$l_install_repl = "Installer la fédération";
|
78 |
$l_install_repl = "Installer la fédération";
|
| 78 |
$l_remote_hosts = "Hôtes distants";
|
79 |
$l_install_repl_s = "Installer la fédération";
|
| 79 |
$l_ip_address = "Adresse IP";
|
80 |
$l_ip_address = "Adresse IP";
|
| 80 |
$l_no_host_connected = "Aucun hote connecté";
|
81 |
$l_no_host_connected = "Aucun hote connecté";
|
| 81 |
$l_no_ssh_key = "Aucune clé SSH importée.";
|
82 |
$l_no_ssh_key = "Aucune clé SSH importée.";
|
| 82 |
$l_not_connected = "Non connecté";
|
83 |
$l_not_connected = "localhost";
|
| 83 |
$l_pubkey_to_deploy = "Si cet ALCASAR est secondaire, copiez la clé publique ci-dessous pour l'importez dans le primaire.";
|
84 |
$l_pubkey_to_deploy = "Copiez la clé publique ci-dessous dans un fichier pour l'importez dans le primaire.";
|
| 84 |
$l_remote_access_mgmt = "Gestion des accès distants";
|
85 |
$l_remote_access_mgmt = "Gestion des accès distants";
|
| 85 |
$l_remote_role = "Rôle de l'hôte distant";
|
86 |
$l_remote_role = "Rôle de l'hôte distant";
|
| 86 |
$l_repl_io_running = "État de la réplication";
|
87 |
$l_repl_io_running = "État de la réplication";
|
| 87 |
$l_started = "Démarré";
|
88 |
$l_started = "Démarré";
|
| 88 |
$l_stopped = "Arrêté";
|
89 |
$l_stopped = "Arrêté";
|
| 89 |
$l_in_progress = "En cours ...";
|
90 |
$l_remote_hosts = "Hôtes distants";
|
| 90 |
$l_replication_install = "Installer la Fédération";
|
91 |
$l_replication_install = "Installer la Fédération";
|
| 91 |
$l_replication_title = "Fédération";
|
92 |
$l_replication_title = "Fédération";
|
| 92 |
$l_role = "Rôle";
|
93 |
$l_role = "Rôle";
|
| 93 |
$l_role_primary = "Primaire";
|
94 |
$l_role_primary = "Primaire";
|
| 94 |
$l_role_secondary = "Secondaire";
|
95 |
$l_role_secondary = "Secondaire";
|
| Line 117... |
Line 118... |
| 117 |
$l_field = "campo";
|
118 |
$l_field = "campo";
|
| 118 |
$l_go_network_conf_page = "Vaya a la página de configuración de red";
|
119 |
$l_go_network_conf_page = "Vaya a la página de configuración de red";
|
| 119 |
$l_host_name = "Nombre de host";
|
120 |
$l_host_name = "Nombre de host";
|
| 120 |
$l_hosts_settings = "Configuración de replicación de hosts remotos";
|
121 |
$l_hosts_settings = "Configuración de replicación de hosts remotos";
|
| 121 |
$l_import_ssh_key = "Importe aquí las claves públicas de los servidores secundarios";
|
122 |
$l_import_ssh_key = "Importe aquí las claves públicas de los servidores secundarios";
|
| - |
|
123 |
$l_in_progress = "En curso ...";
|
| 122 |
$l_install_repl = "Creación de la federación";
|
124 |
$l_install_repl = "Creación de la federación";
|
| 123 |
$l_remote_hosts = "Hosts remotos";
|
125 |
$l_remote_hosts = "Hosts remotos";
|
| 124 |
$l_ip_address = "dirección IP";
|
126 |
$l_ip_address = "dirección IP";
|
| 125 |
$l_no_host_connected = "No hay ningún host conectado.";
|
127 |
$l_no_host_connected = "No hay ningún host conectado.";
|
| 126 |
$l_no_ssh_key = "No se ha importado ninguna clave SSH.";
|
128 |
$l_no_ssh_key = "No se ha importado ninguna clave SSH.";
|
| 127 |
$l_not_connected = "No conectado";
|
129 |
$l_not_connected = "localhost";
|
| 128 |
$l_pubkey_to_deploy = "La clave debe implementarse en los servidores primarios.";
|
130 |
$l_pubkey_to_deploy = "Copie la clave pública que aparece a continuación en un archivo para importarla al primario.";
|
| 129 |
$l_remote_access_mgmt = "Gestión de accesos remotos";
|
131 |
$l_remote_access_mgmt = "Gestión de accesos remotos";
|
| 130 |
$l_remote_role = "Función del host remoto";
|
132 |
$l_remote_role = "Función del host remoto";
|
| 131 |
$l_repl_io_running = "estado de replicación";
|
133 |
$l_repl_io_running = "estado de replicación";
|
| 132 |
$l_started = "Iniciado";
|
134 |
$l_started = "Iniciado";
|
| 133 |
$l_stopped = "Decreto";
|
135 |
$l_stopped = "Decreto";
|
| 134 |
$l_in_progress = "En curso ...";
|
- |
|
| 135 |
$l_replication_install = "Creación de la federación";
|
136 |
$l_replication_install = "Creación de la federación";
|
| 136 |
$l_replication_title = "Federación";
|
137 |
$l_replication_title = "Federación";
|
| 137 |
$l_role = "Papel";
|
138 |
$l_role = "Papel";
|
| 138 |
$l_role_primary = "Primaria";
|
139 |
$l_role_primary = "Primaria";
|
| 139 |
$l_role_secondary = "Secundaria";
|
140 |
$l_role_secondary = "Secundaria";
|
| Line 162... |
Line 163... |
| 162 |
$l_field = "Field";
|
163 |
$l_field = "Field";
|
| 163 |
$l_go_network_conf_page = "Go to network config page.";
|
164 |
$l_go_network_conf_page = "Go to network config page.";
|
| 164 |
$l_host_name = "Host name";
|
165 |
$l_host_name = "Host name";
|
| 165 |
$l_hosts_settings = "Remote replicated hosts settings";
|
166 |
$l_hosts_settings = "Remote replicated hosts settings";
|
| 166 |
$l_import_ssh_key = "Import here the public keys of the secondary servers";
|
167 |
$l_import_ssh_key = "Import here the public keys of the secondary servers";
|
| - |
|
168 |
$l_in_progress = "In progress...";
|
| 167 |
$l_install_repl = "Setting up the federation";
|
169 |
$l_install_repl = "Setting up the federation";
|
| 168 |
$l_remote_hosts = "Remote hosts";
|
170 |
$l_remote_hosts = "Remote hosts";
|
| 169 |
$l_ip_address = "IP address";
|
171 |
$l_ip_address = "IP address";
|
| 170 |
$l_no_host_connected = "No host connected";
|
172 |
$l_no_host_connected = "No host connected";
|
| 171 |
$l_no_ssh_key = "No SSH key imported.";
|
173 |
$l_no_ssh_key = "No SSH key imported.";
|
| 172 |
$l_not_connected = "Not connected";
|
174 |
$l_not_connected = "localhost";
|
| 173 |
$l_pubkey_to_deploy = "The following public key has to be deployed on remote primary servers.";
|
175 |
$l_pubkey_to_deploy = "Copy the public key below into a file to import it into the primary.";
|
| 174 |
$l_remote_access_mgmt = "Remote access management";
|
176 |
$l_remote_access_mgmt = "Remote access management";
|
| 175 |
$l_remote_role = "Remote role";
|
177 |
$l_remote_role = "Remote role";
|
| 176 |
$l_repl_io_running = "Replication state";
|
178 |
$l_repl_io_running = "Replication state";
|
| 177 |
$l_started = "Started";
|
179 |
$l_started = "Started";
|
| 178 |
$l_stopped = "Stopped";
|
180 |
$l_stopped = "Stopped";
|
| 179 |
$l_in_progress = "In progress...";
|
- |
|
| 180 |
$l_replication_install = "Setting up the federation";
|
181 |
$l_replication_install = "Setting up the federation";
|
| 181 |
$l_replication_title = "Federation";
|
182 |
$l_replication_title = "Federation";
|
| 182 |
$l_role = "Role";
|
183 |
$l_role = "Role";
|
| 183 |
$l_role_primary = "Primary";
|
184 |
$l_role_primary = "Primary";
|
| 184 |
$l_role_secondary = "Secondary";
|
185 |
$l_role_secondary = "Secondary";
|
| Line 194... |
Line 195... |
| 194 |
$l_want_server_as_prim = "Want server to be a primary?";
|
195 |
$l_want_server_as_prim = "Want server to be a primary?";
|
| 195 |
}
|
196 |
}
|
| 196 |
|
197 |
|
| 197 |
$reg_ip = '^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$';
|
198 |
$reg_ip = '^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$';
|
| 198 |
$reg_ip_port = '^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\:([1-9]|[1-9][0-9]|[1-9][0-9]{2}|[1-9][0-9]{3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))$';
|
199 |
$reg_ip_port = '^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\:([1-9]|[1-9][0-9]|[1-9][0-9]{2}|[1-9][0-9]{3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]))$';
|
| 199 |
$reg_host = '^[a-zA-Z0-9-_]+$';
|
200 |
$reg_host = '^[a-zA-Z0-9-_.]+$';
|
| 200 |
$reg_ssh_key = "^(ssh-dss AAAAB3NzaC1kc3|ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNT|sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb2|ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29t|ssh-rsa AAAAB3NzaC1yc2)[0-9A-Za-z+/]+[=]{0,3}(\s.*)?$";
|
201 |
$reg_ssh_key = "^(ssh-dss AAAAB3NzaC1kc3|ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNT|sk-ecdsa-sha2-nistp256@openssh.com AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb2|ssh-ed25519 AAAAC3NzaC1lZDI1NTE5|sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29t|ssh-rsa AAAAB3NzaC1yc2)[0-9A-Za-z+/]+[=]{0,3}(\s.*)?$";
|
| 201 |
$reg_linux_user = "[a-z_][a-z0-9_-]*[$]?";
|
202 |
$reg_linux_user = "[a-z_][a-z0-9_-]*[$]?";
|
| 202 |
$reg_mariadb_user = "^[a-z]{1,32}$";
|
203 |
$reg_mariadb_user = "^[a-z]{1,32}$";
|
| 203 |
|
204 |
|
| 204 |
// Allow new SSH file size of 128kB;
|
205 |
// Allow new SSH file size of 128kB;
|
| 205 |
$max_ssh_file_size = 131072;
|
206 |
$max_ssh_file_size = 131072;
|
| 206 |
|
207 |
|
| 207 |
$choice = $_POST['choice'] ?? "";
|
208 |
$choice = $_POST['choice'] ?? "";
|
| 208 |
switch ($choice) {
|
209 |
switch ($choice) {
|
| 209 |
case 'install_replication':
|
210 |
case 'install_replication_p':
|
| - |
|
211 |
if (isset($conf['REPLICATION']) && ($conf['REPLICATION'] == "primary" || $conf['REPLICATION'] == "secondary")) {
|
| - |
|
212 |
exit("Replication already installed.");}
|
| - |
|
213 |
$stdout = [];
|
| - |
|
214 |
exec('sudo /usr/local/bin/alcasar-replication-install.sh -p 2>&1', $stdout);
|
| - |
|
215 |
header('Location: '.$_SERVER['PHP_SELF']);
|
| - |
|
216 |
break;
|
| - |
|
217 |
case 'install_replication_s':
|
| 210 |
if (isset($conf['REPLICATION']) && $conf['REPLICATION'] == "on") {
|
218 |
if (isset($conf['REPLICATION']) && ($conf['REPLICATION'] == "primary" || $conf['REPLICATION'] == "secondary")) {
|
| 211 |
exit("Replication already installed.");}
|
219 |
exit("Replication already installed.");}
|
| 212 |
$stdout = [];
|
220 |
$stdout = [];
|
| 213 |
exec('sudo /usr/local/bin/alcasar-replication-install.sh 2>&1', $stdout);
|
221 |
exec('sudo /usr/local/bin/alcasar-replication-install.sh -s 2>&1', $stdout);
|
| 214 |
header('Location: '.$_SERVER['PHP_SELF']);
|
222 |
header('Location: '.$_SERVER['PHP_SELF']);
|
| 215 |
break;
|
223 |
break;
|
| 216 |
case 'uninstall_replication':
|
224 |
case 'uninstall_replication':
|
| 217 |
if (!isset($conf['REPLICATION']) || $conf['REPLICATION'] == "off") {
|
225 |
if (!isset($conf['REPLICATION']) || $conf['REPLICATION'] == "off") {
|
| 218 |
exit("Replication not installed.");}
|
226 |
exit("Replication not installed.");}
|
| Line 258... |
Line 266... |
| 258 |
break;
|
266 |
break;
|
| 259 |
case 'change_replicas_state':
|
267 |
case 'change_replicas_state':
|
| 260 |
$stdout = [];
|
268 |
$stdout = [];
|
| 261 |
$return = 0;
|
269 |
$return = 0;
|
| 262 |
$key_prefix = "action_primary_";
|
270 |
$key_prefix = "action_primary_";
|
| 263 |
|
- |
|
| 264 |
// Search for action_primary_<hostname> key
|
271 |
// Search for action_primary_<hostname> key
|
| 265 |
foreach ($_POST as $key => $value) {
|
272 |
foreach ($_POST as $key => $value) {
|
| 266 |
if (!str_starts_with($key, $key_prefix)) {
|
273 |
if (!str_starts_with($key, $key_prefix)) {
|
| 267 |
continue;}
|
274 |
continue;}
|
| 268 |
// Get the remote name
|
275 |
// Get the remote name
|
| Line 381... |
Line 388... |
| 381 |
// disable on load
|
388 |
// disable on load
|
| 382 |
submitButton.disabled = true;
|
389 |
submitButton.disabled = true;
|
| 383 |
});
|
390 |
});
|
| 384 |
window.onload = main;
|
391 |
window.onload = main;
|
| 385 |
function main() {
|
392 |
function main() {
|
| - |
|
393 |
const rolePrimaryRadio = document.getElementById('role_primary');
|
| - |
|
394 |
const roleSecondaryRadio = document.getElementById('role_secondary');
|
| - |
|
395 |
if (roleSecondaryRadio.checked) { show_fields_for_new_secondary(); }
|
| 386 |
show_fields_for_new_primary();
|
396 |
if (rolePrimaryRadio.checked) { show_fields_for_new_primary(); }
|
| 387 |
set_required_on_common_fields();
|
397 |
set_required_on_common_fields();
|
| 388 |
enable_apply_btn_if_selected_remote_action();
|
398 |
enable_apply_btn_if_selected_remote_action();
|
| 389 |
enable_apply_btn_if_selected_ssh_key_action();
|
399 |
enable_apply_btn_if_selected_ssh_key_action();
|
| 390 |
}
|
400 |
}
|
| 391 |
// Set 'required' attribute on fields needed by both primary and secondary
|
401 |
// Set 'required' attribute on fields needed by both primary and secondary
|
| Line 458... |
Line 468... |
| 458 |
</head>
|
468 |
</head>
|
| 459 |
<body>
|
469 |
<body>
|
| 460 |
<div id="ldoverlay" class="overlay">
|
470 |
<div id="ldoverlay" class="overlay">
|
| 461 |
<div class="lds-spinner" id="spinner"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>
|
471 |
<div class="lds-spinner" id="spinner"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>
|
| 462 |
</div>
|
472 |
</div>
|
| 463 |
<?php if ($conf['REPLICATION'] == "on") { ?>
|
473 |
<?php if ($conf['REPLICATION'] == "primary" || $conf['REPLICATION'] == "secondary") { ?>
|
| 464 |
<div class="panel">
|
474 |
<div class="panel">
|
| 465 |
<div class="panel-header"><?= $l_hosts_settings ?></div>
|
475 |
<div class="panel-header"><?= $l_hosts_settings ?></div>
|
| 466 |
</div>
|
476 |
</div>
|
| 467 |
<div>
|
477 |
<div>
|
| 468 |
<table width="100%" cellspacing="0" cellpadding="5" border="1">
|
478 |
<table width="100%" cellspacing="0" cellpadding="5" border="1">
|
| Line 520... |
Line 530... |
| 520 |
}
|
530 |
}
|
| 521 |
// List each connection
|
531 |
// List each connection
|
| 522 |
foreach ($connected_prims as $prim) {
|
532 |
foreach ($connected_prims as $prim) {
|
| 523 |
?>
|
533 |
?>
|
| 524 |
<tr>
|
534 |
<tr>
|
| 525 |
<td><?php
|
535 |
<td><?php
|
| 526 |
$master_host = $prim["Master_Host"];
|
536 |
$master_host = $prim["Master_Host"];
|
| 527 |
if ($master_host != "127.0.0.1") {
|
537 |
if ($master_host = "127.0.0.1") {
|
| 528 |
echo "$master_host";
|
538 |
echo "$master_host";
|
| 529 |
} else {
|
539 |
} else {
|
| 530 |
echo "$l_not_connected";
|
540 |
echo "$l_not_connected";
|
| 531 |
}
|
541 |
}
|
| 532 |
?></td>
|
542 |
?></td>
|
| Line 590... |
Line 600... |
| 590 |
<summary><?= $l_error_details ?></summary>
|
600 |
<summary><?= $l_error_details ?></summary>
|
| 591 |
<textarea readonly cols=50 rows=10><?= $errors_msg[$section."_error"] ?></textarea>
|
601 |
<textarea readonly cols=50 rows=10><?= $errors_msg[$section."_error"] ?></textarea>
|
| 592 |
</details>
|
602 |
</details>
|
| 593 |
<?php } ?>
|
603 |
<?php } ?>
|
| 594 |
</td>
|
604 |
</td>
|
| - |
|
605 |
<?php if (isset($conf['REPLICATION']) && ($conf['REPLICATION'] == "secondary")) { ?>
|
| 595 |
<td width="50%" valign="middle" align="center">
|
606 |
<td width="50%" valign="middle" align="center">
|
| 596 |
<?php $section = "add_replica" ?>
|
607 |
<?php $section = "add_replica" ?>
|
| 597 |
<form id="form_add_remote" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
|
608 |
<form id="form_add_remote" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
|
| 598 |
<input type="hidden" name="choice" value="<?= $section ?>">
|
609 |
<input type="hidden" name="choice" value="<?= $section ?>">
|
| 599 |
<table cellspacing="2" cellpadding="3" border="1">
|
610 |
<table cellspacing="2" cellpadding="3" border="1">
|
| Line 604... |
Line 615... |
| 604 |
<tr>
|
615 |
<tr>
|
| 605 |
<td><?= $l_remote_role ?></td>
|
616 |
<td><?= $l_remote_role ?></td>
|
| 606 |
<td>
|
617 |
<td>
|
| 607 |
<fieldset>
|
618 |
<fieldset>
|
| 608 |
<div>
|
619 |
<div>
|
| 609 |
<input type="radio" id="role_primary" name="role" value="primary" checked onClick="show_fields_for_new_primary()"/>
|
620 |
<input type="radio" id="role_primary" name="role" value="primary"
|
| - |
|
621 |
<?= (isset($conf['REPLICATION']) && $conf['REPLICATION'] == "secondary") ? 'checked' : '' ?>
|
| - |
|
622 |
onClick="show_fields_for_new_primary()"/>
|
| 610 |
<label for="role_primary"><?= $l_role_primary ?></label>
|
623 |
<label for="role_primary"><?= $l_role_primary ?></label>
|
| 611 |
|
- |
|
| 612 |
<input type="radio" id="role_secondary" name="role" value="secondary" onClick="show_fields_for_new_secondary()"/>
|
624 |
<input type="radio" id="role_secondary" name="role" value="secondary"
|
| - |
|
625 |
<?= (isset($conf['REPLICATION']) && $conf['REPLICATION'] == "primary") ? 'checked' : '' ?>
|
| - |
|
626 |
onClick="show_fields_for_new_secondary()"/>
|
| 613 |
<label for="role_secondary"><?= $l_role_secondary ?></label>
|
627 |
<label for="role_secondary"><?= $l_role_secondary ?></label>
|
| 614 |
</div>
|
628 |
</div>
|
| 615 |
</fieldset>
|
629 |
</fieldset>
|
| 616 |
</td>
|
630 |
</td>
|
| 617 |
</tr>
|
631 |
</tr>
|
| Line 651... |
Line 665... |
| 651 |
<summary><?= $l_error_details ?></summary>
|
665 |
<summary><?= $l_error_details ?></summary>
|
| 652 |
<textarea readonly cols=50 rows=10><?= htmlspecialchars($errors_msg[$section."_error"]) ?></textarea>
|
666 |
<textarea readonly cols=50 rows=10><?= htmlspecialchars($errors_msg[$section."_error"]) ?></textarea>
|
| 653 |
</details>
|
667 |
</details>
|
| 654 |
<?php } ?>
|
668 |
<?php } ?>
|
| 655 |
</td>
|
669 |
</td>
|
| - |
|
670 |
<?php } ?>
|
| 656 |
</tr>
|
671 |
</tr>
|
| 657 |
</table>
|
672 |
</table>
|
| 658 |
</div>
|
673 |
</div>
|
| 659 |
<br>
|
674 |
<br>
|
| 660 |
<div class="panel">
|
675 |
<div class="panel">
|
| 661 |
<div class="panel-header"><?= $l_remote_access_mgmt ?></div>
|
676 |
<div class="panel-header"><?= $l_remote_access_mgmt ?></div>
|
| 662 |
</div>
|
677 |
</div>
|
| 663 |
<div>
|
678 |
<div>
|
| 664 |
<table width="100%" cellspacing="0" cellpadding="5" border="1">
|
679 |
<table width="100%" cellspacing="0" cellpadding="5" border="1">
|
| 665 |
<tr>
|
680 |
<tr>
|
| - |
|
681 |
<?php if (isset($conf['REPLICATION']) && ($conf['REPLICATION'] == "secondary")) { ?>
|
| - |
|
682 |
<td width="100%" valign="middle" align="center">
|
| - |
|
683 |
<center><?= $l_pubkey_to_deploy ?><br></center>
|
| - |
|
684 |
<br>
|
| - |
|
685 |
<?php
|
| - |
|
686 |
$stdout = [];
|
| - |
|
687 |
$return = 0;
|
| - |
|
688 |
exec("sudo /usr/local/bin/alcasar-replication-ssh-keys-management.sh --show-pubkey 2>&1", $stdout, $return);
|
| - |
|
689 |
// If script went wrong
|
| - |
|
690 |
if ($return != 0) {
|
| - |
|
691 |
echo "<p>$l_cant_read_pubkey</p>";
|
| - |
|
692 |
} else {
|
| - |
|
693 |
$pubkey = htmlspecialchars(implode(PHP_EOL, $stdout), ENT_QUOTES, 'UTF-8'); ?>
|
| - |
|
694 |
<textarea id="pubkey_stdout" readonly style="width: 75%; min-height: 100px; resize: vertical; white-space: pre-wrap; font-family: monospace;"><?= $pubkey ?></textarea>
|
| - |
|
695 |
<?php }
|
| - |
|
696 |
} ?>
|
| - |
|
697 |
<?php if (isset($conf['REPLICATION']) && ($conf['REPLICATION'] == "primary")) { ?>
|
| 666 |
<td width="50%" align="center">
|
698 |
<td width="50%" align="center">
|
| 667 |
<center><?= $l_ssh_keys_for_primary ?></center>
|
699 |
<center><?= $l_ssh_keys_for_primary ?></center>
|
| 668 |
<?php $section = "delete_ssh_key" ?>
|
700 |
<?php $section = "delete_ssh_key" ?>
|
| 669 |
<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
|
701 |
<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
|
| 670 |
<input type="hidden" name="choice" value="<?= $section ?>">
|
702 |
<input type="hidden" name="choice" value="<?= $section ?>">
|
| 671 |
<table cellspacing="2" cellpadding="3" border="1" style="table-layout: auto; min-width: 10em;">
|
703 |
<table cellspacing="2" cellpadding="3" border="1" style="table-layout: auto; min-width: 10em;">
|
| Line 740... |
Line 772... |
| 740 |
<summary><?= $l_error_details ?></summary>
|
772 |
<summary><?= $l_error_details ?></summary>
|
| 741 |
<textarea readonly cols=50 rows=10><?= $errors_msg[$section."_error"] ?></textarea>
|
773 |
<textarea readonly cols=50 rows=10><?= $errors_msg[$section."_error"] ?></textarea>
|
| 742 |
</details>
|
774 |
</details>
|
| 743 |
<?php } ?>
|
775 |
<?php } ?>
|
| 744 |
</td>
|
776 |
</td>
|
| 745 |
<?php if (! $public_key_exist) { ?>
|
- |
|
| 746 |
<td width="25%" valign="middle" align="center">
|
- |
|
| 747 |
<center><?= $l_pubkey_to_deploy ?><br></center>
|
- |
|
| 748 |
<br>
|
- |
|
| 749 |
<?php
|
- |
|
| 750 |
$stdout = [];
|
- |
|
| 751 |
$return = 0;
|
- |
|
| 752 |
exec("sudo /usr/local/bin/alcasar-replication-ssh-keys-management.sh --show-pubkey 2>&1", $stdout, $return);
|
- |
|
| 753 |
// If script went wrong
|
- |
|
| 754 |
if ($return != 0) {
|
- |
|
| 755 |
echo "<p>$l_cant_read_pubkey</p>";
|
- |
|
| 756 |
} else { ?>
|
- |
|
| 757 |
<input type="text" id="pubkey_stdout" readonly value="<?= implode(PHP_EOL, $stdout) ?>">
|
- |
|
| 758 |
<?php } ?>
|
777 |
<?php } ?>
|
| 759 |
</td> <?php } ?>
|
- |
|
| 760 |
</tr>
|
778 |
</tr>
|
| 761 |
</table>
|
779 |
</table>
|
| 762 |
</div>
|
780 |
</div>
|
| 763 |
<br>
|
781 |
<br>
|
| 764 |
<?php } ?>
|
782 |
<?php } ?>
|
| 765 |
<div class="panel">
|
783 |
<div class="panel">
|
| 766 |
<div class="panel-header"><?= $l_replication_title ?></div>
|
784 |
<div class="panel-header"><?= $l_replication_title ?></div>
|
| 767 |
</div>
|
785 |
</div>
|
| 768 |
<table width="100%" cellspacing="0" cellpadding="5" border="1">
|
786 |
<table width="100%" cellspacing="0" cellpadding="5" border="1">
|
| 769 |
<tr>
|
787 |
<tr>
|
| - |
|
788 |
<?php if (isset($conf['REPLICATION']) && ($conf['REPLICATION'] == "primary" || $conf['REPLICATION'] == "secondary")) { ?>
|
| 770 |
<td width="50%" valign="middle" align="center">
|
789 |
<td width="50%" valign="middle" align="center">
|
| 771 |
<?php if ($conf['REPLICATION'] == "on") { ?>
|
- |
|
| 772 |
<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST" onsubmit="return confirm('<?= $l_confirm_uninstall ?>');">
|
790 |
<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST" onsubmit="return confirm('<?= $l_confirm_uninstall ?>');">
|
| 773 |
<input type="hidden" name="choice" value="uninstall_replication">
|
791 |
<input type="hidden" name="choice" value="uninstall_replication">
|
| 774 |
<input type="submit" value="<?= $l_uninstall_repl ?>" onClick="document.getElementById('ldoverlay').style.display='block';">
|
792 |
<input type="submit" value="<?= $l_uninstall_repl ?>" onClick="document.getElementById('ldoverlay').style.display='block';">
|
| 775 |
</form>
|
793 |
</form>
|
| - |
|
794 |
</td>
|
| 776 |
<?php } else { ?>
|
795 |
<?php } else { ?>
|
| - |
|
796 |
<td width="50%" valign="middle" align="center">
|
| - |
|
797 |
<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
|
| - |
|
798 |
<input type="hidden" name="choice" value="install_replication_p">
|
| - |
|
799 |
<input type="submit" value="<?= $l_install_repl." (".$l_role."=".$l_role_primary.")" ?>" onClick="document.getElementById('ldoverlay').style.display='block';">
|
| - |
|
800 |
</form>
|
| - |
|
801 |
</td><td width="50%" valign="middle" align="center">
|
| 777 |
<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
|
802 |
<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
|
| 778 |
<input type="hidden" name="choice" value="install_replication">
|
803 |
<input type="hidden" name="choice" value="install_replication_s">
|
| 779 |
<input type="submit" value="<?= $l_install_repl ?>" onClick="document.getElementById('ldoverlay').style.display='block';">
|
804 |
<input type="submit" value="<?= $l_install_repl." (".$l_role."=".$l_role_secondary.")" ?>" onClick="document.getElementById('ldoverlay').style.display='block';">
|
| 780 |
</form>
|
805 |
</form>
|
| - |
|
806 |
</td>
|
| 781 |
<?php } ?>
|
807 |
<?php } ?>
|
| 782 |
</td>
|
- |
|
| 783 |
<?php if ($conf['REPLICATION'] == "on") { ?>
|
808 |
<?php if (isset($conf['REPLICATION']) && $conf['REPLICATION'] == "primary") { ?>
|
| 784 |
<td width="50%" valign="middle" align="center">
|
809 |
<td width="50%" valign="middle" align="center">
|
| 785 |
<?php if ($conf['SSH_WAN'] !== '0') { ?>
|
810 |
<?php if ($conf['SSH_WAN'] !== '0') { ?>
|
| 786 |
<input type="checkbox" id="togglessh" checked disabled>
|
811 |
<input type="checkbox" id="togglessh" checked disabled>
|
| 787 |
<label for="togglessh"><?= $l_ssh_wan_enabled ?></label>
|
812 |
<label for="togglessh"><?= $l_ssh_wan_enabled ?></label>
|
| 788 |
<?php } else { ?>
|
813 |
<?php } else { ?>
|
| 789 |
<p><?= $l_want_server_as_prim ?></p>
|
814 |
<p><?= $l_want_server_as_prim ?></p>
|
| 790 |
<input type="checkbox" id="togglessh" disabled>
|
815 |
<input type="checkbox" id="togglessh" disabled>
|
| 791 |
<label for="togglessh"><b><?= $l_ssh_wan_must_be_on ?></b> <a href="/acc/admin/network.php"><?= $l_go_network_conf_page ?></a></label>
|
816 |
<label for="togglessh"><b><?= $l_ssh_wan_must_be_on ?></b> <a href="/acc/admin/network.php"><?= $l_go_network_conf_page ?></a></label>
|
| 792 |
<?php } ?>
|
817 |
<?php } ?>
|
| 793 |
</td>
|
- |
|
| 794 |
<?php } ?>
|
818 |
<?php } ?>
|
| 795 |
</tr>
|
819 |
</tr>
|
| 796 |
</table>
|
820 |
</table>
|
| 797 |
</body>
|
821 |
</body>
|
| 798 |
</html>
|
822 |
</html>
|