+136
-17
index.html
+136
-17
index.html
···
89
89
hostname: 'relay1.us-west.bsky.network',
90
90
},
91
91
];
92
+
93
+
window.regionalModAccounts = [ // https://github.com/mary-ext/atproto-scraping?tab=readme-ov-file#bluesky-labelers
94
+
'https://mod-br.bsky.app',
95
+
'https://mod-de.bsky.app',
96
+
'https://mod-in.bsky.app',
97
+
'https://mod-ru.bsky.app',
98
+
'https://mod-tr.bsky.app',
99
+
];
100
+
101
+
window.bskyAccountDeathLabels = {
102
+
['needs-review']: 'Automated action, cleared by manual review from Bluesky moderation team. Your content can ve accessed via direct links on Bluesky, but invisible in feeds and replies to posts.',
103
+
['!suspend']: 'Moderation action from Bluesky moderation team. Makes your content inaccessible on the Bluesky app.',
104
+
['!takedown']: 'Moderation action from Bluesky moderation team. Makes your content inaccessible on the Bluesky app.',
105
+
['!hide']: 'Almost always used with !takedown, makes your content inaccessible on the Bluesky app.',
106
+
// other labels shouldn't cause problems that make you think your pds is broken
107
+
// 'spam': just hides replies by default + makes your posts click-through
108
+
// 'intolerant', etc: similar to spam
109
+
};
110
+
111
+
if (window.blehYeahReady) blehYeahReady();
112
+
else window.yeahBlehIsReady = true;
92
113
</script>
93
114
115
+
<style>
116
+
body:not(.ready) .hide-until-ready,
117
+
body.ready .show-until-ready {
118
+
display: none;
119
+
}
120
+
</style>
121
+
94
122
<script>
95
123
document.addEventListener('alpine:init', () => {
124
+
if (window.yeahBlehIsReady) {
125
+
document.body.classList.add('ready');
126
+
} else {
127
+
window.blehYeahReady = () => document.body.classList.add('ready');
128
+
}
129
+
96
130
Alpine.data('debug', () => ({
97
131
// form input
98
132
identifier: '',
···
487
521
Alpine.data('modLabels', did => ({
488
522
loading: false,
489
523
error: null,
524
+
regionalErrors: [],
490
525
labels: [],
491
526
492
527
async init() {
493
528
this.loading = true;
494
529
this.error = null;
530
+
this.regionalErrors = [];
495
531
this.labels = [];
496
532
497
533
const query = window.SimpleQuery('https://mod.bsky.app');
···
502
538
});
503
539
this.labels = res.labels ?? [];
504
540
// TODO: handle cursors?
541
+
542
+
for (const region of window.regionalModAccounts) {
543
+
// intentionally no await, these come in async
544
+
// (...and could get messy if we start re-checking labels before they're done)
545
+
this.checkRegionLabels(region);
546
+
}
505
547
} catch (e) {
506
548
if (window.isXrpcErr(e)) {
507
549
this.error = e.error;
···
512
554
}
513
555
this.loading = false;
514
556
},
557
+
558
+
async checkRegionLabels(labeler) {
559
+
const query = window.SimpleQuery(labeler);
560
+
try {
561
+
const res = await query('com.atproto.label.queryLabels', {
562
+
params: { uriPatterns: [did] },
563
+
});
564
+
if (res?.labels?.length > 0) this.labels.push(...res.labels);
565
+
} catch (e) {
566
+
if (window.isXrpcErr(e)) {
567
+
this.regionalErrors.push(`${labeler}: ${e.error}`);
568
+
} else {
569
+
this.regionalErrors.push(`Failed to check ${labeler} (see console)`);
570
+
console.error(`labeler: ${labeler}`, e);
571
+
}
572
+
}
573
+
}
515
574
}));
516
575
517
576
Alpine.data('pdsHistory', (did, currentPds) => ({
···
606
665
<div class="hero bg-base-200 p-8">
607
666
<div class="hero-content flex-col">
608
667
<h1 class="text-2xl mb-8">PDS Debugger</h1>
609
-
<form @submit.prevent="await diagnose()">
668
+
<p class="show-until-ready"><em>Loading…</em></p>
669
+
<form class="hide-until-ready" @submit.prevent="await diagnose()">
610
670
<label class="text-sm text-primary" for="identifier">
611
671
atproto handle, DID, or HTTPS PDS URL
612
672
</label>
···
885
945
></a>
886
946
</td>
887
947
</tr>
948
+
<!--<tr>
949
+
<td
950
+
class="text-sm"
951
+
x-data="repoMonitor(did, pds)"
952
+
>
953
+
<button
954
+
class="btn btn-xs btn-success"
955
+
>Start live monitoring</button>
956
+
</td>
957
+
</tr>-->
888
958
</tbody>
889
959
</table>
890
960
</div>
···
998
1068
</template>
999
1069
<template x-if="!loading && !error && labels.length === 0">
1000
1070
<tr>
1001
-
<td class="text-sm">
1002
-
<em>no labels applied by mod.bsky.app</em>
1071
+
<td class="text-xs">
1072
+
<em>No Bluesky moderation labels found</em>
1003
1073
</td>
1004
1074
</tr>
1005
1075
</template>
···
1007
1077
<template x-if="!!label">
1008
1078
<tr x-data="{ expired: isBeforeNow(label.exp) }">
1009
1079
<td>
1080
+
<span x-show="label.neg">removed</span>
1010
1081
<code
1011
1082
x-text="label.cts.split('T')[0]"
1012
1083
:title="label.cts"
1013
1084
></code>
1014
1085
</td>
1015
1086
<td>
1016
-
<span x-text="expired ? 'expired' : 'expires'"></span>
1017
-
<code
1018
-
x-text="label.exp.split('T')[0]"
1019
-
:title="label.exp"
1020
-
></code>
1087
+
<template x-if="!!label.exp">
1088
+
<span x-text="expired ? 'expired' : 'expires'"></span>
1089
+
<code
1090
+
x-text="label.exp.split('T')[0]"
1091
+
:title="label.exp"
1092
+
></code>
1093
+
</template>
1021
1094
</td>
1022
1095
<td>
1023
1096
<code
1024
1097
x-text="label.val"
1025
1098
class="badge badge-sm badge-soft"
1026
-
:class="expired ? 'badge-neutral line-through' : 'badge-warning'"
1027
-
:title="expired ? 'Label expired' : ''"
1099
+
:class="(label.neg || expired)
1100
+
? 'badge-neutral line-through'
1101
+
: !!window.bskyAccountDeathLabels[label.val]
1102
+
? 'badge-warning'
1103
+
: 'badge-info'"
1104
+
:title="label.neg
1105
+
? 'label negated'
1106
+
: expired
1107
+
? 'label expired'
1108
+
: window.bskyAccountDeathLabels[label.val] ?? ''"
1028
1109
></code>
1029
1110
</td>
1111
+
<td
1112
+
x-data="didToHandle(label.src)"
1113
+
x-intersect:enter.once="load"
1114
+
>
1115
+
<span x-show="loading">Loading…</span>
1116
+
<span x-show="error !== null" x-text="error"></span>
1117
+
<a
1118
+
href="#"
1119
+
class="link"
1120
+
@click.prevent="goto(handle)"
1121
+
x-show="handle !== null"
1122
+
x-text="`@${handle}`"
1123
+
></a>
1124
+
</td>
1030
1125
</tr>
1031
1126
</template>
1032
1127
</template>
1033
1128
</tbody>
1034
1129
</table>
1035
1130
</div>
1131
+
<template x-for="error in regionalErrors">
1132
+
<p
1133
+
x-text="error"
1134
+
class="text-xs text-warning"
1135
+
></p>
1136
+
</template>
1036
1137
</div>
1037
1138
1038
1139
<template x-if="did.startsWith('did:plc:')">
···
1217
1318
1218
1319
<div class="footer text-xs sm:footer-horizontal text-neutral mt-32 p-8 max-w-2xl mx-auto">
1219
1320
<nav>
1220
-
<h3 class="footer-title">Current limitations</h3>
1221
-
<p>PDS hosts without CORS will fail tests</p>
1222
-
<p>Bluesky relay is missing API endpoints</p>
1223
-
<p>Blacksky relay is also missing API endpoints</p>
1224
-
<p>The requestCrawl button is not well tested</p>
1321
+
<h3 class="footer-title mt-3">Current limitations</h3>
1322
+
<p>PDS hosts without CORS will fail tests.</p>
1323
+
<p>Bluesky relay is missing API endpoints.</p>
1324
+
<p>Blacksky relay is also missing API endpoints.</p>
1325
+
<p>The requestCrawl button is not well tested.</p>
1326
+
1327
+
<h3 class="footer-title mt-3">Future features</h3>
1328
+
<p>Firehose listener</p>
1329
+
<p>URL routing</p>
1330
+
<p>Less strict identity resolution</p>
1225
1331
</nav>
1332
+
1226
1333
<nav>
1334
+
<h3 class="footer-title mt-3">Places</h3>
1335
+
<p><a href="https://tangled.org/microcosm.blue/pds-debug">Source code (tangled.org)</a></p>
1336
+
<p><a href="https://discord.gg/Vwamex5UFS">Discord (microcosm)</a></p>
1337
+
<p><a href="https://pdsmoover.com/">PDS Moover</a></p>
1338
+
<p><a href="https://microcosm.blue">microcosm</a></p>
1227
1339
1228
-
<h3 class="footer-title">Future features</h3>
1229
-
<p>Account label lookup</p>
1340
+
<h3 class="footer-title mt-3">Made by</h3>
1341
+
<p>
1342
+
<a href="https://bsky.app/profile/did:plc:hdhoaan3xa3jiuq4fg4mefid">fig</a>
1343
+
<a href="https://github.com/sponsors/uniphil">(sponsor)</a>
1344
+
</p>
1345
+
<p>
1346
+
<a href="https://bsky.app/profile/did:plc:rnpkyqnmsw4ipey6eotbdnnf">bailey</a>
1347
+
<a href="https://github.com/sponsors/fatfingers23">(sponsor)</a>
1348
+
</p>
1230
1349
</nav>
1231
1350
</div>
1232
1351
+5
readme.md
+5
readme.md
+13
useful-accounts.txt
+13
useful-accounts.txt
···
1
+
some accounts that show things useful for testing the debugger
2
+
3
+
4
+
Labels
5
+
6
+
- did:plc:bnwrgnvwkg2n5cbvk4xodb3h | !hide | no other labels
7
+
- did:plc:qhl3vg5tmwey536z2fil2lrh | !hide | from moderation-tr.bsky.app
8
+
- did:plc:fsmaoqqnm6knqh4cuphb4jow | !hide, ~!takedown | takedown negated
9
+
- did:plc:iv3yod6zf2j4zaakq6qyiz46 | !takedown |
10
+
- did:plc:nwrcwcrhpkgrqqvkg3lmaqky | ~needs-review, ~!takedown | both negated
11
+
- did:plc:2tinwgqvf4asiwh36ii6ko7l | needs-review | expired
12
+
- did:plc:5plqrpw3x6j5wzaosssqams7 | spam | no other labels
13
+
- did:plc:tqww7jdpqx5tb3w435fugmxi | intolerant |