This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
SquidDev's profile picture

Cloud Catcher: A web interface for ComputerCraft

Started by SquidDev, 04 May 2018 - 02:38 PM
SquidDev #1
Posted 04 May 2018 - 04:38 PM
One of the more frustrating things about ComputerCraft, is when you try to run your program on a server. Your little script which ran so perfectly in your local world, is now erroring left, right and centre. And this leaves you with no alternative but to face the unending pain which is the in-game editor.

Surely there must be a better solution?

Cloud Catcher: A web interface for ComputerCraft



Cloud Catcher is a website which allows you to remotely interface with a computer, viewing the terminal and editing files. Simply download the client script, pass in the provide token and lo! You should be able to interact with this remote terminal just like any other computer. Well, mostly (see the fine print at the bottom).

That's not all though, enter cloud edit cloud.lua, and your should be greeted with an editor. You can then edit this file to your heart's content: press Ctrl-S to save it, and mirror your changes back to the original computer.

One other rather neat feature is the ability to share sessions. On the top left, you can see your token: click it and you'll be provided with a URL which can be shared with anybody else. Finally, the multiplayer notepad that everyone wanted.

Screenshots
SpoilerEditing a file


Sharing a Cloud Catcher session across multiple browsers

The fine print
It's worth noting that Cloud Catcher is still in development - there are a couple of things you need to be aware of:
  • Cloud Catcher depends on CC:Tweaked. Everything is powered by websockets, so there really isn't a way around that.
  • There's currently a size limit of 15kB on files. I'm looking into adding file compression in future versions, which should alleviate this a bit, but it should still be enough for most programs. We have require now, you're allowed to split things up!
  • Browsers block some keyboard shortcuts from being processed, most notably Ctrl-T. This means it's currently impossible to terminate a program remotely.
More information
If you find a bug, have any suggestions, or just feel like helping out do check out the repository. There's a whooping big todo list on the issue tracker, which might give you an idea of what's planned for the future.

Also a big thanks to 1lann and GravityScore for their work on Mimic: Cloud Catcher's renderer is heavily based off of it.
Edited on 04 May 2018 - 02:39 PM
EveryOS #2
Posted 04 May 2018 - 05:17 PM
My computer gives me an error that it failed to load resource /favicon.ico


Failed to load resource: the server responded with a status of 404 ()




Wait, you have your own website! AMAZING!
Edited on 04 May 2018 - 03:19 PM
SquidDev #3
Posted 04 May 2018 - 05:29 PM
My computer gives me an error that it failed to load resource /favicon.ico
Yeah, that's not really an error per-say, just more that I'm insufficiently imaginative enough to create a logo.

Wait, you have your own website! AMAZING!
To be honest, setting up domain name is incredibly easy. The actual server and associated plumbing is the larger time and cost investment.
Luca_S #4
Posted 04 May 2018 - 06:55 PM
Hmm when trying to download it using wget I get "Failed" and when checking with http.get it gives me Could not connect. When trying the URL in my browser it works. Any Ideas?
SquidDev #5
Posted 04 May 2018 - 06:59 PM
Hmm when trying to download it using wget I get "Failed" and when checking with http.get it gives me Could not connect. When trying the URL in my browser it works. Any Ideas?
It's possible your version of Java doesn't like my https certificate: if you try with http instead, does it work? Note that the downloaded file will be garbage, but it gives me a clue of where to start looking.
Luca_S #6
Posted 05 May 2018 - 06:23 AM
Hmm when trying to download it using wget I get "Failed" and when checking with http.get it gives me Could not connect. When trying the URL in my browser it works. Any Ideas?
It's possible your version of Java doesn't like my https certificate: if you try with http instead, does it work? Note that the downloaded file will be garbage, but it gives me a clue of where to start looking.
arrg, forgot about that thing with letsencrypt certificates, using http works I'm going to try a newer Java version.
SquidDev #7
Posted 05 May 2018 - 07:57 AM
arrg, forgot about that thing with letsencrypt certificates, using http works I'm going to try a newer Java version.
I've updated my configuration to disable https promotion when not using a browser. It's a bit naff, but it should allow you to use http instead. Note that you'll have to replace "wss://" with "ws://" inside the file - I'll look into adding a command line flag for it.
SquidDev #8
Posted 06 May 2018 - 02:57 PM
I've just updated the site with a couple of bugfixes and new features. This should fix issues people were seeing with files not saving, or not appearing to save. I've also added a little "notification" system, which will alert you if a file was modified by somebody else/on the original computer. It won't update your file or anything (yet), but it's a useful bit of information.
Dave-ee Jones #9
Posted 10 May 2018 - 01:29 AM
Very good and useful idea. :)/>
Mumbai #10
Posted 14 May 2018 - 12:06 PM
whelp gg
SquidDev #11
Posted 14 May 2018 - 04:25 PM
whelp gg
Um, thanks. I think?
LoganDark2 #12
Posted 16 June 2018 - 06:42 PM
  • Browsers block some keyboard shortcuts from being processed, most notably Ctrl-T. This means it's currently impossible to terminate a program remotely.

Maybe Windows does. I hope you've still added support for it for those smart Mac users :P/>
Bomb Bloke #13
Posted 17 June 2018 - 02:26 AM
I'd be very surprised if the OS has anything to do with it. Certainly Windows doesn't stop you from using Ctrl+T in Minecraft, so why would you think that? :huh:/>
EveryOS #14
Posted 17 June 2018 - 02:36 AM
CTRL+T is a chrome macro, which is why Mimic can be very annoying on chromebooks…

I tried this, nice, but I found it a bit laggy
SquidDev #15
Posted 17 June 2018 - 07:41 AM
Maybe Windows does. I hope you've still added support for it for those smart Mac users :P/>
Yeah, I can add support for those deranged people who thought the super key should be used to open new tabs.

I tried this, nice, but I found it a bit laggy
I suspect this'll depend on your internet speed and where you are in the world. The server is in France so, if you're on the other side of the pond, the latency might be a little high. That said, I've tested with people in Brazil and it wasn't that bad.
Edited on 17 June 2018 - 05:42 AM
LoganDark2 #16
Posted 17 June 2018 - 07:44 AM
Maybe Windows does. I hope you've still added support for it for those smart Mac users :P/>
Yeah, I can add support for those deranged people who thought the super key should be used to open new tabs.

Well hey, blame the creators of UNIX, not me :P/>

I just like macOS because it's better for coding than Windows. WSL makes it a little better though. I have a dual boot set up between macOS and Windows.
Lupus590 #17
Posted 17 June 2018 - 09:28 AM
I tried this, nice, but I found it a bit laggy
I suspect this'll depend on your internet speed and where you are in the world. The server is in France so, if you're on the other side of the pond, the latency might be a little high. That said, I've tested with people in Brazil and it wasn't that bad.

How easy is it people to take the web end of Cloud Catcher and deploy their own servers? Perhaps people can start self hosting?
SquidDev #18
Posted 17 June 2018 - 09:35 AM
How easy is it people to take the web end of Cloud Catcher and deploy their own servers? Perhaps people can start self hosting?
It's pretty easy - just a matter of hosting the static files and running the server. If people are interested in this, I'm perfectly happy to share my various configuration files. The only thing to bear in mind is that the client always points towards my server, so you'd need to distribute an alternative download - though that's just changing a single line in the build script.
Lupus590 #19
Posted 17 June 2018 - 11:26 AM
That was surprisingly easy: https://github.com/SquidDev-CC/cloud-catcher/pull/4 I haven't been able to test it though.
EveryOS #20
Posted 17 June 2018 - 05:48 PM
I'm in North America, you are in France, might explain that…
Dave-ee Jones #21
Posted 26 July 2018 - 05:34 AM
Fanceh. :D/>
SquidDev #22
Posted 09 September 2018 - 08:43 PM
Just thought I'd do a little status update - while there haven't been any major features since this was released, there's still a couple of nifty changes:

The biggest change, while strictly internal, is that cloud-catcher's protocol has been entirely rewritten. The previous implementation used custom binary formats for each "packet", which made it increasingly hard to maintain the Lua and JS codebases. We now use JSON to encode packets - there's a slight size overhead, but the code is much cleaner.

This does mean you will need to reinstall the Lua client, as this is not backwards compatible. On the bright side, computers will now preserve their connection even if you reload the webpage (assuming the connection token remains the same).

I've also added a nifty settings dialogue, which allows you to change how a couple of things work within the website. Namely:
  • An editor dark mode. If someone has any design skills, I'll happily accept a "dark" CSS theme for the rest of the site.
  • Visualise whitespace, and trim trailing whitespace within the editor.
  • Use BombBloke's high-resolution font instead of CC's default.
One last thing, the cloud.lua script now accepts several options, including -H (to use http instead of https) and -t (to use a different terminal dimension). You can run it with –help to see the possible options.

If people have any suggestions, feature requests or bugs, do not hesitate to post them on the GitHub repository.