Open aumetra opened 1 year ago
This requires deterministic mapping from Mastodon IDs to UUID v7 identifiers.
Inspiration can be drawn from this example: https://github.com/aumetra/masto-snowflake-to-uuid7
Maybe the UUID v7 creation can be done by ourselves since the layout isn't that complicated, and the wyrand
crate should maybe be replaced since it doesn't have that many users (or we could maintain a fork ourselves; we could also easily switch to something like nanorand
if we implement the UUID v7 generation ourselves).
We don't need any cryptographic security for this PRNG since we just use it to stretch out the random data. I'm also open to other ways of achieving that (besides using something like WyRand).
The code to derive the UUID v7 identifiers from the Mastodon IDs should probably live in its own repository. If you are interested in this issue and aren't a member of the organisation, feel free to ping me.
I will then create a new repository that you can PR the code to.
The Mastodon snowflake -> UUID v7 crate is implemented now.
Code can be found here: https://github.com/kitsune-soc/masto-id-convert
We should add routes to keep that return ActivityPub entities on the same routes as Mastodon does.
This is for compatibility in the case an instance migrates from Mastodon to Kitsune, we need to keep the same URLs valid.
This should probably be added behind a compile-time feature flag