AJ ONeal solderjs
  • Provo, UT
  • https://coolaj86.com
  • 6'5 • Technophobic Technologist + Videographer • Go, Rust, Node / VanillaJS (@JSJabber), UX, Security, IoT. Canon 24mm 50mm. #FathersMatter #BlackFathersMatter
  • Joined on Apr 28, 2018
Loading Heatmap…

solderjs commented on issue root/greenlock-express.js#56

Usage with fastify.js

Problem solved then. Looks like you just go back to the basic Quick Start and export that as your `app`.

3 days ago

solderjs closed issue root/greenlock-express.js#38

[400] jwk and kid header fields are mutually exclusive

4 days ago

solderjs commented on issue root/greenlock-express.js#38

[400] jwk and kid header fields are mutually exclusive

Thanks @weiluen. I feel like this has had enough eyes on it and manual testing, so I'm pushing it live. Published - @root/greenlock@4.0.5 - @root/greenlock-express@4.0.4

4 days ago

solderjs closed issue root/greenlock-express.js#55

[400] KeyID header contained an invalid account URL

4 days ago

solderjs commented on issue root/greenlock-express.js#55

[400] KeyID header contained an invalid account URL

I'm not quite sure why this pops up sometimes. For most people it's benign. However, there's already and fix and I'll publish it soon: https://git.rootprojects.org/root/greenlock-express.js/issues/38

4 days ago

solderjs commented on issue root/greenlock.js#29

`middleware` and `tlsOptions` properties no longer exist?

> I really appreciate the immediate response and the time you have spent with me. You're welcome, and lucky. :D You happened to catch me at a good time. I want to be better about responding quickly in general, but usually I'm in the middle of something else that needs my full attention and by the end of the 4-hour block of coding I've forgotten or the email is buried under 20 others. :-/

5 days ago

solderjs commented on issue root/greenlock.js#29

`middleware` and `tlsOptions` properties no longer exist?

> sorry it took so long for me to grasp this And I'm sorry it took me so long to explain it. > but this is not an intuitive way of programming to me. That's the problem of creating something that scales beyond a single process. If you only care about something working on exactly one machine on exactly one CPU, and you don't plan to grow it as a service with many users, then you can just put everything in JavaScript and call it a day. If, however, you're running a service that will gain more users and therefore eventually have to run in 2+ separate processes, you have to think about things differently - you have to put "data" in serializable formats, like JSON, so that more than one process can access it at a time (and preferrably in a database, so that more than one machine can access it at a time). ---- I feel like Greenlock Express is very very good for the simplest cases (run a blog, or personal business site), and Greenlock is very very good at complex cases (like a hosting service with 1,000 users), but that middle ground of a hosting service with 10-100 users... it's a weird place - because it's basically as complicated as 1,000 user case, but seems like it _shouldn't_ be... but it actually is. The difference between 1 and 2 is much bigger than the difference between 2 and 10,000.

5 days ago

solderjs commented on issue root/greenlock.js#29

`middleware` and `tlsOptions` properties no longer exist?

> No routes, nothing like that, FFS... I am not using express... Then what are you using? If you just use node's basic HTTP, it's about the same: `app.js:` ``` var greenlock = ... /* shown just above */ module.exports = function (req, res) { greenlock.add({ ... }).then(function () { res.end("Happy day!"); }); }; ```

5 days ago

solderjs commented on issue root/greenlock.js#29

`middleware` and `tlsOptions` properties no longer exist?

> how to then use this instance of greenlock with the express middleware. You don't. They're separate. --- If you want to use Greenlock Express and load your own express or koa middleware, you do that with https://git.rootprojects.org/root/greenlock-express.js#user-content-v4-quickstart If you want to create admin middleware to manage with the bare Greenlock API, you do that with https://git.rootprojects.org/root/greenlock.js/src/branch/master/README.md#user-content-quick-start You can have 600 instances of Greenlock and they'll all work just fine together as long as they have the same `packageRoot` and `configDir` (or they can even be in completely separate processes as long as the `configDir` has the same settings).

5 days ago

solderjs commented on issue root/greenlock.js#29

`middleware` and `tlsOptions` properties no longer exist?

Let's say you have a route `/add-a-site` where you do some admin authentication and add a site, you'd do it like this: `app.js`: ``` var greenlock = ... app.use('/add-a-site', function (req, res) { greenlock.add({ ... }).then(function () { res.end("Happy day!"); }); }); ``` It writes to the file system (or database) and then when Greenlock Express goes to fetch a certificate, it'll find that it's been added and prepare the `tlsOptions` accordingly.

5 days ago

solderjs commented on issue root/greenlock.js#29

`middleware` and `tlsOptions` properties no longer exist?

> Thanks. How do I then use this greenlock instance with greenlock-express??? You just set `configDir` and `packageRoot` to the same thing. That's it. You don't pass one to the other.

5 days ago

solderjs commented on issue root/greenlock.js#29

`middleware` and `tlsOptions` properties no longer exist?

If you're using your own database and need custom functionality, you write the 2 to 4 callback functions that you need (i.e. for set, get, remove, list). If you just want to use the default file-based storage, then you don't need to do that. ---- If you're building out a hosting service (which is the reason most people need dynamic certificates), then you probably have your stuff in a database (or will soon). Just start with whichever way is simplest for you and don't do any special customization or configuration until you need to.

5 days ago

solderjs commented on issue root/greenlock.js#29

`middleware` and `tlsOptions` properties no longer exist?

Just follow the Quick Start that I linked you to: ```js 'use strict'; var pkg = require('./package.json'); var Greenlock = require('greenlock'); var greenlock = Greenlock.create({ packageRoot: __dirname, configDir: "./greenlock.d/", packageAgent: pkg.name + '/' + pkg.version, maintainerEmail: pkg.author, staging: true, notify: function(event, details) { if ('error' === event) { // `details` is an error object in this case console.error(details); } } }); var altnames = ['example.com', 'www.example.com']; greenlock .add({ subject: altnames[0], altnames: altnames }) .then(function() { // saved config to db (or file system) }); ```

5 days ago

solderjs closed issue root/greenlock.js#27

Problems with new configDir implementation (can't create instance)

5 days ago

solderjs commented on issue root/greenlock.js#27

Problems with new configDir implementation (can't create instance)

I didn't get any feedback from you, so I'm assuming that the Quick Start solved your issue. If you still need help, let me know.

5 days ago

solderjs commented on issue root/greenlock.js#29

`middleware` and `tlsOptions` properties no longer exist?

> OK, so if I create an instance of greenlock manually, how do I then pass it to greenlock-express? You don't. You specify the same `packageRoot` and `configDir`.

5 days ago

solderjs commented on issue root/greenlock.js#29

`middleware` and `tlsOptions` properties no longer exist?

Actually, it sounds like what you want is just to override the manager callbacks, in which case you should look at: https://git.rootprojects.org/root/greenlock-manager-test.js You only need to implement enough to pass the tests for the features you need. For example, if you don't need wildcard support, your callback function doesn't need to pass those tests. ### Public vs Private **Public** If you're going to publish your module to NPM, just pass those tests and do so. The config is JSON (so that it can be stored on the file system, or in a database), which is why you specify the name of the module, rather than `require` it. **Private** Part of the reason for `packageRoot` is that `npm` doesn't handle in-project dependencies very well (or at all), and since many people want implementations that can't be published as public modules, the `packageRoot` is the source from which paths will be `require`d. It feels a little weird, but this is also what `haraka` and many other projects that have to handle unpublished or private dependencies have to do.

5 days ago

solderjs commented on issue root/greenlock.js#29

`middleware` and `tlsOptions` properties no longer exist?

`greenlock` and `greenlock-express` are completely separate. See https://git.rootprojects.org/root/greenlock.js#user-content-quick-start Just make sure that anywhere you initialize Greenlock Express or Greenlock that `packageRoot` and `configDir` point to the same place, otherwise you'll get different configurations.

5 days ago

solderjs commented on issue root/greenlock-express.js#56

Usage with fastify.js

Hmm... this could be an issue of having 2 http handlers set on the same server. Does the default fastify http handler get called? Do you have any way to test that? I'd say hit up the fastify people and ask them if there's a way to get the "app". Most frameworks (express, koa, etc) have some sort of way to do this.

5 days ago

solderjs commented on issue root/greenlock.js#29

`middleware` and `tlsOptions` properties no longer exist?

FYI: Greenlock has never had any dependency on express.js (other than a `devDependency` for one of the examples). Sounds good. I like to follow the pattern of putting a `require.main` listener in my `app.js` for when I need to test it without HTTPS: ```js if (require.main === module) { require('http').createServer(app).listen(process.env.PORT || 3000, function () { console.log("Listening on", this.address()) }); } ```

5 days ago