Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an ES6 Class from lets-encrypt-acme-client.js #4

Merged
merged 3 commits into from
Dec 20, 2024
Merged

Conversation

FirstTimeEZ
Copy link
Owner

Currently you can only have one daemon, which doesn't really make much sense if you have a more complicated setup
lets-encrypt-acme-client.js should be turned into an ES6 Class so there can be multiple instances of it.

/**
 * Create an `LetsEncrypt! Daemon` to Manage a `SSL Certificate`
 * 
 * @see startLetsEncryptDaemon - The actual daemon that will run periodcally after being started to create/renew certificates
 * @see checkChallengesMixin - You must check the `HTTP-01` challenges for each daemon you create
 * @remark `internal` methods could change at any time
 **/
export class LetsEncryptDaemon {
    constructor() {
        this.challengeLists = [];
        this.httpChallenges = [];
        this.checkAnswersFlag = false;
        this.localHost = false;
        this.checkedForLocalHost = false;
        this.acmeKeyChain = undefined;
        this.jsonWebKey = undefined;
        this.jsonWebKeyThumbPrint = undefined;
        this.acmeDirectory = null;
        this.acmeDirectoryURL = DIRECTORY_PRODUCTION;
        this.one = false;
        this.ariWindow = null;
        this.remaining = { days: null, hours: null, minutes: null };
    }

    async startLetsEncryptDaemon(fqdns, sslPath, certificateCallback, optGenerateAnyway = false, optStaging = false, dnsProvider = undefined) { }

    checkChallengesMixin(req, res) {  }

    async internalUpdateDirectory() {  }

    async internalCheckAnswered() {  }
    
    async internalGetAcmeKeyChain(sslPath) {   }

    async internalLetsEncryptDaemon(fqdns, sslPath, certificateCallback, optStaging, dnsProvider) {    }

    async internalFetchSuggest(sslPath, acmeDirectory) {  }

    async internalUpdateSuggestFromText(certificateText, acmeDirectory) {  }

    internalCheckForLocalHostOnce(req) {  }

    internalCheckChallenges() { }

    internalDetermineRequirement(fqdns, certFilePath, optStaging) {  }

    internalExpireDateFromCertificate(__certPath) {  }
}

closes #3

class LetsEncryptDaemon is the default export
class LetsEncryptDaemon is the default export
@FirstTimeEZ FirstTimeEZ added the enhancement New feature or request label Dec 20, 2024
@FirstTimeEZ FirstTimeEZ self-assigned this Dec 20, 2024
class LetsEncryptDaemon is the default export
@FirstTimeEZ FirstTimeEZ merged commit db88b66 into main Dec 20, 2024
@FirstTimeEZ FirstTimeEZ deleted the es6-class branch December 20, 2024 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create an ES6 Class from lets-encrypt-acme-client.js
1 participant