|
@@ -76,17 +76,25 @@ if (isset($_POST['dir']) AND isset($_SESSION['username'])) {
|
|
|
// Store it in the database
|
|
|
addSite($_SESSION['username'], $_POST['dir'], $onion, "onion", "gemini");
|
|
|
|
|
|
- $conf = "
|
|
|
-[" . $onion . "]
|
|
|
-root=" . HT_PATH . "/" . $_SESSION['username'] . "/ht/" . $_POST['dir'] . "
|
|
|
-";
|
|
|
- file_put_contents("/etc/gmnisrv.ini", $conf, FILE_APPEND);
|
|
|
+ // Generate tls keys
|
|
|
+ exec(SUDO_PATH . " " . MANIVER_PATH . " gemini-new-certificate " . $onion);
|
|
|
|
|
|
- // Restart the gmnisrv daemon (as there is no reload support)
|
|
|
- exec(SUDO_PATH . " " . MANIVER_PATH . " restart-gmnisrv");
|
|
|
+ // Add to Twins configuration
|
|
|
+ $conf = "
|
|
|
+ " . $onion . ":
|
|
|
+ cert: " . TWINS_PATH . "/tls/" . $onion . ".crt
|
|
|
+ key: " . TWINS_PATH . "/tls/" . $onion . ".key
|
|
|
+ paths:
|
|
|
+ -
|
|
|
+ path: /
|
|
|
+ root: " . HT_PATH . "/" . $_SESSION['username'] . "/ht/" . $_POST['dir'];
|
|
|
+ file_put_contents(TWINS_PATH . "/twins.conf", $conf, FILE_APPEND);
|
|
|
+
|
|
|
+ // Reload Twins daemon
|
|
|
+ exec(SUDO_PATH . " " . MANIVER_PATH . " reload-twins");
|
|
|
|
|
|
// Tell the user their site address
|
|
|
- echo "<p>L'adresse de votre capsule Onion Gemini est : <br><a href='http://" . $onion . "'<code>http://" . $onion . "</code></a></p>";
|
|
|
+ echo "<p>L'adresse de votre capsule Onion Gemini est : <br><a href='gemini://" . $onion . "'<code>gemini://" . $onion . "</code></a></p>";
|
|
|
|
|
|
}
|
|
|
|