Prep for Gemini

This commit is contained in:
Elizabeth Cray 2023-10-05 18:19:12 -04:00
parent 22d79165b2
commit 2131076545
4 changed files with 51 additions and 0 deletions

View File

@ -19,6 +19,7 @@ Warrant canary available at /etc/ttyserver/canary
* [ ] Canary description popup?
* [ ] Shift-Click for Keygen Options
* [ ] Download SSH Public Key on fingerprint click?
* [ ] Better font scaling for long text
## Completed TODO:
* Change Sign Up to Log In

View File

@ -61,6 +61,42 @@ if (isset($_REQUEST["act"])) {
returnError("Incorrect Verify Query");
}
break;
case "gemproxy":
if (isset($_REQUEST["token"])){
// Verify Encrypted Token
$EncTokenData = $_REQUEST["token"];
$TokenData = verifyEncToken($EncTokenData);
if (gettype($TokenData) == "string") {
// Invalid Token
returnError($TokenData);
}else{
// Valid Token
if (isset($_REQUEST["enable"])){
$userHomeDir = shell_exec("eval echo ~".$TokenData["MastodonData"]->username);
if (!file_exists($userHomeDir)){
returnError("User Home Directory Not Found, try making a new SSH key.");
} else {
if (file_exists($userHomeDir."/public_gemini")){
mkdir($userHomeDir."/public_gemini", 0755);
}
$EnableFile = $userHomeDir."/public_gemini/.serve_ok";
if ($_REQUEST["enable"] == 1){
if (!file_exists($EnableFile)){
file_put_contents($EnableFile, "web_gen");
}
}else{
if (file_exists($EnableFile)){
unlink($EnableFile);
}
}
}
}else {
returnError("Incorrect Gemini Proxy Query");
}
}
}
break;
default:
returnError("Incorrect Action Query");
break;

View File

@ -240,6 +240,16 @@ const logout = () => {
window.location.href = "/?msg=End%20Of%20Line.";
};
const gemini = () => {
Swal.fire({
...SwalConfig,
title: "Gemini",
text: "Gemini is a new internet protocol which:",
html:
"<ul><li>Is heavier than gopher</li><li>Is lighter than the web</li><li>Will not replace either</li></ul>",
});
};
$(() => {
// On Page Load
// Override domain

View File

@ -35,6 +35,10 @@
<input id="keyfile" type="file" style="display: none;"/>
</form>
</div>
<div class="row button">
<button class="col keyButton" onclick="gemini()">Gemini Config</button>
<button class="col keyButton" onclick="configSSH()" hidden>Manage Keys</button>
</div>
<div class="row button">
<button class="col keyButton" onclick="logout()">Log Out</button>
</div>