forked from team/site
1
0
Fork 0

add webfinger tool

This commit is contained in:
Ben Harris 2023-03-27 17:06:27 -04:00
parent f75e6b5977
commit 2ec98a452f
1 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
<?php
$trims = [
"acct:",
"@tilde.team",
"@fuckup.club",
"@nand.sh",
"@ttm.sh",
"@tild3.org",
"@tilde.chat",
"@tilde.news",
"@tilde.site",
"@tildeteam.net",
"@tildeteam.org",
"@tildeverse.net",
"@tildeverse.org",
];
$user = str_replace($trims, "", $_GET["resource"]);
$webfinger_file = "/home/$user/.webfinger.json";
if (file_exists($webfinger_file))
{
header("Content-type: application/jrd+json");
echo file_get_contents($webfinger_file);
}
else
header("Status: 404");
die();