@geekity/cms 0.3.0 → 0.5.0
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/README.md +2217 -214
- package/admin/components/fields.njk +165 -0
- package/admin/layouts/base.njk +1 -1
- package/admin/layouts/settings-page.njk +26 -0
- package/admin/layouts/shell.njk +17 -3
- package/admin/pages/account/forgot.njk +47 -0
- package/admin/pages/account/login.njk +26 -0
- package/admin/pages/account/reset.njk +38 -0
- package/admin/pages/account/setup.njk +28 -0
- package/admin/pages/appearance/themes.njk +69 -0
- package/admin/pages/comments/all.njk +133 -0
- package/admin/{layouts/dashboard.njk → pages/dashboard/home.njk} +8 -15
- package/admin/{layouts/document-conflict.njk → pages/documents/conflict.njk} +1 -0
- package/admin/{layouts/document-editor.njk → pages/documents/editor.njk} +75 -59
- package/admin/{layouts/document-list.njk → pages/documents/list.njk} +19 -2
- package/admin/pages/documents/taxonomy.njk +95 -0
- package/admin/pages/federation/followers.njk +238 -0
- package/admin/pages/federation/settings.njk +77 -0
- package/admin/pages/media/library.njk +160 -0
- package/admin/pages/messages/all.njk +110 -0
- package/admin/pages/navigation/menus.njk +129 -0
- package/admin/{layouts → pages}/placeholder.njk +5 -1
- package/admin/pages/settings/discussion.njk +99 -0
- package/admin/pages/settings/email.njk +203 -0
- package/admin/pages/settings/general.njk +29 -0
- package/admin/pages/settings/permalinks.njk +50 -0
- package/admin/pages/settings/reading.njk +64 -0
- package/admin/pages/tools/content-index.njk +89 -0
- package/admin/pages/users/edit.njk +239 -0
- package/admin/pages/users/list.njk +51 -0
- package/admin/pages/users/new.njk +41 -0
- package/admin/static/admin.css +558 -3
- package/admin/static/copy.js +52 -0
- package/admin/static/editor.js +16 -16
- package/admin/static/slug.js +61 -0
- package/dist/access-log.d.ts +44 -0
- package/dist/access-log.d.ts.map +1 -0
- package/dist/access-log.js +71 -0
- package/dist/access-log.js.map +1 -0
- package/dist/admin/accounts.d.ts +413 -0
- package/dist/admin/accounts.d.ts.map +1 -0
- package/dist/admin/accounts.js +680 -0
- package/dist/admin/accounts.js.map +1 -0
- package/dist/admin/appearance.d.ts +80 -0
- package/dist/admin/appearance.d.ts.map +1 -0
- package/dist/admin/appearance.js +136 -0
- package/dist/admin/appearance.js.map +1 -0
- package/dist/admin/comments.d.ts +90 -0
- package/dist/admin/comments.d.ts.map +1 -0
- package/dist/admin/comments.js +244 -0
- package/dist/admin/comments.js.map +1 -0
- package/dist/admin/credentials.d.ts +26 -2
- package/dist/admin/credentials.d.ts.map +1 -1
- package/dist/admin/credentials.js +35 -2
- package/dist/admin/credentials.js.map +1 -1
- package/dist/admin/documents.d.ts +117 -10
- package/dist/admin/documents.d.ts.map +1 -1
- package/dist/admin/documents.js +328 -41
- package/dist/admin/documents.js.map +1 -1
- package/dist/admin/federation.d.ts +161 -50
- package/dist/admin/federation.d.ts.map +1 -1
- package/dist/admin/federation.js +235 -93
- package/dist/admin/federation.js.map +1 -1
- package/dist/admin/formatting.d.ts +20 -0
- package/dist/admin/formatting.d.ts.map +1 -0
- package/dist/admin/formatting.js +72 -0
- package/dist/admin/formatting.js.map +1 -0
- package/dist/admin/headers.d.ts +65 -0
- package/dist/admin/headers.d.ts.map +1 -0
- package/dist/admin/headers.js +104 -0
- package/dist/admin/headers.js.map +1 -0
- package/dist/admin/index.d.ts +38 -12
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js +25 -7
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/media.d.ts +168 -0
- package/dist/admin/media.d.ts.map +1 -0
- package/dist/admin/media.js +295 -0
- package/dist/admin/media.js.map +1 -0
- package/dist/admin/menu.d.ts +79 -0
- package/dist/admin/menu.d.ts.map +1 -0
- package/dist/admin/menu.js +143 -0
- package/dist/admin/menu.js.map +1 -0
- package/dist/admin/messages.d.ts +80 -0
- package/dist/admin/messages.d.ts.map +1 -0
- package/dist/admin/messages.js +152 -0
- package/dist/admin/messages.js.map +1 -0
- package/dist/admin/navigation.d.ts +155 -0
- package/dist/admin/navigation.d.ts.map +1 -0
- package/dist/admin/navigation.js +292 -0
- package/dist/admin/navigation.js.map +1 -0
- package/dist/admin/preview.d.ts.map +1 -1
- package/dist/admin/preview.js +31 -7
- package/dist/admin/preview.js.map +1 -1
- package/dist/admin/recovery.d.ts +92 -0
- package/dist/admin/recovery.d.ts.map +1 -0
- package/dist/admin/recovery.js +229 -0
- package/dist/admin/recovery.js.map +1 -0
- package/dist/admin/routes.d.ts +0 -20
- package/dist/admin/routes.d.ts.map +1 -1
- package/dist/admin/routes.js +164 -105
- package/dist/admin/routes.js.map +1 -1
- package/dist/admin/session.d.ts +17 -3
- package/dist/admin/session.d.ts.map +1 -1
- package/dist/admin/session.js +19 -5
- package/dist/admin/session.js.map +1 -1
- package/dist/admin/settings-discussion.d.ts +37 -0
- package/dist/admin/settings-discussion.d.ts.map +1 -0
- package/dist/admin/settings-discussion.js +117 -0
- package/dist/admin/settings-discussion.js.map +1 -0
- package/dist/admin/settings-email.d.ts +54 -0
- package/dist/admin/settings-email.d.ts.map +1 -0
- package/dist/admin/settings-email.js +189 -0
- package/dist/admin/settings-email.js.map +1 -0
- package/dist/admin/settings-federation.d.ts +48 -0
- package/dist/admin/settings-federation.d.ts.map +1 -0
- package/dist/admin/settings-federation.js +123 -0
- package/dist/admin/settings-federation.js.map +1 -0
- package/dist/admin/settings-general.d.ts +12 -0
- package/dist/admin/settings-general.d.ts.map +1 -0
- package/dist/admin/settings-general.js +48 -0
- package/dist/admin/settings-general.js.map +1 -0
- package/dist/admin/settings-page.d.ts +119 -0
- package/dist/admin/settings-page.d.ts.map +1 -0
- package/dist/admin/settings-page.js +132 -0
- package/dist/admin/settings-page.js.map +1 -0
- package/dist/admin/settings-pages.d.ts +30 -0
- package/dist/admin/settings-pages.d.ts.map +1 -0
- package/dist/admin/settings-pages.js +43 -0
- package/dist/admin/settings-pages.js.map +1 -0
- package/dist/admin/settings-permalinks.d.ts +16 -0
- package/dist/admin/settings-permalinks.d.ts.map +1 -0
- package/dist/admin/settings-permalinks.js +32 -0
- package/dist/admin/settings-permalinks.js.map +1 -0
- package/dist/admin/settings-reading.d.ts +34 -0
- package/dist/admin/settings-reading.d.ts.map +1 -0
- package/dist/admin/settings-reading.js +49 -0
- package/dist/admin/settings-reading.js.map +1 -0
- package/dist/admin/settings.d.ts +339 -96
- package/dist/admin/settings.d.ts.map +1 -1
- package/dist/admin/settings.js +600 -308
- package/dist/admin/settings.js.map +1 -1
- package/dist/admin/store.d.ts +606 -152
- package/dist/admin/store.d.ts.map +1 -1
- package/dist/admin/store.js +863 -268
- package/dist/admin/store.js.map +1 -1
- package/dist/admin/taxonomy.d.ts +114 -0
- package/dist/admin/taxonomy.d.ts.map +1 -0
- package/dist/admin/taxonomy.js +289 -0
- package/dist/admin/taxonomy.js.map +1 -0
- package/dist/admin/templates.d.ts +46 -14
- package/dist/admin/templates.d.ts.map +1 -1
- package/dist/admin/templates.js +46 -14
- package/dist/admin/templates.js.map +1 -1
- package/dist/admin/throttle.d.ts +84 -0
- package/dist/admin/throttle.d.ts.map +1 -0
- package/dist/admin/throttle.js +143 -0
- package/dist/admin/throttle.js.map +1 -0
- package/dist/admin/tools.d.ts +111 -0
- package/dist/admin/tools.d.ts.map +1 -0
- package/dist/admin/tools.js +182 -0
- package/dist/admin/tools.js.map +1 -0
- package/dist/admin/uploads.d.ts +28 -2
- package/dist/admin/uploads.d.ts.map +1 -1
- package/dist/admin/uploads.js +43 -4
- package/dist/admin/uploads.js.map +1 -1
- package/dist/admin/users.d.ts +100 -13
- package/dist/admin/users.d.ts.map +1 -1
- package/dist/admin/users.js +412 -39
- package/dist/admin/users.js.map +1 -1
- package/dist/cache.d.ts +141 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +207 -0
- package/dist/cache.js.map +1 -0
- package/dist/cli.d.ts +14 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +429 -21
- package/dist/cli.js.map +1 -1
- package/dist/comments/akismet.d.ts +130 -0
- package/dist/comments/akismet.d.ts.map +1 -0
- package/dist/comments/akismet.js +274 -0
- package/dist/comments/akismet.js.map +1 -0
- package/dist/comments/conversation.d.ts +29 -0
- package/dist/comments/conversation.d.ts.map +1 -0
- package/dist/comments/conversation.js +60 -0
- package/dist/comments/conversation.js.map +1 -0
- package/dist/comments/form.d.ts +123 -0
- package/dist/comments/form.d.ts.map +1 -0
- package/dist/comments/form.js +79 -0
- package/dist/comments/form.js.map +1 -0
- package/dist/comments/index.d.ts +16 -0
- package/dist/comments/index.d.ts.map +1 -0
- package/dist/comments/index.js +10 -0
- package/dist/comments/index.js.map +1 -0
- package/dist/comments/markdown.d.ts +8 -0
- package/dist/comments/markdown.d.ts.map +1 -0
- package/dist/comments/markdown.js +85 -0
- package/dist/comments/markdown.js.map +1 -0
- package/dist/comments/moderate.d.ts +71 -0
- package/dist/comments/moderate.d.ts.map +1 -0
- package/dist/comments/moderate.js +88 -0
- package/dist/comments/moderate.js.map +1 -0
- package/dist/comments/policy.d.ts +57 -0
- package/dist/comments/policy.d.ts.map +1 -0
- package/dist/comments/policy.js +80 -0
- package/dist/comments/policy.js.map +1 -0
- package/dist/comments/records.d.ts +266 -0
- package/dist/comments/records.d.ts.map +1 -0
- package/dist/comments/records.js +487 -0
- package/dist/comments/records.js.map +1 -0
- package/dist/comments/routes.d.ts +60 -0
- package/dist/comments/routes.d.ts.map +1 -0
- package/dist/comments/routes.js +212 -0
- package/dist/comments/routes.js.map +1 -0
- package/dist/comments/submission.d.ts +297 -0
- package/dist/comments/submission.d.ts.map +1 -0
- package/dist/comments/submission.js +280 -0
- package/dist/comments/submission.js.map +1 -0
- package/dist/comments/viewer.d.ts +21 -0
- package/dist/comments/viewer.d.ts.map +1 -0
- package/dist/comments/viewer.js +45 -0
- package/dist/comments/viewer.js.map +1 -0
- package/dist/config.d.ts +225 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +121 -6
- package/dist/config.js.map +1 -1
- package/dist/contact/delivery.d.ts +60 -0
- package/dist/contact/delivery.d.ts.map +1 -0
- package/dist/contact/delivery.js +87 -0
- package/dist/contact/delivery.js.map +1 -0
- package/dist/contact/form.d.ts +130 -0
- package/dist/contact/form.d.ts.map +1 -0
- package/dist/contact/form.js +163 -0
- package/dist/contact/form.js.map +1 -0
- package/dist/contact/index.d.ts +17 -0
- package/dist/contact/index.d.ts.map +1 -0
- package/dist/contact/index.js +13 -0
- package/dist/contact/index.js.map +1 -0
- package/dist/contact/records.d.ts +124 -0
- package/dist/contact/records.d.ts.map +1 -0
- package/dist/contact/records.js +218 -0
- package/dist/contact/records.js.map +1 -0
- package/dist/contact/routes.d.ts +17 -0
- package/dist/contact/routes.d.ts.map +1 -0
- package/dist/contact/routes.js +127 -0
- package/dist/contact/routes.js.map +1 -0
- package/dist/contact/submission.d.ts +103 -0
- package/dist/contact/submission.d.ts.map +1 -0
- package/dist/contact/submission.js +166 -0
- package/dist/contact/submission.js.map +1 -0
- package/dist/content/document.d.ts +7 -2
- package/dist/content/document.d.ts.map +1 -1
- package/dist/content/document.js +1 -0
- package/dist/content/document.js.map +1 -1
- package/dist/content/index.d.ts +7 -2
- package/dist/content/index.d.ts.map +1 -1
- package/dist/content/index.js +4 -1
- package/dist/content/index.js.map +1 -1
- package/dist/content/markdown.d.ts.map +1 -1
- package/dist/content/markdown.js +24 -2
- package/dist/content/markdown.js.map +1 -1
- package/dist/content/parser.d.ts.map +1 -1
- package/dist/content/parser.js +11 -4
- package/dist/content/parser.js.map +1 -1
- package/dist/content/save.d.ts +5 -0
- package/dist/content/save.d.ts.map +1 -1
- package/dist/content/save.js +44 -1
- package/dist/content/save.js.map +1 -1
- package/dist/content/schedule.d.ts +125 -0
- package/dist/content/schedule.d.ts.map +1 -0
- package/dist/content/schedule.js +207 -0
- package/dist/content/schedule.js.map +1 -0
- package/dist/content/search.d.ts +64 -0
- package/dist/content/search.d.ts.map +1 -0
- package/dist/content/search.js +136 -0
- package/dist/content/search.js.map +1 -0
- package/dist/content/store.d.ts +220 -7
- package/dist/content/store.d.ts.map +1 -1
- package/dist/content/store.js +392 -67
- package/dist/content/store.js.map +1 -1
- package/dist/content/sync.d.ts +7 -1
- package/dist/content/sync.d.ts.map +1 -1
- package/dist/content/sync.js +18 -10
- package/dist/content/sync.js.map +1 -1
- package/dist/content/time.d.ts +56 -0
- package/dist/content/time.d.ts.map +1 -0
- package/dist/content/time.js +141 -0
- package/dist/content/time.js.map +1 -0
- package/dist/content/writer.d.ts.map +1 -1
- package/dist/content/writer.js +3 -0
- package/dist/content/writer.js.map +1 -1
- package/dist/env.d.ts +70 -5
- package/dist/env.d.ts.map +1 -1
- package/dist/federation/actor.d.ts +95 -41
- package/dist/federation/actor.d.ts.map +1 -1
- package/dist/federation/actor.js +180 -53
- package/dist/federation/actor.js.map +1 -1
- package/dist/federation/article.d.ts +44 -17
- package/dist/federation/article.d.ts.map +1 -1
- package/dist/federation/article.js +98 -46
- package/dist/federation/article.js.map +1 -1
- package/dist/federation/delivery.d.ts +63 -15
- package/dist/federation/delivery.d.ts.map +1 -1
- package/dist/federation/delivery.js +154 -80
- package/dist/federation/delivery.js.map +1 -1
- package/dist/federation/federation.d.ts +22 -17
- package/dist/federation/federation.d.ts.map +1 -1
- package/dist/federation/federation.js +98 -77
- package/dist/federation/federation.js.map +1 -1
- package/dist/federation/followers.d.ts +3 -2
- package/dist/federation/followers.d.ts.map +1 -1
- package/dist/federation/followers.js +6 -5
- package/dist/federation/followers.js.map +1 -1
- package/dist/federation/import-wordpress.d.ts +128 -0
- package/dist/federation/import-wordpress.d.ts.map +1 -0
- package/dist/federation/import-wordpress.js +426 -0
- package/dist/federation/import-wordpress.js.map +1 -0
- package/dist/federation/inbox.d.ts +36 -13
- package/dist/federation/inbox.d.ts.map +1 -1
- package/dist/federation/inbox.js +120 -49
- package/dist/federation/inbox.js.map +1 -1
- package/dist/federation/index.d.ts +22 -10
- package/dist/federation/index.d.ts.map +1 -1
- package/dist/federation/index.js +13 -8
- package/dist/federation/index.js.map +1 -1
- package/dist/federation/keys.d.ts +98 -20
- package/dist/federation/keys.d.ts.map +1 -1
- package/dist/federation/keys.js +269 -39
- package/dist/federation/keys.js.map +1 -1
- package/dist/federation/mount.d.ts +46 -10
- package/dist/federation/mount.d.ts.map +1 -1
- package/dist/federation/mount.js +300 -28
- package/dist/federation/mount.js.map +1 -1
- package/dist/federation/paths.d.ts +23 -35
- package/dist/federation/paths.d.ts.map +1 -1
- package/dist/federation/paths.js +26 -39
- package/dist/federation/paths.js.map +1 -1
- package/dist/federation/records.d.ts +223 -0
- package/dist/federation/records.d.ts.map +1 -0
- package/dist/federation/records.js +506 -0
- package/dist/federation/records.js.map +1 -0
- package/dist/federation/relays.d.ts +114 -0
- package/dist/federation/relays.d.ts.map +1 -0
- package/dist/federation/relays.js +290 -0
- package/dist/federation/relays.js.map +1 -0
- package/dist/federation/replies.d.ts +80 -0
- package/dist/federation/replies.d.ts.map +1 -0
- package/dist/federation/replies.js +166 -0
- package/dist/federation/replies.js.map +1 -0
- package/dist/federation/wordpress.d.ts +131 -0
- package/dist/federation/wordpress.d.ts.map +1 -0
- package/dist/federation/wordpress.js +341 -0
- package/dist/federation/wordpress.js.map +1 -0
- package/dist/files/atomic.d.ts +103 -0
- package/dist/files/atomic.d.ts.map +1 -0
- package/dist/files/atomic.js +150 -0
- package/dist/files/atomic.js.map +1 -0
- package/dist/files/index.d.ts +3 -0
- package/dist/files/index.d.ts.map +1 -0
- package/dist/files/index.js +2 -0
- package/dist/files/index.js.map +1 -0
- package/dist/forms/protection.d.ts +85 -0
- package/dist/forms/protection.d.ts.map +1 -0
- package/dist/forms/protection.js +116 -0
- package/dist/forms/protection.js.map +1 -0
- package/dist/images/icons.d.ts +59 -0
- package/dist/images/icons.d.ts.map +1 -0
- package/dist/images/icons.js +131 -0
- package/dist/images/icons.js.map +1 -0
- package/dist/images/index.d.ts +7 -0
- package/dist/images/index.d.ts.map +1 -0
- package/dist/images/index.js +4 -0
- package/dist/images/index.js.map +1 -0
- package/dist/images/markup.d.ts +47 -0
- package/dist/images/markup.d.ts.map +1 -0
- package/dist/images/markup.js +175 -0
- package/dist/images/markup.js.map +1 -0
- package/dist/images/paths.d.ts +34 -0
- package/dist/images/paths.d.ts.map +1 -0
- package/dist/images/paths.js +41 -0
- package/dist/images/paths.js.map +1 -0
- package/dist/images/variants.d.ts +104 -0
- package/dist/images/variants.d.ts.map +1 -0
- package/dist/images/variants.js +320 -0
- package/dist/images/variants.js.map +1 -0
- package/dist/index.d.ts +123 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +344 -25
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +18 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +34 -3
- package/dist/init.js.map +1 -1
- package/dist/mail/brevo.d.ts +35 -0
- package/dist/mail/brevo.d.ts.map +1 -0
- package/dist/mail/brevo.js +85 -0
- package/dist/mail/brevo.js.map +1 -0
- package/dist/mail/credentials.d.ts +62 -0
- package/dist/mail/credentials.d.ts.map +1 -0
- package/dist/mail/credentials.js +86 -0
- package/dist/mail/credentials.js.map +1 -0
- package/dist/mail/index.d.ts +15 -0
- package/dist/mail/index.d.ts.map +1 -0
- package/dist/mail/index.js +8 -0
- package/dist/mail/index.js.map +1 -0
- package/dist/mail/memory.d.ts +35 -0
- package/dist/mail/memory.d.ts.map +1 -0
- package/dist/mail/memory.js +29 -0
- package/dist/mail/memory.js.map +1 -0
- package/dist/mail/provider.d.ts +80 -0
- package/dist/mail/provider.d.ts.map +1 -0
- package/dist/mail/provider.js +23 -0
- package/dist/mail/provider.js.map +1 -0
- package/dist/mail/service.d.ts +156 -0
- package/dist/mail/service.d.ts.map +1 -0
- package/dist/mail/service.js +265 -0
- package/dist/mail/service.js.map +1 -0
- package/dist/mail/smtp.d.ts +39 -0
- package/dist/mail/smtp.d.ts.map +1 -0
- package/dist/mail/smtp.js +58 -0
- package/dist/mail/smtp.js.map +1 -0
- package/dist/mail/templates.d.ts +91 -0
- package/dist/mail/templates.d.ts.map +1 -0
- package/dist/mail/templates.js +69 -0
- package/dist/mail/templates.js.map +1 -0
- package/dist/notifications/comments.d.ts +66 -0
- package/dist/notifications/comments.d.ts.map +1 -0
- package/dist/notifications/comments.js +151 -0
- package/dist/notifications/comments.js.map +1 -0
- package/dist/notifications/digest.d.ts +135 -0
- package/dist/notifications/digest.d.ts.map +1 -0
- package/dist/notifications/digest.js +287 -0
- package/dist/notifications/digest.js.map +1 -0
- package/dist/notifications/index.d.ts +13 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +8 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/notifications/links.d.ts +60 -0
- package/dist/notifications/links.d.ts.map +1 -0
- package/dist/notifications/links.js +63 -0
- package/dist/notifications/links.js.map +1 -0
- package/dist/notifications/optouts.d.ts +48 -0
- package/dist/notifications/optouts.d.ts.map +1 -0
- package/dist/notifications/optouts.js +93 -0
- package/dist/notifications/optouts.js.map +1 -0
- package/dist/notifications/preferences.d.ts +158 -0
- package/dist/notifications/preferences.d.ts.map +1 -0
- package/dist/notifications/preferences.js +195 -0
- package/dist/notifications/preferences.js.map +1 -0
- package/dist/notifications/routes.d.ts +28 -0
- package/dist/notifications/routes.d.ts.map +1 -0
- package/dist/notifications/routes.js +184 -0
- package/dist/notifications/routes.js.map +1 -0
- package/dist/notifications/tokens.d.ts +60 -0
- package/dist/notifications/tokens.d.ts.map +1 -0
- package/dist/notifications/tokens.js +125 -0
- package/dist/notifications/tokens.js.map +1 -0
- package/dist/notify.d.ts +84 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +149 -0
- package/dist/notify.js.map +1 -0
- package/dist/web/archive.d.ts +49 -0
- package/dist/web/archive.d.ts.map +1 -0
- package/dist/web/archive.js +59 -0
- package/dist/web/archive.js.map +1 -0
- package/dist/web/assets.d.ts +6 -5
- package/dist/web/assets.d.ts.map +1 -1
- package/dist/web/assets.js +5 -7
- package/dist/web/assets.js.map +1 -1
- package/dist/web/authors.d.ts +143 -0
- package/dist/web/authors.d.ts.map +1 -0
- package/dist/web/authors.js +178 -0
- package/dist/web/authors.js.map +1 -0
- package/dist/web/comments.d.ts +60 -0
- package/dist/web/comments.d.ts.map +1 -0
- package/dist/web/comments.js +207 -0
- package/dist/web/comments.js.map +1 -0
- package/dist/web/context.d.ts +162 -28
- package/dist/web/context.d.ts.map +1 -1
- package/dist/web/context.js +123 -26
- package/dist/web/context.js.map +1 -1
- package/dist/web/conversation.d.ts +209 -0
- package/dist/web/conversation.d.ts.map +1 -0
- package/dist/web/conversation.js +557 -0
- package/dist/web/conversation.js.map +1 -0
- package/dist/web/documents.d.ts +36 -6
- package/dist/web/documents.d.ts.map +1 -1
- package/dist/web/documents.js +52 -10
- package/dist/web/documents.js.map +1 -1
- package/dist/web/feed-atom.d.ts +22 -0
- package/dist/web/feed-atom.d.ts.map +1 -0
- package/dist/web/feed-atom.js +83 -0
- package/dist/web/feed-atom.js.map +1 -0
- package/dist/web/feed-item.d.ts +145 -0
- package/dist/web/feed-item.d.ts.map +1 -0
- package/dist/web/feed-item.js +120 -0
- package/dist/web/feed-item.js.map +1 -0
- package/dist/web/feed-json.d.ts +79 -0
- package/dist/web/feed-json.d.ts.map +1 -0
- package/dist/web/feed-json.js +53 -0
- package/dist/web/feed-json.js.map +1 -0
- package/dist/web/feed-rss.d.ts +26 -0
- package/dist/web/feed-rss.d.ts.map +1 -0
- package/dist/web/feed-rss.js +203 -0
- package/dist/web/feed-rss.js.map +1 -0
- package/dist/web/feed-source.d.ts +244 -0
- package/dist/web/feed-source.d.ts.map +1 -0
- package/dist/web/feed-source.js +201 -0
- package/dist/web/feed-source.js.map +1 -0
- package/dist/web/feed-xml.d.ts +63 -0
- package/dist/web/feed-xml.d.ts.map +1 -0
- package/dist/web/feed-xml.js +116 -0
- package/dist/web/feed-xml.js.map +1 -0
- package/dist/web/feeds.d.ts +31 -96
- package/dist/web/feeds.d.ts.map +1 -1
- package/dist/web/feeds.js +94 -198
- package/dist/web/feeds.js.map +1 -1
- package/dist/web/health.d.ts +31 -0
- package/dist/web/health.d.ts.map +1 -0
- package/dist/web/health.js +44 -0
- package/dist/web/health.js.map +1 -0
- package/dist/web/index.d.ts +30 -10
- package/dist/web/index.d.ts.map +1 -1
- package/dist/web/index.js +18 -7
- package/dist/web/index.js.map +1 -1
- package/dist/web/navigation.d.ts +195 -0
- package/dist/web/navigation.d.ts.map +1 -0
- package/dist/web/navigation.js +300 -0
- package/dist/web/navigation.js.map +1 -0
- package/dist/web/negotiate.d.ts +31 -0
- package/dist/web/negotiate.d.ts.map +1 -1
- package/dist/web/negotiate.js +31 -11
- package/dist/web/negotiate.js.map +1 -1
- package/dist/web/recent.d.ts +43 -0
- package/dist/web/recent.d.ts.map +1 -0
- package/dist/web/recent.js +37 -0
- package/dist/web/recent.js.map +1 -0
- package/dist/web/render.d.ts +203 -9
- package/dist/web/render.d.ts.map +1 -1
- package/dist/web/render.js +341 -17
- package/dist/web/render.js.map +1 -1
- package/dist/web/routes.d.ts +25 -8
- package/dist/web/routes.d.ts.map +1 -1
- package/dist/web/routes.js +854 -93
- package/dist/web/routes.js.map +1 -1
- package/dist/web/sanitize.d.ts +19 -0
- package/dist/web/sanitize.d.ts.map +1 -0
- package/dist/web/sanitize.js +272 -0
- package/dist/web/sanitize.js.map +1 -0
- package/dist/web/search.d.ts +79 -0
- package/dist/web/search.d.ts.map +1 -0
- package/dist/web/search.js +94 -0
- package/dist/web/search.js.map +1 -0
- package/dist/web/sitemap.d.ts +120 -0
- package/dist/web/sitemap.d.ts.map +1 -0
- package/dist/web/sitemap.js +199 -0
- package/dist/web/sitemap.js.map +1 -0
- package/dist/web/taxonomy.d.ts +152 -0
- package/dist/web/taxonomy.d.ts.map +1 -0
- package/dist/web/taxonomy.js +237 -0
- package/dist/web/taxonomy.js.map +1 -0
- package/dist/web/templates.d.ts +54 -16
- package/dist/web/templates.d.ts.map +1 -1
- package/dist/web/templates.js +109 -28
- package/dist/web/templates.js.map +1 -1
- package/dist/web/themes.d.ts +226 -0
- package/dist/web/themes.d.ts.map +1 -0
- package/dist/web/themes.js +314 -0
- package/dist/web/themes.js.map +1 -0
- package/dist/webmention/discovery.d.ts +51 -0
- package/dist/webmention/discovery.d.ts.map +1 -0
- package/dist/webmention/discovery.js +176 -0
- package/dist/webmention/discovery.js.map +1 -0
- package/dist/webmention/html.d.ts +71 -0
- package/dist/webmention/html.d.ts.map +1 -0
- package/dist/webmention/html.js +285 -0
- package/dist/webmention/html.js.map +1 -0
- package/dist/webmention/index.d.ts +12 -0
- package/dist/webmention/index.d.ts.map +1 -0
- package/dist/webmention/index.js +8 -0
- package/dist/webmention/index.js.map +1 -0
- package/dist/webmention/links.d.ts +18 -0
- package/dist/webmention/links.d.ts.map +1 -0
- package/dist/webmention/links.js +64 -0
- package/dist/webmention/links.js.map +1 -0
- package/dist/webmention/microformats.d.ts +93 -0
- package/dist/webmention/microformats.d.ts.map +1 -0
- package/dist/webmention/microformats.js +376 -0
- package/dist/webmention/microformats.js.map +1 -0
- package/dist/webmention/receive.d.ts +141 -0
- package/dist/webmention/receive.d.ts.map +1 -0
- package/dist/webmention/receive.js +264 -0
- package/dist/webmention/receive.js.map +1 -0
- package/dist/webmention/routes.d.ts +37 -0
- package/dist/webmention/routes.d.ts.map +1 -0
- package/dist/webmention/routes.js +75 -0
- package/dist/webmention/routes.js.map +1 -0
- package/dist/webmention/service.d.ts +94 -0
- package/dist/webmention/service.d.ts.map +1 -0
- package/dist/webmention/service.js +207 -0
- package/dist/webmention/service.js.map +1 -0
- package/package.json +11 -6
- package/templates/site/content/_data/site.json +8 -0
- package/templates/site/content/pages/about.md +7 -0
- package/templates/site/content/posts/2026-01-01-hello-world.md +5 -3
- package/templates/site/geekity.config.ts +11 -1
- package/templates/site/tsconfig.json +1 -1
- package/themes/default/README.md +1216 -50
- package/themes/default/layouts/404.njk +2 -3
- package/themes/default/layouts/author.njk +36 -0
- package/themes/default/layouts/base.njk +161 -31
- package/themes/default/layouts/category.njk +27 -0
- package/themes/default/layouts/front-page.njk +56 -0
- package/themes/default/layouts/home.njk +17 -1
- package/themes/default/layouts/page.njk +57 -5
- package/themes/default/layouts/post.njk +78 -19
- package/themes/default/layouts/search.njk +57 -0
- package/themes/default/layouts/tag.njk +3 -6
- package/themes/default/mail/comment-digest.html.njk +37 -0
- package/themes/default/mail/comment-digest.subject.njk +3 -0
- package/themes/default/mail/comment-digest.txt.njk +40 -0
- package/themes/default/mail/comment-pending.html.njk +27 -0
- package/themes/default/mail/comment-pending.subject.njk +2 -0
- package/themes/default/mail/comment-pending.txt.njk +24 -0
- package/themes/default/mail/comment-reply.html.njk +21 -0
- package/themes/default/mail/comment-reply.subject.njk +2 -0
- package/themes/default/mail/comment-reply.txt.njk +22 -0
- package/themes/default/mail/contact-message.html.njk +24 -0
- package/themes/default/mail/contact-message.subject.njk +5 -0
- package/themes/default/mail/contact-message.txt.njk +20 -0
- package/themes/default/mail/password-changed.html.njk +18 -0
- package/themes/default/mail/password-changed.subject.njk +2 -0
- package/themes/default/mail/password-changed.txt.njk +17 -0
- package/themes/default/mail/password-reset.html.njk +22 -0
- package/themes/default/mail/password-reset.subject.njk +2 -0
- package/themes/default/mail/password-reset.txt.njk +18 -0
- package/themes/default/mail/test.html.njk +14 -0
- package/themes/default/mail/test.subject.njk +2 -0
- package/themes/default/mail/test.txt.njk +12 -0
- package/themes/default/partials/archive.njk +27 -0
- package/themes/default/partials/bio.njk +71 -0
- package/themes/default/partials/comment-form.njk +137 -0
- package/themes/default/partials/contact-form.njk +88 -0
- package/themes/default/partials/conversation.njk +139 -0
- package/themes/default/partials/feeds.njk +26 -0
- package/themes/default/partials/jsonld.njk +120 -0
- package/themes/default/partials/menu.njk +32 -0
- package/themes/default/partials/pagination.njk +12 -6
- package/themes/default/partials/post-list.njk +51 -18
- package/themes/default/partials/search-form.njk +22 -0
- package/themes/default/partials/tags.njk +26 -5
- package/themes/default/static/highlight.js +4 -0
- package/themes/default/static/style.css +1142 -194
- package/themes/default/theme.json +9 -0
- package/admin/layouts/federation.njk +0 -145
- package/admin/layouts/login.njk +0 -23
- package/admin/layouts/settings.njk +0 -116
- package/admin/layouts/setup.njk +0 -27
- package/admin/layouts/users.njk +0 -91
- /package/admin/{layouts/_flash.njk → components/flash.njk} +0 -0
package/dist/federation/mount.js
CHANGED
|
@@ -1,38 +1,114 @@
|
|
|
1
1
|
import { respondWithObject } from '@fedify/fedify';
|
|
2
2
|
import { federation as federationMiddleware } from '@fedify/hono';
|
|
3
|
+
import { listUsers } from '../admin/accounts.js';
|
|
4
|
+
import { readSiteSettings } from '../admin/settings.js';
|
|
5
|
+
import { authorHref, parseAuthorPath } from '../web/authors.js';
|
|
3
6
|
import { publicDocumentAt } from '../web/documents.js';
|
|
4
|
-
import { prefersActivityStreams } from '../web/negotiate.js';
|
|
7
|
+
import { absoluteUrl, prefersActivityStreams } from '../web/negotiate.js';
|
|
5
8
|
import { requestPath } from '../web/routes.js';
|
|
9
|
+
import { actorAliases, actorId, userActor } from './actor.js';
|
|
6
10
|
import { isFederatedDocument, postArticle } from './article.js';
|
|
11
|
+
import { federationOrigin, handleHref } from './paths.js';
|
|
12
|
+
import { recordWordPressRequest, userByWordPressActorId, wordPressRequestTarget, } from './wordpress.js';
|
|
7
13
|
/**
|
|
8
14
|
* Put Fedify in front of the rest of the app.
|
|
9
15
|
*
|
|
10
16
|
* The middleware only answers the paths Fedify registered — the actor, its
|
|
11
|
-
* collections,
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* request.
|
|
17
|
+
* collections, WebFinger and NodeInfo; everything else falls through to
|
|
18
|
+
* `next()` and reaches the admin and the public site as before. That is why it
|
|
19
|
+
* is mounted first: the public site claims every unmatched path in its
|
|
20
|
+
* not-found handler, so anything registered after it never sees a request.
|
|
16
21
|
*
|
|
17
|
-
* A post
|
|
18
|
-
*
|
|
19
|
-
*
|
|
22
|
+
* A post's object is not one of Fedify's paths at all. decision-13 makes a
|
|
23
|
+
* post's ActivityStreams id its permalink, so {@link activityStreamsDocument}
|
|
24
|
+
* is what serves the `Article`: one URL, answering a browser with the page and
|
|
25
|
+
* a peer with the object. The same handler answers at the `activitypub.id` a
|
|
26
|
+
* migrated post's file names, and sends a browser from there to the permalink.
|
|
20
27
|
*
|
|
21
28
|
* The dispatchers are handed the stores off the Hono context rather than
|
|
22
29
|
* closing over them, so one federation object could serve more than one CMS
|
|
23
30
|
* and so a dispatcher is never reading a store the request did not come with.
|
|
24
31
|
*/
|
|
25
|
-
export function mountFederation(app, federation) {
|
|
32
|
+
export function mountFederation(app, federation, options = {}) {
|
|
33
|
+
// WebFinger is ours rather than Fedify's, and so has to be registered before
|
|
34
|
+
// the middleware that would otherwise answer it. Fedify hard-codes the
|
|
35
|
+
// `self` link to the dispatcher path and computes `aliases` from the
|
|
36
|
+
// resource, neither of which can be added to, so an actor served under the
|
|
37
|
+
// id it had elsewhere could never be discovered by it (doc-8). Owning the
|
|
38
|
+
// route is a dozen lines and gives complete control of `subject`, `aliases`
|
|
39
|
+
// and `links`.
|
|
40
|
+
app.get(WEBFINGER_PATH, (c) => {
|
|
41
|
+
const resource = c.req.query('resource') ?? '';
|
|
42
|
+
const user = webFingerSubject(c, resource);
|
|
43
|
+
if (user === undefined)
|
|
44
|
+
return c.notFound();
|
|
45
|
+
const context = federation.createContext(c.req.raw, contextData(c));
|
|
46
|
+
const { baseUrl } = c.var.config;
|
|
47
|
+
const aliases = actorAliases(context, user, baseUrl);
|
|
48
|
+
return c.json({
|
|
49
|
+
subject: acctOf(user.username, c.var.config.baseUrl),
|
|
50
|
+
aliases: aliases.map((alias) => alias.href),
|
|
51
|
+
links: [
|
|
52
|
+
{
|
|
53
|
+
rel: 'self',
|
|
54
|
+
type: 'application/activity+json',
|
|
55
|
+
href: actorId(context, user).href,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
rel: 'http://webfinger.net/rel/profile-page',
|
|
59
|
+
type: 'text/html',
|
|
60
|
+
href: absoluteUrl(authorHref(user.username), baseUrl),
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
}, 200, {
|
|
64
|
+
// The media type RFC 7033 defines, and the header that lets a browser
|
|
65
|
+
// application read the answer, which is what every other WebFinger
|
|
66
|
+
// server sends.
|
|
67
|
+
'content-type': 'application/jrd+json; charset=utf-8',
|
|
68
|
+
'access-control-allow-origin': '*',
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
// `/@ada`, the short URL WordPress publishes beside the author archive and
|
|
72
|
+
// the one a person is most likely to type. It is an alias rather than a
|
|
73
|
+
// second identity, so it goes where the identity is.
|
|
74
|
+
app.get('/:handle{@.+}', (c) => {
|
|
75
|
+
// The pattern is a regex rather than `/@:username`, because Hono's path
|
|
76
|
+
// parameters are whole segments: the `@` has to be matched inside one.
|
|
77
|
+
const handle = c.req.param('handle') ?? '';
|
|
78
|
+
return c.redirect(authorHref(decodeURIComponent(handle.slice(1))), 301);
|
|
79
|
+
});
|
|
26
80
|
// `@fedify/hono` types its context as the two properties it actually reads,
|
|
27
81
|
// which is looser than Hono's own; the cast is what puts `c.var` back.
|
|
28
|
-
|
|
82
|
+
const fedify = federationMiddleware(federation, (context) => {
|
|
29
83
|
const c = context;
|
|
30
84
|
return contextData(c);
|
|
31
|
-
})
|
|
85
|
+
});
|
|
86
|
+
// The one path where Fedify and the public site both have a claim: a user's
|
|
87
|
+
// author archive is their actor id (decision-14), and Fedify answers a bare
|
|
88
|
+
// `Accept: application/json` as an ActivityStreams request while doc-3 gives
|
|
89
|
+
// that spelling the listing's own JSON. The CMS's rule decides, so a peer
|
|
90
|
+
// asking for `activity+json` or `ld+json` gets the actor and everything else
|
|
91
|
+
// — a browser, a reader, a feed tool — reaches the archive it asked for.
|
|
92
|
+
// Every other Fedify path is left exactly as it was.
|
|
93
|
+
const federationGate = async (c, next) => {
|
|
94
|
+
const isArchive = parseAuthorPath(requestPath(c)) !== undefined;
|
|
95
|
+
if (isArchive && !prefersActivityStreams(c.req.header('accept')))
|
|
96
|
+
return await next();
|
|
97
|
+
return await fedify(c, next);
|
|
98
|
+
};
|
|
99
|
+
app.use('*', federationGate);
|
|
100
|
+
// And then WordPress's, if the site is carrying them (TASK-70). It goes
|
|
101
|
+
// after the canonical middleware, which has already claimed everything it
|
|
102
|
+
// answers, and before the stored-id middleware below, which claims paths of
|
|
103
|
+
// its own: a `/wp-json/` path is served by whichever of the three wants it,
|
|
104
|
+
// and only this one ever does.
|
|
105
|
+
if (options.wordpress !== undefined) {
|
|
106
|
+
app.use('*', wordPressGate(options.wordpress));
|
|
107
|
+
}
|
|
32
108
|
// Named, and typed as a middleware, so the Hono context arrives with its
|
|
33
109
|
// path parameters resolved rather than as `any`.
|
|
34
110
|
const activityStreams = async (c, next) => {
|
|
35
|
-
const response = await activityStreamsDocument(c, federation);
|
|
111
|
+
const response = (await activityStreamsActor(c, federation)) ?? (await activityStreamsDocument(c, federation));
|
|
36
112
|
if (response !== undefined)
|
|
37
113
|
return response;
|
|
38
114
|
await next();
|
|
@@ -40,30 +116,226 @@ export function mountFederation(app, federation) {
|
|
|
40
116
|
app.use('*', activityStreams);
|
|
41
117
|
}
|
|
42
118
|
/**
|
|
43
|
-
* The
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
119
|
+
* The middleware that answers the WordPress ActivityPub plugin's paths, when
|
|
120
|
+
* the site is carrying them.
|
|
121
|
+
*
|
|
122
|
+
* The setting is read per request rather than at boot, which is the whole of
|
|
123
|
+
* AC #4: turning the switch off in the settings screen takes the paths away on
|
|
124
|
+
* the very next request, and turning it on puts them back, with nothing
|
|
125
|
+
* restarted. A request for one of those paths with the switch off falls
|
|
126
|
+
* through to the public site, which answers it as the 404 it is.
|
|
127
|
+
*
|
|
128
|
+
* The instant is recorded before Fedify is asked, because the record is of
|
|
129
|
+
* what the site was *asked for*: a peer still holding the old inbox URL is
|
|
130
|
+
* news whether or not the number in it still names anybody.
|
|
131
|
+
*/
|
|
132
|
+
function wordPressGate(build) {
|
|
133
|
+
let federation;
|
|
134
|
+
let middleware;
|
|
135
|
+
return async (c, next) => {
|
|
136
|
+
const target = wordPressRequestTarget(requestPath(c));
|
|
137
|
+
if (target === undefined)
|
|
138
|
+
return await next();
|
|
139
|
+
if (!readSiteSettings(c.var.config.contentDir).wordpressActivityPub)
|
|
140
|
+
return await next();
|
|
141
|
+
const user = target.wordpressActorId === undefined
|
|
142
|
+
? undefined
|
|
143
|
+
: userByWordPressActorId(c.var.config.dataDir, target.wordpressActorId);
|
|
144
|
+
await recordWordPressRequest({
|
|
145
|
+
dataDir: c.var.config.dataDir,
|
|
146
|
+
target,
|
|
147
|
+
username: user?.username,
|
|
148
|
+
at: c.var.config.now(),
|
|
149
|
+
});
|
|
150
|
+
if (middleware === undefined) {
|
|
151
|
+
federation = build();
|
|
152
|
+
middleware = federationMiddleware(federation, (context) => contextData(context));
|
|
153
|
+
}
|
|
154
|
+
return await middleware(c, next);
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* The person this request is about, when it asks at the id they were published
|
|
159
|
+
* under somewhere else: the `Person` for a peer, a redirect to the author
|
|
160
|
+
* archive for a browser, and `undefined` for everything else.
|
|
161
|
+
*
|
|
162
|
+
* The twin of {@link activityStreamsDocument}, and for the same reason
|
|
163
|
+
* (decision-14): a stored actor id is identity. A follower's server keys the
|
|
164
|
+
* account by the URL it first saw, so that URL has to keep answering with this
|
|
165
|
+
* person's actor for as long as the account exists, or every follow out there
|
|
166
|
+
* points at nothing.
|
|
167
|
+
*
|
|
168
|
+
* Fedify cannot serve it — its router matches paths, and a stored id is
|
|
169
|
+
* commonly a query string on the site root (doc-8) — so it is served here,
|
|
170
|
+
* ahead of the public site, exactly as a post's stored `activitypub.id` is.
|
|
171
|
+
*/
|
|
172
|
+
async function activityStreamsActor(c, federation) {
|
|
173
|
+
const user = storedActorAt(c);
|
|
174
|
+
if (user === undefined)
|
|
175
|
+
return undefined;
|
|
176
|
+
if (!prefersActivityStreams(c.req.header('accept'))) {
|
|
177
|
+
return c.redirect(authorHref(user.username), 301);
|
|
178
|
+
}
|
|
179
|
+
const context = federation.createContext(c.req.raw, contextData(c));
|
|
180
|
+
const actor = await userActor(context, user, { baseUrl: c.var.config.baseUrl });
|
|
181
|
+
return await respondWithObject(actor, { contextLoader: context.contextLoader });
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* The user whose stored actor id is the URL this request asks for, or
|
|
185
|
+
* `undefined`.
|
|
186
|
+
*
|
|
187
|
+
* Built the way {@link storedObjectAt} builds a post's candidate — the
|
|
188
|
+
* request's path and query on the site's base URL, rather than `request.url`,
|
|
189
|
+
* which behind a proxy is the internal address — and matched on the whole URL,
|
|
190
|
+
* query string and all, which is what decision-14 asks for.
|
|
191
|
+
*
|
|
192
|
+
* A user whose stored id happens to be their author URL is not one of these:
|
|
193
|
+
* the actor dispatcher has already answered for that URL, and answering again
|
|
194
|
+
* here would only redirect a browser to where it already is.
|
|
195
|
+
*/
|
|
196
|
+
function storedActorAt(c) {
|
|
197
|
+
const { search } = new URL(c.req.url);
|
|
198
|
+
const candidate = `${absoluteUrl(requestPath(c), c.var.config.baseUrl)}${search}`;
|
|
199
|
+
const user = listUsers(c.var.config.dataDir).find((entry) => entry.actorId === candidate);
|
|
200
|
+
if (user === undefined)
|
|
201
|
+
return undefined;
|
|
202
|
+
if (absoluteUrl(authorHref(user.username), c.var.config.baseUrl) === candidate)
|
|
203
|
+
return undefined;
|
|
204
|
+
return user;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* The post this request is about, when it is about one: the `Article` for a
|
|
208
|
+
* peer, a redirect to the permalink for a browser at a stored id, and
|
|
209
|
+
* `undefined` for everything else.
|
|
210
|
+
*
|
|
211
|
+
* Two URLs can name a post. Its permalink always does — that is the whole of
|
|
212
|
+
* decision-13, and a peer that dereferences a link somebody shared lands on
|
|
213
|
+
* the object rather than on a page it cannot read. The other is the
|
|
214
|
+
* `activitypub.id` a migrated post's file carries: the name its followers,
|
|
215
|
+
* its replies and its RSS subscribers already hold, which has to keep
|
|
216
|
+
* answering or every copy out there points at nothing. A browser that follows
|
|
217
|
+
* one of those old links is sent on to the permalink, because that is the URL
|
|
218
|
+
* a person should end up at.
|
|
219
|
+
*
|
|
220
|
+
* Anything else — a browser at a permalink, a `.md` or `.json` request, a
|
|
221
|
+
* page, a listing — gets `undefined` and falls through to the public site
|
|
222
|
+
* untouched.
|
|
55
223
|
*/
|
|
56
224
|
async function activityStreamsDocument(c, federation) {
|
|
57
|
-
|
|
225
|
+
const wantsObject = prefersActivityStreams(c.req.header('accept'));
|
|
226
|
+
if (wantsObject) {
|
|
227
|
+
const atPermalink = publicDocumentAt(c.var.store, requestPath(c));
|
|
228
|
+
if (atPermalink !== undefined && isFederatedDocument(atPermalink, c.var.store.now())) {
|
|
229
|
+
return await article(c, federation, atPermalink);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const stored = storedObjectAt(c);
|
|
233
|
+
if (stored === undefined)
|
|
234
|
+
return undefined;
|
|
235
|
+
if (!wantsObject)
|
|
236
|
+
return c.redirect(stored.permalink, 301);
|
|
237
|
+
return await article(c, federation, stored);
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* The post whose `activitypub.id` is the URL this request asks for, or
|
|
241
|
+
* `undefined`.
|
|
242
|
+
*
|
|
243
|
+
* The candidate is built the way the ids themselves are — the request's path
|
|
244
|
+
* and query on the site's base URL — rather than taken from `request.url`,
|
|
245
|
+
* which behind a proxy is the internal address. A post whose stored id is its
|
|
246
|
+
* permalink is not one of these: the permalink lookup has already answered for
|
|
247
|
+
* it, and answering again here would only invite a redirect to itself.
|
|
248
|
+
*/
|
|
249
|
+
function storedObjectAt(c) {
|
|
250
|
+
const { search } = new URL(c.req.url);
|
|
251
|
+
const candidate = `${absoluteUrl(requestPath(c), c.var.config.baseUrl)}${search}`;
|
|
252
|
+
const document = c.var.store.getByStoredObjectId(candidate);
|
|
253
|
+
if (document === undefined || document.type !== 'post')
|
|
58
254
|
return undefined;
|
|
59
|
-
|
|
60
|
-
if (document === undefined || !isFederatedDocument(document))
|
|
255
|
+
if (absoluteUrl(document.permalink, c.var.config.baseUrl) === candidate)
|
|
61
256
|
return undefined;
|
|
257
|
+
return document;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* One post as the ActivityStreams response a peer asked for.
|
|
261
|
+
*
|
|
262
|
+
* The article is built through the same {@link postArticle} the outbox uses,
|
|
263
|
+
* off a context Fedify makes for this request, so the object a peer fetches
|
|
264
|
+
* and the one it is delivered cannot drift apart.
|
|
265
|
+
*/
|
|
266
|
+
async function article(c, federation, document) {
|
|
62
267
|
const context = federation.createContext(c.req.raw, contextData(c));
|
|
63
268
|
return await respondWithObject(postArticle(context, document), {
|
|
64
269
|
contextLoader: context.contextLoader,
|
|
65
270
|
});
|
|
66
271
|
}
|
|
272
|
+
/** Where WebFinger lives, which is defined on the host rather than under a site. */
|
|
273
|
+
export const WEBFINGER_PATH = '/.well-known/webfinger';
|
|
274
|
+
/** `acct:{username}@{host}`, the handle a person types into a search box. */
|
|
275
|
+
export function acctOf(username, baseUrl) {
|
|
276
|
+
return `acct:${username}@${federationOrigin(baseUrl === '' ? 'http://localhost' : baseUrl).handleHost}`;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* The user a WebFinger `resource` asks about, or `undefined` for one this site
|
|
280
|
+
* answers for nobody.
|
|
281
|
+
*
|
|
282
|
+
* Every spelling of a person resolves, and they are the ones decision-14 lists
|
|
283
|
+
* as their aliases: the `acct:` handle, the author archive, `/@{username}` and
|
|
284
|
+
* — for somebody who was published elsewhere first — the id they were
|
|
285
|
+
* published under. Matching every one of them is what lets a peer that holds
|
|
286
|
+
* any one URL for this person find the others, which is the whole job of
|
|
287
|
+
* WebFinger, and it is how a server holding only `?author=2` discovers that
|
|
288
|
+
* the account it follows is still here.
|
|
289
|
+
*
|
|
290
|
+
* Both sides of the comparison go through {@link canonicalResource} first, so
|
|
291
|
+
* the spellings that differ only in how they were typed are one spelling by
|
|
292
|
+
* the time they are matched, and no spelling needs a branch of its own.
|
|
293
|
+
*/
|
|
294
|
+
export function webFingerSubject(c, resource) {
|
|
295
|
+
const wanted = canonicalResource(resource);
|
|
296
|
+
if (wanted === '')
|
|
297
|
+
return undefined;
|
|
298
|
+
const { baseUrl } = c.var.config;
|
|
299
|
+
return listUsers(c.var.config.dataDir).find((user) => [
|
|
300
|
+
acctOf(user.username, baseUrl),
|
|
301
|
+
absoluteUrl(authorHref(user.username), baseUrl),
|
|
302
|
+
absoluteUrl(handleHref(user.username), baseUrl),
|
|
303
|
+
...(user.actorId === undefined ? [] : [user.actorId]),
|
|
304
|
+
].some((spelling) => canonicalResource(spelling) === wanted));
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* One resource in the spelling every equivalent one reduces to.
|
|
308
|
+
*
|
|
309
|
+
* A host is case-insensitive — in DNS, in RFC 3986 and in RFC 7033 — so
|
|
310
|
+
* `acct:ada@EXAMPLE.COM` names the same person as `acct:ada@example.com` and
|
|
311
|
+
* has to find them. A username is not: Geekity compares one case sensitively
|
|
312
|
+
* (see {@link User.username}), so the case is left exactly as it was asked
|
|
313
|
+
* for and `acct:Ada@example.com` stays somebody this site does not have.
|
|
314
|
+
*
|
|
315
|
+
* A bare `user@host` is not what RFC 7033 asks for, but it is what enough
|
|
316
|
+
* clients send that refusing it would only look like a missing account, and
|
|
317
|
+
* the same goes for the leading `@` of `@ada@example.com`, which is how the
|
|
318
|
+
* handle is written everywhere a person reads it. Both are spelled back out
|
|
319
|
+
* as the `acct:` URI they meant.
|
|
320
|
+
*/
|
|
321
|
+
function canonicalResource(resource) {
|
|
322
|
+
const trimmed = resource.trim();
|
|
323
|
+
// A URL carries its own rules, and `URL` applies them: the scheme and the
|
|
324
|
+
// host come back lower-cased, the path untouched.
|
|
325
|
+
if (/^[a-z][a-z\d+.-]*:\/\//i.test(trimmed)) {
|
|
326
|
+
try {
|
|
327
|
+
return new URL(trimmed).href;
|
|
328
|
+
}
|
|
329
|
+
catch {
|
|
330
|
+
return trimmed;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
const handle = trimmed.replace(/^acct:/i, '').replace(/^@/, '');
|
|
334
|
+
const at = handle.lastIndexOf('@');
|
|
335
|
+
if (at <= 0)
|
|
336
|
+
return handle;
|
|
337
|
+
return `acct:${handle.slice(0, at)}@${handle.slice(at + 1).toLowerCase()}`;
|
|
338
|
+
}
|
|
67
339
|
/** What the dispatchers are handed, off the Hono context. */
|
|
68
340
|
function contextData(c) {
|
|
69
341
|
return { admin: c.var.admin, store: c.var.store, config: c.var.config };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.js","sourceRoot":"","sources":["../../src/federation/mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"mount.js","sourceRoot":"","sources":["../../src/federation/mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGlE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE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CAAC,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;AAC7E,CAAC;AAED,6DAA6D;AAC7D,SAAS,WAAW,CAAC,CAAsB;IACzC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;AAC1E,CAAC"}
|
|
@@ -1,48 +1,36 @@
|
|
|
1
1
|
import type { FederationOrigin } from '@fedify/fedify';
|
|
2
2
|
/**
|
|
3
|
-
* Where
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
3
|
+
* Where a user's ActivityPub endpoints live: at their author URL, and under it.
|
|
4
|
+
*
|
|
5
|
+
* decision-14 makes every user an actor whose id is their author archive,
|
|
6
|
+
* `{baseUrl}/author/{username}/`, so there is no prefix of its own any more —
|
|
7
|
+
* the actor is a page in a browser and an actor to a peer, exactly as a post
|
|
8
|
+
* is its permalink to both (decision-13). The collections are the archive's
|
|
9
|
+
* children, with the trailing slashes every URL on this site has, and Fedify
|
|
10
|
+
* builds each id from these templates so nothing has to guess the form.
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
* the site
|
|
13
|
-
*
|
|
14
|
-
* is `{baseUrl}/ap/actor` however often the handle is renamed.
|
|
12
|
+
* A GET of `/author/ada` without the slash is a Fedify 404 that falls through
|
|
13
|
+
* to the public site's own canonical redirect, which is where a browser that
|
|
14
|
+
* followed an actor id without its slash lands (doc-8).
|
|
15
15
|
*/
|
|
16
|
-
export declare const ACTOR_PATH: "/
|
|
16
|
+
export declare const ACTOR_PATH: "/author/{identifier}/";
|
|
17
17
|
/** The actor's inbox, its outbox and its two follow collections. */
|
|
18
|
-
export declare const INBOX_PATH: "/
|
|
19
|
-
export declare const OUTBOX_PATH: "/
|
|
20
|
-
export declare const FOLLOWERS_PATH: "/
|
|
21
|
-
export declare const FOLLOWING_PATH: "/
|
|
22
|
-
/** The instance-wide inbox, which a peer may use to deliver to every actor at once. */
|
|
23
|
-
export declare const SHARED_INBOX_PATH: "/ap/shared-inbox";
|
|
18
|
+
export declare const INBOX_PATH: "/author/{identifier}/inbox/";
|
|
19
|
+
export declare const OUTBOX_PATH: "/author/{identifier}/outbox/";
|
|
20
|
+
export declare const FOLLOWERS_PATH: "/author/{identifier}/followers/";
|
|
21
|
+
export declare const FOLLOWING_PATH: "/author/{identifier}/following/";
|
|
24
22
|
/**
|
|
25
|
-
*
|
|
23
|
+
* The instance-wide inbox, which a peer may use to deliver to every actor at
|
|
24
|
+
* once.
|
|
26
25
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* ActivityStreams id, so the followers who already have the object are not
|
|
30
|
-
* handed a second one.
|
|
26
|
+
* A reserved top-level path (decision-14), which is why `inbox` is one of the
|
|
27
|
+
* two names `web/authors.ts` keeps a user from taking.
|
|
31
28
|
*/
|
|
32
|
-
export declare const
|
|
29
|
+
export declare const SHARED_INBOX_PATH: "/inbox/";
|
|
30
|
+
/** Where a user's mention-style short URL lives: `/@ada`, WordPress's alias. */
|
|
31
|
+
export declare function handleHref(username: string): string;
|
|
33
32
|
/** Where the NodeInfo 2.1 document lives; `/.well-known/nodeinfo` points at it. */
|
|
34
33
|
export declare const NODEINFO_PATH = "/nodeinfo/2.1";
|
|
35
|
-
/** The path a post's ActivityStreams object is served at. */
|
|
36
|
-
export declare function postObjectPath(slug: string): string;
|
|
37
|
-
/**
|
|
38
|
-
* A post's ActivityStreams id, as an absolute URL.
|
|
39
|
-
*
|
|
40
|
-
* It is built on the {@link federationOrigin} rather than on the whole base
|
|
41
|
-
* URL, because that is where Fedify serves the object from: a site in a
|
|
42
|
-
* subdirectory keeps its pages under that directory, but its federation
|
|
43
|
-
* endpoints — this one included — are host-rooted.
|
|
44
|
-
*/
|
|
45
|
-
export declare function postObjectId(slug: string, baseUrl: string): string;
|
|
46
34
|
/**
|
|
47
35
|
* The id of the `Create` that announced an object.
|
|
48
36
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/federation/paths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/federation/paths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,yBAA2C,CAAC;AAEnE,oEAAoE;AACpE,eAAO,MAAM,UAAU,+BAAiC,CAAC;AACzD,eAAO,MAAM,WAAW,gCAAkC,CAAC;AAC3D,eAAO,MAAM,cAAc,mCAAqC,CAAC;AACjE,eAAO,MAAM,cAAc,mCAAqC,CAAC;AAEjE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,WAA6B,CAAC;AAE5D,gFAAgF;AAChF,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,mFAAmF;AACnF,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAE7C;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,GAAG,GAAG,MAAM,GAAG,GAAG,CAE5D;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,GAAG,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,CAE9E;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,GAAG,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,GAAG,CAE9E;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAGlE"}
|
package/dist/federation/paths.js
CHANGED
|
@@ -1,51 +1,38 @@
|
|
|
1
|
+
import { AUTHOR_BASE, INBOX_BASE } from '../web/authors.js';
|
|
1
2
|
/**
|
|
2
|
-
* Where
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
3
|
+
* Where a user's ActivityPub endpoints live: at their author URL, and under it.
|
|
4
|
+
*
|
|
5
|
+
* decision-14 makes every user an actor whose id is their author archive,
|
|
6
|
+
* `{baseUrl}/author/{username}/`, so there is no prefix of its own any more —
|
|
7
|
+
* the actor is a page in a browser and an actor to a peer, exactly as a post
|
|
8
|
+
* is its permalink to both (decision-13). The collections are the archive's
|
|
9
|
+
* children, with the trailing slashes every URL on this site has, and Fedify
|
|
10
|
+
* builds each id from these templates so nothing has to guess the form.
|
|
9
11
|
*
|
|
10
|
-
*
|
|
11
|
-
* the site
|
|
12
|
-
*
|
|
13
|
-
* is `{baseUrl}/ap/actor` however often the handle is renamed.
|
|
12
|
+
* A GET of `/author/ada` without the slash is a Fedify 404 that falls through
|
|
13
|
+
* to the public site's own canonical redirect, which is where a browser that
|
|
14
|
+
* followed an actor id without its slash lands (doc-8).
|
|
14
15
|
*/
|
|
15
|
-
export const ACTOR_PATH =
|
|
16
|
+
export const ACTOR_PATH = `/${AUTHOR_BASE}/{identifier}/`;
|
|
16
17
|
/** The actor's inbox, its outbox and its two follow collections. */
|
|
17
|
-
export const INBOX_PATH = `${ACTOR_PATH}
|
|
18
|
-
export const OUTBOX_PATH = `${ACTOR_PATH}
|
|
19
|
-
export const FOLLOWERS_PATH = `${ACTOR_PATH}
|
|
20
|
-
export const FOLLOWING_PATH = `${ACTOR_PATH}
|
|
21
|
-
/** The instance-wide inbox, which a peer may use to deliver to every actor at once. */
|
|
22
|
-
export const SHARED_INBOX_PATH = `${FEDERATION_PREFIX}/shared-inbox`;
|
|
18
|
+
export const INBOX_PATH = `${ACTOR_PATH}inbox/`;
|
|
19
|
+
export const OUTBOX_PATH = `${ACTOR_PATH}outbox/`;
|
|
20
|
+
export const FOLLOWERS_PATH = `${ACTOR_PATH}followers/`;
|
|
21
|
+
export const FOLLOWING_PATH = `${ACTOR_PATH}following/`;
|
|
23
22
|
/**
|
|
24
|
-
*
|
|
23
|
+
* The instance-wide inbox, which a peer may use to deliver to every actor at
|
|
24
|
+
* once.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* ActivityStreams id, so the followers who already have the object are not
|
|
29
|
-
* handed a second one.
|
|
26
|
+
* A reserved top-level path (decision-14), which is why `inbox` is one of the
|
|
27
|
+
* two names `web/authors.ts` keeps a user from taking.
|
|
30
28
|
*/
|
|
31
|
-
export const
|
|
29
|
+
export const SHARED_INBOX_PATH = `/${INBOX_BASE}/`;
|
|
30
|
+
/** Where a user's mention-style short URL lives: `/@ada`, WordPress's alias. */
|
|
31
|
+
export function handleHref(username) {
|
|
32
|
+
return `/@${encodeURIComponent(username)}`;
|
|
33
|
+
}
|
|
32
34
|
/** Where the NodeInfo 2.1 document lives; `/.well-known/nodeinfo` points at it. */
|
|
33
35
|
export const NODEINFO_PATH = '/nodeinfo/2.1';
|
|
34
|
-
/** The path a post's ActivityStreams object is served at. */
|
|
35
|
-
export function postObjectPath(slug) {
|
|
36
|
-
return `${FEDERATION_PREFIX}/posts/${encodeURIComponent(slug)}`;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* A post's ActivityStreams id, as an absolute URL.
|
|
40
|
-
*
|
|
41
|
-
* It is built on the {@link federationOrigin} rather than on the whole base
|
|
42
|
-
* URL, because that is where Fedify serves the object from: a site in a
|
|
43
|
-
* subdirectory keeps its pages under that directory, but its federation
|
|
44
|
-
* endpoints — this one included — are host-rooted.
|
|
45
|
-
*/
|
|
46
|
-
export function postObjectId(slug, baseUrl) {
|
|
47
|
-
return new URL(postObjectPath(slug), federationOrigin(baseUrl).webOrigin).href;
|
|
48
|
-
}
|
|
49
36
|
/**
|
|
50
37
|
* The id of the `Create` that announced an object.
|
|
51
38
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/federation/paths.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/federation/paths.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,WAAW,gBAAyB,CAAC;AAEnE,oEAAoE;AACpE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,UAAU,QAAiB,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,UAAU,SAAkB,CAAC;AAC3D,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,UAAU,YAAqB,CAAC;AACjE,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,UAAU,YAAqB,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,UAAU,GAAY,CAAC;AAE5D,gFAAgF;AAChF,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,OAAO,KAAK,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC;AAC7C,CAAC;AAED,mFAAmF;AACnF,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAsB;IACrD,OAAO,IAAI,GAAG,CAAC,GAAG,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAsB,EAAE,QAAgB;IACvE,OAAO,IAAI,GAAG,CAAC,GAAG,QA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