@push.rocks/smartproxy 10.0.9 → 10.0.10
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/dist_ts/00_commitinfo_data.js +2 -2
- package/dist_ts/common/types.d.ts +1 -1
- package/dist_ts/networkproxy/classes.np.certificatemanager.js +1 -1
- package/dist_ts/networkproxy/classes.np.networkproxy.js +1 -1
- package/dist_ts/port80handler/classes.port80handler.js +2 -2
- package/dist_ts/smartproxy/classes.smartproxy.js +1 -1
- package/package.json +1 -1
- package/readme.md +2 -2
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/common/types.ts +1 -1
- package/ts/networkproxy/classes.np.certificatemanager.ts +1 -1
- package/ts/networkproxy/classes.np.networkproxy.ts +1 -1
- package/ts/port80handler/classes.port80handler.ts +2 -2
- package/ts/smartproxy/classes.smartproxy.ts +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartproxy',
|
|
6
|
-
version: '10.0.
|
|
6
|
+
version: '10.0.10',
|
|
7
7
|
description: 'A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, dynamic routing with authentication options, and automatic ACME certificate management.'
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFNBQVM7SUFDbEIsV0FBVyxFQUFFLG1PQUFtTztDQUNqUCxDQUFBIn0=
|
|
@@ -68,9 +68,9 @@ export interface IDomainForwardConfig {
|
|
|
68
68
|
* Unified ACME configuration options used across proxies and handlers
|
|
69
69
|
*/
|
|
70
70
|
export interface IAcmeOptions {
|
|
71
|
+
accountEmail?: string;
|
|
71
72
|
enabled?: boolean;
|
|
72
73
|
port?: number;
|
|
73
|
-
contactEmail?: string;
|
|
74
74
|
useProduction?: boolean;
|
|
75
75
|
httpsRedirectPort?: number;
|
|
76
76
|
renewThresholdDays?: number;
|
|
@@ -312,7 +312,7 @@ export class CertificateManager {
|
|
|
312
312
|
// Build and configure Port80Handler
|
|
313
313
|
this.port80Handler = buildPort80Handler({
|
|
314
314
|
port: this.options.acme.port,
|
|
315
|
-
|
|
315
|
+
accountEmail: this.options.acme.accountEmail,
|
|
316
316
|
useProduction: this.options.acme.useProduction,
|
|
317
317
|
httpsRedirectPort: this.options.port, // Redirect to our HTTPS port
|
|
318
318
|
enabled: this.options.acme.enabled,
|
|
@@ -54,7 +54,7 @@ export class NetworkProxy {
|
|
|
54
54
|
acme: {
|
|
55
55
|
enabled: optionsArg.acme?.enabled || false,
|
|
56
56
|
port: optionsArg.acme?.port || 80,
|
|
57
|
-
|
|
57
|
+
accountEmail: optionsArg.acme?.accountEmail || 'admin@example.com',
|
|
58
58
|
useProduction: optionsArg.acme?.useProduction || false, // Default to staging for safety
|
|
59
59
|
renewThresholdDays: optionsArg.acme?.renewThresholdDays || 30,
|
|
60
60
|
autoRenew: optionsArg.acme?.autoRenew !== false, // Default to true
|
|
@@ -67,7 +67,7 @@ export class Port80Handler extends plugins.EventEmitter {
|
|
|
67
67
|
// Default options
|
|
68
68
|
this.options = {
|
|
69
69
|
port: options.port ?? 80,
|
|
70
|
-
|
|
70
|
+
accountEmail: options.accountEmail ?? 'admin@example.com',
|
|
71
71
|
useProduction: options.useProduction ?? false, // Safer default: staging
|
|
72
72
|
httpsRedirectPort: options.httpsRedirectPort ?? 443,
|
|
73
73
|
enabled: options.enabled ?? true, // Enable by default
|
|
@@ -97,7 +97,7 @@ export class Port80Handler extends plugins.EventEmitter {
|
|
|
97
97
|
// Initialize SmartAcme for ACME challenge management (diskless HTTP handler)
|
|
98
98
|
if (this.options.enabled) {
|
|
99
99
|
this.smartAcme = new plugins.smartacme.SmartAcme({
|
|
100
|
-
accountEmail: this.options.
|
|
100
|
+
accountEmail: this.options.accountEmail,
|
|
101
101
|
certManager: new plugins.smartacme.MemoryCertManager(),
|
|
102
102
|
environment: this.options.useProduction ? 'production' : 'integration',
|
|
103
103
|
challengeHandlers: [new DisklessHttp01Handler(this.acmeHttp01Storage)],
|
|
@@ -55,7 +55,7 @@ export class SmartProxy extends plugins.EventEmitter {
|
|
|
55
55
|
this.settings.acme = {
|
|
56
56
|
enabled: false,
|
|
57
57
|
port: 80,
|
|
58
|
-
|
|
58
|
+
accountEmail: 'admin@example.com',
|
|
59
59
|
useProduction: false,
|
|
60
60
|
renewThresholdDays: 30,
|
|
61
61
|
autoRenew: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@push.rocks/smartproxy",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, dynamic routing with authentication options, and automatic ACME certificate management.",
|
|
6
6
|
"main": "dist_ts/index.js",
|
package/readme.md
CHANGED
|
@@ -384,7 +384,7 @@ Listen for certificate events via EventEmitter:
|
|
|
384
384
|
- **SmartProxy**:
|
|
385
385
|
- `certificate` (domain, publicKey, privateKey, expiryDate, source, isRenewal)
|
|
386
386
|
|
|
387
|
-
Provide a `
|
|
387
|
+
Provide a `certProvisionFunction(domain)` in SmartProxy settings to supply static certs or return `'http01'`.
|
|
388
388
|
|
|
389
389
|
## Configuration Options
|
|
390
390
|
|
|
@@ -429,7 +429,7 @@ Provide a `certProviderFunction(domain)` in SmartProxy settings to supply static
|
|
|
429
429
|
- `sniEnabled`, `defaultAllowedIPs`, `preserveSourceIP` (booleans)
|
|
430
430
|
- Timeouts: `initialDataTimeout`, `socketTimeout`, `inactivityTimeout`, etc.
|
|
431
431
|
- Socket opts: `noDelay`, `keepAlive`, `enableKeepAliveProbes`
|
|
432
|
-
- `acme` (IAcmeOptions), `
|
|
432
|
+
- `acme` (IAcmeOptions), `certProvisionFunction` (callback)
|
|
433
433
|
- `useNetworkProxy` (number[]), `networkProxyPort` (number)
|
|
434
434
|
|
|
435
435
|
## Troubleshooting
|
package/ts/00_commitinfo_data.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartproxy',
|
|
6
|
-
version: '10.0.
|
|
6
|
+
version: '10.0.10',
|
|
7
7
|
description: 'A powerful proxy package that effectively handles high traffic, with features such as SSL/TLS support, port proxying, WebSocket handling, dynamic routing with authentication options, and automatic ACME certificate management.'
|
|
8
8
|
}
|
package/ts/common/types.ts
CHANGED
|
@@ -77,9 +77,9 @@ export interface IDomainForwardConfig {
|
|
|
77
77
|
* Unified ACME configuration options used across proxies and handlers
|
|
78
78
|
*/
|
|
79
79
|
export interface IAcmeOptions {
|
|
80
|
+
accountEmail?: string; // Email for Let's Encrypt account
|
|
80
81
|
enabled?: boolean; // Whether ACME is enabled
|
|
81
82
|
port?: number; // Port to listen on for ACME challenges (default: 80)
|
|
82
|
-
contactEmail?: string; // Email for Let's Encrypt account
|
|
83
83
|
useProduction?: boolean; // Use production environment (default: staging)
|
|
84
84
|
httpsRedirectPort?: number; // Port to redirect HTTP requests to HTTPS (default: 443)
|
|
85
85
|
renewThresholdDays?: number; // Days before expiry to renew certificates
|
|
@@ -357,7 +357,7 @@ export class CertificateManager {
|
|
|
357
357
|
// Build and configure Port80Handler
|
|
358
358
|
this.port80Handler = buildPort80Handler({
|
|
359
359
|
port: this.options.acme.port,
|
|
360
|
-
|
|
360
|
+
accountEmail: this.options.acme.accountEmail,
|
|
361
361
|
useProduction: this.options.acme.useProduction,
|
|
362
362
|
httpsRedirectPort: this.options.port, // Redirect to our HTTPS port
|
|
363
363
|
enabled: this.options.acme.enabled,
|
|
@@ -76,7 +76,7 @@ export class NetworkProxy implements IMetricsTracker {
|
|
|
76
76
|
acme: {
|
|
77
77
|
enabled: optionsArg.acme?.enabled || false,
|
|
78
78
|
port: optionsArg.acme?.port || 80,
|
|
79
|
-
|
|
79
|
+
accountEmail: optionsArg.acme?.accountEmail || 'admin@example.com',
|
|
80
80
|
useProduction: optionsArg.acme?.useProduction || false, // Default to staging for safety
|
|
81
81
|
renewThresholdDays: optionsArg.acme?.renewThresholdDays || 30,
|
|
82
82
|
autoRenew: optionsArg.acme?.autoRenew !== false, // Default to true
|
|
@@ -101,7 +101,7 @@ export class Port80Handler extends plugins.EventEmitter {
|
|
|
101
101
|
// Default options
|
|
102
102
|
this.options = {
|
|
103
103
|
port: options.port ?? 80,
|
|
104
|
-
|
|
104
|
+
accountEmail: options.accountEmail ?? 'admin@example.com',
|
|
105
105
|
useProduction: options.useProduction ?? false, // Safer default: staging
|
|
106
106
|
httpsRedirectPort: options.httpsRedirectPort ?? 443,
|
|
107
107
|
enabled: options.enabled ?? true, // Enable by default
|
|
@@ -134,7 +134,7 @@ export class Port80Handler extends plugins.EventEmitter {
|
|
|
134
134
|
// Initialize SmartAcme for ACME challenge management (diskless HTTP handler)
|
|
135
135
|
if (this.options.enabled) {
|
|
136
136
|
this.smartAcme = new plugins.smartacme.SmartAcme({
|
|
137
|
-
accountEmail: this.options.
|
|
137
|
+
accountEmail: this.options.accountEmail,
|
|
138
138
|
certManager: new plugins.smartacme.MemoryCertManager(),
|
|
139
139
|
environment: this.options.useProduction ? 'production' : 'integration',
|
|
140
140
|
challengeHandlers: [ new DisklessHttp01Handler(this.acmeHttp01Storage) ],
|
|
@@ -78,7 +78,7 @@ export class SmartProxy extends plugins.EventEmitter {
|
|
|
78
78
|
this.settings.acme = {
|
|
79
79
|
enabled: false,
|
|
80
80
|
port: 80,
|
|
81
|
-
|
|
81
|
+
accountEmail: 'admin@example.com',
|
|
82
82
|
useProduction: false,
|
|
83
83
|
renewThresholdDays: 30,
|
|
84
84
|
autoRenew: true,
|