diff --git a/changelog.md b/changelog.md index 99031f8..4a0b648 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2025-05-05 - 10.0.10 - fix(docs) +Update README: rename certProviderFunction to certProvisionFunction in configuration options for consistency. + +- Replaced 'certProviderFunction' with 'certProvisionFunction' in the docs to reflect the updated API. +- Ensured all references in the readme are consistent with the new naming convention. + ## 2025-05-05 - 10.0.9 - fix(documentation) Update documentation to use 'certProviderFunction' instead of 'certProvider' in SmartProxy settings. diff --git a/readme.md b/readme.md index 252f1ef..6dbdac3 100644 --- a/readme.md +++ b/readme.md @@ -384,7 +384,7 @@ Listen for certificate events via EventEmitter: - **SmartProxy**: - `certificate` (domain, publicKey, privateKey, expiryDate, source, isRenewal) -Provide a `certProviderFunction(domain)` in SmartProxy settings to supply static certs or return `'http01'`. +Provide a `certProvisionFunction(domain)` in SmartProxy settings to supply static certs or return `'http01'`. ## Configuration Options @@ -429,7 +429,7 @@ Provide a `certProviderFunction(domain)` in SmartProxy settings to supply static - `sniEnabled`, `defaultAllowedIPs`, `preserveSourceIP` (booleans) - Timeouts: `initialDataTimeout`, `socketTimeout`, `inactivityTimeout`, etc. - Socket opts: `noDelay`, `keepAlive`, `enableKeepAliveProbes` -- `acme` (IAcmeOptions), `certProviderFunction` (callback) +- `acme` (IAcmeOptions), `certProvisionFunction` (callback) - `useNetworkProxy` (number[]), `networkProxyPort` (number) ## Troubleshooting diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 6b7ab60..131f1c1 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartproxy', - version: '10.0.9', + version: '10.0.10', 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.' } diff --git a/ts/common/types.ts b/ts/common/types.ts index a0937a1..e04febd 100644 --- a/ts/common/types.ts +++ b/ts/common/types.ts @@ -77,9 +77,9 @@ export interface IDomainForwardConfig { * Unified ACME configuration options used across proxies and handlers */ export interface IAcmeOptions { + accountEmail?: string; // Email for Let's Encrypt account enabled?: boolean; // Whether ACME is enabled port?: number; // Port to listen on for ACME challenges (default: 80) - contactEmail?: string; // Email for Let's Encrypt account useProduction?: boolean; // Use production environment (default: staging) httpsRedirectPort?: number; // Port to redirect HTTP requests to HTTPS (default: 443) renewThresholdDays?: number; // Days before expiry to renew certificates diff --git a/ts/networkproxy/classes.np.certificatemanager.ts b/ts/networkproxy/classes.np.certificatemanager.ts index 9181b45..28c8ce0 100644 --- a/ts/networkproxy/classes.np.certificatemanager.ts +++ b/ts/networkproxy/classes.np.certificatemanager.ts @@ -357,7 +357,7 @@ export class CertificateManager { // Build and configure Port80Handler this.port80Handler = buildPort80Handler({ port: this.options.acme.port, - contactEmail: this.options.acme.contactEmail, + accountEmail: this.options.acme.accountEmail, useProduction: this.options.acme.useProduction, httpsRedirectPort: this.options.port, // Redirect to our HTTPS port enabled: this.options.acme.enabled, diff --git a/ts/networkproxy/classes.np.networkproxy.ts b/ts/networkproxy/classes.np.networkproxy.ts index f203157..5f6b003 100644 --- a/ts/networkproxy/classes.np.networkproxy.ts +++ b/ts/networkproxy/classes.np.networkproxy.ts @@ -76,7 +76,7 @@ export class NetworkProxy implements IMetricsTracker { acme: { enabled: optionsArg.acme?.enabled || false, port: optionsArg.acme?.port || 80, - contactEmail: optionsArg.acme?.contactEmail || 'admin@example.com', + accountEmail: optionsArg.acme?.accountEmail || 'admin@example.com', useProduction: optionsArg.acme?.useProduction || false, // Default to staging for safety renewThresholdDays: optionsArg.acme?.renewThresholdDays || 30, autoRenew: optionsArg.acme?.autoRenew !== false, // Default to true diff --git a/ts/port80handler/classes.port80handler.ts b/ts/port80handler/classes.port80handler.ts index 3f752ad..40893a7 100644 --- a/ts/port80handler/classes.port80handler.ts +++ b/ts/port80handler/classes.port80handler.ts @@ -101,7 +101,7 @@ export class Port80Handler extends plugins.EventEmitter { // Default options this.options = { port: options.port ?? 80, - contactEmail: options.contactEmail ?? 'admin@example.com', + accountEmail: options.accountEmail ?? 'admin@example.com', useProduction: options.useProduction ?? false, // Safer default: staging httpsRedirectPort: options.httpsRedirectPort ?? 443, enabled: options.enabled ?? true, // Enable by default @@ -134,7 +134,7 @@ export class Port80Handler extends plugins.EventEmitter { // Initialize SmartAcme for ACME challenge management (diskless HTTP handler) if (this.options.enabled) { this.smartAcme = new plugins.smartacme.SmartAcme({ - accountEmail: this.options.contactEmail, + accountEmail: this.options.accountEmail, certManager: new plugins.smartacme.MemoryCertManager(), environment: this.options.useProduction ? 'production' : 'integration', challengeHandlers: [ new DisklessHttp01Handler(this.acmeHttp01Storage) ], diff --git a/ts/smartproxy/classes.smartproxy.ts b/ts/smartproxy/classes.smartproxy.ts index c7f51d9..794a4d5 100644 --- a/ts/smartproxy/classes.smartproxy.ts +++ b/ts/smartproxy/classes.smartproxy.ts @@ -78,7 +78,7 @@ export class SmartProxy extends plugins.EventEmitter { this.settings.acme = { enabled: false, port: 80, - contactEmail: 'admin@example.com', + accountEmail: 'admin@example.com', useProduction: false, renewThresholdDays: 30, autoRenew: true,