diff --git a/ht/gemini-domain.php b/ht/gemini-domain.php
new file mode 100644
index 0000000..d1f9b02
--- /dev/null
+++ b/ht/gemini-domain.php
@@ -0,0 +1,78 @@
+
+
+
+ Ajouter un domaine sur un dossier de site
+ Le domaine doit pointer vers ces adresses IP :
+ IPv4 : 45.13.104.169
+ IPv6 : 2a0b:cbc0:1103:2::106f
+
+
+
+
+
+
+
diff --git a/ht/gemini-onion.php b/ht/gemini-onion.php
new file mode 100644
index 0000000..76c32fa
--- /dev/null
+++ b/ht/gemini-onion.php
@@ -0,0 +1,89 @@
+
+
+ Ajouter un accès en .onion sur un dossier
+
+
+
+
+L'adresse de votre capsule Onion Gemini est :
http://" . $onion . "";
+
+}
+
+?>
+
+
diff --git a/ht/http-onion.php b/ht/http-onion.php
index 664358d..b63c543 100644
--- a/ht/http-onion.php
+++ b/ht/http-onion.php
@@ -55,11 +55,11 @@ if (isset($_POST['dir']) AND isset($_SESSION['username'])) {
$torConf = $torConf . "\nHiddenServiceDir /var/lib/tor/niver/" . $_POST['dir'] . "/\nHiddenServicePort 80 [::1]:80";
file_put_contents("/etc/tor/torrc", $torConf);
- exec("sudo -u root /root/maniver/target/debug/maniver reload-tor", $output);
+ exec("sudo -u root " . MANIVER_PATH . " reload-tor", $output);
addNiverLog("Tor reloaded by " . $_SESSION['username'], $output);
// Copy generated address to a location readable by PHP
- exec("sudo -u root /root/maniver/target/debug/maniver export-tor " . $_SESSION['username'] . " " . $_POST['dir'], $output);
+ exec("sudo -u root " . MANIVER_PATH . " export-tor " . $_SESSION['username'] . " " . $_POST['dir'], $output);
addNiverLog("Tor data exported by " . $_SESSION['username'], $output);
// Get the address generated by Tor
@@ -80,7 +80,7 @@ if (isset($_POST['dir']) AND isset($_SESSION['username'])) {
exec("sudo /root/maniver/target/debug/maniver reload-nginx");
// Tell the user their site address
- echo "L'adresse de votre site Onion est :
http://" . $onion . "
";
+ echo "L'adresse de votre site Onion HTTP est :
http://" . $onion . "
";
}
diff --git a/ht/https-domain.php b/ht/https-domain.php
index 181e976..b7bf693 100644
--- a/ht/https-domain.php
+++ b/ht/https-domain.php
@@ -1,4 +1,5 @@
+
Ajouter un domaine sur un dossier de site
Le domaine doit pointer vers ces adresses IP :
@@ -64,9 +65,9 @@ if (isset($_POST['domain']) AND isset($_POST['dir']) AND isset($_SESSION['userna
$conf = preg_replace("#DIR#", $_POST['dir'], $conf);
$conf = preg_replace("#USER#", $_SESSION['username'], $conf);
file_put_contents("/etc/nginx/hyper.d/" . $_POST['domain'] . ".conf", $conf);
- exec("sudo /root/maniver/target/debug/maniver reload-nginx");
+ exec("sudo " . MANIVER_PATH . " reload-nginx");
//certbot certonly --nginx -d testcrabe.atope.art
- echo "Accès par domaine ajouté sur ce dossier !";
+ echo "Accès HTTP par domaine ajouté sur ce dossier !";
}
?>
diff --git a/ht/index.php b/ht/index.php
index 5dff417..ade1604 100644
--- a/ht/index.php
+++ b/ht/index.php
@@ -5,7 +5,11 @@ Accéder à son espace SFTP, pour publier et mettre à jour ses sites
Un site HTML, accessible par Tor, avec une adresse en .onion
-Des pages HTML, accessible directement, par un nom de domaine
+Un site HTML, accessible directement, par un nom de domaine
+
+Une capsule Gemini, accessible par Tor, avec une adresse en .onion
+
+Une capsule Gemini, accessible directement, par un nom de domaine
diff --git a/ht/le.php b/ht/le.php
index e33efb1..dd5e001 100644
--- a/ht/le.php
+++ b/ht/le.php
@@ -14,7 +14,7 @@
if (isset($_POST['domain'])) {
- exec("sudo /root/maniver/target/debug/maniver le-install " . $_POST['domain'], $output);
+ exec("sudo " . MANIVER_PATH . " le-install " . $_POST['domain'], $output);
echo "";
print_r($output);
echo "
";
diff --git a/ht/sftp.php b/ht/sftp.php
index 7a8241b..a3efb26 100644
--- a/ht/sftp.php
+++ b/ht/sftp.php
@@ -4,7 +4,7 @@
if ($_SESSION['sftp_enabled'] == false) { ?>
Pour que vous puissiez mettre en ligne votre site via SFTP, veuillez définir un mot de passe.
-
Il ne pourra pas être modifié.
+
Il sera loggué en clair dans le systèmee et il ne pourra pas être modifié.
+
+= 0 AND $_POST['flag'] <= 255))
+ exit("ERROR: Wrong value for flag");
+
+ if (!(preg_match("/^[a-z]{1,127}$/", $_POST['tag'])))
+ exit("ERROR: Wrong value for tag");
+
+ if (!(preg_match("/^[a-z0-9.-]{1,255}$/", $_POST['value'])))
+ exit("ERROR: Wrong value for value");
+
+ nsCheckZonePossession($_POST['zone']);
+ checkAbsoluteDomainFormat($_POST['domain']);
+
+ $action = checkAction($_POST['action']);
+
+ $ttl = nsTtl($_POST['ttl-value'], $_POST['ttl-multiplier']);
+
+ exec(KNOTC_PATH . " zone-begin " . $_POST['zone']);
+ exec(KNOTC_PATH . " zone-" . $action . "set " . $_POST['zone'] . " " . $_POST['domain'] . " " . $ttl . " IN CAA " . $_POST['flag'] . " " . $_POST['tag'] . " " . $_POST['value']);
+ exec(KNOTC_PATH . " zone-commit " . $_POST['zone']);
+ echo "Enregistrement ajouté";
+}
+
+?>
+
+
diff --git a/ns/index.php b/ns/index.php
index 1e11e2e..c43208a 100644
--- a/ns/index.php
+++ b/ns/index.php
@@ -16,7 +16,7 @@ Mettre en place DANEEnregistrement SRV
Indiquer un serveur pour un domaine
-
+
Indiquer le serveur mail pour un domaine
Indiquer la localisation physique d'un domaine
diff --git a/ns/ip.php b/ns/ip.php
index 2773f2d..66c5565 100644
--- a/ns/ip.php
+++ b/ns/ip.php
@@ -67,12 +67,7 @@ if (isset($_POST['domain']) AND isset($_POST['ip']) AND isset($_POST['zone']) AN
else
exit("Erreur inconnue sur le format de l'IP");
- if ($_POST['action'] == "delete")
- $action = "un";
- else if ($_POST['action'] == "add")
- $action = "";
- else
- exit("ERROR : Wrong value for action");
+ $action = checkAction($_POST['action']);
exec(KNOTC_PATH . " zone-begin " . $_POST['zone']);
exec(KNOTC_PATH . " zone-" . $action . "set " . $_POST['zone'] . " " . $_POST['domain'] . " 3600 " . $record . " " . $_POST['ip']);
diff --git a/ns/ns.php b/ns/ns.php
index 12c010a..accca00 100644
--- a/ns/ns.php
+++ b/ns/ns.php
@@ -40,12 +40,7 @@ if (isset($_POST['zone']) AND isset($_POST['domain']) AND isset($_POST['action']
checkAbsoluteDomainFormat($_POST['domain']);
checkAbsoluteDomainFormat($_POST['ns']);
- if ($_POST['action'] == "delete")
- $action = "un";
- else if ($_POST['action'] == "add")
- $action = "";
- else
- exit("Erreur : valeur invalide pour action");
+ $action = checkAction($_POST['action']);
exec(KNOTC_PATH . " zone-begin " . $_POST['zone']);
exec(KNOTC_PATH . " zone-" . $action . "set " . $_POST['zone'] . " " . $_POST['domain'] . " 3600 IN NS " . $_POST['ns']);
diff --git a/ns/txt.php b/ns/txt.php
index 5546900..00b5827 100644
--- a/ns/txt.php
+++ b/ns/txt.php
@@ -42,18 +42,13 @@ if (isset($_POST['zone']) AND isset($_POST['domain']) AND isset($_POST['action']
nsCheckZonePossession($_POST['zone']);
checkAbsoluteDomainFormat($_POST['domain']);
- if ($_POST['action'] == "delete")
- $action = "un";
- else if ($_POST['action'] == "add")
- $action = "";
- else
- exit("Erreur : valeur invalide pour action");
+ $action = checkAction($_POST['action']);
$test = ' 3600 IN TXT \"' . $_POST['txt'] . '\"';
echo $test;
exec(KNOTC_PATH . " zone-begin " . $_POST['zone']);
- exec(KNOTC_PATH . " zone-" . $action . "set " . $_POST['zone'] . " " . $_POST['domain'] . ' 3600 IN TXT \"' . $_POST['txt'] . '\"');
+ exec(KNOTC_PATH . " zone-" . $action . "set " . $_POST['zone'] . " " . $_POST['domain'] . ' 3600 IN TXT \"' . $_POST['txt'] . '\"');
exec(KNOTC_PATH . " zone-commit " . $_POST['zone']);
echo "Enregistrement ajouté";
}
diff --git a/reg/glue.php b/reg/glue.php
index d01a36c..99fd39e 100644
--- a/reg/glue.php
+++ b/reg/glue.php
@@ -58,12 +58,7 @@ if (isset($_POST['action']) AND isset($_POST['subdomain']) AND isset($_POST['suf
else
exit("Unknown error about IP format");
- if ($_POST['action'] == "delete")
- $action = "un";
- else if ($_POST['action'] == "add")
- $action = "";
- else
- exit("ERROR : Wrong value for action");
+ $action = checkAction($_POST['action']);
// Remove anything before the first dot and the first dot itself
$suffix = regGetSuffix($_POST['suffix']);
diff --git a/reg/ns.php b/reg/ns.php
index 40d4cb2..dcdcfc9 100644
--- a/reg/ns.php
+++ b/reg/ns.php
@@ -39,12 +39,7 @@ if (isset($_POST['domain']) AND isset($_POST['action']) AND isset($_POST['ns'])
regCheckDomainPossession($_POST['domain']);
checkAbsoluteDomainFormat($_POST['ns']);
- if ($_POST['action'] == "delete")
- $action = "un";
- else if ($_POST['action'] == "add")
- $action = "";
- else
- exit("Erreur : valeur invalide pour action");
+ $action = checkAction($_POST['action']);
$suffix = regGetSuffix($_POST['domain']);
diff --git a/top.inc.php b/top.inc.php
index 3e1f5a8..4564611 100644
--- a/top.inc.php
+++ b/top.inc.php
@@ -26,6 +26,7 @@ define("PAGE", basename($_SERVER['PHP_SELF'], '.php'));
define("DB_PATH", ROOT_PATH . "/db/niver.db");
define("KNOTC_PATH", "/usr/sbin/knotc");
define("KEYMGR_PATH", "/usr/sbin/keymgr");
+define("MANIVER_PATH", "/root/maniver/target/release/maniver");
if (SERVICE != "auth" AND !isset($_SESSION['username'])) {
header('Location: ' . PREFIX . '/auth/login?redir=' . SERVICE . "/" . PAGE, true, 302);