浏览代码

Print SSH fingerprints

Miraty 3 年之前
父节点
当前提交
759c6e696f
共有 2 个文件被更改,包括 51 次插入22 次删除
  1. 20 10
      config.ini
  2. 31 12
      public/ht/index.php

+ 20 - 10
config.ini

@@ -19,21 +19,31 @@ knotc_path = "/usr/sbin/knotc"
 knot_zones_path = "/srv/ns"
 
 [ht]
+; Path were user's sites will be stored
 ht_path = "/srv/ht"
-ipv6_address = "::1"
-ipv4_address = "127.0.0.1"
-sftp_domain = "sftp.niver.test"
-public_sftp_port = 2022
-https_port = 42443
-internal_onion_http_port = 9080
-sudo_path = "/usr/bin/sudo"
-chgrp_path = "/usr/bin/chgrp"
-systemctl_path = "/usr/bin/systemctl"
-certbot_path = "/usr/bin/certbot"
 ; Nginx configuration directory
 nginx_config_path = "/etc/nginx/ht"
 ; Tor configuration file
 tor_config_path = "/etc/tor/instances/niver/torrc"
 ; Tor keys directory
 tor_keys_path = "/var/lib/tor-instances/niver/keys"
+
+sudo_path = "/usr/bin/sudo"
+systemctl_path = "/usr/bin/systemctl"
+certbot_path = "/usr/bin/certbot"
+chgrp_path = "/usr/bin/chgrp"
+
 sftpgo_group = sftpgo
+
+; Will be shown to users
+ipv6_address = "::1"
+ipv4_address = "127.0.0.1"
+sftp_pub = "/etc/sftpgo/ed25519.pub"
+sftp_fp = "/etc/sftpgo/ed25519.fp"
+sftp_asciiart = "/etc/sftpgo/ed25519.asciiart"
+sftp_domain = "sftp.niver.test"
+public_sftp_port = 2022
+
+; Will be used in configuration files
+https_port = 42443
+internal_onion_http_port = 9080

+ 31 - 12
public/ht/index.php

@@ -1,22 +1,31 @@
 <?php require "../../common/top.php"; ?>
 
-Vous avez accès à un espace <abbr title="SSH File Transfert Protocol">SFTP</abbr>. Vous pouvez téléverser vos sites dans <code>/&lt;nom du site&gt;/*</code>.
+<p>
+	Vous avez accès à un espace <abbr title="SSH File Transfert Protocol">SFTP</abbr>. Vous pouvez téléverser vos sites dans <code>/&lt;nom du site&gt;/*</code>. Indiquez les données ci-dessous à votre client <abbr title="SSH File Transfert Protocol">SFTP</abbr> pour y accéder.
+</p>
 
-<a href="sftp://<?= $_SESSION['username'] ?>@<?= CONF['ht']['sftp_domain'] ?>:<?= CONF['ht']['public_sftp_port'] ?>/">sftp://<?= $_SESSION['username'] ?>@<?= CONF['ht']['sftp_domain'] ?>:<?= CONF['ht']['public_sftp_port'] ?>/</a>
+<section>
 
-Indiquez les données ci-dessous à votre client <abbr title="SSH File Transfert Protocol">SFTP</abbr> pour y accéder.
+	<details>
+		<summary>Clé publique</summary>
+		<code><?= file_get_contents(CONF['ht']['sftp_pub']) ?></code>
+	</details>
 
-<dl>
-	<dt>Utilisataire</dt>
-	<dd>
-		<code><?= $_SESSION['username'] ?></code>
-	</dd>
+	<details>
+		<summary>Empreinte</summary>
+		<code><?= file_get_contents(CONF['ht']['sftp_fp']) ?></code>
+	</details>
 
-	<dt>Clé de passe</dt>
-	<dd>
-		celle que vous avez définit lors de l'activation de l'accès <abbr title="SSH File Transfert Protocol">SFTP</abbr>
-	</dd>
+	<details>
+		<summary>Art ASCII</summary>
+		<pre><?= file_get_contents(CONF['ht']['sftp_asciiart']) ?></pre>
+	</details>
+
+</section>
+
+<a href="sftp://<?= isset($_SESSION['username']) ? $_SESSION['username'] : '&lt;username&gt;'; ?>@<?= CONF['ht']['sftp_domain'] ?>:<?= CONF['ht']['public_sftp_port'] ?>/">sftp://<?= isset($_SESSION['username']) ? $_SESSION['username'] : '&lt;username&gt;'; ?>@<?= CONF['ht']['sftp_domain'] ?>:<?= CONF['ht']['public_sftp_port'] ?>/</a>
 
+<dl>
 	<dt>Serveur</dt>
 	<dd>
 		<code><?= CONF['ht']['sftp_domain'] ?></code>
@@ -31,6 +40,16 @@ Indiquez les données ci-dessous à votre client <abbr title="SSH File Transfert
 	<dd>
 		<code>/</code>
 	</dd>
+
+	<dt>Utilisataire</dt>
+	<dd>
+		<code><?= isset($_SESSION['username']) ? $_SESSION['username'] : '&lt;username&gt;'; ?></code>
+	</dd>
+
+	<dt>Clé de passe</dt>
+	<dd>
+		celle que vous avez définit lors de l'activation de l'accès <abbr title="SSH File Transfert Protocol">SFTP</abbr>
+	</dd>
 </dl>
 
 <dl>