Przeglądaj źródła

Add linkToDocs()

Miraty 3 lat temu
rodzic
commit
a63cf55c72
7 zmienionych plików z 23 dodań i 6 usunięć
  1. 3 3
      common/init.php
  2. 3 3
      common/pages.php
  3. 1 0
      config.ini
  4. 4 0
      fn/common.php
  5. 4 0
      public/css/main.css
  6. 4 0
      public/ht/index.php
  7. 4 0
      public/reg/glue.php

+ 3 - 3
common/init.php

@@ -10,8 +10,8 @@ define("PLACEHOLDER_DOMAIN", "example"); // From RFC2606: Reserved Top Level DNS
 define("PLACEHOLDER_IPV6", "2001:db8::3"); // From RFC3849: IPv6 Address Prefix Reserved for Documentation
 define("PLACEHOLDER_IPV4", "203.0.113.42"); // From RFC5737: IPv4 Address Blocks Reserved for Documentation
 
-// Page titles definition
-require "pages.php";
-
 foreach (array_diff(scandir(CONF['common']['root_path'] . "/fn"), array('..', '.')) as $file)
 	require CONF['common']['root_path'] . '/fn/' . $file;
+
+// Page titles definition
+require "pages.php";

+ 3 - 3
common/pages.php

@@ -84,11 +84,11 @@ define('DESCRIPTIONS', [
 		],
 		'ht' => [
 			'index' => 'Mettre en ligne son site statique sur un espace <abbr title="SSH File Transfert Protocol">SFTP</abbr>, et le faire répondre en <abbr title="HyperText Transfert Protocol">HTTP</abbr> par DNS ou Tor',
-			'add-http-onion' => 'Ajouter un accès HTTP par service Onion sur un sous-dossier de l\'espace SFTP',
-			'add-http-dns' => 'Ajouter un accès HTTP par DNS et TLS sur un sous-dossier de l\'espace SFTP',
+			'add-http-onion' => 'Ajouter un accès HTTP par ' . linkToDocs('tor', 'service Onion') . ' sur un sous-dossier de l\'espace SFTP',
+			'add-http-dns' => 'Ajouter un accès HTTP par ' . linkToDocs('dns', 'DNS') . ' et ' . linkToDocs('tls', 'TLS') . ' sur un sous-dossier de l\'espace SFTP',
 			'del-http-onion' => 'Retirer un accès HTTP par service Onion d\'un sous-dossier de l\'espace SFTP',
 			'del-http-dns' => 'Retirer un accès HTTP par DNS et TLS d\'un sous-dossier de l\'espace SFTP',
-			'le' => 'Installer un certificat Let\'s Encrypt sur un domaine',
+			'le' => 'Installer un certificat ' . linkToDocs('ca', 'Let\'s Encrypt') . ' sur un domaine',
 		],
 	]
 );

+ 1 - 0
config.ini

@@ -1,5 +1,6 @@
 [common]
 root_path = "/srv/niver/core"
+docs_prefix = "/docs/"
 ; Prefix in URL, if any
 prefix =
 

+ 4 - 0
fn/common.php

@@ -102,3 +102,7 @@ function removeDirectory($dir) {
 	if (rmdir($dir) !== true)
 		serverError("Unable to remove directory.");
 }
+
+function linkToDocs($ref, $title) {
+	return '<a rel="help" href="' . CONF['common']['docs_prefix'] . $ref . '.html">' . $title . '</a>';
+}

+ 4 - 0
public/css/main.css

@@ -88,6 +88,10 @@ a:active {
 	color: var(--foreground-color);
 }
 
+a[rel=help]:before {
+	content: 'ℹ️ ';
+}
+
 dt a {
 	font-size: 1.1rem;
 }

+ 4 - 0
public/ht/index.php

@@ -1,5 +1,9 @@
 <?php require "../../common/html.php"; ?>
 
+<p>
+	Ce service permet d'envoyer des fichiers sur le serveur par <?= linkToDocs('sftp', 'SFTP') ?> afin de les rendre accessibles par <?= linkToDocs('http', 'HTTP') ?>.
+</p>
+
 <?php displayIndex(); ?>
 
 <p>

+ 4 - 0
public/reg/glue.php

@@ -35,6 +35,10 @@ if (isset($_SESSION['username']))
 	<input value="Valider" type="submit">
 </form>
 
+<p>
+	<?= linkToDocs('glue-record', 'Les glue records'); ?>
+</p>
+
 <?php
 
 switchToFormProcess();