diff --git a/src/Vervis/Handler/Inbox.hs b/src/Vervis/Handler/Inbox.hs index 995f36e..e02e204 100644 --- a/src/Vervis/Handler/Inbox.hs +++ b/src/Vervis/Handler/Inbox.hs @@ -34,7 +34,6 @@ import Control.Monad.Trans.Except (ExceptT (ExceptT), runExceptT) import Crypto.Error (CryptoFailable (..)) import Crypto.PubKey.Ed25519 (publicKey, signature, verify) import Data.Aeson -import Data.Aeson.Encode.Pretty.ToEncoding import Data.Bifunctor (first, second) import Data.HashMap.Strict (HashMap) import Data.List.NonEmpty (NonEmpty (..)) @@ -50,15 +49,16 @@ import Network.HTTP.Client (Manager, HttpException, requestFromURI) import Network.HTTP.Simple (httpJSONEither, getResponseBody, setRequestManager, addRequestHeader) import Network.HTTP.Types.Header (hDate, hHost) import Text.Blaze.Html (Html) +import Text.Shakespeare.I18N (RenderMessage) import UnliftIO.Exception (try) import Yesod.Auth (requireAuth) -import Yesod.Core (ContentType, defaultLayout, whamlet, toHtml) +import Yesod.Core (ContentType, defaultLayout, whamlet, toHtml, HandlerSite) import Yesod.Core.Content (TypedContent) import Yesod.Core.Json (requireJsonBody) import Yesod.Core.Handler -import Yesod.Form.Fields (Textarea (..), textareaField) -import Yesod.Form.Functions (areq, checkMMap, runFormPost, renderDivs) -import Yesod.Form.Types (Field, Enctype, FormResult (..)) +import Yesod.Form.Fields (Textarea (..), textField, textareaField) +import Yesod.Form.Functions +import Yesod.Form.Types import Yesod.Persist.Core (runDB, get404) import qualified Data.ByteString.Char8 as BC (unpack) @@ -74,8 +74,10 @@ import Yesod.HttpSignature (verifyRequestSignature) import qualified Network.HTTP.Signature as S (Algorithm (..)) +import Data.Aeson.Encode.Pretty.ToEncoding import Network.FedURI import Web.ActivityPub +import Yesod.Auth.Unverified import Vervis.ActorKey import Vervis.Foundation @@ -91,32 +93,9 @@ getInboxR = do Welcome to the ActivityPub inbox test page! It's the beginning of federation support in Vervis. Currently POSTing activities doesn't do anything, they're just verified and the results are - displayed on this page. Here's how to POST an activity - successfully: -
- (NOTE: Currently only Ed25519 signatures are supported, which is - incompatible with the default RSA-SHA256 used on the Fediverse) -
https://forgefed.angeley.es/ns#algorithm
and its
- value should be
- https://forgefed.angeley.es/ns#ed25519
. The actual
- key PEM should indeed be an Ed25519 public key, rather than
- RSA.
- - I'm aware these instructions aren't exactly clear and - self-contained. Soon I'll either clarify them or further - development will make things easier. In particular, by using one - Vervis instance to POST an activity to another Vervis instance. + displayed on this page. To test, go to another Vervis instance's + outbox page, submit an activity, and come back here to see + results.
Last 10 activities posted:
Enter an activity JSON document and click "Submit" to send it. -
NOTES: -
+ This is a federation test page. Provide a recepient actor URI and + message text, and a Create activity creating a new Note will be sent + to the destination server.