Compare commits

...

10 Commits

Author SHA1 Message Date
b87ca1fa03 2.0.5 2018-08-11 15:10:28 +02:00
824f872fa5 fix(tests): update 2018-08-11 15:10:27 +02:00
80248c77d0 2.0.4 2018-08-11 15:09:19 +02:00
f592150646 fix(host handling): update 2018-08-11 15:09:19 +02:00
f24652936a 2.0.3 2018-08-11 00:29:16 +02:00
79af6c4a68 fix(CI): accessLevel 2018-08-11 00:29:16 +02:00
fafc757930 2.0.2 2018-08-11 00:25:20 +02:00
ead5e1a7bd fix(CI): now installing stufall alright 2018-08-11 00:25:20 +02:00
ad57be180a 2.0.1 2018-08-10 23:44:31 +02:00
7cc4ce02c9 fix(core): update 2018-08-10 23:44:31 +02:00
7 changed files with 41 additions and 9 deletions

View File

@ -1,4 +1,4 @@
image: hosttoday/ht-docker-node:npmts image: hosttoday/ht-docker-node:npmci
stages: stages:
- test - test
@ -10,11 +10,13 @@ before_script:
testSTABLE: testSTABLE:
stage: test stage: test
script: script:
- npmci npm install
- npmci npm test stable - npmci npm test stable
only: only:
- tags - tags
tags: tags:
- docker - docker
- notpriv
release: release:
stage: release stage: release

8
npmextra.json Normal file
View File

@ -0,0 +1,8 @@
{
"npmci": {
"npmAccessLevel": "public"
},
"npmdocker": {
}
}

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "smartnginx", "name": "smartnginx",
"version": "2.0.0", "version": "2.0.5",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,7 @@
{ {
"name": "@pushrocks/smartnginx", "name": "@pushrocks/smartnginx",
"version": "2.0.0", "version": "2.0.5",
"private": false,
"description": "control nginx from node, TypeScript ready", "description": "control nginx from node, TypeScript ready",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",
@ -35,6 +36,5 @@
"@gitzone/tstest": "^1.0.13", "@gitzone/tstest": "^1.0.13",
"@pushrocks/tapbundle": "^3.0.5", "@pushrocks/tapbundle": "^3.0.5",
"qenv": "^1.1.7" "qenv": "^1.1.7"
}, }
"private": true
} }

View File

@ -30,8 +30,8 @@ tap.test(`should produce an instance of NginxConfig`, async () => {
}); });
tap.test('.addZone() should add a zone to NginxConfig Object', async () => { tap.test('.addZone() should add a zone to NginxConfig Object', async () => {
testSmartNginx.addHost(testNginxZone01); testSmartNginx.addHost('test200.bleu.de', '192.192.192.191');
testSmartNginx.addHost(testNginxZone02); testSmartNginx.addHost('test201.blue.de', '192.192.192.191');
}); });
tap.test('.deploy() should deploy a config from an instance', async () => { tap.test('.deploy() should deploy a config from an instance', async () => {

View File

@ -1,5 +1,15 @@
import * as plugins from './smartnginx.plugins'; import * as plugins from './smartnginx.plugins';
export class CertHandler { export class CertHandler {
private _readyDeferred = plugins.smartpromise.defer();
certHandlerReady = this._readyDeferred.promise;
constructor() {} // nothing to do here for now
/**
* ensure a cert is at the right location
* @param hostName
*/
async ensureCertForHost(hostName) {
}
} }

View File

@ -26,10 +26,22 @@ export class SmartNginx {
* add a host * add a host
* @param nginxHostArg * @param nginxHostArg
*/ */
addHost(nginxHostArg: NginxHost) { addHost(hostNameArg: string, destinationIp: string): NginxHost {
this.hosts.push(nginxHostArg); const nginxHost = new NginxHost(this, {
hostName: hostNameArg,
destination: destinationIp
})
this.hosts.push(nginxHost);
return nginxHost;
} }
getNginxHostByHostName(hostNameArg: string): NginxHost {
return this.hosts.find(nginxHost => {
return nginxHost.hostName === hostNameArg;
})
}
/** /**
* listHosts * listHosts
*/ */