@rmdes/indiekit-endpoint-activitypub 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -0
- package/package.json +1 -1
- package/views/activitypub-dashboard.njk +31 -22
package/index.js
CHANGED
|
@@ -166,6 +166,8 @@ export default class ActivityPubEndpoint {
|
|
|
166
166
|
router.use((req, res, next) => {
|
|
167
167
|
if (!self._fedifyMiddleware) return next();
|
|
168
168
|
if (req.method !== "GET" && req.method !== "HEAD") return next();
|
|
169
|
+
// Skip Fedify for admin routes — handled by authenticated router
|
|
170
|
+
if (req.path.startsWith("/admin")) return next();
|
|
169
171
|
return self._fedifyMiddleware(req, res, next);
|
|
170
172
|
});
|
|
171
173
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rmdes/indiekit-endpoint-activitypub",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"indiekit",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
{# Progress bar #}
|
|
40
40
|
<div style="background: var(--color-offset); border-radius: 4px; height: 1.5rem; margin-block-end: var(--space-m); overflow: hidden;">
|
|
41
41
|
<div
|
|
42
|
-
x-bind:style="'width:' + progress + '%;
|
|
43
|
-
style="width: {{ refollowStatus.progressPercent }}%;
|
|
42
|
+
x-bind:style="'width:' + progress + '%; height: 100%; transition: width 0.5s ease; background: var(--color-primary);'"
|
|
43
|
+
style="width: {{ refollowStatus.progressPercent }}%; height: 100%; transition: width 0.5s ease; background: var(--color-primary);">
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
46
|
|
|
@@ -48,39 +48,42 @@
|
|
|
48
48
|
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--space-s); margin-block-end: var(--space-m);">
|
|
49
49
|
<div style="padding: var(--space-s); background: var(--color-offset); border-radius: 4px; text-align: center;">
|
|
50
50
|
<div style="font-size: var(--font-size-xl);" x-text="remaining">{{ refollowStatus.remaining }}</div>
|
|
51
|
-
<div style="font-size: var(--font-size-s); color: var(--color-
|
|
51
|
+
<div style="font-size: var(--font-size-s); color: var(--color-outline);">{{ __("activitypub.refollow.remaining") }}</div>
|
|
52
52
|
</div>
|
|
53
53
|
<div style="padding: var(--space-s); background: var(--color-offset); border-radius: 4px; text-align: center;">
|
|
54
54
|
<div style="font-size: var(--font-size-xl);" x-text="sent">{{ refollowStatus.sent }}</div>
|
|
55
|
-
<div style="font-size: var(--font-size-s); color: var(--color-
|
|
55
|
+
<div style="font-size: var(--font-size-s); color: var(--color-outline);">{{ __("activitypub.refollow.awaitingAccept") }}</div>
|
|
56
56
|
</div>
|
|
57
57
|
<div style="padding: var(--space-s); background: var(--color-offset); border-radius: 4px; text-align: center;">
|
|
58
58
|
<div style="font-size: var(--font-size-xl);" x-text="federated">{{ refollowStatus.federated }}</div>
|
|
59
|
-
<div style="font-size: var(--font-size-s); color: var(--color-
|
|
59
|
+
<div style="font-size: var(--font-size-s); color: var(--color-outline);">{{ __("activitypub.refollow.accepted") }}</div>
|
|
60
60
|
</div>
|
|
61
61
|
<div style="padding: var(--space-s); background: var(--color-offset); border-radius: 4px; text-align: center;">
|
|
62
62
|
<div style="font-size: var(--font-size-xl);" x-text="failed">{{ refollowStatus.failed }}</div>
|
|
63
|
-
<div style="font-size: var(--font-size-s); color: var(--color-
|
|
63
|
+
<div style="font-size: var(--font-size-s); color: var(--color-outline);">{{ __("activitypub.refollow.failed") }}</div>
|
|
64
64
|
</div>
|
|
65
65
|
</div>
|
|
66
66
|
|
|
67
67
|
{# Status + controls #}
|
|
68
68
|
<div style="display: flex; align-items: center; gap: var(--space-s);">
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<button type="submit" class="button" style="font-size: var(--font-size-s);">{{ __("activitypub.refollow.resume") }}</button>
|
|
77
|
-
</form>
|
|
78
|
-
{% endif %}
|
|
69
|
+
<span class="badge" x-text="statusLabel">{{ __("activitypub.refollow.status." + refollowStatus.status) }}</span>
|
|
70
|
+
<form x-show="status === 'running'" method="post" action="{{ mountPath }}/admin/refollow/pause" x-on:submit.prevent="pause" style="display: none;">
|
|
71
|
+
<button type="submit" class="button" style="font-size: var(--font-size-s);">{{ __("activitypub.refollow.pause") }}</button>
|
|
72
|
+
</form>
|
|
73
|
+
<form x-show="status === 'paused'" method="post" action="{{ mountPath }}/admin/refollow/resume" x-on:submit.prevent="resume" style="display: none;">
|
|
74
|
+
<button type="submit" class="button" style="font-size: var(--font-size-s);">{{ __("activitypub.refollow.resume") }}</button>
|
|
75
|
+
</form>
|
|
79
76
|
</div>
|
|
80
77
|
</section>
|
|
81
78
|
|
|
82
79
|
<script>
|
|
83
80
|
function refollowProgress(mountPath) {
|
|
81
|
+
const statusLabels = {
|
|
82
|
+
idle: '{{ __("activitypub.refollow.status.idle") }}',
|
|
83
|
+
running: '{{ __("activitypub.refollow.status.running") }}',
|
|
84
|
+
paused: '{{ __("activitypub.refollow.status.paused") }}',
|
|
85
|
+
completed: '{{ __("activitypub.refollow.status.completed") }}'
|
|
86
|
+
};
|
|
84
87
|
return {
|
|
85
88
|
progress: {{ refollowStatus.progressPercent }},
|
|
86
89
|
remaining: {{ refollowStatus.remaining }},
|
|
@@ -89,6 +92,9 @@
|
|
|
89
92
|
failed: {{ refollowStatus.failed }},
|
|
90
93
|
status: '{{ refollowStatus.status }}',
|
|
91
94
|
interval: null,
|
|
95
|
+
get statusLabel() {
|
|
96
|
+
return statusLabels[this.status] || this.status;
|
|
97
|
+
},
|
|
92
98
|
init() {
|
|
93
99
|
if (this.status === 'running' || this.status === 'paused') {
|
|
94
100
|
this.interval = setInterval(() => this.poll(), 10000);
|
|
@@ -100,6 +106,7 @@
|
|
|
100
106
|
async poll() {
|
|
101
107
|
try {
|
|
102
108
|
const res = await fetch(mountPath + '/admin/refollow/status');
|
|
109
|
+
if (!res.ok) return;
|
|
103
110
|
const data = await res.json();
|
|
104
111
|
this.progress = data.progressPercent;
|
|
105
112
|
this.remaining = data.remaining;
|
|
@@ -113,14 +120,16 @@
|
|
|
113
120
|
} catch {}
|
|
114
121
|
},
|
|
115
122
|
async pause() {
|
|
116
|
-
await fetch(mountPath + '/admin/refollow/pause', { method: 'POST' });
|
|
117
|
-
this.status = 'paused';
|
|
123
|
+
const res = await fetch(mountPath + '/admin/refollow/pause', { method: 'POST' });
|
|
124
|
+
if (res.ok) this.status = 'paused';
|
|
118
125
|
},
|
|
119
126
|
async resume() {
|
|
120
|
-
await fetch(mountPath + '/admin/refollow/resume', { method: 'POST' });
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
127
|
+
const res = await fetch(mountPath + '/admin/refollow/resume', { method: 'POST' });
|
|
128
|
+
if (res.ok) {
|
|
129
|
+
this.status = 'running';
|
|
130
|
+
if (!this.interval) {
|
|
131
|
+
this.interval = setInterval(() => this.poll(), 10000);
|
|
132
|
+
}
|
|
124
133
|
}
|
|
125
134
|
}
|
|
126
135
|
};
|