@bprotsyk/aso-core 2.0.15 → 2.0.18
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.
- package/lib/general/namecheap-domain.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/utils/server-util.d.ts +1 -1
- package/lib/utils/server-util.js +2 -2
- package/package.json +1 -1
- package/src/general/domain.ts +0 -1
- package/src/general/namecheap-domain.ts +1 -1
- package/src/index.ts +1 -1
- package/src/templetes/nginx-template.conf +35 -0
- package/src/utils/server-util.ts +3 -3
package/lib/index.d.ts
CHANGED
|
@@ -22,5 +22,5 @@ export { IKeitaroOffer } from "./keitaro/keitaro-offer";
|
|
|
22
22
|
export { IKeitaroStream } from "./keitaro/keitaro-stream";
|
|
23
23
|
export { ICloudflareDomainStatus, ICloudflareDomainType, ICloudflareDomain } from "./general/cloudflare-domain";
|
|
24
24
|
export { IDomain, IDomainSetupResult, DomainStatus, DomainTarget, CONST_CLOUFLARE_STATUS_READY, IDomainsBuyRequestResponse, getDomainTargetByIp } from "./general/domain";
|
|
25
|
-
export { INamecheapDomain, INamecheapBuyRequest, INamecheapContactInfo, NamecheapBuyRequestSchema, INamecheapGetDomainsResult,
|
|
25
|
+
export { INamecheapDomain, INamecheapBuyRequest, INamecheapContactInfo, NamecheapBuyRequestSchema, INamecheapGetDomainsResult, INamecheapBuyResult } from "./general/namecheap-domain";
|
|
26
26
|
export { ServerUtil } from "./utils/server-util";
|
|
@@ -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<
|
|
28
|
+
serverConect(IP: string): Promise<boolean>;
|
|
29
29
|
}
|
package/lib/utils/server-util.js
CHANGED
|
@@ -195,11 +195,11 @@ class ServerUtil {
|
|
|
195
195
|
username: 'root',
|
|
196
196
|
password: 'A0a693E4CrK6tdvSlE',
|
|
197
197
|
});
|
|
198
|
-
return
|
|
198
|
+
return true;
|
|
199
199
|
}
|
|
200
200
|
catch (error) {
|
|
201
201
|
console.error(`Failed to connect to ${IP}:`, error);
|
|
202
|
-
return
|
|
202
|
+
return false;
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
}
|
package/package.json
CHANGED
package/src/general/domain.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -29,5 +29,5 @@ export { IKeitaroStream } from "./keitaro/keitaro-stream"
|
|
|
29
29
|
|
|
30
30
|
export { ICloudflareDomainStatus, ICloudflareDomainType, ICloudflareDomain } from "./general/cloudflare-domain"
|
|
31
31
|
export { IDomain, IDomainSetupResult, DomainStatus, DomainTarget, CONST_CLOUFLARE_STATUS_READY, IDomainsBuyRequestResponse, getDomainTargetByIp } from "./general/domain"
|
|
32
|
-
export { INamecheapDomain, INamecheapBuyRequest, INamecheapContactInfo, NamecheapBuyRequestSchema, INamecheapGetDomainsResult,
|
|
32
|
+
export { INamecheapDomain, INamecheapBuyRequest, INamecheapContactInfo, NamecheapBuyRequestSchema, INamecheapGetDomainsResult, INamecheapBuyResult } from "./general/namecheap-domain"
|
|
33
33
|
export {ServerUtil} from "./utils/server-util";
|
|
@@ -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
|
+
}
|
package/src/utils/server-util.ts
CHANGED
|
@@ -224,7 +224,7 @@ export class ServerUtil {
|
|
|
224
224
|
return config;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
async serverConect(IP: string): Promise<
|
|
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
|
|
240
|
+
return true;
|
|
241
241
|
} catch (error) {
|
|
242
242
|
console.error(`Failed to connect to ${IP}:`, error);
|
|
243
|
-
return
|
|
243
|
+
return false;
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
|