fedipod-server 0.28.1 → 0.30.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.
Files changed (438) hide show
  1. package/README.md +38 -34
  2. package/config/server.json +22 -0
  3. package/dist/claims.js +3 -2
  4. package/dist/directory.d.ts +2 -0
  5. package/dist/door.d.ts +4 -0
  6. package/dist/door.js +31 -0
  7. package/dist/fedipod.d.ts +16 -0
  8. package/dist/fedipod.js +13 -0
  9. package/dist/front.d.ts +3 -0
  10. package/dist/front.js +94 -0
  11. package/dist/handler.d.ts +39 -101
  12. package/dist/handler.js +86 -617
  13. package/dist/handler.jsonld +6 -30
  14. package/dist/identities.d.ts +62 -0
  15. package/dist/identities.js +236 -0
  16. package/dist/mounts.d.ts +43 -0
  17. package/dist/mounts.js +123 -0
  18. package/dist/opt-in.d.ts +46 -0
  19. package/dist/opt-in.js +176 -0
  20. package/dist/store-pod.js +37 -0
  21. package/package.json +10 -18
  22. package/lib/client/c2s.mjs +0 -582
  23. package/lib/client/localapi.mjs +0 -87
  24. package/lib/client/masto/accounts.mjs +0 -309
  25. package/lib/client/masto/body.mjs +0 -156
  26. package/lib/client/masto/index.mjs +0 -206
  27. package/lib/client/masto/instance.mjs +0 -112
  28. package/lib/client/masto/media.mjs +0 -79
  29. package/lib/client/masto/oauth.mjs +0 -656
  30. package/lib/client/masto/render.mjs +0 -518
  31. package/lib/client/masto/statuses.mjs +0 -372
  32. package/lib/client/masto/timelines.mjs +0 -438
  33. package/lib/client/oidc-auth.mjs +0 -62
  34. package/lib/client/streaming.mjs +0 -154
  35. package/lib/client/webpush.mjs +0 -98
  36. package/lib/connections/acctfeed.mjs +0 -257
  37. package/lib/connections/atproto.mjs +0 -309
  38. package/lib/connections/bskyfeed.mjs +0 -243
  39. package/lib/connections/bskygroup.mjs +0 -162
  40. package/lib/connections/fediacct.mjs +0 -253
  41. package/lib/connections/import.mjs +0 -357
  42. package/lib/connections/tagfeed.mjs +0 -212
  43. package/lib/connections/vault.mjs +0 -114
  44. package/lib/core/as2.mjs +0 -206
  45. package/lib/core/contexts/activitystreams.json +0 -379
  46. package/lib/core/contexts/anno.json +0 -126
  47. package/lib/core/contexts/did-v1.json +0 -57
  48. package/lib/core/contexts/fep-5711.json +0 -36
  49. package/lib/core/contexts/gotosocial.json +0 -86
  50. package/lib/core/contexts/identity-v1.json +0 -152
  51. package/lib/core/contexts/index.mjs +0 -63
  52. package/lib/core/contexts/join-lemmy.json +0 -33
  53. package/lib/core/contexts/joinmastodon.json +0 -28
  54. package/lib/core/contexts/litepub-0.1.json +0 -60
  55. package/lib/core/contexts/map.json +0 -19
  56. package/lib/core/contexts/miscellany.json +0 -19
  57. package/lib/core/contexts/quotes.json +0 -18
  58. package/lib/core/contexts/schemaorg.json +0 -8845
  59. package/lib/core/contexts/security-data-integrity-v1.json +0 -78
  60. package/lib/core/contexts/security-data-integrity-v2.json +0 -81
  61. package/lib/core/contexts/security-multikey-v1.json +0 -35
  62. package/lib/core/contexts/security-v1.json +0 -74
  63. package/lib/core/contexts/webfinger.json +0 -10
  64. package/lib/core/deliver.mjs +0 -371
  65. package/lib/core/graphview.mjs +0 -327
  66. package/lib/core/intake/activities.mjs +0 -633
  67. package/lib/core/intake/activity.mjs +0 -318
  68. package/lib/core/intake/channel.mjs +0 -144
  69. package/lib/core/intake/group.mjs +0 -256
  70. package/lib/core/intake/index.mjs +0 -701
  71. package/lib/core/intake/notes.mjs +0 -360
  72. package/lib/core/intake/verify.mjs +0 -142
  73. package/lib/core/keys.mjs +0 -153
  74. package/lib/core/lease.mjs +0 -206
  75. package/lib/core/polls.mjs +0 -105
  76. package/lib/core/profile-page.mjs +0 -104
  77. package/lib/core/proof.mjs +0 -79
  78. package/lib/core/publisher/collections.mjs +0 -237
  79. package/lib/core/publisher/index.mjs +0 -500
  80. package/lib/core/publisher/notes.mjs +0 -453
  81. package/lib/core/publisher/questions.mjs +0 -239
  82. package/lib/core/publisher/restore.mjs +0 -224
  83. package/lib/core/shapes/activitystreams.ttl +0 -157
  84. package/lib/core/shapes/index.mjs +0 -132
  85. package/lib/core/shapes/shapes-text.mjs +0 -13
  86. package/lib/core/social.mjs +0 -531
  87. package/lib/core/storage.mjs +0 -176
  88. package/lib/core/store.mjs +0 -568
  89. package/lib/core/wire-quotes.mjs +0 -71
  90. package/lib/core/wire.mjs +0 -889
  91. package/lib/device/account.mjs +0 -87
  92. package/lib/device/admin/index.mjs +0 -13
  93. package/lib/device/admin/origins.mjs +0 -35
  94. package/lib/device/admin/routes/connections.mjs +0 -144
  95. package/lib/device/admin/routes/gateway.mjs +0 -199
  96. package/lib/device/admin/routes/lifecycle.mjs +0 -200
  97. package/lib/device/admin/routes/owner.mjs +0 -322
  98. package/lib/device/admin/routes/setup.mjs +0 -412
  99. package/lib/device/admin/routes/social.mjs +0 -188
  100. package/lib/device/admin/server.mjs +0 -95
  101. package/lib/device/admin/static.mjs +0 -247
  102. package/lib/device/admin/surface.mjs +0 -315
  103. package/lib/device/certs.mjs +0 -281
  104. package/lib/device/cli/commands/account.mjs +0 -586
  105. package/lib/device/cli/commands/run.mjs +0 -278
  106. package/lib/device/cli/commands/service.mjs +0 -221
  107. package/lib/device/cli/commands/setup.mjs +0 -447
  108. package/lib/device/cli/commands/state.mjs +0 -561
  109. package/lib/device/cli/context.mjs +0 -288
  110. package/lib/device/export-collections.mjs +0 -161
  111. package/lib/device/gateway-move.mjs +0 -58
  112. package/lib/device/home.mjs +0 -161
  113. package/lib/device/migrate.mjs +0 -115
  114. package/lib/device/ports.mjs +0 -27
  115. package/lib/device/remote.mjs +0 -54
  116. package/lib/device/setup.mjs +0 -459
  117. package/lib/device/update.mjs +0 -96
  118. package/lib/gateway/caches.mjs +0 -36
  119. package/lib/gateway/directory.mjs +0 -90
  120. package/lib/gateway/front-core.mjs +0 -970
  121. package/lib/gateway/gateway-core.mjs +0 -165
  122. package/lib/gateway/headers.mjs +0 -49
  123. package/lib/gateway/httpsig.mjs +0 -159
  124. package/lib/gateway/notices.mjs +0 -84
  125. package/lib/gateway/quiet.mjs +0 -189
  126. package/lib/pod/README.md +0 -61
  127. package/lib/pod/actor.mjs +0 -96
  128. package/lib/pod/collection.mjs +0 -77
  129. package/lib/pod/containers.mjs +0 -140
  130. package/lib/pod/discovery.mjs +0 -46
  131. package/lib/pod/featured.mjs +0 -18
  132. package/lib/pod/followers.mjs +0 -24
  133. package/lib/pod/following.mjs +0 -10
  134. package/lib/pod/http.mjs +0 -74
  135. package/lib/pod/inbox.mjs +0 -166
  136. package/lib/pod/links.mjs +0 -35
  137. package/lib/pod/media.mjs +0 -27
  138. package/lib/pod/notes.mjs +0 -80
  139. package/lib/pod/notifications.mjs +0 -89
  140. package/lib/pod/outbox.mjs +0 -18
  141. package/lib/pod/package.json +0 -19
  142. package/lib/pod/policy.mjs +0 -58
  143. package/lib/pod/private.mjs +0 -19
  144. package/lib/pod/root.mjs +0 -104
  145. package/lib/pod/state.mjs +0 -40
  146. package/lib/pod/transport.mjs +0 -525
  147. package/lib/pod/urls.mjs +0 -85
  148. package/lib/server/embed.mjs +0 -423
  149. package/lib/session/README.md +0 -137
  150. package/lib/session/demo.html +0 -94
  151. package/lib/session/fedi-account.mjs +0 -408
  152. package/lib/session/fedi-login.mjs +0 -123
  153. package/lib/session/oidc-session.mjs +0 -233
  154. package/lib/session/package.json +0 -49
  155. package/lib/shared/guard.mjs +0 -213
  156. package/lib/shared/links.mjs +0 -9
  157. package/lib/shared/safefetch.mjs +0 -235
  158. package/lib/shared/ua.mjs +0 -29
  159. package/phanpy/dist/404.html +0 -40
  160. package/phanpy/dist/_headers +0 -2
  161. package/phanpy/dist/apple-touch-icon.png +0 -0
  162. package/phanpy/dist/assets/ICONS-DIPJeU0C.js +0 -2
  163. package/phanpy/dist/assets/ICONS-DIPJeU0C.js.map +0 -1
  164. package/phanpy/dist/assets/ScheduledAtField-D-Abfo4J.js +0 -183
  165. package/phanpy/dist/assets/ScheduledAtField-D-Abfo4J.js.map +0 -1
  166. package/phanpy/dist/assets/Temml-CCjoacWt.woff2 +0 -0
  167. package/phanpy/dist/assets/__vite-browser-external-C7iut881.js +0 -2
  168. package/phanpy/dist/assets/__vite-browser-external-C7iut881.js.map +0 -1
  169. package/phanpy/dist/assets/boosts-carousel-BiOaNdMT.jpg +0 -0
  170. package/phanpy/dist/assets/catch-up-O5q5C75Z.png +0 -0
  171. package/phanpy/dist/assets/chunk-aKtaBQYM.js +0 -1
  172. package/phanpy/dist/assets/compose-CFEx7wb4.js +0 -2
  173. package/phanpy/dist/assets/compose-CFEx7wb4.js.map +0 -1
  174. package/phanpy/dist/assets/compose-ZJN5xSb4.js +0 -35
  175. package/phanpy/dist/assets/compose-ZJN5xSb4.js.map +0 -1
  176. package/phanpy/dist/assets/debug.module-YFQgwnIr.js +0 -52
  177. package/phanpy/dist/assets/debug.module-YFQgwnIr.js.map +0 -1
  178. package/phanpy/dist/assets/dom-p1YcJ5Rw.js +0 -2
  179. package/phanpy/dist/assets/dom-p1YcJ5Rw.js.map +0 -1
  180. package/phanpy/dist/assets/home-mobile-dark@2x-Dc-J8-SM.png +0 -0
  181. package/phanpy/dist/assets/home-mobile-light@2x-Bd3fod8m.png +0 -0
  182. package/phanpy/dist/assets/home-tablet-dark@2x-BgcNI8le.png +0 -0
  183. package/phanpy/dist/assets/home-tablet-light@2x-BW2RV9T6.png +0 -0
  184. package/phanpy/dist/assets/icons/add-circle-line-WD0mwORD.js +0 -1
  185. package/phanpy/dist/assets/icons/alert-line-CpFUMf9s.js +0 -1
  186. package/phanpy/dist/assets/icons/android-2-line-Bzxnrd3S.js +0 -1
  187. package/phanpy/dist/assets/icons/announcement-line-5nwaJFJm.js +0 -1
  188. package/phanpy/dist/assets/icons/arrow-down-circle-line-a7Id9-Iv.js +0 -1
  189. package/phanpy/dist/assets/icons/arrow-down-line-B8uzXzq6.js +0 -1
  190. package/phanpy/dist/assets/icons/arrow-left-line-CGrGT9C-.js +0 -1
  191. package/phanpy/dist/assets/icons/arrow-right-line-CE-HERfX.js +0 -1
  192. package/phanpy/dist/assets/icons/arrow-to-up-line-CvdQjmcy.js +0 -1
  193. package/phanpy/dist/assets/icons/arrow-up-circle-line-DEparSNF.js +0 -1
  194. package/phanpy/dist/assets/icons/arrow-up-line-C7yBeugc.js +0 -1
  195. package/phanpy/dist/assets/icons/arrows-right-line-BtbXmJGP.js +0 -1
  196. package/phanpy/dist/assets/icons/at-line-CF66Bznk.js +0 -1
  197. package/phanpy/dist/assets/icons/attachment-line-BY8It-l9.js +0 -1
  198. package/phanpy/dist/assets/icons/blockquote-line-BS6pU_hm.js +0 -1
  199. package/phanpy/dist/assets/icons/board-line-C0UWXyA6.js +0 -1
  200. package/phanpy/dist/assets/icons/bookmark-line-1CtX5JLF.js +0 -1
  201. package/phanpy/dist/assets/icons/building-5-line-Dd59MzbO.js +0 -1
  202. package/phanpy/dist/assets/icons/bus-2-line-6_dvA0GG.js +0 -1
  203. package/phanpy/dist/assets/icons/calendar-day-line-Crpl_fmu.js +0 -1
  204. package/phanpy/dist/assets/icons/calendar-month-line-vommts2C.js +0 -1
  205. package/phanpy/dist/assets/icons/calendar-time-add-line-BU_DTlQk.js +0 -1
  206. package/phanpy/dist/assets/icons/camera-line-Cv69MEei.js +0 -1
  207. package/phanpy/dist/assets/icons/celebrate-line-B8DvIoi0.js +0 -1
  208. package/phanpy/dist/assets/icons/chart-bar-line-FK-QOmtF.js +0 -1
  209. package/phanpy/dist/assets/icons/chart-line-line-BGcJAFWw.js +0 -1
  210. package/phanpy/dist/assets/icons/chat-3-line-YFK2-hwz.js +0 -1
  211. package/phanpy/dist/assets/icons/check-circle-line-DsAxFr5-.js +0 -1
  212. package/phanpy/dist/assets/icons/clipboard-line-BBp364gJ.js +0 -1
  213. package/phanpy/dist/assets/icons/close-circle-line-CICdiuGz.js +0 -1
  214. package/phanpy/dist/assets/icons/close-line-DYrFWcjv.js +0 -1
  215. package/phanpy/dist/assets/icons/cloud-line-tiQAbah8.js +0 -1
  216. package/phanpy/dist/assets/icons/code-line-fAl8iiV3.js +0 -1
  217. package/phanpy/dist/assets/icons/comment-2-line-CR3g7WeB.js +0 -1
  218. package/phanpy/dist/assets/icons/copy-2-line-CLW69yF5.js +0 -1
  219. package/phanpy/dist/assets/icons/delete-2-line-B8xmbr4n.js +0 -1
  220. package/phanpy/dist/assets/icons/document-3-line-DBGNhAg2.js +0 -1
  221. package/phanpy/dist/assets/icons/document-line-C7mb9sb7.js +0 -1
  222. package/phanpy/dist/assets/icons/down-line-BGqSSThd.js +0 -1
  223. package/phanpy/dist/assets/icons/edit-4-line-DcgGaEhx.js +0 -1
  224. package/phanpy/dist/assets/icons/emoji-2-line-D8YgnM-y.js +0 -1
  225. package/phanpy/dist/assets/icons/exit-line-Dc07BS-x.js +0 -1
  226. package/phanpy/dist/assets/icons/external-link-line-BvpSkmjO.js +0 -1
  227. package/phanpy/dist/assets/icons/eye-2-line-CiWXx-f_.js +0 -1
  228. package/phanpy/dist/assets/icons/eye-close-line-BgTaSJ4P.js +0 -1
  229. package/phanpy/dist/assets/icons/filter-2-line-B_mR2usy.js +0 -1
  230. package/phanpy/dist/assets/icons/filter-line-C_nm-3cU.js +0 -1
  231. package/phanpy/dist/assets/icons/flag-1-line-C2HB05I0.js +0 -1
  232. package/phanpy/dist/assets/icons/forbid-circle-line-D3LTT9yd.js +0 -1
  233. package/phanpy/dist/assets/icons/formula-line-DLrt2d6j.js +0 -1
  234. package/phanpy/dist/assets/icons/grid-line-CgUmEikf.js +0 -1
  235. package/phanpy/dist/assets/icons/group-line-C5fnX0wU.js +0 -1
  236. package/phanpy/dist/assets/icons/hand-finger-2-line-BGgxbuL9.js +0 -1
  237. package/phanpy/dist/assets/icons/hashtag-line-CyTEEXBb.js +0 -1
  238. package/phanpy/dist/assets/icons/heart-crack-line-BZddbO2C.js +0 -1
  239. package/phanpy/dist/assets/icons/heart-line-CJ7K47J4.js +0 -1
  240. package/phanpy/dist/assets/icons/history-2-line-kWWvFzqv.js +0 -1
  241. package/phanpy/dist/assets/icons/history-line-bGQiwbTH.js +0 -1
  242. package/phanpy/dist/assets/icons/home-3-line-fRU1zeLG.js +0 -1
  243. package/phanpy/dist/assets/icons/information-line-iNk6-sOY.js +0 -1
  244. package/phanpy/dist/assets/icons/keyboard-line-DsCyuQNz.js +0 -1
  245. package/phanpy/dist/assets/icons/layout-4-line-CZkOX52Z.js +0 -1
  246. package/phanpy/dist/assets/icons/layout-5-line-B_znt5wO.js +0 -1
  247. package/phanpy/dist/assets/icons/left-line-eUw0tya4.js +0 -1
  248. package/phanpy/dist/assets/icons/lightning-line-DaKoDdix.js +0 -1
  249. package/phanpy/dist/assets/icons/link-2-line-DCqLmMA7.js +0 -1
  250. package/phanpy/dist/assets/icons/list-check-line-BAxosBh9.js +0 -1
  251. package/phanpy/dist/assets/icons/lock-line-CPoaXeUW.js +0 -1
  252. package/phanpy/dist/assets/icons/mail-line-B0P8aa1L.js +0 -1
  253. package/phanpy/dist/assets/icons/moon-line-CEqNAToP.js +0 -1
  254. package/phanpy/dist/assets/icons/more-1-fill-Dw2e5xab.js +0 -1
  255. package/phanpy/dist/assets/icons/more-3-line-BIiVjYTz.js +0 -1
  256. package/phanpy/dist/assets/icons/notification-line-BZZq2Gtu.js +0 -1
  257. package/phanpy/dist/assets/icons/pencil-line-CKh8-A1v.js +0 -1
  258. package/phanpy/dist/assets/icons/photo-album-line-Bnfg2u40.js +0 -1
  259. package/phanpy/dist/assets/icons/pin-line-DpTolyhs.js +0 -1
  260. package/phanpy/dist/assets/icons/play-fill-B0-G_8lX.js +0 -1
  261. package/phanpy/dist/assets/icons/qrcode-2-line-B6SPCaHn.js +0 -1
  262. package/phanpy/dist/assets/icons/quill-pen-line-B6LUrnCP.js +0 -1
  263. package/phanpy/dist/assets/icons/quote-left-fill-hQZ1cj_6.js +0 -1
  264. package/phanpy/dist/assets/icons/radar-line-CKyroTth.js +0 -1
  265. package/phanpy/dist/assets/icons/react-line-CoIKhhtK.js +0 -1
  266. package/phanpy/dist/assets/icons/refresh-2-line-D0mTF97S.js +0 -1
  267. package/phanpy/dist/assets/icons/right-line-B3KWJaqc.js +0 -1
  268. package/phanpy/dist/assets/icons/rocket-line-4KZl537D.js +0 -1
  269. package/phanpy/dist/assets/icons/round-fill-C69NTrZ0.js +0 -1
  270. package/phanpy/dist/assets/icons/round-line-B9k_1uo-.js +0 -1
  271. package/phanpy/dist/assets/icons/route-line-B28ReHcE.js +0 -1
  272. package/phanpy/dist/assets/icons/rows-4-line-CrBniagM.js +0 -1
  273. package/phanpy/dist/assets/icons/scan-line-DSf74YdP.js +0 -1
  274. package/phanpy/dist/assets/icons/search-2-line-B6geIU1z.js +0 -1
  275. package/phanpy/dist/assets/icons/settings-3-line-azJwK47w.js +0 -1
  276. package/phanpy/dist/assets/icons/settings-6-line-C_5zc5YR.js +0 -1
  277. package/phanpy/dist/assets/icons/share-2-line-D5MxWjrm.js +0 -1
  278. package/phanpy/dist/assets/icons/share-forward-line-Cp61fZzZ.js +0 -1
  279. package/phanpy/dist/assets/icons/sparkles-2-line-DYYyXTaW.js +0 -1
  280. package/phanpy/dist/assets/icons/sparkles-line-C2hY1s6I.js +0 -1
  281. package/phanpy/dist/assets/icons/time-line-BF3eet1v.js +0 -1
  282. package/phanpy/dist/assets/icons/transfer-4-line-oisfvTBw.js +0 -1
  283. package/phanpy/dist/assets/icons/translate-line-BFWol2Ce.js +0 -1
  284. package/phanpy/dist/assets/icons/unlock-line-X_x5vwv3.js +0 -1
  285. package/phanpy/dist/assets/icons/upload-3-line-DgzwUJeW.js +0 -1
  286. package/phanpy/dist/assets/icons/user-4-line-BVSynZCp.js +0 -1
  287. package/phanpy/dist/assets/icons/user-add-2-line-BlGS5Q8q.js +0 -1
  288. package/phanpy/dist/assets/icons/user-add-line-BbXdHG4z.js +0 -1
  289. package/phanpy/dist/assets/icons/user-edit-line-BFAHOV0X.js +0 -1
  290. package/phanpy/dist/assets/icons/user-follow-line-BXux0wSd.js +0 -1
  291. package/phanpy/dist/assets/icons/user-star-line-DdYlpHLU.js +0 -1
  292. package/phanpy/dist/assets/icons/user-warning-line-Cj43j0_E.js +0 -1
  293. package/phanpy/dist/assets/icons/user-x-line-DIDgNlPH.js +0 -1
  294. package/phanpy/dist/assets/icons/volume-line-Bs390KQt.js +0 -1
  295. package/phanpy/dist/assets/icons/volume-mute-line-DzlzIqFZ.js +0 -1
  296. package/phanpy/dist/assets/icons/walk-line-yNXfB-md.js +0 -1
  297. package/phanpy/dist/assets/icons/world-2-line-CenkGIwj.js +0 -1
  298. package/phanpy/dist/assets/icons/zoom-in-line-CaENUphf.js +0 -1
  299. package/phanpy/dist/assets/icons/zoom-out-line-BDNk0EWo.js +0 -1
  300. package/phanpy/dist/assets/instances-BNPptnn-.json +0 -333
  301. package/phanpy/dist/assets/locales/ar-SA-CfheRbCu.js +0 -1
  302. package/phanpy/dist/assets/locales/ca-ES-DHRW86Tz.js +0 -1
  303. package/phanpy/dist/assets/locales/cs-CZ-CKoqEuA1.js +0 -1
  304. package/phanpy/dist/assets/locales/de-DE-ByRPMRFy.js +0 -1
  305. package/phanpy/dist/assets/locales/eo-UY-CPC7wLCS.js +0 -1
  306. package/phanpy/dist/assets/locales/es-ES-dJa0Fd9t.js +0 -1
  307. package/phanpy/dist/assets/locales/eu-ES-C3djlPR2.js +0 -1
  308. package/phanpy/dist/assets/locales/fa-IR-DTT490Ck.js +0 -1
  309. package/phanpy/dist/assets/locales/fi-FI-B23MCPuz.js +0 -1
  310. package/phanpy/dist/assets/locales/fr-FR-BcaQsO5C.js +0 -1
  311. package/phanpy/dist/assets/locales/gl-ES-BR-CVKBN.js +0 -1
  312. package/phanpy/dist/assets/locales/he-IL-CfheRbCu.js +0 -1
  313. package/phanpy/dist/assets/locales/hu-HU-CfheRbCu.js +0 -1
  314. package/phanpy/dist/assets/locales/it-IT-C1136UFV.js +0 -1
  315. package/phanpy/dist/assets/locales/ja-JP-CRZmRAhD.js +0 -1
  316. package/phanpy/dist/assets/locales/kab-Cz8xH_TT.js +0 -1
  317. package/phanpy/dist/assets/locales/ko-KR-CG9UiY4o.js +0 -1
  318. package/phanpy/dist/assets/locales/lt-LT-CJcI6sHZ.js +0 -1
  319. package/phanpy/dist/assets/locales/nb-NO-CfheRbCu.js +0 -1
  320. package/phanpy/dist/assets/locales/nl-NL-DxN4Yc1t.js +0 -1
  321. package/phanpy/dist/assets/locales/oc-FR-CfheRbCu.js +0 -1
  322. package/phanpy/dist/assets/locales/pl-PL-DkwGXf6P.js +0 -1
  323. package/phanpy/dist/assets/locales/pseudo-LOCALE-CQ4XxkQ0.js +0 -1
  324. package/phanpy/dist/assets/locales/pt-BR-nGL0HdFS.js +0 -1
  325. package/phanpy/dist/assets/locales/pt-PT-Cp17aj2z.js +0 -1
  326. package/phanpy/dist/assets/locales/ru-RU-0Y8cIoaK.js +0 -1
  327. package/phanpy/dist/assets/locales/th-TH-CfheRbCu.js +0 -1
  328. package/phanpy/dist/assets/locales/tok-CfheRbCu.js +0 -1
  329. package/phanpy/dist/assets/locales/tr-TR-CfheRbCu.js +0 -1
  330. package/phanpy/dist/assets/locales/uk-UA-C5E3dFBf.js +0 -1
  331. package/phanpy/dist/assets/locales/zh-CN-BHJi7_et.js +0 -1
  332. package/phanpy/dist/assets/locales/zh-TW-CfheRbCu.js +0 -1
  333. package/phanpy/dist/assets/main-BdqNbG-a.js +0 -26
  334. package/phanpy/dist/assets/main-BdqNbG-a.js.map +0 -1
  335. package/phanpy/dist/assets/mock-home-DGhR__He.js +0 -2
  336. package/phanpy/dist/assets/mock-home-DGhR__He.js.map +0 -1
  337. package/phanpy/dist/assets/multi-column-ROck0NVt.jpg +0 -0
  338. package/phanpy/dist/assets/multi-hashtag-timeline-DH5INVHi.jpg +0 -0
  339. package/phanpy/dist/assets/nested-comments-thread-hv59kZLc.jpg +0 -0
  340. package/phanpy/dist/assets/polyfill-force-H8sUkLGp.js +0 -2
  341. package/phanpy/dist/assets/polyfill-force-H8sUkLGp.js.map +0 -1
  342. package/phanpy/dist/assets/pwa-viewport-ogKbF51K.js +0 -20
  343. package/phanpy/dist/assets/pwa-viewport-ogKbF51K.js.map +0 -1
  344. package/phanpy/dist/assets/style-B1iLPTPR.css +0 -2
  345. package/phanpy/dist/assets/temml-DuyIQMei.js +0 -97
  346. package/phanpy/dist/assets/temml-DuyIQMei.js.map +0 -1
  347. package/phanpy/dist/assets/tinyld.light.node-DtbBhLYC.js +0 -2
  348. package/phanpy/dist/assets/tinyld.light.node-DtbBhLYC.js.map +0 -1
  349. package/phanpy/dist/assets/year-in-posts-B2lywqdx.png +0 -0
  350. package/phanpy/dist/assets/year-in-posts-DJv_star.js +0 -3
  351. package/phanpy/dist/assets/year-in-posts-DJv_star.js.map +0 -1
  352. package/phanpy/dist/compose/index.html +0 -20
  353. package/phanpy/dist/favicon.ico +0 -0
  354. package/phanpy/dist/index.html +0 -73
  355. package/phanpy/dist/logo-192.png +0 -0
  356. package/phanpy/dist/logo-512.png +0 -0
  357. package/phanpy/dist/logo-badge-72.png +0 -0
  358. package/phanpy/dist/logo-maskable-512.png +0 -0
  359. package/phanpy/dist/logo-monochrome-512.png +0 -0
  360. package/phanpy/dist/logo-monochrome-maskable-512.png +0 -0
  361. package/phanpy/dist/manifest.webmanifest +0 -1
  362. package/phanpy/dist/og-image-2.jpg +0 -0
  363. package/phanpy/dist/og-image.png +0 -0
  364. package/phanpy/dist/robots.txt +0 -2
  365. package/phanpy/dist/sw.js +0 -2
  366. package/phanpy/dist/sw.js.map +0 -1
  367. package/phanpy/dist/version.json +0 -1
  368. package/run-agent.mjs +0 -897
  369. package/vendor/gate.cjs +0 -138
  370. package/vendor/idp-grant.cjs +0 -394
  371. package/vendor/jfetch.cjs +0 -16
  372. package/web/admin/actors.js +0 -145
  373. package/web/admin/bar.css +0 -126
  374. package/web/admin/bar.js +0 -99
  375. package/web/admin/client/client.js +0 -66
  376. package/web/admin/client/index.html +0 -69
  377. package/web/admin/client-pick.js +0 -79
  378. package/web/admin/common.js +0 -23
  379. package/web/admin/connections.js +0 -112
  380. package/web/admin/gateway.js +0 -133
  381. package/web/admin/group.js +0 -258
  382. package/web/admin/index.html +0 -603
  383. package/web/admin/notices-bar.js +0 -90
  384. package/web/admin/oauth-signin.mjs +0 -37
  385. package/web/admin/record.js +0 -390
  386. package/web/admin/setup/index.html +0 -241
  387. package/web/admin/setup/setup.js +0 -326
  388. package/web/admin/tokens.css +0 -68
  389. package/web/admin/upkeep.js +0 -177
  390. package/web/admin/window.css +0 -55
  391. package/web/admin/window.js +0 -136
  392. package/web/app/README.md +0 -81
  393. package/web/app/admin-facade.mjs +0 -588
  394. package/web/app/agent.mjs +0 -663
  395. package/web/app/atproto-browser.mjs +0 -86
  396. package/web/app/authorize_interaction.html +0 -56
  397. package/web/app/authorize_interaction.js +0 -69
  398. package/web/app/boot.mjs +0 -576
  399. package/web/app/deliver-relay.mjs +0 -129
  400. package/web/app/dist/boot.js +0 -34218
  401. package/web/app/dist/boot.js.map +0 -7
  402. package/web/app/dist/sw.js +0 -72810
  403. package/web/app/dist/sw.js.map +0 -7
  404. package/web/app/fediacct-browser.mjs +0 -146
  405. package/web/app/gateway-move.mjs +0 -60
  406. package/web/app/idb-kv.mjs +0 -35
  407. package/web/app/index.html +0 -242
  408. package/web/app/keys-browser.mjs +0 -71
  409. package/web/app/keystore.mjs +0 -82
  410. package/web/app/oidc-session.mjs +0 -6
  411. package/web/app/pod-auth.mjs +0 -248
  412. package/web/app/pod-remote.mjs +0 -84
  413. package/web/app/shims/_globals.mjs +0 -2
  414. package/web/app/shims/fedify-sig.mjs +0 -77
  415. package/web/app/shims/node-crypto.mjs +0 -113
  416. package/web/app/shims/node-fs.mjs +0 -17
  417. package/web/app/shims/node-path.mjs +0 -19
  418. package/web/app/shims/node-url.mjs +0 -7
  419. package/web/app/shims/prelude.js +0 -58
  420. package/web/app/shims/safefetch.mjs +0 -58
  421. package/web/app/shims/shapes-text.mjs +0 -8
  422. package/web/app/shims/web-push.mjs +0 -14
  423. package/web/app/signup.mjs +0 -318
  424. package/web/app/sw-src.mjs +0 -220
  425. package/web/app/update.js +0 -70
  426. package/web/front/admin.html +0 -55
  427. package/web/front/admin.js +0 -89
  428. package/web/front/install.sh +0 -69
  429. package/web/front/new-account.html +0 -35
  430. package/web/front/new-account.js +0 -13
  431. package/web/front/notices.html +0 -69
  432. package/web/front/notices.js +0 -107
  433. package/web/front/run.html +0 -58
  434. package/web/front/run.js +0 -195
  435. package/web/front/solid-oidc-client.js +0 -6
  436. package/web/icons/forum.svg +0 -11
  437. package/web/icons/gateway.svg +0 -14
  438. package/web/icons/local.svg +0 -11
@@ -1,241 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>FediPod — setup</title>
7
- <link rel="icon" href="/icons/local.svg" type="image/svg+xml">
8
- <link rel="stylesheet" href="../tokens.css">
9
- <style>
10
- /* 20px on the root, not on body, so every rem below scales with it. */
11
- :root { color-scheme: light dark; font-size: 125%; --heading: #1a4f8a; }
12
- body { font: 1rem/1.5 Arial, Helvetica, sans-serif; margin: 0; }
13
- /* The bar spans the window; the form stays in a centred column under it. */
14
- /* The same 960 column the bar and the record use, so the three pages line up. */
15
- #page { max-width: 960px; margin: 0 auto; padding: 1.75rem 1rem 4rem; box-sizing: border-box; }
16
- h1, h2, h3 { color: var(--heading); }
17
- h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
18
- h2 { font-size: 1.1rem; margin: 2rem 0 .5rem; }
19
- p { margin: .5rem 0; }
20
- .sub { color: #666; margin-top: 0; }
21
- fieldset { border: 1px solid #bbb; border-radius: .4rem; margin: 1rem 0; padding: .75rem 1rem 1rem; }
22
- legend { padding: 0 .3rem; font-weight: 600; }
23
- label { display: block; margin: .75rem 0 .2rem; }
24
- .hint { color: #666; font-size: .9rem; margin: .15rem 0 0; }
25
- input[type=text], input[type=email], input[type=url], input[type=password], select, textarea {
26
- font: inherit; width: 100%; padding: .5rem; box-sizing: border-box;
27
- border: 1px solid #767676; border-radius: .3rem; background: Field; color: FieldText;
28
- }
29
- .choice { display: block; margin: .35rem 0; font-weight: normal; }
30
- .choice input { margin-right: .4rem; }
31
- button { font: inherit; padding: .6rem 1.2rem; border-radius: .3rem; border: 1px solid #666;
32
- background: ButtonFace; color: ButtonText; cursor: pointer; }
33
- button.primary { font-weight: 600; }
34
- button:disabled { opacity: .5; cursor: default; }
35
- .address { font-size: 1.2rem; font-weight: 600; word-break: break-all; }
36
- .warn { border-left: .25rem solid #c60; padding-left: .75rem; }
37
- .err { border-left: .25rem solid #b00020; padding-left: .75rem; color: #b00020; }
38
- /* Announced, not shown: the step list beside it already says this visually. */
39
- /* In the accessibility tree from load, hidden by being empty: a live region
40
- added to the tree in the same task as its text does not announce. */
41
- #form-error:empty, #run-error:empty { display: none; }
42
- .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
43
- overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
44
- .steps { list-style: none; padding: 0; }
45
- .steps li { padding: .3rem 0; }
46
- .steps .state { display: inline-block; width: 1.6rem; }
47
- .note { color: #666; font-size: .9rem; word-break: break-all; }
48
- .origins { font-family: ui-monospace, monospace; font-size: .95rem; word-break: break-all; }
49
- @media (prefers-color-scheme: dark) { :root { --heading: #7fb3e8; }
50
- .sub, .hint, .note { color: #aaa; } fieldset { border-color: #555; }
51
- /* 2.40:1 without this — the record page has always had the override and
52
- this page, where an error IS the whole message, did not. */
53
- .err { color: #ff8a8a; border-left-color: #ff8a8a; } }
54
- </style>
55
- <link rel="stylesheet" href="../bar.css">
56
- </head>
57
- <body>
58
-
59
- <nav id="bar" aria-label="Site">
60
- <h1 class="name">FediPod</h1>
61
- <span id="bar-handle"></span>
62
- <!-- The account group, styled like the client group beside it: one label,
63
- then the places to go. The browser build adds "sign out" to it. -->
64
- <span id="account-pick"><span id="account-now">account:</span>
65
- <a id="bar-fediverse" href="../client/" title=" Open the client and read your timeline">visit</a>
66
- <a id="bar-manage" href="../" title=" The record: what this actor is, and what you can do to it">manage</a>
67
- </span>
68
- <!-- Notices from whoever runs this site. Shown only when the site has any
69
- (notices-bar.js asks /api/notices); the count is how many are new here. -->
70
- <button type="button" id="bar-notices" hidden aria-haspopup="dialog" aria-controls="notices-list"
71
- title=" Notices from the operator of this site">&#128276;<span id="bar-notices-count" aria-live="polite"></span></button>
72
- <a id="bar-add" href="../?new=1" title=" Set up another actor on this machine, with its own pod" aria-current="page">add new account</a>
73
- </nav>
74
- <main id="page">
75
- <p class="sub" id="strap">setting up…</p>
76
-
77
- <!-- Nothing here is wired up by hand: setup.js reads /setup/state and shows
78
- exactly one of these. -->
79
-
80
- <section id="pane-loading">
81
- <p>Reading this agent's state…</p>
82
- </section>
83
-
84
- <section id="pane-done" hidden>
85
- <h2>Ready</h2>
86
- <p class="address" id="done-address"></p>
87
- <p id="done-note"></p>
88
- <p id="done-links"></p>
89
- </section>
90
-
91
- <section id="pane-configured" hidden>
92
- <h2>This agent is already set up</h2>
93
- <p class="address" id="configured-address"></p>
94
- <p>
95
- <a href="../">Edit the record</a>
96
- &nbsp;·&nbsp;
97
- <a href="../../" id="configured-client">Open the client</a>
98
- </p>
99
- <p class="hint">For another actor, use <strong>add new account</strong> above.</p>
100
- </section>
101
-
102
- <section id="pane-run" hidden>
103
- <h2 id="run-title">Setting up</h2>
104
- <ul class="steps" id="run-steps"></ul>
105
- <p class="sr-only" id="run-say" role="status"></p>
106
- <p class="err" id="run-error" role="alert"></p>
107
- <p><button id="run-again" title=" Try the step that failed again" hidden>Try again</button>
108
- <button id="run-reenter" title=" Discard the credential and enter the account and pod again" hidden>Re-enter credentials</button></p>
109
- </section>
110
-
111
- <section id="pane-form" hidden>
112
- <form id="form">
113
-
114
- <fieldset>
115
- <legend>What kind of Actor?</legend>
116
- <label class="choice"><input type="radio" name="kind" value="person" checked>
117
- A <strong>person</strong> — an account you read and post from</label>
118
- <label class="choice"><input type="radio" name="kind" value="group">
119
- A <strong>group</strong> of fediverse users you manage</label>
120
- </fieldset>
121
-
122
- <fieldset>
123
- <legend>Actor's Handle</legend>
124
- <input type="text" id="handle" name="handle" autocomplete="off" autofocus
125
- placeholder="handle part of fediverse address: @HANDLE@server"
126
- aria-label="Actor's Handle" aria-describedby="handle-hint">
127
- <p class="hint" id="handle-hint">The name in your fediverse address. This is permanent. Letters, digits,
128
- hyphens, and underscores only.</p>
129
- </fieldset>
130
-
131
- <fieldset id="fs-pod">
132
- <legend>Actor's Pod</legend>
133
- <label class="choice"><input type="radio" name="mode" value="new" checked>
134
- Create a Solid account and pod for the Actor</label>
135
- <label class="choice"><input type="radio" name="mode" value="existing">
136
- Use a pod I already have</label>
137
-
138
- <div id="row-issuer-new">
139
- <label for="issuer-new">Solid pod provider</label>
140
- <select id="issuer-new" name="issuerNew" aria-describedby="issuer-new-hint">
141
- <option value="https://solidcommunity.net">solidcommunity.net</option>
142
- <option value="https://privatedatapod.com">privatedatapod.com</option>
143
- <option value="https://solid.redpencil.io">redpencil.io</option>
144
- <option value="https://pods.solidcommunity.au">solidcommunity.au</option>
145
- <option value="https://solidweb.me">solidweb.me</option>
146
- <option value="https://teamid.live">teamid.live</option>
147
- <option value="">Other…</option>
148
- </select>
149
- <div id="row-issuer-other" hidden>
150
- <label for="issuerOther">Provider address</label>
151
- <input type="url" id="issuerOther" name="issuerOther" autocomplete="url" placeholder="https://pods.example.org">
152
- </div>
153
- <p class="hint" id="issuer-new-hint">The Community Solid Server providers from
154
- solidproject.org. A provider that puts pods on paths gives your address at a
155
- gateway instead.</p>
156
- </div>
157
-
158
- <div id="row-issuer-existing" hidden>
159
- <label for="issuer">Solid identity provider</label>
160
- <input type="url" id="issuer" name="issuer" value="https://solidcommunity.net" autocomplete="url">
161
- </div>
162
-
163
- <label for="email">Solid Account email/username</label>
164
- <input type="email" id="email" name="email" autocomplete="email" placeholder="you@example.org">
165
-
166
- <div id="row-password">
167
- <label for="password">Solid Account password</label>
168
- <input type="password" id="password" name="password" autocomplete="current-password"
169
- aria-describedby="password-hint">
170
- <p class="hint" id="password-hint">Password is sent once in return for a credential which is stored locally.
171
- The password itself is never stored. You may revoke the credential without changing the
172
- password.</p>
173
- </div>
174
-
175
- <div id="row-podname">
176
- <label for="podName">Pod name</label>
177
- <input type="text" id="podName" name="podName" autocomplete="off"
178
- aria-describedby="podname-hint">
179
- <p class="hint" id="podname-hint">The subdomain of your pod address, it will become
180
- https://YOUR-POD-NAME.your-identity-provider</p>
181
- </div>
182
-
183
- <div id="row-pod" hidden>
184
- <label for="pod">Pod address</label>
185
- <input type="url" id="pod" name="pod" autocomplete="url" placeholder="https://you.solidcommunity.net/">
186
- </div>
187
- </fieldset>
188
-
189
- <p id="row-reenter" class="warn" hidden>Finishing a setup that already has an account credential.
190
- Wrong account or pod?
191
- <button type="button" id="form-reenter" title=" Discard the credential and enter the account and pod again">Re-enter credentials</button></p>
192
-
193
- <fieldset id="fs-shape" hidden>
194
- <legend>Where your address lives</legend>
195
- <label class="choice"><input type="radio" name="shape" value="pod" checked> On your pod</label>
196
- <label class="choice"><input type="radio" name="shape" value="front"> At a gateway</label>
197
- <div id="row-gateway" hidden>
198
- <label for="gatewayOrigin">Gateway</label>
199
- <input type="url" id="gatewayOrigin" name="gatewayOrigin" value="https://fedipod.net" autocomplete="url">
200
- <p class="hint">The gateway answers your address and forwards your mail to your pod.</p>
201
- </div>
202
- <p class="hint" id="shape-note" hidden></p>
203
- </fieldset>
204
-
205
- <h2>You will be</h2>
206
- <p class="address" id="preview">…</p>
207
- <div id="preview-notes"></div>
208
- <p>The handle and the pod cannot be changed afterwards. Everything else — display
209
- name, bio, pictures — you set in the client.</p>
210
-
211
- <p class="err" id="form-error" role="alert"></p>
212
- <p><button type="submit" class="primary" id="submit" title=" Create it">Create it</button></p>
213
- </form>
214
- </section>
215
-
216
- </main>
217
-
218
- <script src="../bar.js"></script>
219
- <script src="../common.js"></script>
220
- <script src="setup.js"></script>
221
-
222
- <!-- The notices: the list, and one notice open. Declared here and filled by
223
- notices-bar.js from /api/notices; nothing in them is markup from a notice. -->
224
- <dialog id="notices-list" aria-labelledby="notices-title">
225
- <section>
226
- <h2 id="notices-title">Notices</h2>
227
- <ul id="notices-items"></ul>
228
- <p class="row"><button type="button" id="notices-close" class="primary" title=" Close the list of notices">Close</button></p>
229
- </section>
230
- </dialog>
231
- <dialog id="notice-view" aria-labelledby="notice-view-title">
232
- <section>
233
- <h2 id="notice-view-title"></h2>
234
- <p class="when" id="notice-view-when"></p>
235
- <div id="notice-view-body"></div>
236
- <p class="row"><button type="button" id="notice-view-close" class="primary" title=" Back to the list of notices">Close</button></p>
237
- </section>
238
- </dialog>
239
- <script src="../notices-bar.js"></script>
240
- </body>
241
- </html>
@@ -1,326 +0,0 @@
1
- // setup.js — the questions the CLI used to ask, asked here instead. Every
2
- // request is relative, so the page behaves identically whether it was reached
3
- // at localhost:<port> or at <handle>.localhost:<port>.
4
- //
5
- // External file, not an inline script: the CSP allows 'self' plus the hashes
6
- // of Phanpy's own inline bootstrap, and nothing else. `$`, `BASE`, `api` and
7
- // `postJson` come from ../common.js, loaded first.
8
-
9
- // Empty means gone, not a blank line where a sentence used to be.
10
- const strap = (t) => { const el = $('strap'); el.textContent = t || ''; el.hidden = !t; };
11
- // By id, not by position: these were `body > section` until a wrapper went
12
- // round them for layout, and the selector then matched nothing — every pane
13
- // kept whatever it started as and the page sat on "Reading this agent's state".
14
- const show = (id) => { for (const s of document.querySelectorAll('section[id^="pane-"]')) s.hidden = s.id !== id; };
15
-
16
- let state = null;
17
-
18
- // ---- what the agent needs from us ----
19
-
20
- async function start() {
21
- const { json } = await api('/setup/state');
22
- state = json || {};
23
- if (state.phase === 'running' || state.phase === 'done' || state.phase === 'error') return watchRun();
24
- if (state.configured) return paneConfigured();
25
- return paneForm();
26
- }
27
-
28
- function paneConfigured() {
29
- strap('already set up');
30
- $('configured-address').textContent = state.handle ? `@${state.handle}` : '';
31
- $('configured-client').hidden = state.kind === 'group';
32
- show('pane-configured');
33
- // The address needs the pod host, which only /config knows.
34
- api('/config').then(({ json }) => {
35
- if (json?.address) $('configured-address').textContent = json.address;
36
- });
37
- }
38
-
39
- // ---- the form ----
40
-
41
- function paneForm() {
42
- // Nothing is asked in a terminal any more — every question is on this page.
43
- // A fresh run needs no strap at all; a resumed one has something to say.
44
- strap(state.resumable ? 'finishing a setup that did not complete' : '');
45
- if (state.handle) $('handle').value = state.handle;
46
- // A signup page's carry-over: the form opens with its answers already in.
47
- const fr = state.firstRun;
48
- if (fr && !state.resumable) {
49
- if (fr.kind) $('form').elements.kind.value = fr.kind;
50
- if (fr.handle) $('handle').value = fr.handle;
51
- if (fr.pod) { $('form').elements.mode.value = 'existing'; $('pod').value = fr.pod; }
52
- // A gateway-arranged signup names its own provider; give the dropdown that
53
- // choice too, so the carried-over answer survives the narrower control.
54
- if (fr.issuer) {
55
- $('issuer').value = fr.issuer;
56
- const sel = $('issuer-new');
57
- if (![...sel.options].some(o => o.value === fr.issuer)) {
58
- const o = document.createElement('option');
59
- o.value = fr.issuer;
60
- o.textContent = host(fr.issuer);
61
- sel.appendChild(o);
62
- }
63
- sel.value = fr.issuer;
64
- }
65
- if (fr.gatewayHost) strap(`finishing your ${fr.gatewayHost} signup — enter your Solid account details`);
66
- }
67
- // Resuming: the account exists and the credential is minted. Asking for a
68
- // password again would mint a second one and orphan the first, which cannot
69
- // be recovered.
70
- // Set both ways, not just hidden-when-resuming: re-entering credentials
71
- // re-renders this in the other mode, and a one-way hide would strand the
72
- // account and pod fields off-screen. Resuming settles the account and the
73
- // credential, so those fields go; a fresh run shows them.
74
- $('row-reenter').hidden = !state.resumable;
75
- $('fs-pod').hidden = state.resumable;
76
- // The password field also goes when AP_PASSWORD supplied it in the environment.
77
- $('row-password').hidden = state.resumable || state.passwordSupplied;
78
- $('submit').textContent = state.resumable ? 'Finish setting up' : 'Create it';
79
- if (state.resumable) $('form-reenter').onclick = reEnter; // the escape from a wrong credential
80
- show('pane-form');
81
- // The markup's autofocus was set while this pane was still hidden, so it
82
- // never fired — move focus to the first field now that the pane is showing.
83
- $('handle').focus();
84
- for (const el of $('form').elements) {
85
- el.addEventListener('input', onEdit);
86
- el.addEventListener('change', onEdit);
87
- }
88
- $('form').addEventListener('submit', onSubmit);
89
- onEdit();
90
- }
91
-
92
- function answers() {
93
- const f = $('form').elements;
94
- const kind = f.kind.value;
95
- const mode = state.resumable ? 'existing' : f.mode.value;
96
- const issuer = mode === 'new'
97
- ? (f.issuerNew.value || (f.issuerOther ? f.issuerOther.value : '')).trim()
98
- : f.issuer.value.trim();
99
- const a = {
100
- kind,
101
- mode,
102
- handle: f.handle.value.trim(),
103
- issuer,
104
- email: f.email.value.trim(),
105
- // Where the address lives; a group cannot front (yet), so it stays 'pod'.
106
- shape: (kind === 'group') ? 'pod' : (f.shape ? f.shape.value : 'pod'),
107
- gatewayOrigin: (f.gatewayOrigin ? f.gatewayOrigin.value.trim() : '') || 'https://fedipod.net',
108
- };
109
- if (mode === 'new') a.podName = f.podName.value.trim() || a.handle;
110
- else a.pod = f.pod.value.trim();
111
- if (!state.resumable && !state.passwordSupplied) a.password = f.password.value;
112
- return a;
113
- }
114
-
115
- // Every warning the CLI printed before it asked "create pod and fediverse
116
- // account?", in the same words, as you type.
117
- const NOTES = {
118
- 'pod-is-a-path': (a) =>
119
- `This pod is a path on ${host(a.pod)}, not the root of its own host. WebFinger is `
120
- + 'answered only at a host root, which this pod cannot write to, so other servers '
121
- + 'will not find this address. Posting and reading still work; being discovered does not.',
122
- };
123
- const REFUSALS = {
124
- 'group-needs-host-root': () =>
125
- 'A group needs a pod at the root of its own host, or nobody could ever find it. '
126
- + 'Give the group a pod of its own, or set this up as a person.',
127
- };
128
- const host = (u) => { try { return new URL(u).host; } catch { return u; } };
129
-
130
- let editTimer = null;
131
- function onEdit() {
132
- const mode = state.resumable ? 'existing' : $('form').elements.mode.value;
133
- $('row-podname').hidden = mode !== 'new';
134
- $('row-pod').hidden = mode === 'new';
135
- $('row-issuer-new').hidden = mode !== 'new';
136
- $('row-issuer-existing').hidden = mode === 'new';
137
- const f = $('form').elements;
138
- if ($('row-issuer-other')) $('row-issuer-other').hidden = !(mode === 'new' && f.issuerNew.value === '');
139
- if ($('row-gateway')) $('row-gateway').hidden = !(f.shape && f.shape.value === 'front');
140
- clearTimeout(editTimer);
141
- editTimer = setTimeout(preview, 150);
142
- }
143
-
144
- async function preview() {
145
- const a = answers();
146
- $('preview-notes').textContent = '';
147
- if (!a.handle || (a.mode === 'existing' && !a.pod)) { $('preview').textContent = '…'; return; }
148
- if (state.resumable) { $('preview').textContent = `@${a.handle}@…`; return; }
149
- const { json } = await postJson('/setup/check', a);
150
- if (!json) return;
151
- $('preview').textContent = json.address || '…';
152
- // The address-shape choice: hidden for a group (a group cannot front yet),
153
- // locked to the gateway for a pod on a suffix-based host, an open choice
154
- // for a pod at its own host.
155
- const f = $('form').elements;
156
- const shapeFs = $('fs-shape');
157
- if (shapeFs) {
158
- const isGroup = a.kind === 'group';
159
- shapeFs.hidden = isGroup || (a.mode === 'existing' && !a.pod);
160
- const forced = !!json.forced;
161
- for (const r of f.shape) r.disabled = forced;
162
- if (forced) { for (const r of f.shape) r.checked = r.value === 'front'; }
163
- if ($('row-gateway')) $('row-gateway').hidden = !(f.shape.value === 'front');
164
- const note = $('shape-note');
165
- if (note) {
166
- note.hidden = !forced;
167
- note.textContent = forced
168
- ? 'Your pod is on a suffix-based host, so its address lives at the gateway. Your posts, key and data stay on your pod.'
169
- : '';
170
- }
171
- }
172
- const notes = $('preview-notes');
173
- for (const w of json.warnings || []) {
174
- const p = document.createElement('p');
175
- p.className = 'warn';
176
- p.textContent = NOTES[w] ? NOTES[w](a) : w;
177
- notes.appendChild(p);
178
- }
179
- if (json.refusal) {
180
- const p = document.createElement('p');
181
- p.className = 'err';
182
- p.textContent = REFUSALS[json.refusal] ? REFUSALS[json.refusal]() : json.refusal;
183
- notes.appendChild(p);
184
- }
185
- $('submit').disabled = !!json.refusal;
186
- }
187
-
188
- async function onSubmit(ev) {
189
- ev.preventDefault();
190
- $('form-error').textContent = '';
191
- $('submit').disabled = true;
192
- const { status, json } = await postJson('/setup', answers());
193
- if (status !== 202) {
194
- $('submit').disabled = false;
195
- $('form-error').textContent = json?.error || `setup refused (HTTP ${status})`;
196
- return;
197
- }
198
- watchRun();
199
- }
200
-
201
- // ---- the run ----
202
-
203
- const LABELS = {
204
- account: 'Creating the account and pod',
205
- credential: 'Minting a credential for this machine',
206
- bootstrap: 'Provisioning the pod',
207
- connect: 'Connecting',
208
- publish: 'Publishing the actor',
209
- verify: 'Checking the world can see it',
210
- };
211
- const MARKS = { waiting: '·', running: '⟳', ok: '✓', skipped: '–', error: '✗' };
212
-
213
- async function watchRun() {
214
- show('pane-run');
215
- strap('setting up');
216
- const { json: run } = await api('/setup/progress');
217
- if (!run) return;
218
- renderRun(run);
219
- if (run.phase === 'running') return setTimeout(watchRun, 700);
220
- if (run.phase === 'done') return paneDone(run.result);
221
- $('run-title').textContent = 'Setup stopped';
222
- $('run-error').textContent = run.error || 'unknown error';
223
- $('run-again').hidden = false;
224
- $('run-again').onclick = async () => {
225
- // Re-read the state: a run that got as far as the credential resumes from
226
- // there rather than minting a second one.
227
- const { json } = await api('/setup/state');
228
- state = json || state;
229
- paneForm();
230
- };
231
- // A failure past the credential (a wrong pod answering 401 to the first
232
- // write) leaves a credential that "Try again" can only re-use. Offer to
233
- // discard it and re-enter the account and pod — only when there is one.
234
- const { json: st } = await api('/setup/state');
235
- const reenter = $('run-reenter');
236
- reenter.hidden = !st?.hasCredential;
237
- reenter.onclick = reEnter;
238
- }
239
-
240
- // Discard the saved credential (server confirms, then the full form returns).
241
- // Destructive and unrecoverable — a minted credential is shown once — so it
242
- // asks first.
243
- async function reEnter() {
244
- if (!confirm('Discard the saved account credential and enter the account and pod again?\n\n'
245
- + 'The old credential is left on your account — revoke it from the account dashboard if you want it gone.')) return;
246
- const { status, json } = await postJson('/setup/reset', {});
247
- if (status !== 200) {
248
- const box = $('pane-form').hidden ? $('run-error') : $('form-error');
249
- box.textContent = json?.error || `could not reset (HTTP ${status})`;
250
- return;
251
- }
252
- const { json: st } = await api('/setup/state');
253
- state = st || {};
254
- paneForm();
255
- }
256
-
257
- function renderRun(run) {
258
- const ul = $('run-steps');
259
- ul.textContent = '';
260
- for (const s of run.steps) {
261
- const li = document.createElement('li');
262
- const mark = document.createElement('span');
263
- mark.className = 'state';
264
- mark.textContent = MARKS[s.state] || '·';
265
- // The glyph is the whole of what says how a step went, and `⟳` read aloud
266
- // is not a word. Naming it leaves the visual result exactly as it was.
267
- mark.setAttribute('aria-label', s.state || 'waiting');
268
- li.appendChild(mark);
269
- li.appendChild(document.createTextNode(LABELS[s.key] || s.key));
270
- if (s.note) {
271
- const note = document.createElement('div');
272
- note.className = 'note';
273
- note.textContent = s.note;
274
- li.appendChild(note);
275
- }
276
- ul.appendChild(li);
277
- }
278
- // One polite line rather than a live region over the whole list: the list is
279
- // rebuilt from scratch on every poll, and announcing all six steps twice a
280
- // second is not progress, it is noise. Only the step actually moving is said.
281
- const now = run.steps.find(s => s.state === 'running')
282
- || [...run.steps].reverse().find(s => s.state && s.state !== 'waiting');
283
- const say = now ? `${LABELS[now.key] || now.key}: ${now.state}` : '';
284
- const line = $('run-say');
285
- if (line && line.textContent !== say) line.textContent = say;
286
- }
287
-
288
- function paneDone(result) {
289
- // Straight to the thing you set it up FOR. A group has no client of its own,
290
- // so it goes to its console instead. Warnings are the exception: an address
291
- // nobody can resolve, or documents a stranger cannot read, are worth stopping
292
- // for — the client would just look empty and not say why.
293
- const stop = !result?.resolvable || result?.unreachable?.length;
294
- if (!stop) {
295
- location.href = result?.kind === 'group' ? '/admin/' : '/admin/client/';
296
- return;
297
- }
298
- strap('set up');
299
- show('pane-done');
300
- $('done-address').textContent = result?.address || `@${result?.handle} — no resolvable address`;
301
- const notes = [];
302
- if (!result?.resolvable) {
303
- notes.push(`${result?.pod} is not the root of its own host, so this address cannot be `
304
- + 'discovered by other servers. Posting and reading still work.');
305
- }
306
- if (result?.unreachable?.length) {
307
- notes.push(`Not readable without credentials yet: ${result.unreachable.join(', ')}. `
308
- + 'Other servers cannot fetch this actor until that clears.');
309
- }
310
- $('done-note').className = notes.length ? 'warn' : '';
311
- $('done-note').textContent = notes.join(' ');
312
-
313
- const links = $('done-links');
314
- links.textContent = '';
315
- const add = (href, text) => {
316
- if (links.hasChildNodes()) links.appendChild(document.createTextNode(' · '));
317
- const a = document.createElement('a');
318
- a.href = href;
319
- a.textContent = text;
320
- links.appendChild(a);
321
- };
322
- if (result?.kind !== 'group') add('/', 'Open the client');
323
- add('/admin/', 'Edit the record');
324
- }
325
-
326
- start();
@@ -1,68 +0,0 @@
1
- /* tokens.css — the FediPod design tokens: the front page's palette
2
- (web/app/index.html), so the front, the record page, the bar and the client
3
- shell are one visual system. The front is the reference; these values mirror
4
- its :root. Declared under every name the pages already use — plus aliases
5
- (--ink=--fg, --muted=--sub, --link=--accent, --field-edge=--field-border,
6
- --danger=--err, --ring=--focus) — so a page only has to drop its own :root
7
- colours and inherit these. The base size and the font family live here too:
8
- 20px base, Arial, and nothing on any page below 16px. */
9
- :root {
10
- color-scheme: light dark;
11
- font-size: 125%; /* 20px base (125% of 16) */
12
- --font: Arial, Helvetica, sans-serif; /* one family across the site */
13
-
14
- /* ground + text */
15
- --bg: #ffffff; --fg: #1a1a1a; --ink: #1a1a1a;
16
- --surface: #f0f2f5; /* the page ground behind cards */
17
- --raised: #ffffff; /* cards, the rail, the bar band, dialogs */
18
-
19
- /* structure + action */
20
- --heading: #2c4a35; --accent: #12467e; --link: #12467e;
21
- --sub: #565656; --muted: #565656; --line: #b0b0b0;
22
-
23
- /* fields */
24
- --field-bg: #ececec; --field-bg-hover: #e2e4e8; --field-hover: #e2e4e8;
25
- --field-text: #141414; --field-edge: #6f6f6f; --field-border: #6f6f6f;
26
-
27
- /* buttons — filled, muted forest green (like the front) */
28
- --btn: #3a5f43; --btn-hover: #30503a; --btn-text: #ffffff;
29
- --btn-bg: #ececec; --btn-bg-hover: #e2e4e8; --btn-bg-active: #d8dade; --btn-edge: #6f6f6f;
30
-
31
- /* status + focus */
32
- --err: #b00020; --danger: #b00020; --warn: #8a4b00; --ok: #1f7a3d;
33
- --focus: #12467e; --ring: #12467e;
34
-
35
- /* the edge of a dialog: bright against the page behind it */
36
- --dialog-edge: #b8b8b8;
37
-
38
- /* every other row of a table. A stripe nobody can see is not a stripe:
39
- this is a real step from the page, not a hint of one. */
40
- --stripe: #d3dce8;
41
-
42
- --chevron: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23124f8a' stroke-width='1.6' stroke-linecap='round'/></svg>");
43
- }
44
-
45
- @media (prefers-color-scheme: dark) {
46
- :root {
47
- --bg: #191919; --fg: #f3f3f3; --ink: #f3f3f3;
48
- --surface: #18191a; --raised: #242526;
49
-
50
- --heading: #a7d4b5; --accent: #8fc2f2; --link: #8fc2f2;
51
- --sub: #d2d2d2; --muted: #d2d2d2; --line: #6d6d6d;
52
-
53
- --field-bg: #474747; --field-bg-hover: #515151; --field-hover: #515151;
54
- --field-text: #f5f5f5; --field-edge: #9aa0a6; --field-border: #9aa0a6;
55
-
56
- /* a touch brighter on the dark page so white text and the fill-vs-page edge
57
- both clear their contrast floors — still muted (kept in sync with the front) */
58
- --btn: #4a7a54; --btn-hover: #3f6a49; --btn-text: #ffffff;
59
- --btn-bg: #474747; --btn-bg-hover: #515151; --btn-bg-active: #5b5b5b; --btn-edge: #9aa0a6;
60
-
61
- --err: #ff9b9b; --danger: #ff9b9b; --warn: #ffb366; --ok: #7fd39a;
62
- --focus: #8fc2f2; --ring: #8fc2f2;
63
- --dialog-edge: #f3f3f3;
64
- --stripe: #363c45;
65
-
66
- --chevron: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23bcd8f0' stroke-width='1.6' stroke-linecap='round'/></svg>");
67
- }
68
- }