Compare commits

..

10 Commits

Author SHA1 Message Date
9e1c73febf 2.0.2 2018-10-07 21:06:28 +02:00
dcf1915816 2.0.1 2018-10-07 21:05:46 +02:00
748c911168 fix(core): update 2018-10-07 21:05:45 +02:00
3a48cb4ea8 2.0.0 2018-10-07 21:02:18 +02:00
a035c5c0b0 BREAKING CHANGE(scope): change to @pushrocks 2018-10-07 21:02:17 +02:00
f9c521b7b3 1.1.4 2018-08-12 21:45:21 +02:00
19cfe8bdc5 fix(core): update 2018-08-12 21:45:21 +02:00
601d6b30d3 1.1.3 2018-08-12 20:59:56 +02:00
57ffc82c43 1.1.2 2018-08-12 20:59:00 +02:00
312d3c01cd fix(npm publishing): update 2018-08-12 20:58:59 +02:00
13 changed files with 188 additions and 1176 deletions

View File

@ -3,69 +3,140 @@ image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
- .npmci_cache/
key: "$CI_BUILD_STAGE"
stages:
- security
- test
- release
- trigger
- pages
- metadata
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
tags:
- docker
- notpriv
snyk:
stage: security
script:
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- docker
- notpriv
# ====================
# test stage
# ====================
testLEGACY:
stage: test
script:
- npmci test legacy
- npmci node install legacy
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- docker
- notpriv
allow_failure: true
testLTS:
stage: test
script:
- npmci test lts
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- docker
- notpriv
testSTABLE:
stage: test
script:
- npmci test stable
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- docker
- notpriv
release:
stage: release
script:
- npmci publish
- npmci node install stable
- npmci npm publish
only:
- tags
- tags
tags:
- docker
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
tags:
- docker
- priv
trigger:
stage: trigger
stage: metadata
script:
- npmci trigger
- npmci trigger
only:
- tags
- tags
tags:
- docker
- docker
- notpriv
pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
stage: metadata
script:
- npmci command yarn global add npmpage
- npmci command npmpage
- npmci command npm install -g typedoc typescript
- npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
tags:
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true
windowsCompatibility:
image: stefanscherer/node-windows:10-build-tools
stage: metadata
script:
- npm install & npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- windows
allow_failure: true

12
.snyk Normal file
View File

@ -0,0 +1,12 @@
# 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

@ -1,13 +1,16 @@
# smartacme
acme implementation in TypeScript
## Availabililty
[![npm](https://umbrellazone.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartacme)
[![git](https://umbrellazone.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/umbrellazone/smartacme)
[![git](https://umbrellazone.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/umbrellazone/smartacme)
[![docs](https://umbrellazone.gitlab.io/assets/repo-button-docs.svg)](https://umbrellazone.gitlab.io/smartacme/)
## Status for master
[![build status](https://GitLab.com/umbrellazone/smartacme/badges/master/build.svg)](https://GitLab.com/umbrellazone/smartacme/commits/master)
[![coverage report](https://GitLab.com/umbrellazone/smartacme/badges/master/coverage.svg)](https://GitLab.com/umbrellazone/smartacme/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartacme.svg)](https://www.npmjs.com/package/smartacme)
@ -19,11 +22,12 @@ acme implementation in TypeScript
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://umbrellazone.gitlab.io/assets/repo-footer.svg)](https://umbrella.zone)

View File

@ -1,13 +1,16 @@
# smartacme
acme implementation in TypeScript
## Availabililty
[![npm](https://umbrellazone.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartacme)
[![git](https://umbrellazone.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/umbrellazone/smartacme)
[![git](https://umbrellazone.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/umbrellazone/smartacme)
[![docs](https://umbrellazone.gitlab.io/assets/repo-button-docs.svg)](https://umbrellazone.gitlab.io/smartacme/)
## Status for master
[![build status](https://GitLab.com/umbrellazone/smartacme/badges/master/build.svg)](https://GitLab.com/umbrellazone/smartacme/commits/master)
[![coverage report](https://GitLab.com/umbrellazone/smartacme/badges/master/coverage.svg)](https://GitLab.com/umbrellazone/smartacme/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartacme.svg)](https://www.npmjs.com/package/smartacme)
@ -19,41 +22,42 @@ acme implementation in TypeScript
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
```javascript
import { SmartAcme } from 'smartacme'
import { SmartAcme } from 'smartacme';
let smac = new SmartAcme()
let smac = new SmartAcme()(async () => {
// learn async/await, it'll make your life easier
(async () => { // learn async/await, it'll make your life easier
// optionally accepts a filePath Arg with a stored acmeaccount.json
// will create an account and
let myAccount = await smac.createAcmeAccount();
// optionally accepts a filePath Arg with a stored acmeaccount.json
// will create an account and
let myAccount = await smac.createAcmeAccount()
// will return a dnsHash to set in your DNS record
let myCert = await myAccount.createAcmeCert('example.com')
// will return a dnsHash to set in your DNS record
let myCert = await myAccount.createAcmeCert('example.com');
// gets and accepts the specified challenge
// first argument optional, defaults to dns-01 (which is the cleanest method for production use)
let myChallenge = await myCert.getChallenge('dns-01')
// gets and accepts the specified challenge
// first argument optional, defaults to dns-01 (which is the cleanest method for production use)
let myChallenge = await myCert.getChallenge('dns-01');
/* ----------
/* ----------
Now you need to set the challenge in your DNS
myChallenge.domainNamePrefixed is the address for the record
myChallenge.dnsKeyHash is the ready to use txt record value expected by letsencrypt
-------------*/
})()
})();
```
## Other relevant npm modules
module name | description
--- | ---
cert | a higlevel production module that uses smartacme to manage certs
smartnginx | a highlevel production tool for docker environments to manage nginx
| module name | description |
| ----------- | ------------------------------------------------------------------- |
| cert | a higlevel production module that uses smartacme to manage certs |
| smartnginx | a highlevel production tool for docker environments to manage nginx |
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://umbrellazone.gitlab.io/assets/repo-footer.svg)](https://umbrella.zone
[![repo-footer](https://umbrellazone.gitlab.io/assets/repo-footer.svg)](https://umbrella.zone

View File

@ -1,7 +1,6 @@
{
"npmci": {
"globalNpmTools": [
"npmts"
]
}
}
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public"
}
}

63
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "smartacme",
"version": "1.1.1",
"name": "@pushrocks/smartacme",
"version": "2.0.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -45,12 +45,12 @@
}
},
"@gitzone/tstest": {
"version": "1.0.13",
"resolved": "https://registry.npmjs.org/@gitzone/tstest/-/tstest-1.0.13.tgz",
"integrity": "sha512-nEdT3YJHrpkUVpum75n/ZU5voCjd7Fvq8gqbf47oaPC6r2LbqUhc6PnKo/YYaQLgXAaBtCTxFLZMUlWDg5fguw==",
"version": "1.0.15",
"resolved": "https://registry.npmjs.org/@gitzone/tstest/-/tstest-1.0.15.tgz",
"integrity": "sha512-+t5fvYK4a0JkwwH0Fokh5aOxVzrax5OjDUL4zmhBk7KFmXt7fdvcqsSNaEp9iyqC52dLiDybdAXqHYZypXTIYw==",
"dev": true,
"requires": {
"@gitzone/tsrun": "^1.1.11",
"@gitzone/tsrun": "^1.1.12",
"@pushrocks/consolecolor": "^2.0.1",
"@pushrocks/smartfile": "^6.0.6",
"@pushrocks/smartlog": "^2.0.1",
@ -197,9 +197,9 @@
"dev": true
},
"@types/node": {
"version": "10.5.8",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.8.tgz",
"integrity": "sha512-sWSjw+bYW/2W+1V3m8tVsm9PKJcxk3NHN7oRqNUfEdofKg0Imbdu1dQbFvLKjZQXEDXRN6IfSMACjJ7Wv4NGCQ==",
"version": "10.11.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.11.4.tgz",
"integrity": "sha512-ojnbBiKkZFYRfQpmtnnWTMw+rzGp/JiystjluW9jgN3VzRwilXddJ6aGQ9V/7iuDG06SBgn7ozW9k3zcAnYjYQ==",
"dev": true
},
"@types/vinyl": {
@ -218,12 +218,12 @@
"dev": true
},
"acme-v2": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/acme-v2/-/acme-v2-1.2.0.tgz",
"integrity": "sha512-3H86vhNJAc7x1TKk+6zfMNbxDSD20RsF3jM1Uf5x7NkgjU8nAwvzJ2W3kcyuivFKB8BntCcTIC8KtZKqF8eSBw==",
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/acme-v2/-/acme-v2-1.2.1.tgz",
"integrity": "sha512-7FRl/vgZpcm7VCOiiAU6ntkclHkkEdCk1uNAkuEA0sZ8R0YX3pBjh066y/QqzEAfmDbbiYr+DYlVhZoHTbmXEQ==",
"requires": {
"@coolaj86/urequest": "^1.1.1",
"rsa-compat": "^1.3.0"
"@coolaj86/urequest": "^1.3.6",
"rsa-compat": "^1.5.1"
}
},
"ansi-256-colors": {
@ -303,8 +303,7 @@
"bindings": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz",
"integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==",
"dev": true
"integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw=="
},
"brace-expansion": {
"version": "1.1.11",
@ -731,8 +730,7 @@
"isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"dev": true
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
},
"js-base64": {
"version": "2.4.8",
@ -855,13 +853,12 @@
"nan": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
"integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==",
"dev": true
"integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA=="
},
"node-forge": {
"version": "0.6.49",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.6.49.tgz",
"integrity": "sha1-8e6V1ddGI5OP4Z1piqWibVTS9g8="
"version": "0.7.6",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.6.tgz",
"integrity": "sha512-sol30LUpz1jQFBjOKwbjxijiE3b6pjd74YwfD0fJOKPjF+fONKb2Yg8rYgS6+bK6VDl+/wfr4IYpC7jDzLUIfw=="
},
"normalize-newline": {
"version": "3.0.0",
@ -1006,11 +1003,12 @@
}
},
"rsa-compat": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/rsa-compat/-/rsa-compat-1.5.1.tgz",
"integrity": "sha512-IPGhsT5HM501z49trBPT5ePrNcO3F3Gy9yCdd6H38VHLHNJqBxWdKyQasFjLhfQ5RYAmkJAkb8NnkuNgCC/zCg==",
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/rsa-compat/-/rsa-compat-1.6.0.tgz",
"integrity": "sha512-Eoqx0e9mcVpRQZ9IaVhZ0Su0WZ9CN6XKC1qWoyvueEloq2+kApZqmtueva/SHEo1mmB80sowZsyWU7TFcCvlzg==",
"requires": {
"node-forge": "^0.6.41"
"node-forge": "^0.7.6",
"ursa-optional": "^0.9.6"
}
},
"safe-buffer": {
@ -1316,6 +1314,16 @@
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
"dev": true
},
"ursa-optional": {
"version": "0.9.8",
"resolved": "https://registry.npmjs.org/ursa-optional/-/ursa-optional-0.9.8.tgz",
"integrity": "sha512-kYxw2g6fe9G/J2QG9CZH3FvVDvPXG8nw5X614zBjKZp7GI8e1jYobeNxxHElDu+dwEGleTJiT4ZxEa4j3OfPuA==",
"requires": {
"bindings": "^1.3.0",
"nan": "^2.10.0",
"which": "^1.3.1"
}
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
@ -1363,7 +1371,6 @@
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
}

View File

@ -1,11 +1,13 @@
{
"name": "smartacme",
"version": "1.1.1",
"name": "@pushrocks/smartacme",
"version": "2.0.2",
"private": false,
"description": "acme implementation in TypeScript",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "(tstest test/)"
"test": "(tstest test/)",
"build": "echo \"Not needed for now\""
},
"repository": {
"type": "git",
@ -25,14 +27,14 @@
"dependencies": {
"@pushrocks/smartdelay": "^2.0.2",
"@pushrocks/smartpromise": "^2.0.5",
"acme-v2": "^1.2.0",
"rsa-compat": "^1.5.1"
"acme-v2": "^1.2.1",
"rsa-compat": "^1.6.0"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.0.22",
"@gitzone/tsrun": "^1.1.12",
"@gitzone/tstest": "^1.0.13",
"@types/node": "^10.5.8",
"@gitzone/tstest": "^1.0.15",
"@types/node": "^10.11.4",
"cflare": "^1.0.5",
"qenv": "^1.1.7",
"tapbundle": "^2.0.2"

View File

@ -4,11 +4,11 @@ import * as smartacme from '../ts/index';
let smartAcmeInstance: smartacme.SmartAcme;
tap.test('should create a valid instance of SmartAcme' , async () => {
tap.test('should create a valid instance of SmartAcme', async () => {
smartAcmeInstance = new smartacme.SmartAcme();
await smartAcmeInstance.init()
await smartAcmeInstance.init();
console.log(smartAcmeInstance.directoryUrls);
await smartAcmeInstance.getCertificateForDomain('bleu.de');
})
});
tap.start();
tap.start();

View File

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

View File

@ -2,7 +2,7 @@ import * as plugins from './smartacme.plugins';
const rsa = require('rsa-compat').RSA;
export class KeyPair {
rsaKeyPair: any
rsaKeyPair: any;
/**
* generates a fresh rsa keyPair
@ -11,7 +11,7 @@ export class KeyPair {
const done = plugins.smartpromise.defer();
var options = { bitlen: 2048, exp: 65537, public: true, pem: true, internal: true };
rsa.generateKeypair(options, function(err, keypair) {
if(err) {
if (err) {
console.log(err);
}
done.resolve(keypair);

View File

@ -1,9 +1,6 @@
const acme = require('acme-v2').ACME.create({
RSA: require('rsa-compat').RSA,
// other overrides
promisify: require('util').promisify,
// used for constructing user-agent
os: require('os'),
process: require('process'),

View File

@ -1,7 +1,4 @@
import * as smartpromise from '@pushrocks/smartpromise';
import * as smartdelay from '@pushrocks/smartdelay';
export {
smartpromise,
smartdelay
}
export { smartpromise, smartdelay };

1081
yarn.lock

File diff suppressed because it is too large Load Diff