Hahahahaha WTF.
Some tables in the Commento database use a 64-char hex string as an identifier, namely, comments and accounts.

64 hex chars. Sounds like SHA-256, right? That's a decent method of generating a unique identifier.

..no. code is this: RandomHex(32).
It just generates 32 bytes of random data from Go's 'rand' and hex-encodes it. Luckily the chance of two randomly generated 256-bit strings colliding is... Birthday attack says, infinitesimally small.

Follow

This also means that adding dummy accounts is dummy simple.
Generate some random strings and slot it into the database. There's no foreign keys either (SOMEHOW) so I don't have to worry about that too much.

The only real issue would be emails since Commento would want to send out alerts. But I think I can solve that with a tweak or two.

So the flow would go like this:

- Create a "commenter" with a random hex ID, random bcrypt password (of good length), email is mastodon handle, link is mastodon page, photo is... photo, provider is "mastodon"

- Create an email config setting reply emails to FALSE for their "email" (mastodon handle)

- Create a comment referencing said commenter, interpreting their toot as markdown to render.

As well as local book-keeping to handle deletes, check toot privacy, and note passwords just in case.

If anyone feels like being a beta tester for something that's horribly broken, go follow @tekdmn_blog which I'll start connecting shortly.

Sign in to participate in the conversation
Tek's Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!