Compare commits

...

8 Commits

Author SHA1 Message Date
5c4d5a4a85 2.0.49 2019-08-20 22:28:48 +02:00
1be3f7f388 fix(core): update 2019-08-20 22:28:48 +02:00
8c2aa23406 2.0.48 2019-08-14 13:06:05 +02:00
d2d4ad70ce fix(core): update 2019-08-14 13:06:04 +02:00
e3817f92c7 2.0.47 2019-04-11 02:01:45 +02:00
159c043ba6 fix(core): update 2019-04-11 02:01:44 +02:00
fbdb98c355 2.0.46 2019-04-11 01:42:49 +02:00
b81dc319e2 fix(core): update 2019-04-11 01:42:48 +02:00
4 changed files with 17 additions and 8 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartnginx", "name": "@pushrocks/smartnginx",
"version": "2.0.45", "version": "2.0.49",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartnginx", "name": "@pushrocks/smartnginx",
"version": "2.0.45", "version": "2.0.49",
"private": false, "private": false,
"description": "control nginx from node, TypeScript ready", "description": "control nginx from node, TypeScript ready",
"main": "dist/index.js", "main": "dist/index.js",

View File

@ -119,11 +119,11 @@ export class SmartNginx {
// write standard self signed certificate // write standard self signed certificate
const selfsignedCert = plugins.selfsigned.generate([{ name: 'commonName', value: 'selfsigned.git.zone' }], { days: 365}); const selfsignedCert = plugins.selfsigned.generate([{ name: 'commonName', value: 'selfsigned.git.zone' }], { days: 365});
plugins.smartfile.memory.toFsSync(selfsignedCert.private, plugins.path.join(paths.nginxHostDirPath, './default.private.pem'));
plugins.smartfile.memory.toFsSync(selfsignedCert.public, plugins.path.join(paths.nginxHostDirPath, './default.public.pem'));
// deploy hosts // deploy hosts
plugins.smartfile.fs.ensureEmptyDirSync(paths.nginxHostDirPath); plugins.smartfile.fs.ensureDirSync(paths.nginxHostDirPath);
plugins.smartfile.memory.toFsSync(selfsignedCert.private, plugins.path.join(paths.nginxHostDirPath, './default.private.pem'));
plugins.smartfile.memory.toFsSync(selfsignedCert.cert, plugins.path.join(paths.nginxHostDirPath, './default.public.pem'));
for (const host of this.deployedHosts.getArray()) { for (const host of this.deployedHosts.getArray()) {
await host.deploy(); await host.deploy();
this.logger.log('info', `Host ${host.hostName} deployed!`); this.logger.log('info', `Host ${host.hostName} deployed!`);
@ -134,4 +134,13 @@ export class SmartNginx {
this.hostCandidates.wipe(); this.hostCandidates.wipe();
} }
} }
/**
* stops the smartnginx instance
*/
public async stop() {
if (this.nginxProcess) {
await this.nginxProcess.stop();
}
}
} }

View File

@ -66,7 +66,7 @@ export let getBaseConfigString = (defaultProxy: string) => {
server { server {
listen *:80 default_server; listen *:80 default_server;
server_name selfsigned.git.zone; server_name selfsigned.git.zone;
rewrite ^ ${defaultProxy} permanent; rewrite ^ ${defaultProxy} redirect;
} }
server { server {
@ -74,7 +74,7 @@ export let getBaseConfigString = (defaultProxy: string) => {
server_name selfsigned.git.zone; server_name selfsigned.git.zone;
ssl_certificate ${paths.nginxHostDirPath}/default.public.pem; ssl_certificate ${paths.nginxHostDirPath}/default.public.pem;
ssl_certificate_key ${paths.nginxHostDirPath}/default.private.pem; ssl_certificate_key ${paths.nginxHostDirPath}/default.private.pem;
rewrite ^ ${defaultProxy} permanent; rewrite ^ ${defaultProxy} redirect;
} }
include ${paths.nginxHostDirPath}/*.conf; include ${paths.nginxHostDirPath}/*.conf;