Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
280335f6f6 | |||
b90092c043 | |||
9e1c73febf | |||
dcf1915816 | |||
748c911168 | |||
3a48cb4ea8 | |||
a035c5c0b0 | |||
f9c521b7b3 | |||
19cfe8bdc5 | |||
601d6b30d3 | |||
57ffc82c43 | |||
312d3c01cd |
107
.gitlab-ci.yml
107
.gitlab-ci.yml
@ -3,69 +3,148 @@ image: hosttoday/ht-docker-node:npmci
|
|||||||
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .yarn/
|
- .npmci_cache/
|
||||||
key: "$CI_BUILD_STAGE"
|
key: "$CI_BUILD_STAGE"
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
- security
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
- trigger
|
- metadata
|
||||||
- pages
|
|
||||||
|
|
||||||
testLEGACY:
|
# ====================
|
||||||
stage: test
|
# security stage
|
||||||
|
# ====================
|
||||||
|
mirror:
|
||||||
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci test legacy
|
- npmci git mirror
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
|
snyk:
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci command npm install -g snyk
|
||||||
|
- npmci command npm install --ignore-scripts
|
||||||
|
- npmci command snyk test
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
|
sast:
|
||||||
|
stage: security
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-dbase:npmci
|
||||||
|
variables:
|
||||||
|
DOCKER_DRIVER: overlay2
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
services:
|
||||||
|
- docker:stable-dind
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci npm install
|
||||||
|
- npmci command npm run build
|
||||||
|
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
||||||
|
- docker run
|
||||||
|
--env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}"
|
||||||
|
--volume "$PWD:/code"
|
||||||
|
--volume /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
|
||||||
|
artifacts:
|
||||||
|
reports:
|
||||||
|
sast: gl-sast-report.json
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
|
# ====================
|
||||||
|
# test stage
|
||||||
|
# ====================
|
||||||
|
|
||||||
testLTS:
|
testLTS:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test lts
|
- npmci npm prepare
|
||||||
|
- npmci node install lts
|
||||||
|
- npmci npm install
|
||||||
|
- npmci npm test
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
testSTABLE:
|
testSTABLE:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci test stable
|
- npmci npm prepare
|
||||||
|
- npmci node install stable
|
||||||
|
- npmci npm install
|
||||||
|
- npmci npm test
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
script:
|
script:
|
||||||
- npmci publish
|
- npmci node install stable
|
||||||
|
- npmci npm publish
|
||||||
only:
|
only:
|
||||||
- tags
|
- 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:
|
trigger:
|
||||||
stage: trigger
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci trigger
|
- npmci trigger
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-node:npmci
|
image: hosttoday/ht-docker-node:npmci
|
||||||
stage: pages
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci command yarn global add npmpage
|
- npmci command npm install -g typedoc typescript
|
||||||
- npmci command npmpage
|
- npmci npm prepare
|
||||||
|
- npmci npm install
|
||||||
|
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
- notpriv
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
|
allow_failure: true
|
||||||
|
12
.snyk
Normal file
12
.snyk
Normal 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: {}
|
@ -1,13 +1,16 @@
|
|||||||
# smartacme
|
# smartacme
|
||||||
|
|
||||||
acme implementation in TypeScript
|
acme implementation in TypeScript
|
||||||
|
|
||||||
## Availabililty
|
## Availabililty
|
||||||
|
|
||||||
[](https://www.npmjs.com/package/smartacme)
|
[](https://www.npmjs.com/package/smartacme)
|
||||||
[](https://GitLab.com/umbrellazone/smartacme)
|
[](https://GitLab.com/umbrellazone/smartacme)
|
||||||
[](https://github.com/umbrellazone/smartacme)
|
[](https://github.com/umbrellazone/smartacme)
|
||||||
[](https://umbrellazone.gitlab.io/smartacme/)
|
[](https://umbrellazone.gitlab.io/smartacme/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
|
|
||||||
[](https://GitLab.com/umbrellazone/smartacme/commits/master)
|
[](https://GitLab.com/umbrellazone/smartacme/commits/master)
|
||||||
[](https://GitLab.com/umbrellazone/smartacme/commits/master)
|
[](https://GitLab.com/umbrellazone/smartacme/commits/master)
|
||||||
[](https://www.npmjs.com/package/smartacme)
|
[](https://www.npmjs.com/package/smartacme)
|
||||||
@ -19,11 +22,12 @@ acme implementation in TypeScript
|
|||||||
[](http://standardjs.com/)
|
[](http://standardjs.com/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Use TypeScript for best in class instellisense.
|
Use TypeScript for best in class instellisense.
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
For further information read the linked docs at the top of this README.
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
> 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)
|
||||||
|
|
||||||
[](https://umbrella.zone)
|
[](https://umbrella.zone)
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
# smartacme
|
# smartacme
|
||||||
|
|
||||||
acme implementation in TypeScript
|
acme implementation in TypeScript
|
||||||
|
|
||||||
## Availabililty
|
## Availabililty
|
||||||
|
|
||||||
[](https://www.npmjs.com/package/smartacme)
|
[](https://www.npmjs.com/package/smartacme)
|
||||||
[](https://GitLab.com/umbrellazone/smartacme)
|
[](https://GitLab.com/umbrellazone/smartacme)
|
||||||
[](https://github.com/umbrellazone/smartacme)
|
[](https://github.com/umbrellazone/smartacme)
|
||||||
[](https://umbrellazone.gitlab.io/smartacme/)
|
[](https://umbrellazone.gitlab.io/smartacme/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
|
|
||||||
[](https://GitLab.com/umbrellazone/smartacme/commits/master)
|
[](https://GitLab.com/umbrellazone/smartacme/commits/master)
|
||||||
[](https://GitLab.com/umbrellazone/smartacme/commits/master)
|
[](https://GitLab.com/umbrellazone/smartacme/commits/master)
|
||||||
[](https://www.npmjs.com/package/smartacme)
|
[](https://www.npmjs.com/package/smartacme)
|
||||||
@ -19,41 +22,42 @@ acme implementation in TypeScript
|
|||||||
[](http://standardjs.com/)
|
[](http://standardjs.com/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Use TypeScript for best in class instellisense.
|
Use TypeScript for best in class instellisense.
|
||||||
|
|
||||||
```javascript
|
```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
|
// optionally accepts a filePath Arg with a stored acmeaccount.json
|
||||||
// will create an account and
|
// will create an account and
|
||||||
let myAccount = await smac.createAcmeAccount()
|
let myAccount = await smac.createAcmeAccount();
|
||||||
|
|
||||||
// will return a dnsHash to set in your DNS record
|
// will return a dnsHash to set in your DNS record
|
||||||
let myCert = await myAccount.createAcmeCert('example.com')
|
let myCert = await myAccount.createAcmeCert('example.com');
|
||||||
|
|
||||||
// gets and accepts the specified challenge
|
// gets and accepts the specified challenge
|
||||||
// first argument optional, defaults to dns-01 (which is the cleanest method for production use)
|
// first argument optional, defaults to dns-01 (which is the cleanest method for production use)
|
||||||
let myChallenge = await myCert.getChallenge('dns-01')
|
let myChallenge = await myCert.getChallenge('dns-01');
|
||||||
|
|
||||||
/* ----------
|
/* ----------
|
||||||
Now you need to set the challenge in your DNS
|
Now you need to set the challenge in your DNS
|
||||||
myChallenge.domainNamePrefixed is the address for the record
|
myChallenge.domainNamePrefixed is the address for the record
|
||||||
myChallenge.dnsKeyHash is the ready to use txt record value expected by letsencrypt
|
myChallenge.dnsKeyHash is the ready to use txt record value expected by letsencrypt
|
||||||
-------------*/
|
-------------*/
|
||||||
})()
|
})();
|
||||||
```
|
```
|
||||||
|
|
||||||
## Other relevant npm modules
|
## Other relevant npm modules
|
||||||
module name | description
|
|
||||||
--- | ---
|
| 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
|
| 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)
|
> 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)
|
||||||
|
|
||||||
[](https://umbrella.zone
|
[](https://umbrella.zone
|
@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
"npmci": {
|
"npmci": {
|
||||||
"globalNpmTools": [
|
"npmGlobalTools": [],
|
||||||
"npmts"
|
"npmAccessLevel": "public"
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
63
package-lock.json
generated
63
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "smartacme",
|
"name": "@pushrocks/smartacme",
|
||||||
"version": "1.1.1",
|
"version": "2.0.3",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -45,12 +45,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@gitzone/tstest": {
|
"@gitzone/tstest": {
|
||||||
"version": "1.0.13",
|
"version": "1.0.15",
|
||||||
"resolved": "https://registry.npmjs.org/@gitzone/tstest/-/tstest-1.0.13.tgz",
|
"resolved": "https://registry.npmjs.org/@gitzone/tstest/-/tstest-1.0.15.tgz",
|
||||||
"integrity": "sha512-nEdT3YJHrpkUVpum75n/ZU5voCjd7Fvq8gqbf47oaPC6r2LbqUhc6PnKo/YYaQLgXAaBtCTxFLZMUlWDg5fguw==",
|
"integrity": "sha512-+t5fvYK4a0JkwwH0Fokh5aOxVzrax5OjDUL4zmhBk7KFmXt7fdvcqsSNaEp9iyqC52dLiDybdAXqHYZypXTIYw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@gitzone/tsrun": "^1.1.11",
|
"@gitzone/tsrun": "^1.1.12",
|
||||||
"@pushrocks/consolecolor": "^2.0.1",
|
"@pushrocks/consolecolor": "^2.0.1",
|
||||||
"@pushrocks/smartfile": "^6.0.6",
|
"@pushrocks/smartfile": "^6.0.6",
|
||||||
"@pushrocks/smartlog": "^2.0.1",
|
"@pushrocks/smartlog": "^2.0.1",
|
||||||
@ -197,9 +197,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "10.5.8",
|
"version": "10.11.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.8.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.11.4.tgz",
|
||||||
"integrity": "sha512-sWSjw+bYW/2W+1V3m8tVsm9PKJcxk3NHN7oRqNUfEdofKg0Imbdu1dQbFvLKjZQXEDXRN6IfSMACjJ7Wv4NGCQ==",
|
"integrity": "sha512-ojnbBiKkZFYRfQpmtnnWTMw+rzGp/JiystjluW9jgN3VzRwilXddJ6aGQ9V/7iuDG06SBgn7ozW9k3zcAnYjYQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@types/vinyl": {
|
"@types/vinyl": {
|
||||||
@ -218,12 +218,12 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"acme-v2": {
|
"acme-v2": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/acme-v2/-/acme-v2-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/acme-v2/-/acme-v2-1.2.1.tgz",
|
||||||
"integrity": "sha512-3H86vhNJAc7x1TKk+6zfMNbxDSD20RsF3jM1Uf5x7NkgjU8nAwvzJ2W3kcyuivFKB8BntCcTIC8KtZKqF8eSBw==",
|
"integrity": "sha512-7FRl/vgZpcm7VCOiiAU6ntkclHkkEdCk1uNAkuEA0sZ8R0YX3pBjh066y/QqzEAfmDbbiYr+DYlVhZoHTbmXEQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@coolaj86/urequest": "^1.1.1",
|
"@coolaj86/urequest": "^1.3.6",
|
||||||
"rsa-compat": "^1.3.0"
|
"rsa-compat": "^1.5.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ansi-256-colors": {
|
"ansi-256-colors": {
|
||||||
@ -303,8 +303,7 @@
|
|||||||
"bindings": {
|
"bindings": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz",
|
||||||
"integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw==",
|
"integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
@ -731,8 +730,7 @@
|
|||||||
"isexe": {
|
"isexe": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
|
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"js-base64": {
|
"js-base64": {
|
||||||
"version": "2.4.8",
|
"version": "2.4.8",
|
||||||
@ -855,13 +853,12 @@
|
|||||||
"nan": {
|
"nan": {
|
||||||
"version": "2.10.0",
|
"version": "2.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
|
"resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
|
||||||
"integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==",
|
"integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"node-forge": {
|
"node-forge": {
|
||||||
"version": "0.6.49",
|
"version": "0.7.6",
|
||||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.6.49.tgz",
|
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.6.tgz",
|
||||||
"integrity": "sha1-8e6V1ddGI5OP4Z1piqWibVTS9g8="
|
"integrity": "sha512-sol30LUpz1jQFBjOKwbjxijiE3b6pjd74YwfD0fJOKPjF+fONKb2Yg8rYgS6+bK6VDl+/wfr4IYpC7jDzLUIfw=="
|
||||||
},
|
},
|
||||||
"normalize-newline": {
|
"normalize-newline": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
@ -1006,11 +1003,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rsa-compat": {
|
"rsa-compat": {
|
||||||
"version": "1.5.1",
|
"version": "1.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/rsa-compat/-/rsa-compat-1.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/rsa-compat/-/rsa-compat-1.6.0.tgz",
|
||||||
"integrity": "sha512-IPGhsT5HM501z49trBPT5ePrNcO3F3Gy9yCdd6H38VHLHNJqBxWdKyQasFjLhfQ5RYAmkJAkb8NnkuNgCC/zCg==",
|
"integrity": "sha512-Eoqx0e9mcVpRQZ9IaVhZ0Su0WZ9CN6XKC1qWoyvueEloq2+kApZqmtueva/SHEo1mmB80sowZsyWU7TFcCvlzg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"node-forge": "^0.6.41"
|
"node-forge": "^0.7.6",
|
||||||
|
"ursa-optional": "^0.9.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"safe-buffer": {
|
"safe-buffer": {
|
||||||
@ -1316,6 +1314,16 @@
|
|||||||
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
|
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
|
||||||
"dev": true
|
"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": {
|
"util-deprecate": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||||
@ -1363,7 +1371,6 @@
|
|||||||
"version": "1.3.1",
|
"version": "1.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||||
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
|
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"isexe": "^2.0.0"
|
"isexe": "^2.0.0"
|
||||||
}
|
}
|
||||||
|
16
package.json
16
package.json
@ -1,11 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "smartacme",
|
"name": "@pushrocks/smartacme",
|
||||||
"version": "1.1.1",
|
"version": "2.0.3",
|
||||||
|
"private": false,
|
||||||
"description": "acme implementation in TypeScript",
|
"description": "acme implementation in TypeScript",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)"
|
"test": "(tstest test/)",
|
||||||
|
"build": "(tsbuild)"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -25,14 +27,14 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartdelay": "^2.0.2",
|
"@pushrocks/smartdelay": "^2.0.2",
|
||||||
"@pushrocks/smartpromise": "^2.0.5",
|
"@pushrocks/smartpromise": "^2.0.5",
|
||||||
"acme-v2": "^1.2.0",
|
"acme-v2": "^1.2.1",
|
||||||
"rsa-compat": "^1.5.1"
|
"rsa-compat": "^1.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.0.22",
|
"@gitzone/tsbuild": "^2.0.22",
|
||||||
"@gitzone/tsrun": "^1.1.12",
|
"@gitzone/tsrun": "^1.1.12",
|
||||||
"@gitzone/tstest": "^1.0.13",
|
"@gitzone/tstest": "^1.0.15",
|
||||||
"@types/node": "^10.5.8",
|
"@types/node": "^10.11.4",
|
||||||
"cflare": "^1.0.5",
|
"cflare": "^1.0.5",
|
||||||
"qenv": "^1.1.7",
|
"qenv": "^1.1.7",
|
||||||
"tapbundle": "^2.0.2"
|
"tapbundle": "^2.0.2"
|
||||||
|
@ -4,11 +4,11 @@ import * as smartacme from '../ts/index';
|
|||||||
|
|
||||||
let smartAcmeInstance: smartacme.SmartAcme;
|
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();
|
smartAcmeInstance = new smartacme.SmartAcme();
|
||||||
await smartAcmeInstance.init()
|
await smartAcmeInstance.init();
|
||||||
console.log(smartAcmeInstance.directoryUrls);
|
console.log(smartAcmeInstance.directoryUrls);
|
||||||
await smartAcmeInstance.getCertificateForDomain('bleu.de');
|
await smartAcmeInstance.getCertificateForDomain('bleu.de');
|
||||||
})
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
@ -1 +1 @@
|
|||||||
export * from './smartacme.classes.smartacme'
|
export * from './smartacme.classes.smartacme';
|
||||||
|
@ -2,7 +2,7 @@ import * as plugins from './smartacme.plugins';
|
|||||||
const rsa = require('rsa-compat').RSA;
|
const rsa = require('rsa-compat').RSA;
|
||||||
|
|
||||||
export class KeyPair {
|
export class KeyPair {
|
||||||
rsaKeyPair: any
|
rsaKeyPair: any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* generates a fresh rsa keyPair
|
* generates a fresh rsa keyPair
|
||||||
@ -11,7 +11,7 @@ export class KeyPair {
|
|||||||
const done = plugins.smartpromise.defer();
|
const done = plugins.smartpromise.defer();
|
||||||
var options = { bitlen: 2048, exp: 65537, public: true, pem: true, internal: true };
|
var options = { bitlen: 2048, exp: 65537, public: true, pem: true, internal: true };
|
||||||
rsa.generateKeypair(options, function(err, keypair) {
|
rsa.generateKeypair(options, function(err, keypair) {
|
||||||
if(err) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
done.resolve(keypair);
|
done.resolve(keypair);
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
const acme = require('acme-v2').ACME.create({
|
const acme = require('acme-v2').ACME.create({
|
||||||
RSA: require('rsa-compat').RSA,
|
RSA: require('rsa-compat').RSA,
|
||||||
|
|
||||||
// other overrides
|
|
||||||
promisify: require('util').promisify,
|
|
||||||
|
|
||||||
// used for constructing user-agent
|
// used for constructing user-agent
|
||||||
os: require('os'),
|
os: require('os'),
|
||||||
process: require('process'),
|
process: require('process'),
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
import * as smartdelay from '@pushrocks/smartdelay';
|
import * as smartdelay from '@pushrocks/smartdelay';
|
||||||
|
|
||||||
export {
|
export { smartpromise, smartdelay };
|
||||||
smartpromise,
|
|
||||||
smartdelay
|
|
||||||
}
|
|
||||||
|
16
tslint.json
16
tslint.json
@ -1,3 +1,17 @@
|
|||||||
{
|
{
|
||||||
"extends": "tslint-config-standard"
|
"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"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user