Add linkToDocs()

This commit is contained in:
Miraty 2022-07-20 20:03:45 +02:00
parent 1167b52fc6
commit a63cf55c72
7 changed files with 23 additions and 6 deletions

View File

@ -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_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 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) foreach (array_diff(scandir(CONF['common']['root_path'] . "/fn"), array('..', '.')) as $file)
require CONF['common']['root_path'] . '/fn/' . $file; require CONF['common']['root_path'] . '/fn/' . $file;
// Page titles definition
require "pages.php";

View File

@ -84,11 +84,11 @@ define('DESCRIPTIONS', [
], ],
'ht' => [ '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', '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-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 DNS et TLS 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-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', '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',
], ],
] ]
); );

View File

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

View File

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

View File

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

View File

@ -1,5 +1,9 @@
<?php require "../../common/html.php"; ?> <?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(); ?> <?php displayIndex(); ?>
<p> <p>

View File

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