@bprotsyk/aso-core 2.0.15 → 2.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,5 +25,5 @@ export declare class ServerUtil {
25
25
  refresh(): Promise<boolean>;
26
26
  deployLandingPage(host: string, username: string, password: string, remotePath: string, files: any): Promise<void>;
27
27
  generateNginxConfig(domain: string, rootPath: string): Promise<string>;
28
- serverConect(IP: string): Promise<string>;
28
+ serverConect(IP: string): Promise<boolean>;
29
29
  }
@@ -195,11 +195,11 @@ class ServerUtil {
195
195
  username: 'root',
196
196
  password: 'A0a693E4CrK6tdvSlE',
197
197
  });
198
- return `Successfully connected to ${IP}`;
198
+ return true;
199
199
  }
200
200
  catch (error) {
201
201
  console.error(`Failed to connect to ${IP}:`, error);
202
- return `Failed to connect to ${IP}`;
202
+ return false;
203
203
  }
204
204
  }
205
205
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bprotsyk/aso-core",
3
- "version": "2.0.15",
3
+ "version": "2.0.17",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "scripts": {
@@ -18,7 +18,6 @@ export interface IDomain extends Document {
18
18
  originalDNSHost: string | null
19
19
  createdAt: number
20
20
  expiresAt: number
21
-
22
21
  ip: string
23
22
  subdomain: string | null
24
23
  txtRecords: string[]
@@ -0,0 +1,35 @@
1
+ server {
2
+ server_name {{domain}};
3
+ listen 80;
4
+
5
+ return 301 https://{{domain}}$request_uri;
6
+ }
7
+
8
+ server {
9
+ listen 443 ssl;
10
+
11
+ ssl_certificate "/etc/letsencrypt/live/{{domain}}/fullchain.pem";
12
+ ssl_certificate_key "/etc/letsencrypt/live/{{domain}}/privkey.pem";
13
+ ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
14
+ ssl_prefer_server_ciphers on;
15
+ ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
16
+ add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
17
+ ssl_stapling on;
18
+
19
+ error_log /var/log/nginx/{{domain}}.error.log error;
20
+
21
+ root {{rootPath}}{{domain}};
22
+ error_page 404 /policy/index.html;
23
+
24
+ server_name www.{{domain}} {{domain}};
25
+
26
+ location / {
27
+ root {{rootPath}}{{domain}};
28
+ add_header 'Access-Control-Allow-Origin' '*';
29
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
30
+ add_header 'Access-Control-Allow-Headers' 'Origin, Authorization, Accept, Content-Type, X-Requested-With';
31
+ if ($request_method = 'OPTIONS') {
32
+ return 204;
33
+ }
34
+ }
35
+ }
@@ -224,7 +224,7 @@ export class ServerUtil {
224
224
  return config;
225
225
  }
226
226
 
227
- async serverConect(IP: string): Promise<string> {
227
+ async serverConect(IP: string): Promise<boolean> {
228
228
  if (!this.ssh) {
229
229
  this.ssh = new NodeSSH();
230
230
  }
@@ -237,10 +237,10 @@ export class ServerUtil {
237
237
  password: 'A0a693E4CrK6tdvSlE',
238
238
  });
239
239
 
240
- return `Successfully connected to ${IP}`;
240
+ return true;
241
241
  } catch (error) {
242
242
  console.error(`Failed to connect to ${IP}:`, error);
243
- return `Failed to connect to ${IP}`;
243
+ return false;
244
244
  }
245
245
  }
246
246