text
stringlengths
0
2.35k
**Jon Calhoun:** Okay. And the idea was to give it useful defaults and things like that, so that people setting this up are less likely to make mistakes that are, I assume, pretty common when setting things up like that?
**Mohammed S. Al Sahaf:** Yeah, especially with the SSH, because over the years - SSH has been around since the '90s, and the defaults have been changing and improving over time, but we have so many blogs and tutorials written that were probably written for the early 2000's, while we are here in 2022 and SHA 1 isn't sa...
\[20:01\] At the same time, you'll find those tutorials, those blog posts saying "Well, generate an RSA 1024-bit key and it should be alright to use with your SSH server." The goal is just like Caddy now is working with safe defaults for TLS \[unintelligible 00:20:14.10\] and have more than representation in defaults f...
The other key that's automatically generated is the ECDSA, but the regular DSA isn't generated, and so on. All of that is written in the comments, in the docs, in the code docs itself.
**Jon Calhoun:** So getting into this, I assume that this means you had to actually learn about all of the proper ways to do things now, versus the past... And you had mentioned that reading blogs - sometimes you find blogs that were written in 2000, when security practices might be a little bit different. Would you ha...
**Mohammed S. Al Sahaf:** That's a tough one. One of the things that I had to look at, that's an easy one to look at, is look at when was it published. If it was published in the '90s, cross it out, look for something more recent. I'm not a cryptographer, I'm gonna admit this, but I know from a few readings that ellipt...
The same thing for RSA. We know from recent findings that RSA 1024 bits isn't safe anymore... So higher bits, and so on. It's more following the recommendations of well-known cryptographers, for example.
I remember reading one of -- some of the stuff I came across, and I used a few blog posts by Matthew Green; I don't remember exactly the titles, but it was part of my research that I went through and I've found which algorithms should I use and which not.
**Jon Calhoun:** So when you're going through these algorithms, has Go been a language where you've found a lot of them were already implemented for you, or have you had to go and try to implement some of these on your own?
**Mohammed S. Al Sahaf:** No, I never needed to implement any of those on my own, which is delightful. Go had everything battery-included. Again, one of the things that's readily available is the 825519. That was already in there, and it's part of the standard lib. I just had to only grab it from there and generate the...
**Natalie Pistunovich:** One of the skills you picked up in this project is cryptography. Is there any other interesting skill that you picked up along the way?
**Mohammed S. Al Sahaf:** Oh, I had to learn a lot about pseudo-teletype. That has a ton of stuff that I had to go through, whether it was for Unix systems or for Windows. Especially on the Windows side, because it didn't have the PTY interface, and then they developed the \[unintelligible 00:23:45.04\] interface, but ...
**Matt Holt:** I'm glad you did that, because I don't even really wanna go there... It sounds kind of gnarly.
**Mohammed S. Al Sahaf:** \[24:06\] Oh, it is. It's funny, because here we are, we have the basic kind of system we work on almost always virtual machines, yet we're still SSH-ing into a server. The other side - and the name still implies it; it says teletype, pseudo-teletype, and you will tell the server "Here are my ...
**Matt Holt:** I was just looking at the list of modules... If you go to the Caddy download page, or the modules page, and you look at the SSH app that you wrote - it registers a lot of plugins or modules. I see SSH actors, actor matchers, ask, lots of ask and authentication, different providers and flows, config loade...
**Mohammed S. Al Sahaf:** Okay, so the actors are equivalent or analogous to handlers in HTTP. And the actor matchers are analogous to the matchers in the HTTP app. So just like you can define multiple possible actions or handlers for a particular request based on certain criteria, now you can use the matchers to match...
**Matt Holt:** This is cool. So you can kind of compose your own SSH logic with JSON in a memory-safe SSH server... And it looks like you have two actors so far - a shell and a static response. So you can start a shell for the user who logged in, or just write a static - like a screen, basically, to the user... And it'...
**Mohammed S. Al Sahaf:** For the shell actor there are a few enhancements that I've been working on locally. I know there are certain areas or gaps in the implementation that I have picked up on -- that I've fixed locally, and I haven't pushed yet... Because C is in the way. So the shell needs a lot of enhancements. T...
**Matt Holt:** \[27:54\] I could see this being extended to implement custom SSH apps. I've seen kind of a resurgence lately in graphical, SSH-based applications, and I could see this maybe being a good platform to launch and deploy those. So you can deploy a website, but you can also deploy an SSH app. So if a user wa...
**Jon Calhoun:** I think one of the ones I saw recently was by Charm, I think was the company... They have like a self-hosted Git server that made it look all pretty and stuff when you SSH-ed in. But every time I see one of those, I just think that like that's its own style of programming, making something look good in...
Mohammed, you had said you had to figure all that out, and I feel like that's a skill that if somebody asked your average developer to go build that right now, they would need some sort of reference material, because it's just not something people do as much anymore.
**Mohammed S. Al Sahaf:** Making anything look pretty is difficult, and it takes skill.
**Jon Calhoun:** That's true. So Mohammed, you've spend, it sounds like, two years - granted, it was a part-time project - working on this. And it's a massive extension. If somebody was gonna get started building an extension for Caddy, or getting involved in that sort of thing, do you have any recommendations for them...
**Mohammed S. Al Sahaf:** As Matt said, there are four basic concepts that you need to look at. If you're implementing a module for Caddy, you're 99% of the time - or probably 100% of the time - implementing an interface, and you're registering your module as part of a namespace where Caddy can find it and load it up.
So I would say find exactly where within Caddy do you want to add your module, which particular functionality or namespace you're looking at. Is it a listener wrapper, is it a handler, is it a connection policy? And then find the interface that you need to implement for that area and start from there. You can start sma...
I admit this is pretty much a generic advice for all projects. But this is what it is like for Caddy. And you need to look at how you're config structure is gonna look like. So consider how you would like your JSON configuration to look like, and move from there. And this was the only complex part, or the difficult par...
**Matt Holt:** Yeah, I wrestled with that, too. I think when I first started writing Caddy 2, the first 3-4 months was to me just going back and forth on what the JSON should look like... So Caddy's native config structure is JSON, but most people use the Caddy file for ease of use... But I've actually got quite a few ...
We actually do have a lot of business users in JSON... So that might be helpful if you wanna contribute - knowing your native config, what that looks like, and kind of getting that right. Because that'll impact a lot of future capabilities as well.
**Jon Calhoun:** Matt, I think you had said that pretty much everything inside of Caddy is essentially a module that's running... Am I recalling that correctly?
**Matt Holt:** Yeah. Everything except for its core, like, module loading and logging; it's core API, and such. Yeah.
**Jon Calhoun:** So are any of those built-in extensions that would be worth checking out for somebody who's just getting started, versus the ones that are a lot more complex?
**Matt Holt:** \[31:58\] Yeah, I would check out extensions or modules that are like what you want to build. So if you want to build an HTTP handler that handles requests, then you should look at HTTP handlers. A simple one is the static response handler, where you just hardcode a response. That's a pretty good one. If...
**Natalie Pistunovich:** Jon you asked Mohammed what is your tip for people who want to start, and Mohammed, you gave a very good answer of "Start something small, and build on top of that. Don't make that too complex." Do you feel that your experience as a product manager helped you start in an organized way? And if y...
**Mohammed S. Al Sahaf:** Yeah, it's been really a great feedback loop where at my job as a product manager I have to fix something or develop something in a certain manner for customers and I know the product is gonna be large, so I have to structure it in a way where it is extensible and easier to implement new funct...
**Natalie Pistunovich:** Which do you prefer? \[laughs\]
**Mohammed S. Al Sahaf:** Develop from scratch. It's a hundred times easier than inheriting something and I have to fix it. \[unintelligible 00:33:52.04\] You have a legacy and you have thousands of customers already using it, and there's this edge case that's not an edge case anymore, and it's really a painful corner ...
And you know, if it's a breaking change, you're gonna have all of those customers yelling at you over \[unintelligible 00:34:37.03\] phone calls. And with that, I find developing something from scratch is way better. The way it feeds back is - for me as a product manager, one of the things I took upon myself, because I...
**Natalie Pistunovich:** \[35:57\] This is an interesting answer. It makes a lot of sense, and it also makes me think about people who take the path from project or product management into developer... Because you hear a lot about people going from software into product management, but I have to say, I personally know ...
**Matt Holt:** I think more software should be written like that, with that approach.
**Jon Calhoun:** I think in general there's a lot of people who get into software development and -- I don't know how to describe this... It's almost like they view things like this is the way it should be for good software, and they ignore the fact that there are real business needs that need to be achieved, and thing...
**Break:** \[37:07\]
**Jingle:** \[39:24\]
**Natalie Pistunovich:** So, gentlemen... What is the unpopular opinion that you brought onboard?
**Matt Holt:** Mine is that vanilla JS is enough for anyone.
**Natalie Pistunovich:** Okay...
**Jon Calhoun:** Do you mean like modern vanilla JS?
**Matt Holt:** Yeah, of course. I'm writing kind of a frontend app in my spare time right now, and there definitely are a few little pain points, but it's kind of like those pain points in Go, where you just write a less function, or something like that. So you do that in vanilla JavaScript, it's such a -- like, the tr...
**Jon Calhoun:** \[40:24\] I kind of wonder if half that issue stems from the fact that for the longest time vanilla JS was very hard to use, by itself at least... And I agree with you that it's gotten way, way better, to the point that if somebody started over, I'd be like "You can start with vanilla JS." But I don't ...
**Matt Holt:** Yeah. I mean, maybe there's a place for frameworks, but I'm not even using jQuery at this time, and it's really been a breeze putting this together. I understand what's going on -- the DOM is a weird place, and there are definitely quirks, JavaScriptisms that are just a little strange; you've gotta read ...
**Natalie Pistunovich:** I'll just say that already one disagreement showed up on Slack, so... Kudos. There will be a survey afterwards on Twitter... We'll see how that predicts the outcome.