Compare commits

..

20 Commits

Author SHA1 Message Date
018a25ba6a 4.0.1 2022-09-27 15:44:06 +02:00
3c052df1e7 fix(core): update 2022-09-27 15:44:06 +02:00
17c85eb8b9 4.0.0 2022-09-27 15:40:55 +02:00
2bcb31e4d6 BREAKING CHANGE(core): update 2022-09-27 15:40:55 +02:00
70aef3fe7e 3.0.15 2021-01-22 23:43:22 +00:00
734bde4a98 fix(core): update 2021-01-22 23:43:21 +00:00
c7d9a42feb 3.0.14 2021-01-22 23:32:34 +00:00
f20bc72abb fix(core): update 2021-01-22 23:32:34 +00:00
cd2cfce683 3.0.13 2021-01-22 22:59:28 +00:00
44ab180474 fix(core): update 2021-01-22 22:59:27 +00:00
15557dfdd6 3.0.12 2021-01-22 20:31:56 +00:00
488f616d34 fix(core): update 2021-01-22 20:31:55 +00:00
e920406ce9 3.0.11 2021-01-22 18:47:02 +00:00
e044fd81bd fix(core): update 2021-01-22 18:47:01 +00:00
edaccc357d 3.0.10 2021-01-22 18:33:53 +00:00
67f645ad50 fix(core): update 2021-01-22 18:33:53 +00:00
bfeced5f34 3.0.9 2020-11-18 16:52:50 +00:00
24b9794a18 fix(core): update 2020-11-18 16:52:49 +00:00
a781329a47 3.0.8 2020-08-13 03:10:38 +00:00
6b5e0a1207 fix(core): update 2020-08-13 03:10:37 +00:00
17 changed files with 11886 additions and 8672 deletions

View File

@ -36,6 +36,7 @@ auditProductionDependencies:
- npmci command npm audit --audit-level=high --only=prod --production - npmci command npm audit --audit-level=high --only=prod --production
tags: tags:
- docker - docker
allow_failure: true
auditDevDependencies: auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci

12
.snyk
View File

@ -1,12 +0,0 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.12.0
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
'npm:node-forge:20180226':
- rsa-compat > node-forge:
reason: None given
expires: '2018-09-11T19:17:24.148Z'
- acme-v2 > rsa-compat > node-forge:
reason: None given
expires: '2018-09-11T19:17:24.148Z'
patch: {}

View File

@ -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"
} }

20381
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,14 @@
{ {
"name": "@pushrocks/smartacme", "name": "@pushrocks/smartacme",
"version": "3.0.7", "version": "4.0.1",
"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",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
"type": "module",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/)",
"build": "(tsbuild --web)" "build": "(tsbuild --web --allowimplicitany)"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -25,30 +26,28 @@
}, },
"homepage": "https://gitlab.com/umbrellazone/smartacme#README", "homepage": "https://gitlab.com/umbrellazone/smartacme#README",
"dependencies": { "dependencies": {
"@pushrocks/lik": "^4.0.17", "@pushrocks/lik": "^6.0.0",
"@pushrocks/smartdata": "^3.1.29", "@pushrocks/smartdata": "^5.0.8",
"@pushrocks/smartdelay": "^2.0.10", "@pushrocks/smartdelay": "^2.0.13",
"@pushrocks/smartdns": "^4.0.4", "@pushrocks/smartdns": "^5.0.2",
"@pushrocks/smartexpress": "^3.0.76", "@pushrocks/smartexpress": "^4.0.21",
"@pushrocks/smartlog": "^2.0.36", "@pushrocks/smartlog": "^3.0.1",
"@pushrocks/smartpromise": "^3.0.6", "@pushrocks/smartpromise": "^3.1.7",
"@pushrocks/smartrequest": "^1.1.47", "@pushrocks/smartrequest": "^2.0.11",
"@pushrocks/smartstring": "^3.0.18", "@pushrocks/smartstring": "^4.0.5",
"@pushrocks/smarttime": "^3.0.24", "@pushrocks/smarttime": "^3.0.45",
"@pushrocks/smartunique": "^3.0.3", "@pushrocks/smartunique": "^3.0.3",
"@tsclass/tsclass": "^3.0.21", "@tsclass/tsclass": "^4.0.21",
"acme-client": "^3.3.1" "acme-client": "^4.2.5"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.24", "@gitzone/tsbuild": "^2.1.65",
"@gitzone/tsrun": "^1.2.12", "@gitzone/tsrun": "^1.2.37",
"@gitzone/tstest": "^1.0.43", "@gitzone/tstest": "^1.0.73",
"@mojoio/cloudflare": "^5.0.6", "@mojoio/cloudflare": "^5.0.9",
"@pushrocks/qenv": "^4.0.10", "@pushrocks/qenv": "^5.0.2",
"@pushrocks/tapbundle": "^3.2.9", "@pushrocks/tapbundle": "^5.0.4",
"@types/node": "^14.0.27", "@types/node": "^18.7.23"
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",

View File

@ -1,6 +1,5 @@
required: required:
- CF_EMAIL - CF_TOKEN
- CF_KEY
- MONGODB_URL - MONGODB_URL
- MONGODB_PASSWORD - MONGODB_PASSWORD
- MONGODB_DATABASE - MONGODB_DATABASE

View File

@ -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 | [![pipeline status](https://gitlab.com/pushrocks/smartuniverse/badges/master/pipeline.svg)](https://lossless.cloud) GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartacme/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartuniverse/badges/master/coverage.svg)](https://lossless.cloud) GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartacme/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartuniverse)](https://lossless.cloud) npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartacme)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartuniverse)](https://lossless.cloud) Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartacme)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud) TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud) Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartuniverse)](https://lossless.cloud) PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartacme)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartuniverse)](https://lossless.cloud) PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartacme)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartuniverse)](https://lossless.cloud) BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartacme)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud) Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
## Usage ## Usage

View File

@ -3,12 +3,9 @@ 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.js';
let smartAcmeInstance: smartacme.SmartAcme; let smartAcmeInstance: smartacme.SmartAcme;
@ -33,14 +30,15 @@ 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 () => {
const certMatcherMod = await import('../ts/smartacme.classes.certmatcher'); const certMatcherMod = await import('../ts/smartacme.classes.certmatcher.js');
const certMatcher = new certMatcherMod.CertMatcher(); const certMatcher = new certMatcherMod.CertMatcher();
const matchedCert = certMatcher.getCertificateDomainNameByDomainName('level3.level2.level1'); const matchedCert = certMatcher.getCertificateDomainNameByDomainName('level3.level2.level1');
expect(matchedCert).to.equal('level2.level1'); expect(matchedCert).toEqual('level2.level1');
}); });
tap.test('should stop correctly', async () => { tap.test('should stop correctly', async () => {

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smartacme',
version: '4.0.1',
description: 'acme with an easy yet powerful interface in TypeScript'
}

View File

@ -1 +1 @@
export * from './smartacme.classes.smartacme'; export * from './smartacme.classes.smartacme.js';

View File

@ -1 +1 @@
export * from './accountdata'; export * from './accountdata.js';

View File

@ -1,8 +1,8 @@
import * as plugins from './smartacme.plugins'; import * as plugins from './smartacme.plugins.js';
import * as interfaces from './interfaces'; import * as interfaces from './interfaces/index.js';
import { CertManager } from './smartacme.classes.certmanager'; import { CertManager } from './smartacme.classes.certmanager.js';
import { Collection, svDb, unI } from '@pushrocks/smartdata'; import { Collection, svDb, unI } from '@pushrocks/smartdata';

View File

@ -1,8 +1,8 @@
import * as plugins from './smartacme.plugins'; import * as plugins from './smartacme.plugins.js';
import { Cert } from './smartacme.classes.cert'; import { Cert } from './smartacme.classes.cert.js';
import { SmartAcme } from './smartacme.classes.smartacme'; import { SmartAcme } from './smartacme.classes.smartacme.js';
import * as interfaces from './interfaces'; import * as interfaces from './interfaces/index.js';
export class CertManager { export class CertManager {
// ========= // =========
@ -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();

View File

@ -1,5 +1,5 @@
import * as plugins from './smartacme.plugins'; import * as plugins from './smartacme.plugins.js';
import * as interfaces from './interfaces'; import * as interfaces from './interfaces/index.js';
/** /**
* certmatcher is responsible for matching certificates * certmatcher is responsible for matching certificates

View File

@ -1,7 +1,7 @@
import * as plugins from './smartacme.plugins'; import * as plugins from './smartacme.plugins.js';
import { Cert } from './smartacme.classes.cert'; import { Cert } from './smartacme.classes.cert.js';
import { CertManager } from './smartacme.classes.certmanager'; import { CertManager } from './smartacme.classes.certmanager.js';
import { CertMatcher } from './smartacme.classes.certmatcher'; import { CertMatcher } from './smartacme.classes.certmatcher.js';
/** /**
* the options for the class @see SmartAcme * the options for the class @see SmartAcme
@ -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);

View File

@ -1,7 +1,10 @@
{ {
"compilerOptions": { "compilerOptions": {
"experimentalDecorators": true, "experimentalDecorators": true,
"target": "es2017", "useDefineForClassFields": false,
"module": "commonjs" "target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext",
"esModuleInterop": true
} }
} }

View File

@ -1,17 +0,0 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}