Add options to disable each service
This commit is contained in:
parent
c7fba71721
commit
6c7cc99abd
4 changed files with 14 additions and 2 deletions
|
@ -64,6 +64,9 @@ echo (PAGE != "index") ? '<a class="niver" href="..">Niver</a><ul><li> <a href="
|
|||
<main>
|
||||
<?php
|
||||
|
||||
if (in_array(SERVICE, ['reg', 'ns', 'ht']) AND CONF[SERVICE]['enabled'] !== true)
|
||||
userError("Ce service est désactivé.");
|
||||
|
||||
// Protect against cross-site request forgery if a POST request is received
|
||||
if (empty($_POST) === false AND (isset($_SERVER['HTTP_SEC_FETCH_SITE']) !== true OR $_SERVER['HTTP_SEC_FETCH_SITE'] !== "same-origin"))
|
||||
userError("Anti-<abbr title='Cross-Site Request Forgery'>CSRF</abbr> verification failed ! (Wrong or unset <code>Sec-Fetch-Site</code> HTTP header)");
|
||||
|
|
|
@ -7,15 +7,18 @@ prefix =
|
|||
knotc_path = "/usr/sbin/knotc"
|
||||
|
||||
[reg]
|
||||
enabled = true
|
||||
registry = niver.test.
|
||||
registry_file = "/srv/ns/niver.test.zone"
|
||||
ttl = 86400
|
||||
subdomain_regex = "^[a-z0-9]{4,63}$"
|
||||
|
||||
[ns]
|
||||
enabled = true
|
||||
knot_zones_path = "/srv/ns"
|
||||
|
||||
[ht]
|
||||
enabled = true
|
||||
; Path were user's sites will be stored
|
||||
ht_path = "/srv/ht"
|
||||
; Nginx configuration directory
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// When the user requests something unexpected
|
||||
function userError($msg) {
|
||||
http_response_code(403);
|
||||
echo "<p><strong>Erreur utilisataire</strong> : <em>" . $msg . "</em></p>";
|
||||
echo "<p><strong>Erreur utilisataire</strong> : <em>" . $msg . "</em></p>\n";
|
||||
closeHTML();
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@ function userError($msg) {
|
|||
function serverError($msg) {
|
||||
http_response_code(500);
|
||||
error_log("Niver internal error: " . strip_tags($msg));
|
||||
echo "<p><strong>Server error</strong>: The server encountered an error: <em>" . $msg . "</em></p>";
|
||||
echo "<p><strong>Server error</strong>: The server encountered an error: <em>" . $msg . "</em></p>\n";
|
||||
closeHTML();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,18 +5,24 @@
|
|||
<dd>
|
||||
Gérer son compte Niver
|
||||
</dd>
|
||||
<?php if(CONF['reg']['enabled'] === true) { ?>
|
||||
<dt><a class="reg" href="reg/">Registre</code></a></dt>
|
||||
<dd>
|
||||
Demander l'attribution d'un sous-domaine</code>
|
||||
</dd>
|
||||
<?php } ?>
|
||||
<?php if(CONF['ns']['enabled'] === true) { ?>
|
||||
<dt><a class="ns" href="ns/">Serveurs de noms</a></dt>
|
||||
<dd>
|
||||
Utiliser le serveur de noms de Niver pour héberger ses zones
|
||||
</dd>
|
||||
<?php } ?>
|
||||
<?php if(CONF['ht']['enabled'] === true) { ?>
|
||||
<dt><a class="ht" href="ht/">Hypertexte</a></dt>
|
||||
<dd>
|
||||
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
|
||||
</dd>
|
||||
<?php } ?>
|
||||
</dl>
|
||||
|
||||
<?php closeHTML(); ?>
|
||||
|
|
Loading…
Reference in a new issue