33 lines
2.7 KiB
JavaScript
33 lines
2.7 KiB
JavaScript
"use strict";
|
|
var plugins = require("./smartnginx.plugins");
|
|
var paths = require("./smartnginx.paths");
|
|
var snippets = require("./smartnginx.snippets");
|
|
(function (zoneTypes) {
|
|
zoneTypes[zoneTypes["reverseProxy"] = 0] = "reverseProxy";
|
|
zoneTypes[zoneTypes["static"] = 1] = "static";
|
|
})(exports.zoneTypes || (exports.zoneTypes = {}));
|
|
var zoneTypes = exports.zoneTypes;
|
|
var NginxZone = (function () {
|
|
function NginxZone(optionsArg) {
|
|
this.zoneName = optionsArg.zoneName;
|
|
this.type = optionsArg.type;
|
|
this.destination = optionsArg.destination;
|
|
this.configString = snippets.getZoneConfigString(optionsArg.zoneName, optionsArg.destination);
|
|
}
|
|
;
|
|
NginxZone.prototype.deploy = function (certInstanceArg) {
|
|
var done = plugins.q.defer();
|
|
var filePath = plugins.path.join(paths.nginxZoneBase, this.zoneName + ".conf");
|
|
// writeConfig
|
|
plugins.smartfile.memory.toFsSync(this.configString, filePath);
|
|
// get cert
|
|
certInstanceArg.getDomainCert(this.zoneName)
|
|
.then(done.resolve);
|
|
return done.promise;
|
|
};
|
|
;
|
|
return NginxZone;
|
|
}());
|
|
exports.NginxZone = NginxZone;
|
|
;
|
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRuZ2lueC5jbGFzc2VzLm5naW54em9uZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0bmdpbnguY2xhc3Nlcy5uZ2lueHpvbmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVksT0FBTyxXQUFNLHNCQUFzQixDQUFDLENBQUE7QUFDaEQsSUFBWSxLQUFLLFdBQU0sb0JBQW9CLENBQUMsQ0FBQTtBQUU1QyxJQUFZLFFBQVEsV0FBTSx1QkFDMUIsQ0FBQyxDQURnRDtBQUNqRCxXQUFZL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