r/ComputerCraft • u/chancetofreezer • Jan 03 '25
cc-email : email in minecraft
For a weekend project I made a little email system along with a really basic auth system to handle user identification.
Github links:
Email: https://github.com/GabrielleAkers/cc-email
Auth: https://github.com/GabrielleAkers/cc-auth
To get started you need at least 3 advanced computers on the same network (you could also use 2 computers with multishell.run -- 1 for client and 1 for server).
First setup the central auth server by running the following:
> pastebin run SbSdvnZN server
> auth_serverThen setup the email server with:
> pastebin run SbSdvnZN client
> cd ..
> pastebin run LSdUFXvx server
> email_serverThen set the chunk to forceload.
Now to setup any clients do:
> pastebin run SbSdvnZN client
> cd ..
> pastebin run LSdUFXvx clientThen you from the email directory can run the email client with:
> email_clientand send/receive emails with ease.
The system is event driven so there shouldn't be lots of rednet spam, and the default domain is @tuah since that's what my server uses, but you can configure that in the auth_shared and email_shared files on clients and hosts.
It auto fetches the latest changes from github so if you do modify the domain you'll need to redo that config every time it updates.
There's still some work to do like adding a way to get a list of existing email addresses and adding a gui option to configure the domain, but otherwise it works fine.
Some images:
Login screen: https://imgur.com/a/YHJQfTr
Inbox: https://imgur.com/a/b5hgeWT
Sending email: https://imgur.com/a/DupgX8b
4
u/codeartha Jan 03 '25
That's an insane amount of work. And although I don't see myself using it, Congrats!
3
u/Bright-Historian-216 Jan 03 '25
is there a possibility of adding several servers? if i were implementing something like this i would do something like:
rednet.host("com","tuah")
and then by sending an email to "hawk@tuah.com" it is saved on the hosting server. how do you implement this?
2
u/fatboychummy Jan 03 '25
So, big warnings here:
Rednet is extremely easy to spoof, and extremely easy to listen in on. For something like this you are going to want a much more robust level of security, including likely client-server handshakes, encrypted communications, and such.
For example, to spoof a sender, all you have to do is the following:
And congrats, now your computer is identified as computer
32on Rednet.On the receiving side of things, rednet just uses the underlying
modemlibrary, and sends every message over the extrarednet.CHANNEL_REPEATchannel, so to listen in on every single rednet message, all you have to do is the following:Securing your communications
Don't get me wrong, using rednet is perfectly fine. It's a routing protocol, and is decently good at doing its job. Your programs just needs to ensure the following:
There's a pretty good cryptography library that can handle all of this for you: https://github.com/migeyel/ccryptolib
I would love to write out a longer message to explain the various parts of the library and how they can help, but unfortunately I'm running a bit low on time right now.
Give it a look though, and if you have any questions I might be able to answer them later. I don't consider myself a "security guru", but I think I'm at least reasonably informed. Someone who's better at this stuff might also be able to jump in too.
2
u/triccmints Jan 04 '25
This is awesome! What a fun project.
I've always loved the idea of more social projects like this for computercraft but never found a server with an active cc community.