Giter Club home page Giter Club logo

Comments (10)

Cherry avatar Cherry commented on June 4, 2024 2

Thanks for all the feedback and research here folks. An updated version (1.2.4) has been published with the PR from @ajuanjojjj which should resolve this issue. 🎉

from acme-dns-01-cloudflare.

farzeni avatar farzeni commented on June 4, 2024 1

Thank you @ajuanjojjj, it fixed the issue in my case

from acme-dns-01-cloudflare.

Cherry avatar Cherry commented on June 4, 2024

Thanks for the report. I'm unable to replicate this myself in any of our projects, but looking at the code at https://git.rootprojects.org/root/greenlock.js/src/branch/master/plugins.js#L12-L26, seems to indicate that P_loadHelper is somehow being passed undefined, which is then causing require() to be passed undefined too, triggering this error.

https://git.rootprojects.org/root/greenlock.js/issues/35 seems to be a related issue. Try tweaking the packageRoot, configDir, store.basePath, etc. directories - I expect it's related to that.

from acme-dns-01-cloudflare.

ajuanjojjj avatar ajuanjojjj commented on June 4, 2024

I'm able to replicate it, using "acme-dns-01-cloudflare": "^1.2.3" and "greenlock": "^4.0.4". However, the "The "id" argument must be of type string. Received undefined" is not the end of the story, but just the error on the first run.

Deleting the config folder causes it to happen again, but if the error is thrown and then node ran again, it'll throw
Fatal error during greenlock init: bad challenge dns-01 module config{"options":{"token":"\\hidden\\","verifyPropagation":true,"verbose":true},"client":{},"propagationDelay":0}

Server.js content:

const acmeDnsCloudflare = require("acme-dns-01-cloudflare");

const cloudflareDns01 = new acmeDnsCloudflare({
	token: "\\HIDDEN\\",
	verifyPropagation: true,
	verbose: true // log propagation delays and other debug information
});


const Greenlock = require("greenlock");
const pkg = require("./package.json");

const greenlock = Greenlock.create({
	packageAgent: pkg.name + "/" + pkg.version,
	configDir: "./store",
	packageRoot: __dirname,
	maintainerEmail: "[email protected]"
});

greenlock.manager.defaults({
	agreeToTerms: true,
	subscriberEmail: "[email protected]",
	store: {
		module: "greenlock-store-fs",
		basePath: "./store/certs"
	},
	challenges: {
		"dns-01": cloudflareDns01
	}
});

greenlock.add({
	"subject": "\\HIDDEN\\",
	"altnames": [
		"\\HIDDEN\\",
		"\\HIDDEN\\"
	]
}).then(function () {
	console.log("SUCCESS");
}).catch(console.error);

EDIT:

Adding "module": "acme-dns-01-cloudflare" manually to config.json:defaults.challenges also brings you back to the The "id" argument must be of type string. Received undefined error

from acme-dns-01-cloudflare.

ajuanjojjj avatar ajuanjojjj commented on June 4, 2024

Oh, and better not to abuse the tests, since you might hit the rate limit for your IP: https://letsencrypt.org/docs/rate-limits/

Guess how I found out (:

from acme-dns-01-cloudflare.

ajuanjojjj avatar ajuanjojjj commented on June 4, 2024

After quite the evening of debugging, I think ive found where some of the (multiple) issues fall, although i'm not familiar with how the module works, so feel free to correct me where i'm wrong
index.js:57:

  • Missing a this.module = "acme-dns-01-cloudflare"; declaration
  • The cloudflare class is not being saved correctly in the config.json file (JSON.stringify or something like that failing). Fixed by refactoring this.client to this.cloudflareClient and adding an extra this.client without the cloudflare prototype.
  • The client data may be fed via options.token (server.js) or options.client?.token (config.json), so you have to check for both

Doing all of this seems to have fixed the issue, although more testing would be nice (I'm not completly sure i've not bypassed any extra errors while debugging)

from acme-dns-01-cloudflare.

farzeni avatar farzeni commented on June 4, 2024

Same problem here @ajuanjojjj , do you have a public repo to check your changes?

from acme-dns-01-cloudflare.

ajuanjojjj avatar ajuanjojjj commented on June 4, 2024

Same problem here @ajuanjojjj , do you have a public repo to check your changes?

Just pushed a PR that fixed it for me, feel free to check it out :D

from acme-dns-01-cloudflare.

zoutepopcorn avatar zoutepopcorn commented on June 4, 2024

Wow, that worked @ajuanjojjj great work

I just copy / paste the node_modules/index.js with this content:
https://github.com/ajuanjojjj/acme-dns-01-cloudflare/blob/master/index.js.

@Cherry can we accept this please

from acme-dns-01-cloudflare.

ajuanjojjj avatar ajuanjojjj commented on June 4, 2024

Wow, that worked @ajuanjojjj great work

I just copy / paste the node_modules/index.js with this content:
https://github.com/ajuanjojjj/acme-dns-01-cloudflare/blob/master/index.js.

@Cherry can we accept this please

The PR is already linked, we just need to fix some minor stuff and it will be added on the next release!

(Also, if you find the module useful, please star it so it gets more traction and hopefully more people help tweaking/fixing it :D)

from acme-dns-01-cloudflare.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.