Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
edaccc357d | |||
67f645ad50 | |||
bfeced5f34 | |||
24b9794a18 | |||
a781329a47 | |||
6b5e0a1207 |
@ -4,9 +4,9 @@
|
|||||||
"module": {
|
"module": {
|
||||||
"githost": "gitlab.com",
|
"githost": "gitlab.com",
|
||||||
"gitscope": "pushrocks",
|
"gitscope": "pushrocks",
|
||||||
"gitrepo": "smartuniverse",
|
"gitrepo": "smartacme",
|
||||||
"shortDescription": "acme with an easy yet powerful interface in TypeScript",
|
"shortDescription": "acme with an easy yet powerful interface in TypeScript",
|
||||||
"npmPackagename": "@pushrocks/smartuniverse",
|
"npmPackagename": "@pushrocks/smartacme",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"projectDomain": "push.rocks"
|
"projectDomain": "push.rocks"
|
||||||
}
|
}
|
||||||
|
3207
package-lock.json
generated
3207
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
26
package.json
26
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartacme",
|
"name": "@pushrocks/smartacme",
|
||||||
"version": "3.0.7",
|
"version": "3.0.10",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "acme with an easy yet powerful interface in TypeScript",
|
"description": "acme with an easy yet powerful interface in TypeScript",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@ -25,28 +25,28 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/umbrellazone/smartacme#README",
|
"homepage": "https://gitlab.com/umbrellazone/smartacme#README",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/lik": "^4.0.17",
|
"@pushrocks/lik": "^4.0.20",
|
||||||
"@pushrocks/smartdata": "^3.1.29",
|
"@pushrocks/smartdata": "^3.1.54",
|
||||||
"@pushrocks/smartdelay": "^2.0.10",
|
"@pushrocks/smartdelay": "^2.0.10",
|
||||||
"@pushrocks/smartdns": "^4.0.4",
|
"@pushrocks/smartdns": "^4.0.4",
|
||||||
"@pushrocks/smartexpress": "^3.0.76",
|
"@pushrocks/smartexpress": "^3.0.100",
|
||||||
"@pushrocks/smartlog": "^2.0.36",
|
"@pushrocks/smartlog": "^2.0.39",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.1.3",
|
||||||
"@pushrocks/smartrequest": "^1.1.47",
|
"@pushrocks/smartrequest": "^1.1.51",
|
||||||
"@pushrocks/smartstring": "^3.0.18",
|
"@pushrocks/smartstring": "^3.0.24",
|
||||||
"@pushrocks/smarttime": "^3.0.24",
|
"@pushrocks/smarttime": "^3.0.38",
|
||||||
"@pushrocks/smartunique": "^3.0.3",
|
"@pushrocks/smartunique": "^3.0.3",
|
||||||
"@tsclass/tsclass": "^3.0.21",
|
"@tsclass/tsclass": "^3.0.29",
|
||||||
"acme-client": "^3.3.1"
|
"acme-client": "^3.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.24",
|
"@gitzone/tsbuild": "^2.1.25",
|
||||||
"@gitzone/tsrun": "^1.2.12",
|
"@gitzone/tsrun": "^1.2.12",
|
||||||
"@gitzone/tstest": "^1.0.43",
|
"@gitzone/tstest": "^1.0.52",
|
||||||
"@mojoio/cloudflare": "^5.0.6",
|
"@mojoio/cloudflare": "^5.0.6",
|
||||||
"@pushrocks/qenv": "^4.0.10",
|
"@pushrocks/qenv": "^4.0.10",
|
||||||
"@pushrocks/tapbundle": "^3.2.9",
|
"@pushrocks/tapbundle": "^3.2.9",
|
||||||
"@types/node": "^14.0.27",
|
"@types/node": "^14.14.22",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
|
3
qenv.yml
3
qenv.yml
@ -1,6 +1,5 @@
|
|||||||
required:
|
required:
|
||||||
- CF_EMAIL
|
- CF_TOKEN
|
||||||
- CF_KEY
|
|
||||||
- MONGODB_URL
|
- MONGODB_URL
|
||||||
- MONGODB_PASSWORD
|
- MONGODB_PASSWORD
|
||||||
- MONGODB_DATABASE
|
- MONGODB_DATABASE
|
||||||
|
24
readme.md
24
readme.md
@ -1,26 +1,26 @@
|
|||||||
# @pushrocks/smartuniverse
|
# @pushrocks/smartacme
|
||||||
acme with an easy yet powerful interface in TypeScript
|
acme with an easy yet powerful interface in TypeScript
|
||||||
|
|
||||||
## Availabililty and Links
|
## Availabililty and Links
|
||||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartuniverse)
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartacme)
|
||||||
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartuniverse)
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartacme)
|
||||||
* [github.com (source mirror)](https://github.com/pushrocks/smartuniverse)
|
* [github.com (source mirror)](https://github.com/pushrocks/smartacme)
|
||||||
* [docs (typedoc)](https://pushrocks.gitlab.io/smartuniverse/)
|
* [docs (typedoc)](https://pushrocks.gitlab.io/smartacme/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
|
|
||||||
Status Category | Status Badge
|
Status Category | Status Badge
|
||||||
-- | --
|
-- | --
|
||||||
GitLab Pipelines | [](https://lossless.cloud)
|
GitLab Pipelines | [](https://lossless.cloud)
|
||||||
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||||
npm | [](https://lossless.cloud)
|
npm | [](https://lossless.cloud)
|
||||||
Snyk | [](https://lossless.cloud)
|
Snyk | [](https://lossless.cloud)
|
||||||
TypeScript Support | [](https://lossless.cloud)
|
TypeScript Support | [](https://lossless.cloud)
|
||||||
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
Code Style | [](https://lossless.cloud)
|
Code Style | [](https://lossless.cloud)
|
||||||
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||||
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||||
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||||
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
@ -3,10 +3,7 @@ import { Qenv } from '@pushrocks/qenv';
|
|||||||
import * as cloudflare from '@mojoio/cloudflare';
|
import * as cloudflare from '@mojoio/cloudflare';
|
||||||
|
|
||||||
const testQenv = new Qenv('./', './.nogit/');
|
const testQenv = new Qenv('./', './.nogit/');
|
||||||
const testCloudflare = new cloudflare.CloudflareAccount({
|
const testCloudflare = new cloudflare.CloudflareAccount(testQenv.getEnvVarOnDemand('CF_TOKEN'));
|
||||||
email: testQenv.getEnvVarOnDemand('CF_EMAIL'),
|
|
||||||
key: testQenv.getEnvVarOnDemand('CF_KEY'),
|
|
||||||
});
|
|
||||||
|
|
||||||
import * as smartacme from '../ts/index';
|
import * as smartacme from '../ts/index';
|
||||||
|
|
||||||
@ -33,7 +30,8 @@ tap.test('should create a valid instance of SmartAcme', async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
tap.test('should get a domain certificate', async () => {
|
tap.test('should get a domain certificate', async () => {
|
||||||
await smartAcmeInstance.getCertificateForDomain('bleu.de');
|
const certificate = await smartAcmeInstance.getCertificateForDomain('bleu.de');
|
||||||
|
console.log(certificate);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('certmatcher should correctly match domains', async () => {
|
tap.test('certmatcher should correctly match domains', async () => {
|
||||||
|
@ -43,7 +43,7 @@ export class CertManager {
|
|||||||
* @param certDomainNameArg the domain Name to retrieve the vcertificate for
|
* @param certDomainNameArg the domain Name to retrieve the vcertificate for
|
||||||
*/
|
*/
|
||||||
public async retrieveCertificate(certDomainNameArg: string): Promise<Cert> {
|
public async retrieveCertificate(certDomainNameArg: string): Promise<Cert> {
|
||||||
const existingCertificate: Cert = await Cert.getInstance({
|
const existingCertificate: Cert = await Cert.getInstance<Cert>({
|
||||||
domainName: certDomainNameArg,
|
domainName: certDomainNameArg,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ export class CertManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async deleteCertificate(certDomainNameArg: string) {
|
public async deleteCertificate(certDomainNameArg: string) {
|
||||||
const cert: Cert = await Cert.getInstance({
|
const cert: Cert = await Cert.getInstance<Cert>({
|
||||||
domainName: certDomainNameArg,
|
domainName: certDomainNameArg,
|
||||||
});
|
});
|
||||||
await cert.delete();
|
await cert.delete();
|
||||||
|
@ -13,7 +13,6 @@ export interface ISmartAcmeOptions {
|
|||||||
setChallenge: (dnsChallengeArg: plugins.tsclass.network.IDnsChallenge) => Promise<any>;
|
setChallenge: (dnsChallengeArg: plugins.tsclass.network.IDnsChallenge) => Promise<any>;
|
||||||
removeChallenge: (dnsChallengeArg: plugins.tsclass.network.IDnsChallenge) => Promise<any>;
|
removeChallenge: (dnsChallengeArg: plugins.tsclass.network.IDnsChallenge) => Promise<any>;
|
||||||
environment: 'production' | 'integration';
|
environment: 'production' | 'integration';
|
||||||
logger?: plugins.smartlog.Smartlog;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -32,7 +31,7 @@ export class SmartAcme {
|
|||||||
// the acme client
|
// the acme client
|
||||||
private client: any;
|
private client: any;
|
||||||
private smartdns = new plugins.smartdns.Smartdns({});
|
private smartdns = new plugins.smartdns.Smartdns({});
|
||||||
public logger: plugins.smartlog.Smartlog;
|
public logger: plugins.smartlog.ConsoleLog;
|
||||||
|
|
||||||
// the account private key
|
// the account private key
|
||||||
private privateKey: string;
|
private privateKey: string;
|
||||||
@ -47,9 +46,7 @@ export class SmartAcme {
|
|||||||
|
|
||||||
constructor(optionsArg: ISmartAcmeOptions) {
|
constructor(optionsArg: ISmartAcmeOptions) {
|
||||||
this.options = optionsArg;
|
this.options = optionsArg;
|
||||||
this.options.logger
|
this.logger = new plugins.smartlog.ConsoleLog();
|
||||||
? (this.logger = optionsArg.logger)
|
|
||||||
: (this.logger = plugins.smartlog.defaultLogger);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -156,6 +153,7 @@ export class SmartAcme {
|
|||||||
hostName: fullHostName,
|
hostName: fullHostName,
|
||||||
challenge: keyAuthorization,
|
challenge: keyAuthorization,
|
||||||
});
|
});
|
||||||
|
await plugins.smartdelay.delayFor(30000);
|
||||||
await this.smartdns.checkUntilAvailable(fullHostName, 'TXT', keyAuthorization, 100, 5000);
|
await this.smartdns.checkUntilAvailable(fullHostName, 'TXT', keyAuthorization, 100, 5000);
|
||||||
console.log('Cool down an extra 60 second for region availability');
|
console.log('Cool down an extra 60 second for region availability');
|
||||||
await plugins.smartdelay.delayFor(60000);
|
await plugins.smartdelay.delayFor(60000);
|
||||||
|
Reference in New Issue
Block a user