From 9b773608c788a1ee1d312da214ab79580a31e8f9 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Mon, 5 May 2025 10:29:00 +0000 Subject: [PATCH] fix(smartproxy): rename certProvider to certProvisionFunction in certificate provisioning interfaces and SmartProxy --- changelog.md | 6 ++++++ ts/00_commitinfo_data.ts | 2 +- ts/smartproxy/classes.pp.interfaces.ts | 2 +- ts/smartproxy/classes.smartproxy.ts | 6 +++--- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/changelog.md b/changelog.md index dfbdea6..ec3d337 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2025-05-05 - 10.0.8 - fix(smartproxy) +rename certProvider to certProvisionFunction in certificate provisioning interfaces and SmartProxy + +- In ts/smartproxy/classes.pp.interfaces.ts, renamed the optional property 'certProvider' to 'certProvisionFunction'. +- In ts/smartproxy/classes.smartproxy.ts, updated references from this.settings.certProvider to this.settings.certProvisionFunction. + ## 2025-05-04 - 10.0.7 - fix(core) refactor: Rename IPortProxySettings to ISmartProxyOptions in internal modules diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 741244e..6acf2e0 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.7', + version: '10.0.8', 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/smartproxy/classes.pp.interfaces.ts b/ts/smartproxy/classes.pp.interfaces.ts index 41bde1f..2c737a5 100644 --- a/ts/smartproxy/classes.pp.interfaces.ts +++ b/ts/smartproxy/classes.pp.interfaces.ts @@ -91,7 +91,7 @@ export interface ISmartProxyOptions { * Optional certificate provider callback. Return 'http01' to use HTTP-01 challenges, * or a static certificate object for immediate provisioning. */ - certProvider?: (domain: string) => Promise; + certProvisionFunction?: (domain: string) => Promise; } /** diff --git a/ts/smartproxy/classes.smartproxy.ts b/ts/smartproxy/classes.smartproxy.ts index 888a4e7..c7f51d9 100644 --- a/ts/smartproxy/classes.smartproxy.ts +++ b/ts/smartproxy/classes.smartproxy.ts @@ -165,7 +165,7 @@ export class SmartProxy extends plugins.EventEmitter { this.settings.domainConfigs, this.port80Handler, this.networkProxyBridge, - this.settings.certProvider, + this.settings.certProvisionFunction, acme.renewThresholdDays!, acme.renewCheckIntervalHours!, acme.autoRenew!, @@ -393,9 +393,9 @@ export class SmartProxy extends plugins.EventEmitter { for (const domain of domainConfig.domains) { if (domain.includes('*')) continue; let provision = 'http01' as string | plugins.tsclass.network.ICert; - if (this.settings.certProvider) { + if (this.settings.certProvisionFunction) { try { - provision = await this.settings.certProvider(domain); + provision = await this.settings.certProvisionFunction(domain); } catch (err) { console.log(`certProvider error for ${domain}: ${err}`); }