Fediverse search system

Fediver

beta version

【Publickey】の検索結果


QNAP NASをTailscaleに接続したので、ルーターのパケットフィルタ強化を見据えて、QNAP NASに内側から接続できるようにDNSをいじるためにNextDNSを入れた。
NextDNSには元々広告ブロックの機能も備わっているが、広告業者へのアクセスをDNSではたき落とすのは、Publickeyなどのきちんとアド・ポリシーを定めて運用しているサイトが不憫になるのでこちらとしてはやりたくなく、Vivaldiなどの広告ブロック機能付きブラウザを使う前提で無効化している(プライバシー関連では偽装サードパーティートラッカー対策のみ有効)。
IDNホモグラフ攻撃対策などのセキュリティ機能はきっちり使わせていただく。


QNAP NASをTailscaleに接続したので、ルーターのパケットフィルタ強化を見据えて、QNAP NASに内側から接続できるようにDNSをいじるためにNextDNSを入れた。
NextDNSには元々広告ブロックの機能も備わっているが、広告業者へのアクセスをDNSではたき落とすのは、Publickeyなどのきちんとアド・ポリシーを定めて運用しているサイトが不憫になるのでこちらとしてはやりたくなく、Vivaldiなどの広告ブロック機能付きブラウザを使う前提で無効化している。


@s3_odara 多分ActivityPubってブロックリスト公開する仕様ではなくね?(当然ブロックされた相手はわかるが)
自分のActor取ってみたけどそれらしいものは見当たらない

{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",
{
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"toot": "http://joinmastodon.org/ns#",
"featured": {
"@id": "toot:featured",
"@type": "@id"
},
"featuredTags": {
"@id": "toot:featuredTags",
"@type": "@id"
},
"alsoKnownAs": {
"@id": "as:alsoKnownAs",
"@type": "@id"
},
"movedTo": {
"@id": "as:movedTo",
"@type": "@id"
},
"schema": "http://schema.org#",
"PropertyValue": "schema:PropertyValue",
"value": "schema:value",
"discoverable": "toot:discoverable",
"suspended": "toot:suspended",
"memorial": "toot:memorial",
"indexable": "toot:indexable",
"attributionDomains": {
"@id": "toot:attributionDomains",
"@type": "@id"
},
"Emoji": "toot:Emoji",
"focalPoint": {
"@container": "@list",
"@id": "toot:focalPoint"
}
}
],
"id": "https://mastodon.hakurei.win/users/relay",
"type": "Person",
"following": "https://mastodon.hakurei.win/users/relay/following",
"followers": "https://mastodon.hakurei.win/users/relay/followers",
"inbox": "https://mastodon.hakurei.win/users/relay/inbox",
"outbox": "https://mastodon.hakurei.win/users/relay/outbox",
"featured": "https://mastodon.hakurei.win/users/relay/collections/featured",
"featuredTags": "https://mastodon.hakurei.win/users/relay/collections/tags",
"preferredUsername": "relay",
"name": ":onmyou:‮:vc:‭Charlie Root‬",
"summary": "\u003cp\u003eプログラムとかやってるらしい謎のソ連製巫女\u003cbr /\u003e幻想郷社会主義帝国の管理者\u003cbr /\u003eサーバー破壊検定3級\u003c/p\u003e\u003cp\u003eKeyoxide認証用\u003cbr /\u003eopenpgp4fpr:029BE97239D16F6A8B08151B8EBB335CB284FB75\u003c/p\u003e",
"url": "https://mastodon.hakurei.win/@relay",
"manuallyApprovesFollowers": false,
"discoverable": true,
"indexable": true,
"published": "2023-08-29T00:00:00Z",
"memorial": false,
"attributionDomains": [
"hakurei.win"
],
"publicKey": {
"id": "https://mastodon.hakurei.win/users/relay#main-key",
"owner": "https://mastodon.hakurei.win/users/relay",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAppWtw7MIasSbzjY6irWo\njyAqpACUuCDd7K2jXPCIpqexCRxzTcxAv2whErWfGd3nbxw86WLCXVMLT83K16Qk\nE1eunXpjupuwFH3dHAcf64otbs1EgD5LBF7pnB8P/bRzf86QOFgNo+YPitHMed6a\n+5rh2q7EZLYyVWDGmVLyNpqsGsRc7hxG+NjVh2rZJgZEqboAefSUuYq0VmeC8Uvn\no8HLMUmaC3cmbQ1RpDiMktF0LMHSn4/X4+Yzwi1gkwA9tfRoMORudRV5Mnv7Ez+8\nzoIuAZ5O9BzY2R8V4WO8+WPqRnEdhdhyGGYoK3ptpjaI/K6M05HUI92oKV/BS1cv\nKwIDAQAB\n-----END PUBLIC KEY-----\n"
},
"tag": [
{
"id": "https://mastodon.hakurei.win/emojis/25703",
"type": "Emoji",
"name": ":onmyou:",
"updated": "2023-09-06T07:57:02Z",
"icon": {
"type": "Image",
"mediaType": "image/gif",
"url": "https://mastodon.hakurei.win/system/custom_emojis/images/000/025/703/original/1a05478092810515.gif"
}
},
{
"id": "https://mastodon.hakurei.win/emojis/4579",
"type": "Emoji",
"name": ":vc:",
"updated": "2023-08-30T04:26:47Z",
"icon": {
"type": "Image",
"mediaType": "image/png",
"url": "https://mastodon.hakurei.win/system/custom_emojis/images/000/004/579/original/e752744ea722a9cb.png"
}
}
],
"attachment": [
{
"type": "PropertyValue",
"name": "ホームページ",
"value": "\u003ca href=\"https://hakurei.win/\" target=\"_blank\" rel=\"nofollow noopener me\" translate=\"no\"\u003e\u003cspan class=\"invisible\"\u003ehttps://\u003c/span\u003e\u003cspan class=\"\"\u003ehakurei.win/\u003c/span\u003e\u003cspan class=\"invisible\"\u003e\u003c/span\u003e\u003c/a\u003e"
},
{
"type": "PropertyValue",
"name": "Keyoxide",
"value": "\u003ca href=\"https://keyoxide.org/reimu@hakurei.win\" target=\"_blank\" rel=\"nofollow noopener me\" translate=\"no\"\u003e\u003cspan class=\"invisible\"\u003ehttps://\u003c/span\u003e\u003cspan class=\"\"\u003ekeyoxide.org/reimu@hakurei.win\u003c/span\u003e\u003cspan class=\"invisible\"\u003e\u003c/span\u003e\u003c/a\u003e"
}
],
"endpoints": {
"sharedInbox": "https://mastodon.hakurei.win/inbox"
},
"icon": {
"type": "Image",
"mediaType": "image/gif",
"url": "https://mastodon.hakurei.win/system/accounts/avatars/110/974/438/178/272/269/original/cefccde5d63ba39f.gif"
},
"image": {
"type": "Image",
"mediaType": "image/gif",
"url": "https://mastodon.hakurei.win/system/accounts/headers/110/974/438/178/272/269/original/8e81d09fb87f793c.gif"
}
}

このエラーの対処法わかる人います?
ちなみにdbにはそもそも
<ユーザー名>のレコードはないのと、https://mastodon.social/users/<ユーザー名>でアクセスするとそのページは存在しないと言われる
くわえて現時点でmastodon.social上のユーザーしかこのエラーに引っかからない

db-1  | 2024-11-10 04:08:44.413 UTC [114373] ERROR:  duplicate key value violates unique constraint "IDX_171e64971c780ebd23fae140bb"
db-1  | 2024-11-10 04:08:44.413 UTC [114373] DETAIL:  Key ("keyId")=(https://mastodon.social/users/<ユーザー名>#main-key) already exists.
db-1  | 2024-11-10 04:08:44.413 UTC [114373] STATEMENT:  INSERT INTO "user_publickey"("userId", "keyId", "keyPem") VALUES ($1, $2, $3)


う〜ん
エラーメッセージ見る限りuser_publickey周りでkeyの重複が起きているのが原因に見えるんだけどその当該キーがそもそもdbに存在してないんだよな…


やったことまとめ

*
userテーブルの重複確認
* 重複が確認された
*
userテーブルの重複レコードを削除
* 以下のコマンドでプライマリーキーを追加

ALTER TABLE "user"
ADD CONSTRAINT "PK_cace4a159ff9f2512dd42373760" PRIMARY KEY ("id");
* 以下のコマンドで外部キー制約を追加
ALTER TABLE "user_publickey"
ADD CONSTRAINT "FK_10c146e4b39b443ede016f6736d"
FOREIGN KEY ("userId")
REFERENCES "user"("id") ON DELETE CASCADE;


なんで多分以下を叩くことになって流石に心配なのでテスト環境上でバックアップ取ってる

DELETE FROM "user_publickey"
WHERE "userId" NOT IN (SELECT "id" FROM "user");


これ叩いたら7000件くらい出てきた

SELECT "userId" FROM "user_publickey"
WHERE "userId" NOT IN (SELECT "id" FROM "user");