@geekity/cms 0.3.0 → 0.4.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 +2091 -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/pages/documents/editor.njk +196 -0
- 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/media/library.njk +160 -0
- package/admin/pages/messages/all.njk +110 -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/federation.njk +75 -0
- package/admin/pages/settings/general.njk +29 -0
- package/admin/pages/settings/permalinks.njk +50 -0
- package/admin/pages/settings/reading.njk +72 -0
- package/admin/pages/users/edit.njk +239 -0
- package/admin/pages/users/list.njk +48 -0
- package/admin/pages/users/new.njk +41 -0
- package/admin/static/admin.css +498 -3
- package/admin/static/copy.js +52 -0
- package/admin/static/editor.js +16 -16
- package/admin/static/slug.js +61 -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 +127 -10
- package/dist/admin/documents.d.ts.map +1 -1
- package/dist/admin/documents.js +360 -41
- package/dist/admin/documents.js.map +1 -1
- package/dist/admin/federation.d.ts +151 -50
- package/dist/admin/federation.d.ts.map +1 -1
- package/dist/admin/federation.js +225 -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 +126 -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/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 +155 -105
- package/dist/admin/routes.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 +39 -0
- package/dist/admin/settings-federation.d.ts.map +1 -0
- package/dist/admin/settings-federation.js +103 -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 +102 -0
- package/dist/admin/settings-page.d.ts.map +1 -0
- package/dist/admin/settings-page.js +126 -0
- package/dist/admin/settings-page.js.map +1 -0
- package/dist/admin/settings-pages.d.ts +19 -0
- package/dist/admin/settings-pages.d.ts.map +1 -0
- package/dist/admin/settings-pages.js +33 -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 +33 -0
- package/dist/admin/settings-reading.d.ts.map +1 -0
- package/dist/admin/settings-reading.js +48 -0
- package/dist/admin/settings-reading.js.map +1 -0
- package/dist/admin/settings.d.ts +325 -96
- package/dist/admin/settings.d.ts.map +1 -1
- package/dist/admin/settings.js +650 -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 +44 -14
- package/dist/admin/templates.d.ts.map +1 -1
- package/dist/admin/templates.js +44 -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/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 +424 -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 +75 -0
- package/dist/comments/form.d.ts.map +1 -0
- package/dist/comments/form.js +64 -0
- package/dist/comments/form.js.map +1 -0
- package/dist/comments/index.d.ts +15 -0
- package/dist/comments/index.d.ts.map +1 -0
- package/dist/comments/index.js +9 -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 +58 -0
- package/dist/comments/routes.d.ts.map +1 -0
- package/dist/comments/routes.js +177 -0
- package/dist/comments/routes.js.map +1 -0
- package/dist/comments/submission.d.ts +263 -0
- package/dist/comments/submission.d.ts.map +1 -0
- package/dist/comments/submission.js +241 -0
- package/dist/comments/submission.js.map +1 -0
- package/dist/config.d.ts +190 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +118 -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 +202 -7
- package/dist/content/store.d.ts.map +1 -1
- package/dist/content/store.js +374 -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 +58 -4
- 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 +42 -10
- package/dist/federation/mount.d.ts.map +1 -1
- package/dist/federation/mount.js +266 -26
- 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 +327 -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 +73 -0
- package/dist/web/navigation.d.ts.map +1 -0
- package/dist/web/navigation.js +110 -0
- package/dist/web/navigation.js.map +1 -0
- package/dist/web/negotiate.d.ts +9 -0
- package/dist/web/negotiate.d.ts.map +1 -1
- package/dist/web/negotiate.js +6 -1
- 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 +197 -9
- package/dist/web/render.d.ts.map +1 -1
- package/dist/web/render.js +334 -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 +845 -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 +205 -0
- package/dist/web/themes.d.ts.map +1 -0
- package/dist/web/themes.js +277 -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 +1 -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 +1096 -50
- package/themes/default/layouts/404.njk +2 -3
- package/themes/default/layouts/author.njk +37 -0
- package/themes/default/layouts/base.njk +172 -31
- package/themes/default/layouts/category.njk +27 -0
- package/themes/default/layouts/front-page.njk +57 -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 +77 -0
- package/themes/default/partials/comment-form.njk +109 -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/pagination.njk +12 -6
- package/themes/default/partials/post-list.njk +51 -18
- package/themes/default/partials/search-form.njk +17 -0
- package/themes/default/partials/tags.njk +26 -5
- package/themes/default/static/highlight.js +4 -0
- package/themes/default/static/style.css +1119 -194
- package/themes/default/theme.json +5 -0
- package/admin/layouts/document-editor.njk +0 -167
- 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
|
@@ -1,55 +1,109 @@
|
|
|
1
|
-
import type { Context, RequestContext } from '@fedify/fedify';
|
|
2
|
-
import { Application, Group, Organization, Person, Service } from '@fedify/vocab';
|
|
1
|
+
import type { Context, RequestContext, SenderKeyPair } from '@fedify/fedify';
|
|
3
2
|
import type { Actor } from '@fedify/vocab';
|
|
4
|
-
import type {
|
|
5
|
-
/**
|
|
6
|
-
* The vocabulary class behind each of {@link ACTOR_TYPES}.
|
|
7
|
-
*
|
|
8
|
-
* The setting is a string, because it is a form field and a SQLite row; this
|
|
9
|
-
* is where it becomes the class the actor document is built from.
|
|
10
|
-
*/
|
|
11
|
-
export declare const ACTOR_CLASSES: {
|
|
12
|
-
readonly Person: typeof Person;
|
|
13
|
-
readonly Organization: typeof Organization;
|
|
14
|
-
readonly Service: typeof Service;
|
|
15
|
-
readonly Group: typeof Group;
|
|
16
|
-
readonly Application: typeof Application;
|
|
17
|
-
};
|
|
18
|
-
/** What {@link siteActor} needs beyond the Fedify context. */
|
|
19
|
-
export interface SiteActorOptions {
|
|
20
|
-
/** The settings the profile is built from. */
|
|
21
|
-
settings: SiteSettings;
|
|
22
|
-
/**
|
|
23
|
-
* The base URL actually in effect, which the settings' own may not be: it is
|
|
24
|
-
* what the avatar's path is resolved against. Defaults to the setting.
|
|
25
|
-
*/
|
|
26
|
-
baseUrl?: string | undefined;
|
|
27
|
-
}
|
|
3
|
+
import type { User } from '../admin/accounts.ts';
|
|
28
4
|
/**
|
|
29
|
-
*
|
|
30
|
-
* the site has none.
|
|
5
|
+
* A user as the fediverse sees them (decision-14).
|
|
31
6
|
*
|
|
32
|
-
*
|
|
7
|
+
* Everything a peer reads about a person is built here, off one rule: an
|
|
8
|
+
* actor's id is decided once, in {@link actorId}, and every other id — the
|
|
9
|
+
* key, the multikey, the aliases, the `actor` of every activity — hangs off
|
|
10
|
+
* that same value rather than being spelled again. That is what lets a user
|
|
11
|
+
* published elsewhere be served under the id their followers already hold
|
|
12
|
+
* (decision-14) without a second spelling of anything.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* One user by their username, or `undefined` when nobody has it.
|
|
16
|
+
*
|
|
17
|
+
* The username is the Fedify identifier (decision-14), so this is what every
|
|
18
|
+
* dispatcher and every inbox handler starts with: an identifier nobody answers
|
|
19
|
+
* to is `null` back to Fedify, which is a 404, rather than an empty collection.
|
|
20
|
+
*/
|
|
21
|
+
export declare function userByUsername(dataDir: string, username: string): User | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* An avatar as the absolute URL an `icon` carries, or `undefined` when there
|
|
24
|
+
* is none.
|
|
25
|
+
*
|
|
26
|
+
* A profile holds what the upload endpoint handed back —
|
|
33
27
|
* `/uploads/2026/09/me.png` — because that is where the site serves the file
|
|
34
28
|
* and where an Eleventy build of the same content copies it through to. A peer
|
|
35
29
|
* reading the actor has no site to resolve that against, so it is made
|
|
36
|
-
* absolute here.
|
|
30
|
+
* absolute here. One already given as an absolute URL is left alone.
|
|
37
31
|
*/
|
|
38
32
|
export declare function avatarUrl(avatar: string, baseUrl: string): string | undefined;
|
|
39
33
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
34
|
+
* One user's ActivityStreams id.
|
|
35
|
+
*
|
|
36
|
+
* The author URL, which is what Fedify derives from the dispatcher path —
|
|
37
|
+
* unless the user's record carries the id they were published under somewhere
|
|
38
|
+
* else, in which case that is who they are (decision-14). A stored id is
|
|
39
|
+
* identity rather than cache: a follower's server keys the account by it, and
|
|
40
|
+
* answering under a different one would read as a different person rather than
|
|
41
|
+
* as the same person moved.
|
|
42
42
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
43
|
+
* This is the only place that choice is made, and every id built from it — the
|
|
44
|
+
* key id, the multikeys, the `actor` of every activity, the sender key pairs,
|
|
45
|
+
* the WebFinger `self` — follows from here without spelling the rule again
|
|
46
|
+
* (doc-8). What does *not* follow is `url`: the archive is still where a
|
|
47
|
+
* person is sent, and the actor's collections are still its dispatcher path's
|
|
48
|
+
* children, because those are cache and a peer refetches them.
|
|
48
49
|
*/
|
|
49
|
-
export declare function
|
|
50
|
+
export declare function actorId(context: Context<unknown>, user: User): URL;
|
|
50
51
|
/**
|
|
51
|
-
* The
|
|
52
|
-
*
|
|
52
|
+
* The keys a user signs with, as the sender Fedify is handed.
|
|
53
|
+
*
|
|
54
|
+
* An explicit list rather than `{ identifier }`, which is the whole point:
|
|
55
|
+
* Fedify derives a key id from the dispatcher path and would go on doing so
|
|
56
|
+
* under a stored actor id, signing with a key id no peer could dereference.
|
|
57
|
+
* Built from {@link actorId} instead, so the `Signature-Input` header and the
|
|
58
|
+
* integrity proof name keys the actor document really publishes.
|
|
59
|
+
*
|
|
60
|
+
* The order is {@link ACTOR_KEY_ALGORITHMS}: RSA first, which Mastodon
|
|
61
|
+
* verifies HTTP Signatures with and which is `#main-key`; then Ed25519, whose
|
|
62
|
+
* multikey Fedify numbers `#multikey-1` because RSA took slot zero.
|
|
63
|
+
*/
|
|
64
|
+
export declare function senderKeyPairs(context: Context<unknown>, user: User): Promise<SenderKeyPair[]>;
|
|
65
|
+
/**
|
|
66
|
+
* The id a signature names for one of an actor's keys.
|
|
67
|
+
*
|
|
68
|
+
* The RSA pair signs HTTP Signatures and is published as `publicKey`, which
|
|
69
|
+
* every peer looks for at `#main-key`; the rest sign FEP-8b32 proofs and are
|
|
70
|
+
* named by the multikey they are published as.
|
|
71
|
+
*/
|
|
72
|
+
export declare function keyIdFor(id: URL, index: number): URL;
|
|
73
|
+
/** `{actor}#main-key`: the RSA key a peer verifies an HTTP Signature with. */
|
|
74
|
+
export declare function mainKeyId(id: URL): URL;
|
|
75
|
+
/**
|
|
76
|
+
* `{actor}#multikey-{n}`: one entry of `assertionMethod`.
|
|
77
|
+
*
|
|
78
|
+
* Fedify numbers its own multikeys in `ACTOR_KEY_ALGORITHMS` order, so RSA is
|
|
79
|
+
* 0 and Ed25519 is 1 (doc-8), and the numbering is kept because a peer that
|
|
80
|
+
* cached the document holds these ids.
|
|
81
|
+
*/
|
|
82
|
+
export declare function multikeyId(id: URL, index: number): URL;
|
|
83
|
+
/** The three URLs a user answers to, which WebFinger and `alsoKnownAs` list. */
|
|
84
|
+
export declare function actorAliases(context: Context<unknown>, user: User, baseUrl: string): URL[];
|
|
85
|
+
/** What {@link userActor} needs beyond the Fedify context. */
|
|
86
|
+
export interface UserActorOptions {
|
|
87
|
+
/**
|
|
88
|
+
* The base URL actually in effect, which is what the archive URL and the
|
|
89
|
+
* avatar's path are resolved against.
|
|
90
|
+
*/
|
|
91
|
+
baseUrl: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* One user's ActivityPub actor, as decision-14 describes it.
|
|
95
|
+
*
|
|
96
|
+
* A `Person`, always: a user is a person, and the site is no longer an actor
|
|
97
|
+
* at all, so there is nothing left for the old `actorType` setting to choose
|
|
98
|
+
* between. The profile fields are exactly what the archive prints — the same
|
|
99
|
+
* {@link profileContext} a theme is handed — so the page and the actor cannot
|
|
100
|
+
* say different things about somebody.
|
|
101
|
+
*
|
|
102
|
+
* The keys are built by hand rather than taken from `getActorKeyPairs`, whose
|
|
103
|
+
* `cryptographicKey` and `multikey` carry ids Fedify derived from the
|
|
104
|
+
* dispatcher path. Under a stored actor id those would name keys the document
|
|
105
|
+
* does not publish, and a peer that cannot dereference the key id in a
|
|
106
|
+
* signature rejects the signature (doc-8).
|
|
53
107
|
*/
|
|
54
|
-
export declare function
|
|
108
|
+
export declare function userActor(context: RequestContext<unknown> | Context<unknown>, user: User, options: UserActorOptions): Promise<Actor>;
|
|
55
109
|
//# sourceMappingURL=actor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor.d.ts","sourceRoot":"","sources":["../../src/federation/actor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"actor.d.ts","sourceRoot":"","sources":["../../src/federation/actor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE7E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAKjD;;;;;;;;;GASG;AAEH;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAElF;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAW7E;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,GAAG,CAYlE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EACzB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,aAAa,EAAE,CAAC,CAQ1B;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,CAEpD;AAED,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,EAAE,EAAE,GAAG,GAAG,GAAG,CAEtC;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,CAEtD;AAED,gFAAgF;AAChF,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,EAAE,CAQ1F;AAED,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,SAAS,CAC7B,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,EACnD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,KAAK,CAAC,CAkEhB"}
|
package/dist/federation/actor.js
CHANGED
|
@@ -1,28 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { CryptographicKey, Endpoints, Image, Multikey, Person, PropertyValue } from '@fedify/vocab';
|
|
2
|
+
import { listUsers } from '../admin/accounts.js';
|
|
3
|
+
import { authorHref, profileContext } from '../web/authors.js';
|
|
3
4
|
import { absoluteUrl } from '../web/negotiate.js';
|
|
5
|
+
import { handleHref } from './paths.js';
|
|
4
6
|
/**
|
|
5
|
-
*
|
|
7
|
+
* A user as the fediverse sees them (decision-14).
|
|
6
8
|
*
|
|
7
|
-
*
|
|
8
|
-
* is
|
|
9
|
+
* Everything a peer reads about a person is built here, off one rule: an
|
|
10
|
+
* actor's id is decided once, in {@link actorId}, and every other id — the
|
|
11
|
+
* key, the multikey, the aliases, the `actor` of every activity — hangs off
|
|
12
|
+
* that same value rather than being spelled again. That is what lets a user
|
|
13
|
+
* published elsewhere be served under the id their followers already hold
|
|
14
|
+
* (decision-14) without a second spelling of anything.
|
|
9
15
|
*/
|
|
10
|
-
export const ACTOR_CLASSES = {
|
|
11
|
-
Person,
|
|
12
|
-
Organization,
|
|
13
|
-
Service,
|
|
14
|
-
Group,
|
|
15
|
-
Application,
|
|
16
|
-
};
|
|
17
16
|
/**
|
|
18
|
-
*
|
|
19
|
-
* the site has none.
|
|
17
|
+
* One user by their username, or `undefined` when nobody has it.
|
|
20
18
|
*
|
|
21
|
-
* The
|
|
19
|
+
* The username is the Fedify identifier (decision-14), so this is what every
|
|
20
|
+
* dispatcher and every inbox handler starts with: an identifier nobody answers
|
|
21
|
+
* to is `null` back to Fedify, which is a 404, rather than an empty collection.
|
|
22
|
+
*/
|
|
23
|
+
export function userByUsername(dataDir, username) {
|
|
24
|
+
return listUsers(dataDir).find((user) => user.username === username);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* An avatar as the absolute URL an `icon` carries, or `undefined` when there
|
|
28
|
+
* is none.
|
|
29
|
+
*
|
|
30
|
+
* A profile holds what the upload endpoint handed back —
|
|
22
31
|
* `/uploads/2026/09/me.png` — because that is where the site serves the file
|
|
23
32
|
* and where an Eleventy build of the same content copies it through to. A peer
|
|
24
33
|
* reading the actor has no site to resolve that against, so it is made
|
|
25
|
-
* absolute here.
|
|
34
|
+
* absolute here. One already given as an absolute URL is left alone.
|
|
26
35
|
*/
|
|
27
36
|
export function avatarUrl(avatar, baseUrl) {
|
|
28
37
|
const value = avatar.trim();
|
|
@@ -40,52 +49,170 @@ export function avatarUrl(avatar, baseUrl) {
|
|
|
40
49
|
}
|
|
41
50
|
}
|
|
42
51
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
52
|
+
* One user's ActivityStreams id.
|
|
53
|
+
*
|
|
54
|
+
* The author URL, which is what Fedify derives from the dispatcher path —
|
|
55
|
+
* unless the user's record carries the id they were published under somewhere
|
|
56
|
+
* else, in which case that is who they are (decision-14). A stored id is
|
|
57
|
+
* identity rather than cache: a follower's server keys the account by it, and
|
|
58
|
+
* answering under a different one would read as a different person rather than
|
|
59
|
+
* as the same person moved.
|
|
60
|
+
*
|
|
61
|
+
* This is the only place that choice is made, and every id built from it — the
|
|
62
|
+
* key id, the multikeys, the `actor` of every activity, the sender key pairs,
|
|
63
|
+
* the WebFinger `self` — follows from here without spelling the rule again
|
|
64
|
+
* (doc-8). What does *not* follow is `url`: the archive is still where a
|
|
65
|
+
* person is sent, and the actor's collections are still its dispatcher path's
|
|
66
|
+
* children, because those are cache and a peer refetches them.
|
|
67
|
+
*/
|
|
68
|
+
export function actorId(context, user) {
|
|
69
|
+
const stored = user.actorId;
|
|
70
|
+
if (stored !== undefined) {
|
|
71
|
+
try {
|
|
72
|
+
return new URL(stored);
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
// Unreachable through the users file, which drops an id that is not a
|
|
76
|
+
// URL on the way in; a caller that built a `User` by hand falls back to
|
|
77
|
+
// the derived id rather than taking the actor down.
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return context.getActorUri(user.username);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The keys a user signs with, as the sender Fedify is handed.
|
|
84
|
+
*
|
|
85
|
+
* An explicit list rather than `{ identifier }`, which is the whole point:
|
|
86
|
+
* Fedify derives a key id from the dispatcher path and would go on doing so
|
|
87
|
+
* under a stored actor id, signing with a key id no peer could dereference.
|
|
88
|
+
* Built from {@link actorId} instead, so the `Signature-Input` header and the
|
|
89
|
+
* integrity proof name keys the actor document really publishes.
|
|
90
|
+
*
|
|
91
|
+
* The order is {@link ACTOR_KEY_ALGORITHMS}: RSA first, which Mastodon
|
|
92
|
+
* verifies HTTP Signatures with and which is `#main-key`; then Ed25519, whose
|
|
93
|
+
* multikey Fedify numbers `#multikey-1` because RSA took slot zero.
|
|
94
|
+
*/
|
|
95
|
+
export async function senderKeyPairs(context, user) {
|
|
96
|
+
const id = actorId(context, user);
|
|
97
|
+
const keys = await context.getActorKeyPairs(user.username);
|
|
98
|
+
return keys.map((key, index) => ({
|
|
99
|
+
keyId: keyIdFor(id, index),
|
|
100
|
+
privateKey: key.privateKey,
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The id a signature names for one of an actor's keys.
|
|
45
105
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* is the RSA one Mastodon verifies HTTP Signatures with, `assertionMethods`
|
|
50
|
-
* are the multikeys FEP-8b32 proofs are checked against.
|
|
106
|
+
* The RSA pair signs HTTP Signatures and is published as `publicKey`, which
|
|
107
|
+
* every peer looks for at `#main-key`; the rest sign FEP-8b32 proofs and are
|
|
108
|
+
* named by the multikey they are published as.
|
|
51
109
|
*/
|
|
52
|
-
export
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
110
|
+
export function keyIdFor(id, index) {
|
|
111
|
+
return index === 0 ? mainKeyId(id) : multikeyId(id, index);
|
|
112
|
+
}
|
|
113
|
+
/** `{actor}#main-key`: the RSA key a peer verifies an HTTP Signature with. */
|
|
114
|
+
export function mainKeyId(id) {
|
|
115
|
+
return new URL(`${id.href}#main-key`, id);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* `{actor}#multikey-{n}`: one entry of `assertionMethod`.
|
|
119
|
+
*
|
|
120
|
+
* Fedify numbers its own multikeys in `ACTOR_KEY_ALGORITHMS` order, so RSA is
|
|
121
|
+
* 0 and Ed25519 is 1 (doc-8), and the numbering is kept because a peer that
|
|
122
|
+
* cached the document holds these ids.
|
|
123
|
+
*/
|
|
124
|
+
export function multikeyId(id, index) {
|
|
125
|
+
return new URL(`${id.href}#multikey-${String(index)}`, id);
|
|
126
|
+
}
|
|
127
|
+
/** The three URLs a user answers to, which WebFinger and `alsoKnownAs` list. */
|
|
128
|
+
export function actorAliases(context, user, baseUrl) {
|
|
129
|
+
const aliases = [
|
|
130
|
+
actorId(context, user),
|
|
131
|
+
new URL(absoluteUrl(handleHref(user.username), baseUrl)),
|
|
132
|
+
];
|
|
133
|
+
const archive = new URL(absoluteUrl(authorHref(user.username), baseUrl));
|
|
134
|
+
if (!aliases.some((alias) => alias.href === archive.href))
|
|
135
|
+
aliases.splice(1, 0, archive);
|
|
136
|
+
return aliases;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* One user's ActivityPub actor, as decision-14 describes it.
|
|
140
|
+
*
|
|
141
|
+
* A `Person`, always: a user is a person, and the site is no longer an actor
|
|
142
|
+
* at all, so there is nothing left for the old `actorType` setting to choose
|
|
143
|
+
* between. The profile fields are exactly what the archive prints — the same
|
|
144
|
+
* {@link profileContext} a theme is handed — so the page and the actor cannot
|
|
145
|
+
* say different things about somebody.
|
|
146
|
+
*
|
|
147
|
+
* The keys are built by hand rather than taken from `getActorKeyPairs`, whose
|
|
148
|
+
* `cryptographicKey` and `multikey` carry ids Fedify derived from the
|
|
149
|
+
* dispatcher path. Under a stored actor id those would name keys the document
|
|
150
|
+
* does not publish, and a peer that cannot dereference the key id in a
|
|
151
|
+
* signature rejects the signature (doc-8).
|
|
152
|
+
*/
|
|
153
|
+
export async function userActor(context, user, options) {
|
|
154
|
+
const { baseUrl } = options;
|
|
155
|
+
const profile = profileContext(user);
|
|
156
|
+
const id = actorId(context, user);
|
|
157
|
+
const icon = profile.avatar === undefined ? undefined : avatarUrl(profile.avatar, baseUrl);
|
|
158
|
+
const keys = await context.getActorKeyPairs(user.username);
|
|
159
|
+
// Fedify catches whatever the key pairs dispatcher throws and hands back an
|
|
160
|
+
// empty list, so this is the only place a key file damaged since boot can be
|
|
161
|
+
// noticed. An actor document with no `publicKey` is worse than no answer: a
|
|
162
|
+
// peer caches it, and every signature that user makes fails to verify
|
|
163
|
+
// against what the peer holds. Failing the request keeps the last good
|
|
164
|
+
// document in the peer's cache instead.
|
|
165
|
+
if (keys.length === 0) {
|
|
166
|
+
throw new Error(`The actor ${user.username} has no usable key pairs. Its key files under the ` +
|
|
167
|
+
'data directory could not be read; see the error the key loader raised. ' +
|
|
168
|
+
'Restore them from a backup, or delete them to ask for new keys on purpose.');
|
|
169
|
+
}
|
|
170
|
+
const rsa = keys[0];
|
|
171
|
+
return new Person({
|
|
172
|
+
id,
|
|
173
|
+
preferredUsername: user.username,
|
|
174
|
+
name: profile.name,
|
|
175
|
+
summary: profile.bio ?? null,
|
|
176
|
+
url: new URL(absoluteUrl(authorHref(user.username), baseUrl)),
|
|
67
177
|
icon: icon === undefined ? null : new Image({ url: new URL(icon) }),
|
|
68
|
-
inbox: context.getInboxUri(
|
|
69
|
-
outbox: context.getOutboxUri(
|
|
70
|
-
followers: context.getFollowersUri(
|
|
71
|
-
following: context.getFollowingUri(
|
|
178
|
+
inbox: context.getInboxUri(user.username),
|
|
179
|
+
outbox: context.getOutboxUri(user.username),
|
|
180
|
+
followers: context.getFollowersUri(user.username),
|
|
181
|
+
following: context.getFollowingUri(user.username),
|
|
72
182
|
endpoints: new Endpoints({ sharedInbox: context.getInboxUri() }),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
//
|
|
76
|
-
|
|
183
|
+
// Every URL this person answers to, which is what a peer reads to know
|
|
184
|
+
// that two ids are one account. WordPress's plugin publishes exactly this
|
|
185
|
+
// list, and `@fedify/vocab` serialises it as `alsoKnownAs`.
|
|
186
|
+
aliases: actorAliases(context, user, baseUrl),
|
|
187
|
+
publicKey: rsa === undefined
|
|
188
|
+
? null
|
|
189
|
+
: new CryptographicKey({
|
|
190
|
+
id: mainKeyId(id),
|
|
191
|
+
owner: id,
|
|
192
|
+
publicKey: rsa.publicKey,
|
|
193
|
+
}),
|
|
194
|
+
assertionMethods: keys.map((key, index) => new Multikey({ id: multikeyId(id, index), controller: id, publicKey: key.publicKey })),
|
|
195
|
+
// Somewhere else this person is, as the property attachments every
|
|
196
|
+
// fediverse client renders under a profile.
|
|
197
|
+
attachments: (profile.links ?? []).map((link) => new PropertyValue({
|
|
198
|
+
name: link.label,
|
|
199
|
+
value: `<a href="${escapeHtml(link.href)}" rel="me nofollow noopener">${escapeHtml(link.href)}</a>`,
|
|
200
|
+
})),
|
|
201
|
+
// A blog's author accepts every follower, and says so, rather than leaving
|
|
202
|
+
// a client to guess whether a follow will ever be answered.
|
|
77
203
|
manuallyApprovesFollowers: false,
|
|
78
204
|
discoverable: true,
|
|
79
205
|
indexable: true,
|
|
80
206
|
});
|
|
81
207
|
}
|
|
82
|
-
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
208
|
+
/** The five characters that cannot travel unescaped inside an attribute. */
|
|
209
|
+
function escapeHtml(value) {
|
|
210
|
+
return value
|
|
211
|
+
.replaceAll('&', '&')
|
|
212
|
+
.replaceAll('<', '<')
|
|
213
|
+
.replaceAll('>', '>')
|
|
214
|
+
.replaceAll('"', '"')
|
|
215
|
+
.replaceAll("'", ''');
|
|
89
216
|
}
|
|
90
217
|
/** A URL, or `null` when the string is empty or is not one. */
|
|
91
218
|
function urlOrNull(value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor.js","sourceRoot":"","sources":["../../src/federation/actor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"actor.js","sourceRoot":"","sources":["../../src/federation/actor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGpG,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC;;;;;;;;;GASG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe,EAAE,QAAgB;IAC9D,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;AACvE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,SAAS,CAAC,MAAc,EAAE,OAAe;IACvD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IACnC,IAAI,SAAS,CAAC,KAAK,CAAC,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,OAAO,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAErC,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,OAAO,CAAC,OAAyB,EAA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AI,KAAK,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAC9B,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1,29 +1,51 @@
|
|
|
1
1
|
import type { Context } from '@fedify/fedify';
|
|
2
2
|
import { Article, Create, Delete, Update } from '@fedify/vocab';
|
|
3
|
+
import type { User } from '../admin/accounts.ts';
|
|
3
4
|
import type { Document } from '../content/document.ts';
|
|
4
5
|
import type { FederationContextData } from './federation.ts';
|
|
6
|
+
/**
|
|
7
|
+
* The user a post is announced by: the one its `author` names, and the site's
|
|
8
|
+
* first account for one that names nobody.
|
|
9
|
+
*
|
|
10
|
+
* decision-14 attributes a post to a person rather than to the site, and
|
|
11
|
+
* `userForAuthor` is the one rule that decides which — a username exactly, a
|
|
12
|
+
* display name only when exactly one person answers to it (TASK-67). The
|
|
13
|
+
* fallback matters because an `author` is free text in a file: a post that
|
|
14
|
+
* names a person who has since been deleted, or names nobody at all, is still
|
|
15
|
+
* a post this site has to be able to announce, and the first account is the
|
|
16
|
+
* only actor that can be chosen without guessing between people.
|
|
17
|
+
*
|
|
18
|
+
* `undefined` only for a site with no accounts, which is one in first-run
|
|
19
|
+
* setup and federates nothing.
|
|
20
|
+
*/
|
|
21
|
+
export declare function documentAuthor(context: Context<FederationContextData>, document: Document): User | undefined;
|
|
5
22
|
/** The media type an `Article`'s `source` is labelled with. */
|
|
6
23
|
export declare const SOURCE_MEDIA_TYPE = "text/markdown";
|
|
7
24
|
/**
|
|
8
25
|
* Whether a document is one of the objects this site federates.
|
|
9
26
|
*
|
|
10
27
|
* doc-4 federates published posts and nothing else: pages are standing
|
|
11
|
-
* content with no place in a timeline, and a draft
|
|
12
|
-
* public at all. This is the one rule, so
|
|
13
|
-
* and the permalink all agree about what
|
|
28
|
+
* content with no place in a timeline, and a draft, a trashed post or one
|
|
29
|
+
* whose date has not arrived is not public at all. This is the one rule, so
|
|
30
|
+
* the object dispatcher, the outbox and the permalink all agree about what
|
|
31
|
+
* exists.
|
|
14
32
|
*/
|
|
15
|
-
export declare function isFederatedDocument(document: Document): boolean;
|
|
33
|
+
export declare function isFederatedDocument(document: Document, now?: Date): boolean;
|
|
16
34
|
/**
|
|
17
35
|
* One post as the `Article` doc-4 describes.
|
|
18
36
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
37
|
+
* Its `id` and its `url` are the same URL — the permalink — because
|
|
38
|
+
* decision-13 gives a post one name for both audiences: a browser asking for
|
|
39
|
+
* HTML gets the page, a peer asking for ActivityStreams gets this. The
|
|
40
|
+
* exception is a post whose file already names an `activitypub.id`, which
|
|
41
|
+
* keeps it; see {@link articleObjectId}.
|
|
24
42
|
*
|
|
25
43
|
* `source` carries the Markdown the file holds, so a peer that wants to quote
|
|
26
44
|
* or re-render the post has the text rather than only the rendering of it.
|
|
45
|
+
*
|
|
46
|
+
* `attributedTo` is the actor of the user the post's `author` names
|
|
47
|
+
* (decision-14), and `cc` is that user's followers: a post belongs to a person
|
|
48
|
+
* on this site, not to the site.
|
|
27
49
|
*/
|
|
28
50
|
export declare function postArticle(context: Context<FederationContextData>, document: Document): Article;
|
|
29
51
|
/**
|
|
@@ -42,8 +64,14 @@ export declare function postCreateActivity(context: Context<FederationContextDat
|
|
|
42
64
|
* ActivityPub offers and all a peer can apply. Its id carries the document's
|
|
43
65
|
* hash, so two edits are two activities and the same edit delivered twice is
|
|
44
66
|
* one; see {@link updateActivityId}.
|
|
67
|
+
*
|
|
68
|
+
* `revision` overrides that. A resend (decision-9) is asking for a revision
|
|
69
|
+
* the followers have already been offered to be offered again, and an activity
|
|
70
|
+
* id a peer has seen is one it is entitled to drop, so a resend passes the
|
|
71
|
+
* moment instead of the hash. Everything else about the activity is the same,
|
|
72
|
+
* which is what makes a resent `Update` and a saved one the same shape.
|
|
45
73
|
*/
|
|
46
|
-
export declare function postUpdateActivity(context: Context<FederationContextData>, document: Document): Update;
|
|
74
|
+
export declare function postUpdateActivity(context: Context<FederationContextData>, document: Document, revision?: string): Update;
|
|
47
75
|
/**
|
|
48
76
|
* The `Delete` that withdraws a post: a `Tombstone` where the `Article` was.
|
|
49
77
|
*
|
|
@@ -58,14 +86,13 @@ export declare function postUpdateActivity(context: Context<FederationContextDat
|
|
|
58
86
|
*/
|
|
59
87
|
export declare function postDeleteActivity(context: Context<FederationContextData>, document: Document, deleted: string): Delete;
|
|
60
88
|
/**
|
|
61
|
-
* A post's ActivityStreams object id
|
|
62
|
-
*
|
|
89
|
+
* A post's ActivityStreams object id, off the Fedify context: its permalink,
|
|
90
|
+
* or the id its file already names (decision-13).
|
|
63
91
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* resolves a stored id back to its post, so the old URL keeps answering.
|
|
92
|
+
* A thin wrapper over {@link postObjectId} so everything in this module reads
|
|
93
|
+
* the id the same way and off the same base URL the article's `url` is built
|
|
94
|
+
* on. The rule itself lives in `web/documents.ts`, because the page, the feed
|
|
95
|
+
* item and the object are one identity now rather than three.
|
|
69
96
|
*/
|
|
70
97
|
export declare function articleObjectId(context: Context<FederationContextData>, document: Document): URL;
|
|
71
98
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"article.d.ts","sourceRoot":"","sources":["../../src/federation/article.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,OAAO,EACP,MAAM,EACN,MAAM,EAKN,MAAM,EACP,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"article.d.ts","sourceRoot":"","sources":["../../src/federation/article.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,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