diff --git a/.gitignore b/.gitignore index a0fa851..460cdce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ css/ niver.log db/niver.db +cmds diff --git a/admin/reg.php b/admin/reg.php deleted file mode 100644 index 1882644..0000000 --- a/admin/reg.php +++ /dev/null @@ -1,149 +0,0 @@ -prepare("INSERT INTO registry(domain, username, last_renewal) VALUES(:domain, :username, :last_renewal)"); - - $time = date("Y-m-d H:i:s"); - $username = "niver"; - $stmt->bindParam(':domain', $extension); - $stmt->bindParam(':username', $username); - $stmt->bindParam(':last_renewal', $time); - - $stmt->execute(); - - echo $extension . "\n"; - exec("cp /var/lib/knot/zones/template /var/lib/knot/zones/" . $extension . "zone"); - exec("sed -i 's/maison.atope.art./" . $extension . "/g' /var/lib/knot/zones/" . $extension . "zone"); - - exec("knotc zone-begin atope.art."); - exec("knotc zone-set atope.art. " . $extension . " 86400 IN NS ns1.atope.art."); - exec("knotc zone-set atope.art. " . $extension . " 86400 IN NS ns6.gandi.net."); - exec("knotc zone-commit atope.art."); - - exec("knotc conf-begin"); - exec("knotc conf-set 'zone[" . $extension . "]'"); - exec("knotc conf-set 'zone[" . $extension . "].file' '" . $extension . "zone'"); - exec("knotc conf-commit"); - - exec("knotc zone-begin " . $extension); - exec("knotc zone-set " . $extension . " " . $extension . " 86400 IN NS ns1.atope.art."); - exec("knotc zone-set " . $extension . " " . $extension . " 86400 IN NS ns6.gandi.net."); - exec("knotc zone-commit " . $extension); -*/ - unset($output); - exec("/usr/sbin/keymgr " . $extension . " ds", $output); - - $dsRecord = preg_replace("/DS/", "86400 DS", $output[0]); - - exec("knotc zone-begin atope.art."); - exec("knotc zone-set atope.art. " . $dsRecord); - exec("knotc zone-commit atope.art."); - -} diff --git a/admin/sftp.php b/admin/sftp.php deleted file mode 100644 index 1c11b15..0000000 --- a/admin/sftp.php +++ /dev/null @@ -1,6 +0,0 @@ -
- +

- +
diff --git a/auth/password.php b/auth/password.php index e94b71d..58fa976 100644 --- a/auth/password.php +++ b/auth/password.php @@ -6,10 +6,10 @@

-
+

-
+
diff --git a/auth/register.php b/auth/register.php index e14428e..ed53236 100755 --- a/auth/register.php +++ b/auth/register.php @@ -39,20 +39,25 @@ if (isset($_POST['username']) AND isset($_POST['password'])) { ?>
-
-
+ Cet identifiant est déjà utilisé. Choisissez-en un autre."; } ?> diff --git a/ht/gemini-domain.php b/ht/gemini-domain.php index f22d31b..614cd92 100644 --- a/ht/gemini-domain.php +++ b/ht/gemini-domain.php @@ -2,9 +2,9 @@

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 + Le domaine doit pointer vers ces adresses IP : +
IPv4 : +
IPv6 :

@@ -64,7 +64,7 @@ if (isset($_POST['domain']) AND isset($_POST['dir']) AND isset($_SESSION['userna $conf = "# START NIVERSITE [" . $_POST['domain'] . "] -root=/srv/hyper/" . $_SESSION['username'] . "/hyper/" . $_POST['dir'] . " +root=" . HT_PATH . "/" . $_SESSION['username'] . "/ht/" . $_POST['dir'] . " # STOP NIVERSITE "; file_put_contents("/etc/gmnisrv.ini", $conf, FILE_APPEND); diff --git a/ht/gemini-onion.php b/ht/gemini-onion.php index 9d969f9..d73f818 100644 --- a/ht/gemini-onion.php +++ b/ht/gemini-onion.php @@ -64,17 +64,19 @@ if (isset($_POST['dir']) AND isset($_SESSION['username'])) { exec(SUDO_PATH . " " . MANIVER_PATH . " export-tor " . $_SESSION['username'] . " " . $_POST['dir'], $output); addNiverLog("Tor data exported by " . $_SESSION['username'], $output); + // Wait + sleep(1); + // Get the address generated by Tor - $onion = file_get_contents("/srv/hyper/" . $_SESSION['username'] . "/hyper/" . $_POST['dir'] . "/hostname"); - $onion = str_replace(array("\r","\n"), "", $onion); + $onion = file_get_contents(HT_PATH . "/" . $_SESSION['username'] . "/ht/" . $_POST['dir'] . "/hostname"); + $onion = str_replace(array("\r", "\n"), "", $onion); // Store it in the database addSite($_SESSION['username'], $_POST['dir'], $onion, "onion", "gemini"); - $conf = "# START NIVERSITE + $conf = " [" . $onion . "] -root=/srv/hyper/" . $_SESSION['username'] . "/hyper/" . $_POST['dir'] . " -# STOP NIVERSITE +root=" . HT_PATH . "/" . $_SESSION['username'] . "/ht/" . $_POST['dir'] . " "; file_put_contents("/etc/gmnisrv.ini", $conf, FILE_APPEND); @@ -82,7 +84,7 @@ root=/srv/hyper/" . $_SESSION['username'] . "/hyper/" . $_POST['dir'] . " exec(SUDO_PATH . " " . MANIVER_PATH . " restart-gmnisrv"); // Tell the user their site address - echo "

L'adresse de votre capsule Onion Gemini est :
http://" . $onion . "

"; + echo "

L'adresse de votre capsule Onion Gemini est :
http://" . $onion . "

"; } diff --git a/ht/http-onion.php b/ht/http-onion.php index 1491660..de235e0 100644 --- a/ht/http-onion.php +++ b/ht/http-onion.php @@ -64,9 +64,12 @@ if (isset($_POST['dir']) AND isset($_SESSION['username'])) { exec(SUDO_PATH . " " . MANIVER_PATH . " export-tor " . $_SESSION['username'] . " " . $_POST['dir'], $output); addNiverLog("Tor data exported by " . $_SESSION['username'], $output); + // Wait + sleep(1); + // Get the address generated by Tor - $onion = file_get_contents("/srv/hyper/" . $_SESSION['username'] . "/hyper/" . $_POST['dir'] . "/hostname"); - $onion = str_replace(array("\r","\n"), "", $onion); + $onion = file_get_contents(HT_PATH . "/" . $_SESSION['username'] . "/ht/" . $_POST['dir'] . "/hostname"); + $onion = str_replace(array("\r", "\n"), "", $onion); // Store it in the database addSite($_SESSION['username'], $_POST['dir'], $onion, "onion", "http"); @@ -79,7 +82,8 @@ if (isset($_POST['dir']) AND isset($_SESSION['username'])) { file_put_contents(NGINX_CONFIG_PATH . "/" . $_POST['dir'] . ".conf", $nginxConf); // Reload Nginx - exec(SUDO_PATH . " " . MANIVER_PATH . " reload-nginx"); + exec(SUDO_PATH . " " . MANIVER_PATH . " reload-nginx", $output); + addNiverLog("Nginx reloaded by " . $_SESSION['username'], $output); // Tell the user their site address echo "

L'adresse de votre site Onion HTTP est :
http://" . $onion . "

"; diff --git a/ht/https-domain.php b/ht/https-domain.php index 8fdf855..68c7544 100644 --- a/ht/https-domain.php +++ b/ht/https-domain.php @@ -2,9 +2,9 @@

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 + Le domaine doit pointer vers ces adresses IP : +
IPv4 : +
IPv6 :

diff --git a/ht/sftp.php b/ht/sftp.php index a6844a4..2ab8c69 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 sera loggué en clair dans le systèmee et il ne pourra pas être modifié. +
Il sera loggué en clair dans le système et il ne pourra pas être modifié.

@@ -28,41 +28,56 @@ if ($_SESSION['sftp_enabled'] == false) { ?> } } else if ($_SESSION['sftp_enabled'] == true) { ?> - Indiquez les données ci-dessous à votre client SFTP pour accéder à vos sites. -
-
Utilisataire
-
- -
+ Vous avez désormais accès à un espace SFTP. Vous pouvez téléverser vos sites dans /ht/<nom du site>/*. +
+
+

Quota

+ L'espace est limité au total à 10Kio de stockage et 10 fichiers/dossiers. +
+
+

Clients SFTP

+ Dolphin et GNOME Fichiers (Nautilus) sont disponibles sur la plupart des distributions GNU et sont installés par défaut respectivement sur les environnements de bureau KDE et GNOME. FileZilla est disponible aussi pour les autres systèmes d'exploitation de bureau. +
+ C'est aussi possible d'utiliser le client sftp en ligne de commande. +
+
+

Informations de connexion

-
Clé de passe
-
- celle que vous avez définit lors de l'activation de l'accès SFTP -
+
+ sftp://@sftp.niver.4.niv.re/ +
-
Serveur
-
- sftp.niver.atope.art -
+ Indiquez les données ci-dessous à votre client SFTP pour y accéder. -
Port
-
- 22 (par défaut) -
+
+
Utilisataire
+
+ +
-
Dossier
-
- / -
-
+
Clé de passe
+
+ celle que vous avez définit lors de l'activation de l'accès SFTP +
-
- sftp://@sftp.niver.atope.art/ -
+
Serveur
+
+ sftp.niver.4.niv.re +
+ +
Port
+
+ 22 (par défaut) +
+ +
Dossier
+
+ / +
+
+ + -

- L'accès n'est disponible qu'en IPv4. -

Vérifier la connexion

@@ -71,12 +86,12 @@ if ($_SESSION['sftp_enabled'] == false) { ?>
- N'acceptez la connexion que si votre client vous montre les mêmes ! + N'acceptez la connexion que si votre client vous montre l'une de ces signatures !
) +define("KNOTC_PATH", "/usr/sbin/knotc"); +define("KEYMGR_PATH", "/usr/sbin/keymgr"); +define("SUDO_PATH", "/usr/bin/sudo"); +define("LS_PATH", "/usr/bin/ls"); + +// Both frontend and backend regexes +define("USERNAME_REGEX", "^[a-z]{4,32}$"); +define("PASSWORD_REGEX", "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z0-9]{8,1024}|.{10,1024}$"); +define("SUBDOMAIN_REGEX", "^[a-z]{4,63}$"); + +// Color scheme +define("THEME", array( + 'htColor' => "#FF0000", + 'regColor' => "#DA03E5", + 'authColor' => "#00FF00", + 'nsColor' => "#00A5A5",//00c4c4 + 'lightColor' => '#FFFFFF', + 'darkColor' => '#2a2a2a', +)); + +// Public suffixes +define("SUFFIXES", array( + "4.niv.re.", + + "asso.4.niv.re.", + "org.4.niv.re.", + "perso.4.niv.re.", + "blog.4.niv.re.", + "me.4.niv.re.", + + "edu.4.niv.re.", + "info.4.niv.re.", + "wiki.4.niv.re.", + "sci.4.niv.re.", + + "pol.4.niv.re.", + "libre.4.niv.re.", + "fem.4.niv.re.", + "eco.4.niv.re.", + "veg.4.niv.re.", + "bio.4.niv.re.", + "anar.4.niv.re.", + "ancom.4.niv.re.", + "acab.4.niv.re.", + "handi.4.niv.re.", + + "queer.4.niv.re.", + "gay.4.niv.re.", + "enby.4.niv.re.", + "trans.4.niv.re.", + + "net.4.niv.re.", + "tech.4.niv.re.", + "io.4.niv.re.", + "sec.4.niv.re.", + "cyber.4.niv.re.", + "dev.4.niv.re.", + "geek.4.niv.re.", + "fs.4.niv.re.", + "ht.4.niv.re.", + "hyper.4.niv.re.", + "git.4.niv.re.", + "forge.4.niv.re.", + "code.4.niv.re.", + "lab.4.niv.re.", + "labs.4.niv.re.", + "gemini.4.niv.re.", + "gmi.4.niv.re.", + "gemlog.4.niv.re.", + "mail.4.niv.re.", + "ynh.4.niv.re.", + "yuno.4.niv.re.", + "sys.4.niv.re.", + + "fed.4.niv.re.", + "fedi.4.niv.re.", + "soc.4.niv.re.", + "masto.4.niv.re.", + "plero.4.niv.re.", + "pix.4.niv.re.", + "mobi.4.niv.re.", + + "art.4.niv.re.", + "music.4.niv.re.", + "video.4.niv.re.", + "draw.4.niv.re.", + "audio.4.niv.re.", + "ink.4.niv.re.", + + "na.4.niv.re.", + "psy.4.niv.re.", + "neuro.4.niv.re.", + "auti.4.niv.re.", + "plur.4.niv.re.", + + "blue.4.niv.re.", + "red.4.niv.re.", + "pink.4.niv.re.", + "green.4.niv.re.", + "black.4.niv.re.", + + "city.4.niv.re.", + "town.4.niv.re.", + "cafe.4.niv.re.", + "home.4.niv.re.", + "forum.4.niv.re.", + + "dream.4.niv.re.", + "space.4.niv.re.", + "forest.4.niv.re.", + "rain.4.niv.re.", + "snow.4.niv.re.", + "sun.4.niv.re.", + "earth.4.niv.re.", + "world.4.niv.re.", + "soft.4.niv.re.", + "cute.4.niv.re.", + "cutie.4.niv.re.", + "fun.4.niv.re.", + "play.4.niv.re.", + "game.4.niv.re.", +)); diff --git a/inc/form/form.ns.inc.php b/inc/form/form.ns.inc.php index f75c8b0..6e218e8 100644 --- a/inc/form/form.ns.inc.php +++ b/inc/form/form.ns.inc.php @@ -5,42 +5,55 @@
- -
- + +
+ +
+ + if (!empty($zones)) { + foreach ($zones as $zone) + echo ""; + } + ?> + +
+
TTL - - - - - - +
+ +
+ + + +
+
+ +
+ +
- - -
- diff --git a/inc/ht.inc.php b/inc/ht.inc.php index 9b4c62e..75df45e 100644 --- a/inc/ht.inc.php +++ b/inc/ht.inc.php @@ -3,7 +3,7 @@ if (strpos($_SERVER['PHP_SELF'], "inc.php") !== false) exit("This file is meant to be included."); function listFsDirs($username) { - exec(LS_PATH . " ls --format=single-column -d /srv/hyper/" . $username . "/hyper/*/", $absoluteDirs); + exec(LS_PATH . " --format=single-column -d " . HT_PATH . "/" . $username . "/ht/*/", $absoluteDirs); $relativeDirs = false; foreach ($absoluteDirs as $i => $absoluteDir) { $tree = explode("/", $absoluteDir); // The last key is NULL diff --git a/inc/html/ttl.ns.inc.php b/inc/html/ttl.ns.inc.php deleted file mode 100644 index f585f26..0000000 --- a/inc/html/ttl.ns.inc.php +++ /dev/null @@ -1,15 +0,0 @@ -
- TTL - -
- -
- -
- -
diff --git a/inc/ns.inc.php b/inc/ns.inc.php index 5f4ff40..87613e4 100644 --- a/inc/ns.inc.php +++ b/inc/ns.inc.php @@ -5,7 +5,6 @@ if (strpos($_SERVER['PHP_SELF'], "inc.php") !== false) function nsCommonRequirements() { if (isset($_POST['action']) AND isset($_POST['zone']) - AND isset($_POST['domain']) AND isset($_POST['ttl-value']) AND isset($_POST['ttl-multiplier']) AND isset($_SESSION['username']) @@ -18,7 +17,12 @@ function nsParseCommonRequirements() { $values['action'] = checkAction($_POST['action']); nsCheckZonePossession($_POST['zone']); - checkAbsoluteDomainFormat($_POST['domain']); + + if (($_POST['subdomain'] === "") OR ($_POST['subdomain'] === "@")) + $values['domain'] = $_POST['zone']; + else + $values['domain'] = $_POST['subdomain'] . "." . $_POST['zone']; + checkAbsoluteDomainFormat($values['domain']); $values['ttl'] = $_POST['ttl-value'] * $_POST['ttl-multiplier']; diff --git a/inc/pages.inc.php b/inc/pages.inc.php index a40c70c..10e9f95 100644 --- a/inc/pages.inc.php +++ b/inc/pages.inc.php @@ -38,7 +38,7 @@ switch (SERVICE) { $page['title'] = "Enregistrement TLSA"; break; case "zone": - $page['title'] = "Ajouter une zone"; + $page['title'] = "Gérer ses zones"; break; } break; @@ -53,7 +53,7 @@ switch (SERVICE) { $page['title'] = "Ajouter un enregistrement NS"; break; case "register": - $page['title'] = "Enregistrer un nouveau nom de domaine"; + $page['title'] = "Enregistrer un nouveau domaine"; break; case "glue": $page['title'] = "Créer un Glue Record"; diff --git a/inc/reg.inc.php b/inc/reg.inc.php index 838a79d..1d9e42f 100644 --- a/inc/reg.inc.php +++ b/inc/reg.inc.php @@ -2,7 +2,8 @@ if (strpos($_SERVER['PHP_SELF'], "inc.php") !== false) exit("This file is meant to be included."); -function regGetSuffix($domain) { +function regGetUpperDomain($domain) { + // Remove anything before the first dot and the first dot itself return preg_replace("/^[^.]+\./", "", $domain); } @@ -75,105 +76,3 @@ function regIsFree($domain) { } } - -$suffixes = array( - "atope.art.", - - "asso.atope.art.", - "org.atope.art.", - "perso.atope.art.", - "blog.atope.art.", - "me.atope.art.", - - "edu.atope.art.", - "info.atope.art.", - "wiki.atope.art.", - "sci.atope.art.", - - "pol.atope.art.", - "libre.atope.art.", - "fem.atope.art.", - "eco.atope.art.", - "veg.atope.art.", - "bio.atope.art.", - "anar.atope.art.", - "ancom.atope.art.", - "acab.atope.art.", - "handi.atope.art.", - - "queer.atope.art.", - "gay.atope.art.", - "enby.atope.art.", - "trans.atope.art.", - - "net.atope.art.", - "tech.atope.art.", - "io.atope.art.", - "sec.atope.art.", - "cyber.atope.art.", - "dev.atope.art.", - "geek.atope.art.", - "fs.atope.art.", - "ht.atope.art.", - "hyper.atope.art.", - "git.atope.art.", - "forge.atope.art.", - "code.atope.art.", - "lab.atope.art.", - "labs.atope.art.", - "gemini.atope.art.", - "gmi.atope.art.", - "gemlog.atope.art.", - "mail.atope.art.", - "ynh.atope.art.", - "yuno.atope.art.", - "sys.atope.art.", - - "fed.atope.art.", - "fedi.atope.art.", - "soc.atope.art.", - "masto.atope.art.", - "plero.atope.art.", - "pix.atope.art.", - "mobi.atope.art.", - - "art.atope.art.", - "music.atope.art.", - "video.atope.art.", - "draw.atope.art.", - "audio.atope.art.", - "ink.atope.art.", - - "na.atope.art.", - "psy.atope.art.", - "neuro.atope.art.", - "auti.atope.art.", - "plur.atope.art.", - - "blue.atope.art.", - "red.atope.art.", - "pink.atope.art.", - "green.atope.art.", - "black.atope.art.", - - "city.atope.art.", - "town.atope.art.", - "cafe.atope.art.", - "home.atope.art.", - "forum.atope.art.", - - "dream.atope.art.", - "space.atope.art.", - "forest.atope.art.", - "rain.atope.art.", - "snow.atope.art.", - "sun.atope.art.", - "earth.atope.art.", - "world.atope.art.", - "soft.atope.art.", - "cute.atope.art.", - "cutie.atope.art.", - "fun.atope.art.", - "play.atope.art.", - "game.atope.art.", -); diff --git a/index.php b/index.php index fc74de7..f720565 100644 --- a/index.php +++ b/index.php @@ -1,17 +1,17 @@
-
Registre atope.art
+
Registre 4.niv.re.
- Demander l'attribution d'un sous-domaine d'atope.art + Demander l'attribution d'un sous-domaine de 4.niv.re.
Serveurs de noms
- Utiliser les serveurs ns*.atope.art pour héberger ses zones de domaines + Utiliser le serveur de noms de Niver pour héberger ses zones
Hypertexte
- Mettre en ligne son site statique sur un espace SFTP, et le faire répondre en HTTP sur des domaines ou par Tor + Mettre en ligne son site statique sur un espace SFTP, et le faire répondre en HTTP ou Gemini par le DNS ou Tor
Authentification
diff --git a/less/form.less b/less/form.less index 25a5ef4..492dc5f 100644 --- a/less/form.less +++ b/less/form.less @@ -12,7 +12,6 @@ input, select { border-radius: 12px; font-size: @fontSize; margin: 5px; - height: 100%; padding: 10px; border-style: solid; border-width: 2px; @@ -48,6 +47,10 @@ input[type=submit] { margin: 22px; } +input#subdomain, input#ttl-value { + text-align: right; +} + #password { width: 24ch; } @@ -65,7 +68,7 @@ input:invalid+span::after { } input:valid+span::after { - content: ''; + content: ''; // ✓ } input+span::after { @@ -76,21 +79,28 @@ input+span::after { font-family: monospace; } -label+input[required]::after { - content: '*'; -} - -/* -input:valid+span:after { - content: '✓'; - padding-left: 10px; -} -*/ -label { - padding-top: 10px; -} - label.aboutInputCondition { display: block; font-size: @fontSize - 10%; } + +fieldset { + border-radius: 20px; + border-width: 2px; + border-style: solid; + display: flex; + flex-direction: row; + justify-content: center; + + @media @light { + border-color: @darkColor; + } + + @media @dark { + border-color: @lightColor; + } +} + +.elForm { + flex-direction: column; +} diff --git a/less/main.less b/less/main.less index 1f44bd7..b129c72 100644 --- a/less/main.less +++ b/less/main.less @@ -14,8 +14,12 @@ h1 { } body { + margin: 0px; font-family: system-ui, sans-serif; font-size: @fontSize; +} + +header, main, footer { margin-left: 20%; margin-right: 20%; @media (max-width: 500px) { @@ -40,17 +44,9 @@ a { color: @authColor; } -footer { - margin-left: 20%; - margin-right: 20%; - @media (max-width: 500px) { - margin-left: 0px; - margin-right: 0px; - } -} - header { text-align: center; + margin-top: 20px; } p { @@ -90,19 +86,3 @@ h2 { color: @darkColor; } } - -/* -.prideFlag { - bottom: 0px; - margin: 0px; - margin-bottom: 12px; - border-color: red; - background-color: rgba(0, 0, 0, 0); - background-image: linear-gradient(to right, rgb(52, 0, 60) 0%, rgb(52, 0, 60) 17%, rgb(0, 40, 137) 17%, rgb(0, 40, 137) 33%, rgb(15, 81, 33) 33%, rgb(15, 81, 33) 50%, rgb(189, 179, 61) 50%, rgb(189, 179, 61) 66%, rgb(169, 105, 34) 66%, rgb(169, 105, 34) 83%, rgb(117, 0, 0) 83%, rgb(117, 0, 0) 100%); - border: 0; - height: 16px; - background: #087F28; - background: linear-gradient(to right, #740D85 0%, #740D85 17%, #064DFE 17%, #064DFE 33%, #087F28 33%, #087F28 50%, #FEEC1A 50%, #FEEC1A 66%, #FE8B0B 66%, #FE8B0B 83%, #E20706 83%, #E20706 100% ); - width: 100%; -} -*/ diff --git a/niver.log b/niver.log index 69ddadc..82f59d0 100644 --- a/niver.log +++ b/niver.log @@ -99,10 +99,359 @@ status: exit code: 1 stdout: stderr: useradd: cannot lock /etc/passwd; try again later. - + 2021-05-17 13:09:55 pale enabled SFTP on their account status: exit code: 1 stdout: stderr: useradd: cannot lock /etc/passwd; try again later. + + +2021-05-26 09:19:38 coco enabled SFTP on their account + status: exit code: 1 + stdout: + stderr: useradd: cannot lock /etc/passwd; try again later. + +2021-05-28 15:01:47 cray enabled SFTP on their account + status: exit code: 1 + stdout: + stderr: useradd: cannot lock /etc/passwd; try again later. + + +2021-05-28 15:09:00 goule enabled SFTP on their account + status: exit code: 1 + stdout: + stderr: useradd: cannot lock /etc/passwd; try again later. + +2021-05-28 15:18:24 fatfat enabled SFTP on their account + status: exit code: 1 + stdout: + stderr: useradd: cannot lock /etc/passwd; try again later. + +2021-07-06 01:07:28 miraaty enabled SFTP on their account + +2021-07-08 21:47:43 testdeux enabled SFTP on their account + status: exit status: 0 + stdout: + stderr: + sent username:password to chpasswd + chpasswd responded with: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + +2021-07-08 23:24:50 testtrois enabled SFTP on their account + status: exit status: 0 + stdout: + stderr: + sent username:password to chpasswd + chpasswd responded with: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + +2021-07-08 23:51:52 testquatre enabled SFTP on their account + status: exit status: 0 + stdout: + stderr: + sent username:password to chpasswd + chpasswd responded with: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + +2021-07-10 19:47:47 Tor reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + +2021-07-10 19:47:47 Tor data exported by testquatre + status: exit status: 0 + stdout: + stderr: + +2021-07-10 19:47:47 Nginx reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + status: exit status: 1 + stdout: + stderr: Job for nginx.service failed. + See "systemctl status nginx.service" and "journalctl -xe" for details. + +2021-07-10 19:52:25 Tor reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + +2021-07-10 19:52:25 Tor data exported by testquatre + status: exit status: 0 + stdout: + stderr: + +2021-07-10 19:52:25 Nginx reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + status: exit status: 1 + stdout: + stderr: Job for nginx.service failed. + See "systemctl status nginx.service" and "journalctl -xe" for details. + + +2021-07-10 20:17:00 Tor reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + +2021-07-10 20:17:00 Tor data exported by testquatre + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + +2021-07-10 20:17:00 Nginx reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 1 + stdout: + stderr: Job for nginx.service failed. + See "systemctl status nginx.service" and "journalctl -xe" for details. + + +2021-07-10 23:25:42 Tor reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + +2021-07-10 23:25:42 Tor data exported by testquatre + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + +2021-07-10 23:25:42 Nginx reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 1 + stdout: + stderr: Job for nginx.service failed. + See "systemctl status nginx.service" and "journalctl -xe" for details. + + +2021-07-11 00:57:45 Tor reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + +2021-07-11 00:57:45 Tor data exported by testquatre + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + +2021-07-11 00:57:45 Nginx reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 1 + stdout: + stderr: Job for nginx.service failed. + See "systemctl status nginx.service" and "journalctl -xe" for details. + + +2021-07-11 01:02:36 Tor reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + +2021-07-11 01:02:36 Tor data exported by testquatre + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + +2021-07-11 01:02:39 Nginx reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 1 + stdout: + stderr: Job for nginx.service failed. + See "systemctl status nginx.service" and "journalctl -xe" for details. + + +2021-07-11 01:10:38 Tor reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + +2021-07-11 01:10:38 Tor data exported by testquatre + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + +2021-07-11 01:10:39 Nginx reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 1 + stdout: + stderr: Job for nginx.service failed. + See "systemctl status nginx.service" and "journalctl -xe" for details. + + +2021-07-14 23:58:48 Tor reloaded by testquatre + status: exit status: 1 + stdout: + stderr: Job for tor@niver.service failed because the control process exited with error code. + See "systemctl status tor@niver.service" and "journalctl -xe" for details. + + +2021-07-14 23:58:48 Tor data exported by testquatre + status: exit status: 1 + stdout: + stderr: Job for tor@niver.service failed because the control process exited with error code. + See "systemctl status tor@niver.service" and "journalctl -xe" for details. + + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + +2021-07-15 00:01:27 Tor reloaded by testquatre + status: exit status: 1 + stdout: + stderr: tor@niver.service is not active, cannot reload. + + +2021-07-15 00:01:27 Tor data exported by testquatre + status: exit status: 1 + stdout: + stderr: tor@niver.service is not active, cannot reload. + + +2021-07-15 00:09:31 Tor reloaded by testquatre + status: exit status: 0 + stdout: + stderr: + +2021-07-15 00:09:31 Tor data exported by testquatre + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + +2021-07-15 03:44:46 Tor reloaded by testquatre + status: exit status: 1 + stdout: + stderr: Job for tor@niver.service failed because the control process exited with error code. + See "systemctl status tor@niver.service" and "journalctl -xe" for details. + + +2021-07-15 03:44:46 Tor data exported by testquatre + status: exit status: 1 + stdout: + stderr: Job for tor@niver.service failed because the control process exited with error code. + See "systemctl status tor@niver.service" and "journalctl -xe" for details. + + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + +2021-07-15 03:44:47 Nginx reloaded by testquatre + status: exit status: 1 + stdout: + stderr: Job for tor@niver.service failed because the control process exited with error code. + See "systemctl status tor@niver.service" and "journalctl -xe" for details. + + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: + status: exit status: 0 + stdout: + stderr: diff --git a/ns/caa.php b/ns/caa.php index 6b408dc..99f7111 100644 --- a/ns/caa.php +++ b/ns/caa.php @@ -40,7 +40,7 @@ if (nsCommonRequirements() exit("ERROR: Wrong value for value"); exec(KNOTC_PATH . " zone-begin " . $_POST['zone']); - exec(KNOTC_PATH . " zone-" . $values['action'] . "set " . $_POST['zone'] . " " . $_POST['domain'] . " " . $values['ttl'] . " IN CAA " . $_POST['flag'] . " " . $_POST['tag'] . " " . $_POST['value']); + exec(KNOTC_PATH . " zone-" . $values['action'] . "set " . $_POST['zone'] . " " . $values['domain'] . " " . $values['ttl'] . " IN CAA " . $_POST['flag'] . " " . $_POST['tag'] . " " . $_POST['value']); exec(KNOTC_PATH . " zone-commit " . $_POST['zone']); echo "Enregistrement ajouté"; } diff --git a/ns/dnssec.php b/ns/dnssec.php index 75724ad..aece32c 100644 --- a/ns/dnssec.php +++ b/ns/dnssec.php @@ -1,5 +1,7 @@ +Afin d'activer DNSSEC, vous devez indiquer un enregistrement DS à la zone parente. + -
- - + -
+ ?> + +

@@ -34,16 +35,11 @@ if (isset($_POST['action']) AND isset($_POST['subdomain']) AND isset($_POST['suffix']) AND isset($_POST['ip'])) { - if ($domains) { - foreach($domains as $domain) { - if ($_POST['suffix'] == $domain) goto ownedSuffix; - } - exit("ERROR : You don't own this suffix"); - } else { + if (!$suffixes) exit("ERROR : You don't own any domain"); - } - ownedSuffix: + if (!in_array($_POST['suffix'], $suffixes)) + exit("ERROR : You don't own this suffix"); $domain = $_POST['subdomain'] . "." . $_POST['suffix']; @@ -60,12 +56,11 @@ if (isset($_POST['action']) AND isset($_POST['subdomain']) AND isset($_POST['suf $action = checkAction($_POST['action']); - // Remove anything before the first dot and the first dot itself - $suffix = regGetSuffix($_POST['suffix']); + $publicSuffix = regGetUpperDomain($_POST['suffix']); - exec(KNOTC_PATH . " zone-begin " . $suffix); - exec(KNOTC_PATH . " zone-" . $action . "set " . $suffix . " " . $_POST['subdomain'] . " 86400 " . $record . " " . $_POST['ip']); - exec(KNOTC_PATH . " zone-commit " . $suffix); + exec(KNOTC_PATH . " zone-begin " . $publicSuffix); + exec(KNOTC_PATH . " zone-" . $action . "set " . $publicSuffix . " " . $domain . " 86400 " . $record . " " . $_POST['ip']); + exec(KNOTC_PATH . " zone-commit " . $publicSuffix); echo "Glue record ajouté"; } diff --git a/reg/index.php b/reg/index.php index 79d0754..0839115 100644 --- a/reg/index.php +++ b/reg/index.php @@ -1,13 +1,13 @@
-
Enregistrer un nouveau nom de domaine
+
Enregistrer un nouveau domaine
- Prendre possession d'un sous-domaine d'atope.art + Prendre possession d'un sous-domaine de 4.niv.re.
Enregistrement NS
- Indiquer les serveurs de noms de son sous-domaine d'atope.art + Indiquer les serveurs de noms de son sous-domaine de 4.niv.re.
Enregistrement DS
@@ -15,7 +15,7 @@
Glue Record
- Indiquer les IP de ses serveurs de noms de son sous-domaine d'atope.art dont les adresses se trouvent sur ce même sous-domaine + Indiquer les IP de ses serveurs de noms de son sous-domaine de 4.niv.re. dont les adresses se trouvent sur ce même sous-domaine
diff --git a/reg/ns.php b/reg/ns.php index dcdcfc9..d15a621 100644 --- a/reg/ns.php +++ b/reg/ns.php @@ -41,7 +41,7 @@ if (isset($_POST['domain']) AND isset($_POST['action']) AND isset($_POST['ns']) $action = checkAction($_POST['action']); - $suffix = regGetSuffix($_POST['domain']); + $suffix = regGetUpperDomain($_POST['domain']); exec(KNOTC_PATH . " zone-begin " . $suffix); exec(KNOTC_PATH . " zone-" . $action . "set " . $suffix . " " . $_POST['domain'] . " 86400 NS " . $_POST['ns']); diff --git a/reg/register.php b/reg/register.php index 0e3f67e..4d58a1f 100644 --- a/reg/register.php +++ b/reg/register.php @@ -1,129 +1,136 @@ -Enregistrer la possession d'un domaine sur son compte
-Doit être composé uniquement de lettres latines non accentuées, au moins 4 +Enregistrer la possession d'un domaine sur son compte.
+Ce domaine doit être composé uniquement d'au moins 4 lettres latines non accentuées.

Domaine - - . - + +
+ +
+ + +

@@ -131,10 +138,10 @@ Doit être composé uniquement de lettres latines non accentuées, au moins 4 "#FF0000", - 'regColor' => "#DA03E5", - 'authColor' => "#00FF00", - 'nsColor' => "#00c4c4", - 'lightColor' => '#FFFFFF', - 'darkColor' => '#2a2a2a', -)); - -// Initialisation de la session (avec des cookies) +require "inc/const.inc.php"; +// Functions usefull everywhere +require "inc/all.inc.php"; +require "inc/format.inc.php"; +// Service-specific functions +require "inc/ht.inc.php"; +require "inc/ns.inc.php"; +require "inc/reg.inc.php"; +// Page titles definition +require "inc/pages.inc.php"; +// Session initialisation (with cookies) session_start([ 'name' => 'niver', 'sid_length' => 64, @@ -52,44 +28,34 @@ session_start([ 'use_only_cookies' => true, ]); -// Redirige vers la page de connexion si pas connecté·e +// Redirect to the login page if not logged in if (SERVICE != "auth" AND !isset($_SESSION['username'])) { header('Location: ' . PREFIX . '/auth/login?redir=' . SERVICE . "/" . PAGE, true, 302); exit; } -// Enlève .php de l'URL (si jamais) +// Remove .php from URL (if any) if (substr($_SERVER['REQUEST_URI'], -4) == ".php") { header("Location: " . PREFIX . "/" . SERVICE . "/" . PAGE, true, 301); // 301 Moved Permanently exit; } -// Fonctions utiles partout -require "inc/all.inc.php"; -require "inc/format.inc.php"; -// Fonctions specifiques à un service -require "inc/ht.inc.php"; -require "inc/ns.inc.php"; -require "inc/reg.inc.php"; -// Définitions des titres de pages -require "inc/pages.inc.php"; - -// Compilation du Less vers le CSS +// Less > CSS compilation require_once 'lessphp/lib/Less/Autoloader.php'; Less_Autoloader::register(); -// Liste les fichiers dans le dossier less/ +// List files in less/ $relativeLessFiles = array_diff(scandir(ROOT_PATH . "/less"), array('..', '.')); -// Remplace les clés par les valeurs, et les valeurs par les clés +// Replace keys by values, and values by keys $relativeLessFiles = array_flip($relativeLessFiles); -// Transforme les chemins relatifs en chemins absolus +// Change relative paths into absolute paths foreach ($relativeLessFiles as $relativeLessFile => $nothing) { $absoluteLessFiles[ROOT_PATH . "/less/" . $relativeLessFile] = ""; } -// Génère un seul fichier CSS minimifié dans css/ à partir des sources dans less/ +// Generate one minified CSS file into css/ from sources in less/ $options = array( 'cache_dir' => ROOT_PATH . '/css/', 'compress' => true @@ -112,22 +78,15 @@ $cssFileName = Less_Cache::Get($absoluteLessFiles, $options, THEME); -