1
0
mirror of https://github.com/Daichimarukana/uwuzu.git synced 2026-06-05 03:24:41 +00:00

uwuzu version 1.2.24

This commit is contained in:
daichimarukana
2023-10-04 00:30:38 +09:00
parent e8ddcb9921
commit 0ecf4b9fb1
41 changed files with 2000 additions and 429 deletions
+13
View File
@@ -0,0 +1,13 @@
<?php
$activitypub_file = "../../server/activitypub.txt";
if(file_get_contents($activitypub_file) === "true"){
header("Content-Type: application/xml; charset=UTF-8");
$domain = $_SERVER['HTTP_HOST'];
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">';
echo '<Link rel="lrdd" type="application/xrd+xml" template="https://'.$domain.'/.well-known/webfinger?resource={uri}"/>';
echo '</XRD>';
}
?>
+19
View File
@@ -0,0 +1,19 @@
<?php
$activitypub_file = "../../server/activitypub.txt";
if(file_get_contents($activitypub_file) === "true"){
header("Content-Type: application/json; charset=utf-8");
$domain = $_SERVER['HTTP_HOST'];
$item = array(
"links" => [
array(
"rel" => "http://nodeinfo.diaspora.software/ns/schema/2.1",
"href" => "https://".$domain."/nodeinfo/2.1",
),
],
);
echo json_encode($item, JSON_UNESCAPED_UNICODE);
}
?>
+39
View File
@@ -0,0 +1,39 @@
<?php
$activitypub_file = "../../server/activitypub.txt";
if(file_get_contents($activitypub_file) === "true"){
header("Content-Type: application/json; charset=utf-8");
$domain = $_SERVER['HTTP_HOST'];
require('../../db.php');
// データベースに接続
try {
$option = array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_MULTI_STATEMENTS => false
);
$pdo = new PDO('mysql:charset=utf8mb4;dbname=' . DB_NAME . ';host=' . DB_HOST, DB_USER, DB_PASS, $option);
} catch (PDOException $e) {
// 接続エラーのときエラー内容を取得する
$error_message[] = $e->getMessage();
}
$user = htmlentities($_GET['resource']);
$userid = str_replace('@','', str_replace('@'.$domain.'', '', $user));
$item = array(
"subject" => "acct:".$userid.'@'.$domain.'',
"links" => [
array(
"rel" => "self",
"type" => "application/activity+json",
"href" => "https://".$domain."/actor/?actor=@".$userid.'',
),
],
);
echo json_encode($item, JSON_UNESCAPED_UNICODE);
}
?>