fix(smartproxy): rename certProvider to certProvisionFunction in certificate provisioning interfaces and SmartProxy

This commit is contained in:
Philipp Kunz 2025-05-05 10:29:00 +00:00
parent 3502807023
commit 9b773608c7
4 changed files with 11 additions and 5 deletions

View File

@ -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

View File

@ -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.'
}

View File

@ -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<ISmartProxyCertProvisionObject>;
certProvisionFunction?: (domain: string) => Promise<ISmartProxyCertProvisionObject>;
}
/**

View File

@ -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}`);
}