fix(host handling): update
This commit is contained in:
parent
f24652936a
commit
f592150646
@ -1,5 +1,8 @@
|
|||||||
{
|
{
|
||||||
"npmci": {
|
"npmci": {
|
||||||
"npmAccessLevel": "public"
|
"npmAccessLevel": "public"
|
||||||
|
},
|
||||||
|
"npmdocker": {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -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) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user