Upgrade to v4 using le-store-s3 #49
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background:
Hi, I'm new to Javascript and Git, so please forgive my ignorance and/or lack of decorum. I am trying to upgrade an exsting client of greenlock v2 to use greenlock v4. I hope this is the right place for filing "issues" and asking questions, since I don't see sufficient granularity of details in the existing documentation to cover my use case. I am using https://www.npmjs.com/package/le-store-s3 as the store.
Version:
Greenlock 4.0.4
Problem:
When invoking
get()
the following fatal error occurs:Cause:
I see
manage.defaults()
is invoked twice when initializing the greenlock manager:During the first invocation, the greenlock manager acts as a "getter" and returns the config here
During the second invocation, the greenlock manager acts as a "setter" and attempts to save the configured defaults here
During the config "save", JSON.stringify throws the exception "TypeError: Converting circular structure to JSON at JSON.stringify (anonymous) at Object.manage._save" when creating the data object
I am using the le-store-s3 create() function to create the le store, then I used a recursive function to print out these "cyclic references" within the le store object as follows:
The le store and the s3 logger stream handler owner appear to be "cyclic references" which cause
JSON.stringify
to throw.Summary:
I'd greatly appreciate feedback and suggestions to help me help myself. I'm not sure if there's a "proper" fix for this or if I should just start hacking away? I'm assuming I'm not the first person attempting to upgrade to greenlock v4 using AWS S3 as the store, so hopefully this is something basic which I'm ignorant and unaware of?
I haven't tested this one myself, but I think what you want is the v3/v4-compatible s3 module:
https://git.rootprojects.org/root/gl-store-s3.js
IIRC you can update the config by converting the keys from
camelCase
tohyphen-case
for the CLI:And if you're using the default JSON config file in
greenlock.d
, you can verify and edit the file by hand - but as a general rule it's not intended to be edited by hand except for debugging.Thanks for your help AJ, I've found that I'm fundamentally using this API incorrectly. Please close this "issue". Thanks, Clayton