dahlia / fedify

ActivityPub server framework in TypeScript
https://fedify.dev/
MIT License
327 stars 13 forks source link

Some issues with the tutorial and also with the blog example #52

Closed carvilsi closed 1 month ago

carvilsi commented 1 month ago

Hi,

Please I'm having some issues with the tutorial and also with the blog example.

For the first issue after cloning the repo and doing some debug I was able to fix it increasing the seconds for the verify function at httpsig/mod.ts. Maybe my internet connection is little bit slow and also I'm using ngrok, could be this the reason? Is it necessary the check about the date?

Any clue about the second issue?

Thanks.

dahlia commented 1 month ago

First of all, thank you for reporting the bug.

The reason Fedify checks a Date header is to protect against replay attacks, and while it's not impossible to not check it, it does seem like the time window is tight. We should either increase the window to be more generous, or make the time window value configurable.

dahlia commented 1 month ago

Maybe my internet connection is little bit slow and also I'm using ngrok, could be this the reason?

Or maybe your system clock is out of sync?

dahlia commented 1 month ago

Okay, the main branch has now the twice longer time window than before. You could also configure it by passing signatureTimeWindow option to Federation() constructor, e.g.:

new Federation({
  signatureTimeWindow: { minutes: 5 },
});

@carvilsi Could you give it a try?

carvilsi commented 1 month ago

Thanks for your quick replay.

I checked the system clock and is sync.

I tried right now and just with the change about increasing the time window it worked like a charm for the two issues. No problem to follow and neither to see the posts from the blog on the activitypub.academy timeline.

I think that the possibility to configure signatureTimeWindow it's very nice.

Going to close the issue, if you do not mind.

Thanks :pray:

dahlia commented 1 month ago

Good to hear it works for you, thank you!