@@ -115,7 +115,7 @@ export interface AccessUrl {
115115export class UrlResolverService {
116116 private readonly logger = new Logger ( UrlResolverService . name ) ;
117117
118- constructor ( private readonly configService : ConfigService < ConfigType > ) { }
118+ constructor ( private readonly configService : ConfigService < ConfigType , true > ) { }
119119
120120 /**
121121 * Constructs a URL from the given field parameters.
@@ -259,11 +259,7 @@ export class UrlResolverService {
259259 }
260260
261261 const { nginx } = store . emhttp ;
262- const {
263- config : {
264- remote : { wanport } ,
265- } ,
266- } = store ;
262+ const wanport = this . configService . getOrThrow ( 'connect.config.wanport' , { infer : true } ) ;
267263
268264 if ( ! nginx || Object . keys ( nginx ) . length === 0 ) {
269265 return { urls : [ ] , errors : [ new Error ( 'Nginx Not Loaded' ) ] } ;
@@ -359,17 +355,18 @@ export class UrlResolverService {
359355 const urlType = this . getUrlTypeFromFqdn ( fqdnUrl . interface ) ;
360356 const fqdnUrlToUse = this . getUrlForField ( {
361357 url : fqdnUrl . fqdn ,
362- portSsl : urlType === URL_TYPE . WAN ? Number ( wanport ) : nginx . httpsPort ,
358+ portSsl : Number ( wanport ?? nginx . httpsPort ) ,
363359 } ) ;
364360
365361 urls . push ( {
366362 name : `FQDN ${ fqdnUrl . interface } ${ fqdnUrl . id !== null ? ` ${ fqdnUrl . id } ` : '' } ` ,
367- type : this . getUrlTypeFromFqdn ( fqdnUrl . interface ) ,
363+ type : urlType ,
368364 ipv4 : fqdnUrlToUse ,
369365 } ) ;
370366 } catch ( error : unknown ) {
371367 if ( error instanceof Error ) {
372368 errors . push ( error ) ;
369+ this . logger . warn ( error ) ;
373370 } else {
374371 this . logger . warn ( 'Uncaught error in network resolver' , error ) ;
375372 }
0 commit comments