You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
First, thanks @larryboymi for this project, it made the job much easier!
I got this project working using Windows/VSCode. I upgraded all dependencies to the latest package versions as of 21-Nov-2019 and deployed the zip file to AWS Lambda with Node 12.x. After upgrade npm install reports 0 vulnerabilities, having said that, there are a lot of depreciated functions that should to be updated that I didn't get around to.
I made some notes while I was getting this working which are copied below. They essentially describe how I did some basic updates to the code and some tips for config and deployment. I thought this might help others, and maybe could be a starting point to refresh the project. Sry, didn't have time to do a PR.
Run npm i or npm run dist and you should see 0 vulnerabilities
Clearly still a bit of cleanup required to get this fully updated, some areas might be:
Update depreciated packages
Update depreciated functions
Other Tips
If you use VSCode to build, then run npm run dist in bash shell (not powershell/cmd/etc) to allow the commands in package.json like mv and other bash style commands to work.
Note that you must have something for s3Folder in config.js (empty is not valid)
For the IAM role (see AWS.md), took me a little while to figure out where I could get the ARN for the route53 hostedzone by looking at the url when you go into Route53 domain manager.
BTW.. I never figured out how to test locally, where are you supposed to put your credentials? Anyway, I just uploaded the zip file to AWS lambda.
On Windows you may need to install Python2.7 (at c:\Python27) Not sure about this, seemed to be needed by some packages pre-upgrade... but then after the upgrade I didn't see it using python, so might not be required any more.
Example config
I rearranged the config a bit, just feels a bit more readable to me. If you modify the default config.js then make sure to update the ACME_DIRECTORY_URLs to the latest.
constUSE_PRODUCTION=process.env.USE_PRODUCTION||false// Change this to true for production.constdefaultCertInfo={'somedomain': ['*.somedomain.com']}consts3AccountBucket='acme-account.somedomain.com'// Create this bucketconsts3CertBucket='acme-certs.somedomain.com'// Create this bucketconsts3Folder='certs'// Create this folder on both bucketsconstacmeAccountFile='account'// This is the filename of a file that gets created in s3AccountBucket/s3Folder. It is pretty much a certificate file.constacmeAccountEmail='YOUR_EMAIL_ADDRESS'constawsRegion='ap-southeast-2'// Enter a region.// Should not need to edit below this line.constproductionDirectoryUrl=process.env.ACME_DIRECTORY_URL||'https://acme-v02.api.letsencrypt.org'// 'https://acme-v01.api.letsencrypt.org'conststagingDirectoryUrl=process.env.ACME_DIRECTORY_URL||'https://acme-staging-v02.api.letsencrypt.org'// 'https://acme-staging.api.letsencrypt.org'module.exports={'s3-account-bucket': process.env.S3_ACCOUNT_BUCKET||s3AccountBucket,'s3-cert-bucket': process.env.S3_CERT_BUCKET||s3CertBucket,'s3-folder': process.env.S3_CERT_FOLDER||s3Folder,'certificate-info': process.env.S3_CERT_INFO ? JSON.parse(process.env.S3_CERT_INFO) : defaultCertInfo,'acme-dns-retry': 30,'acme-dns-retry-delay-ms': 2000,'acme-account-file': process.env.ACME_ACCOUNT_FILE||acmeAccountFile,'acme-account-email': process.env.ACME_ACCOUNT_EMAIL||acmeAccountEmail,'acme-account-key-bits': 2048,'acme-directory-url': USE_PRODUCTION ? productionDirectoryUrl : stagingDirectoryUrl,'region': process.env.AWS_REGION||awsRegion}
Save raw cert files
I also edited createV2Certificate.js, and added a function to save a bunch of raw certificate files.
Copy in this function and change saveCertificate to saveCerts.
First, thanks @larryboymi for this project, it made the job much easier!
I got this project working using Windows/VSCode. I upgraded all dependencies to the latest package versions as of 21-Nov-2019 and deployed the zip file to AWS Lambda with Node 12.x. After upgrade
npm install
reports0 vulnerabilities
, having said that, there are a lot of depreciated functions that should to be updated that I didn't get around to.I made some notes while I was getting this working which are copied below. They essentially describe how I did some basic updates to the code and some tips for config and deployment. I thought this might help others, and maybe could be a starting point to refresh the project. Sry, didn't have time to do a PR.
Upgrading packages
ncu -u
to update packages.jsonpackages-lock.json
(I usually delete the node_modules directory to be sure)/util/generateRSAKeyPair.js
as follows:Run
npm i
ornpm run dist
and you should see0 vulnerabilities
Clearly still a bit of cleanup required to get this fully updated, some areas might be:
Other Tips
npm run dist
in bash shell (not powershell/cmd/etc) to allow the commands in package.json likemv
and other bash style commands to work.s3Folder
in config.js (empty is not valid)Example config
I rearranged the config a bit, just feels a bit more readable to me. If you modify the default config.js then make sure to update the ACME_DIRECTORY_URLs to the latest.
Save raw cert files
I also edited createV2Certificate.js, and added a function to save a bunch of raw certificate files.
Copy in this function and change
saveCertificate
tosaveCerts
.The text was updated successfully, but these errors were encountered: