Is the FogCreek/wetty repository in production?


#1

Can you tell me if FogCreek/wetty is currently in production. I am considering making a pull request but if there is non-public changes then their would be too many conflicts.


#2

That’s not the code that’s currently in production. I don’t think we have anything secret in our wetty changes. If you’re interested, we can get that repo up to date. What were you planning to add?


#5

Any update @Tim? :blush:


#6

Hi @nathfreder,

we’ll let you know when it’s available, unfortunately we can’t give you an ETA right now :frowning:


#7

Thanks, just wanted to make sure that it did not fly under the radar.


#8

Hi @nathfreder,

What’s in FogCreek/wetty is now up to date with what’s in production. Please feel free to make a pull request, and we’ll be happy to take a look. Sorry for the delay!


#9

Great, was it only one commit?


#10

I would also like to know how Wetty connected to the container? Is it run on the container or remotely connected to the container.


#11

It’s remotely connected. We’re running pty.js on the server.


#12

I think that I understand. I’ll try to explain it back to you and see if it is correct. To my understanding you are sending the data from pty.js (container) through WebSockets to Wetty?


#13

Yes, that’s right. What kind of improvements were you thinking of making?


#14

I was thinking of creating a WebSocket server so that you can programatically run commands and see their output. My use for this is creating a GitHub App that auto-deploys to a project and something like Netlify’s Command Line.


#15

Ah, I see. If that’s what you’re looking for wait a couple of days - we’re adding an endpoint to the API that runs a command in the container and returns the output.


#16

Wow! Thanks! Can you update me on when this will be available?


#17

Deployed :slight_smile:
You can use it by POSTing to https://api.glitch.com/projects/<projectId>/exec?authorization=<your glitch token>

The body of the request is JSON:

{
command: ‘something to do’
}

You’ll get back a JSON object:
{
stdout: ,
stderr:
}

You can get your token by looking in the Chrome developer console on the network tab, and searching for routes with ‘authorization=’. They’ll look something like this:

https://api.glitch.development/projects/2cf71ab0-3fb3-4da0-b677-0b193c6207fd?authorization=<token>

Don’t let anybody have that token - it’s your Glitch identity. This part will be easier soon.


#18

What about streams? Is that implemented?


#19

No, right now you can only send a command and get back the results.


#20

It it coming in the future?


#21

I’m not exactly sure what you mean by streams.


#22

I mean processes that do not exit. For instance if you were running node app.js and wanted to see the logs as they come out compared to echo Hello! which exits immediately.