Subversion Repositories ALCASAR

Rev

Rev 3306 | Rev 3309 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3306 Rev 3308
Line 75... Line 75...
75
	$l_hosts_settings	= "Paramètres de réplication des hôtes";
75
	$l_hosts_settings	= "Paramètres de réplication des hôtes";
76
	$l_import_ssh_key	= "Si cet ALCASAR est primaire, importez ici les clés publiques des secondaires";
76
	$l_import_ssh_key	= "Si cet ALCASAR est primaire, importez ici les clés publiques des secondaires";
77
	$l_install_repl		= "Installer la fédération";
77
	$l_install_repl		= "Installer la fédération";
78
	$l_ip_address		= "Adresse IP";
78
	$l_ip_address		= "Adresse IP";
79
	$l_no_primary_connected = "Aucun primaire connecté";
79
	$l_no_primary_connected = "Aucun primaire connecté";
80
	$l_no_ssh_key		= "Pas de clé SSH.";
80
	$l_no_ssh_key		= "Aucune clé SSH importée.";
81
	$l_not_connected	= "Non connecté";
81
	$l_not_connected	= "Non connecté";
82
	$l_pubkey_to_deploy	= "Si cet ALCASAR est secondaire, copiez la clé publique ci-dessous pour l'importez dans le primaire.";
82
	$l_pubkey_to_deploy	= "Si cet ALCASAR est secondaire, copiez la clé publique ci-dessous pour l'importez dans le primaire.";
83
	$l_remote_access_mgmt	= "Gestion des accès distants";
83
	$l_remote_access_mgmt	= "Gestion des accès distants";
84
	$l_remote_role		= "Rôle de l'hôte distant";
84
	$l_remote_role		= "Rôle de l'hôte distant";
85
	$l_repl_io_running	= "État";
85
	$l_repl_io_running	= "État";
Line 115... Line 115...
115
	$l_hosts_settings	= "Paramètres de réplication des hôtes";
115
	$l_hosts_settings	= "Paramètres de réplication des hôtes";
116
	$l_import_ssh_key	= "Importer une clé SSH";
116
	$l_import_ssh_key	= "Importer une clé SSH";
117
	$l_install_repl		= "Creación de la federación";
117
	$l_install_repl		= "Creación de la federación";
118
	$l_ip_address		= "Adresse IP";
118
	$l_ip_address		= "Adresse IP";
119
	$l_no_primary_connected = "Aucun primaire connecté";
119
	$l_no_primary_connected = "Aucun primaire connecté";
120
	$l_no_ssh_key		= "Pas de clé SSH.";
120
	$l_no_ssh_key		= "Aucune clé SSH importée.";
121
	$l_not_connected	= "Non connecté";
121
	$l_not_connected	= "Non connecté";
122
	$l_pubkey_to_deploy	= "La clé doit être déployée sur les serveurs primaires.";
122
	$l_pubkey_to_deploy	= "La clé doit être déployée sur les serveurs primaires.";
123
	$l_remote_access_mgmt	= "Gestion des accès distants";
123
	$l_remote_access_mgmt	= "Gestion des accès distants";
124
	$l_remote_role		= "Rôle de l'hôte distant";
124
	$l_remote_role		= "Rôle de l'hôte distant";
125
	$l_repl_io_running	= "État";
125
	$l_repl_io_running	= "État";
Line 155... Line 155...
155
	$l_hosts_settings	= "Replicated hosts settings";
155
	$l_hosts_settings	= "Replicated hosts settings";
156
	$l_import_ssh_key	= "Import a SSH key";
156
	$l_import_ssh_key	= "Import a SSH key";
157
	$l_install_repl		= "Setting up the federation";
157
	$l_install_repl		= "Setting up the federation";
158
	$l_ip_address		= "IP address";
158
	$l_ip_address		= "IP address";
159
	$l_no_primary_connected = "No primary connected";
159
	$l_no_primary_connected = "No primary connected";
160
	$l_no_ssh_key		= "No SSH key.";
160
	$l_no_ssh_key		= "No SSH key imported.";
161
	$l_not_connected	= "Not connected";
161
	$l_not_connected	= "Not connected";
162
	$l_pubkey_to_deploy	= "The following public key has to be deployed on remote primary servers.";
162
	$l_pubkey_to_deploy	= "The following public key has to be deployed on remote primary servers.";
163
	$l_remote_access_mgmt	= "Remote access management";
163
	$l_remote_access_mgmt	= "Remote access management";
164
	$l_remote_role		= "Remote role";
164
	$l_remote_role		= "Remote role";
165
	$l_repl_io_running	= "State";
165
	$l_repl_io_running	= "State";
Line 208... Line 208...
208
	case 'add_replica':
208
	case 'add_replica':
209
		$role = trim($_POST['role'] ?? "");
209
		$role = trim($_POST['role'] ?? "");
210
		$name = trim($_POST['name'] ?? "");
210
		$name = trim($_POST['name'] ?? "");
211
		$ip = trim($_POST['ip'] ?? "");
211
		$ip = trim($_POST['ip'] ?? "");
212
		$port = trim($_POST['port'] ?? "");
212
		$port = trim($_POST['port'] ?? "");
-
 
213
		// we fix ssh user name to simplify ACC
213
		$user = trim($_POST['user'] ?? "");
214
		// $user = trim($_POST['user'] ?? "");
214
		$pwd = trim($_POST['pwd'] ?? "");
215
		$user = "replication" ;
-
 
216
		// we fix db user name to simplify ACC
215
		$db_user = trim($_POST['db_user'] ?? "");
217
		// $db_user = trim($_POST['db_user'] ?? "");
-
 
218
		$db_user = "db_replication";
216
		$db_pwd = trim($_POST['db_pwd'] ?? "");
219
		$db_pwd = trim($_POST['db_pwd'] ?? "");
217
		$bind_port = trim($_POST['bind_port'] ?? "");
220
		$bind_port = trim($_POST['bind_port'] ?? "");
218
		$stdout = [];
221
		$stdout = [];
219
		$return = 0;
222
		$return = 0;
220
		switch ($role) {
223
		switch ($role) {
Line 426... Line 429...
426
					<th><?= $l_host_name ?></th>
429
					<th><?= $l_host_name ?></th>
427
					<th><?= $l_repl_io_running ?></th>
430
					<th><?= $l_repl_io_running ?></th>
428
					<th><?= $l_bind_port ?></th>
431
					<th><?= $l_bind_port ?></th>
429
					<th><?= $l_action ?></th>
432
					<th><?= $l_action ?></th>
430
				</tr>
433
				</tr>
431
 
-
 
432
				<?php
434
				<?php
433
				$stdout = [];
435
				$stdout = [];
434
				$return = 0;
436
				$return = 0;
435
				exec("sudo /usr/local/bin/alcasar-replication-list.sh --all 2>&1", $stdout, $return);
437
				exec("sudo /usr/local/bin/alcasar-replication-list.sh --all 2>&1", $stdout, $return);
436
 
438
 
Line 503... Line 505...
503
											unset($options["stop"]);
505
											unset($options["stop"]);
504
											break;
506
											break;
505
										default:
507
										default:
506
											break;
508
											break;
507
										}
509
										}
508
 
-
 
509
										// Print options
510
										// Print options
510
										foreach ($options as $key => $value) { ?>
511
										foreach ($options as $key => $value) { ?>
511
											<option value="<?= $key ?>"><?= $value ?></option>
512
											<option value="<?= $key ?>"><?= $value ?></option>
512
										<?php }
513
										<?php }
513
									 ?>
514
									 ?>
Line 570... Line 571...
570
					</tr>
571
					</tr>
571
					<tr>
572
					<tr>
572
						<td><label for="input_port"><?= $l_ssh_port ?></label></td>
573
						<td><label for="input_port"><?= $l_ssh_port ?></label></td>
573
						<td><input type="number" id="input_port" name="port" min="0" max="65535" placeholder="22" class="role_primary" pattern="<?= $reg_ip_port ?>"></td>
574
						<td><input type="number" id="input_port" name="port" min="0" max="65535" placeholder="22" class="role_primary" pattern="<?= $reg_ip_port ?>"></td>
574
					</tr>
575
					</tr>
575
					<tr>
576
<!--					<tr>
576
						<td><label for="input_user"><?= $l_ssh_user ?></label></td>
577
						<td><label for="input_user"><?= $l_ssh_user ?></label></td>
577
						<td><input type="text" id="input_user" name="user" value="replication" disabled class="role_primary" pattern="<?= $reg_linux_user ?>"></td>
578
						<td><input type="text" id="input_user" name="user" value="replication" disabled class="role_primary" pattern="<?= $reg_linux_user ?>"></td>
578
					</tr>
579
					</tr>
579
					<tr>
580
					<tr>
580
						<td><label for="input_db_user"><?= $l_db_user ?></label></td>
581
						<td><label for="input_db_user"><?= $l_db_user ?></label></td>
581
						<td><input type="text" id="input_db_user" name="db_user" value="replication" disabled class="role_primary role_secondary" pattern="<?= $reg_mariadb_user ?>"></td>
582
						<td><input type="text" id="input_db_user" name="db_user" value="replication" disabled class="role_primary role_secondary" pattern="<?= $reg_mariadb_user ?>"></td>
582
					</tr>
583
					</tr>
-
 
584
-->
583
					<tr>
585
					<tr>
584
						<td><label for="input_db_pwd"><?= $l_db_pwd ?></label></td>
586
					<td><label for="input_db_pwd"><?= $l_db_pwd ?></label></td>
585
						<td><input type="password" id="input_db_pwd" name="db_pwd" class="role_primary role_secondary"></td>
587
						<td><input type="password" id="input_db_pwd" name="db_pwd" class="role_primary role_secondary"></td>
586
					</tr>
588
					</tr>
587
					<tr>
589
					<tr>
588
						<td colspan=2 valign="middle" align="center">
590
						<td colspan=2 valign="middle" align="center">
589
							<input type="submit" class="button" value="<?= $l_add_to_list ?>" onClick="document.getElementById('ldoverlay').style.display='block';">
591
							<input type="submit" class="button" value="<?= $l_add_to_list ?>" onClick="document.getElementById('ldoverlay').style.display='block';">
Line 646... Line 648...
646
							<td>
648
							<td>
647
								<input type="checkbox" name="action_ssh_key_<?= htmlspecialchars($hostname) ?>" value="<?= htmlspecialchars($hostname) ?>" class="ssh_key_action_input" onchange="enable_apply_btn_if_selected_ssh_key_action()">
649
								<input type="checkbox" name="action_ssh_key_<?= htmlspecialchars($hostname) ?>" value="<?= htmlspecialchars($hostname) ?>" class="ssh_key_action_input" onchange="enable_apply_btn_if_selected_ssh_key_action()">
648
							</td>
650
							</td>
649
						</tr>
651
						</tr>
650
					<?php }
652
					<?php }
651
 
-
 
652
					// Show submit button if there are primary servers connected
653
					// Show submit button if there are primary servers connected
653
					echo "<td colspan=3 valign='middle' align='center'>";
654
					echo "<tr><td colspan=3 valign='middle' align='center'>";
654
					if (sizeof($stdout)) { ?>
655
					if (sizeof($stdout)) { ?>
655
						<input type="submit" id="apply_changes_ssh_key_btn" value="<?= $l_apply ?>" onClick="document.getElementById('ldoverlay').style.display='block';">
656
						<input type="submit" id="apply_changes_ssh_key_btn" value="<?= $l_apply ?>" onClick="document.getElementById('ldoverlay').style.display='block';">
656
					<?php } else { ?>
657
					<?php } else { ?>
657
						<p><?= $l_no_ssh_key ?></p>
658
						<p><?= $l_no_ssh_key ?></p>
658
					<?php }
659
					<?php }
659
					echo "</td>";
660
					echo "</td></tr>";
660
				} ?>
661
				} ?>
661
			</table>
662
			</table>
662
			</form>
663
			</form>
663
			<?php if (isset($errors_msg[$section."_error"])) { ?>
664
			<?php if (isset($errors_msg[$section."_error"])) { ?>
664
				<details open>
665
				<details open>