Skip to content

Commit d1ff3a7

Browse files
committed
Remove --ingress parameter
1 parent 44b1445 commit d1ff3a7

File tree

6 files changed

+48
-71
lines changed

6 files changed

+48
-71
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Advantages:
5656
### Breaking Changes
5757

5858
- [doorLock]: The default value for **DoorLock.actuatorEnabled** has been changed to true. Thanks Ludovic BOUÉ (https://github.com/Luligu/matterbridge/pull/509).
59+
- [ingress]: Removed `--ingress` parameter used in the old Home Assisant add-on. Update the Matterbridge add-on if you didn't.
5960

6061
### Added
6162

docs/dev_update.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"latest": "3.5.3",
3-
"latestDate": "2026-02-01",
4-
"dev": "3.5.3-dev-123456",
5-
"devDate": "2026-02-01",
2+
"latest": "3.5.4",
3+
"latestDate": "2026-02-13",
4+
"dev": "3.5.4-dev-123456",
5+
"devDate": "2026-02-13",
66
"latestMessage": "",
77
"latestMessageSeverity": "info",
88
"devMessage": "",

docs/main_update.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"latest": "3.5.3",
3-
"latestDate": "2026-02-01",
4-
"dev": "3.5.3-dev-123456",
5-
"devDate": "2026-02-01",
2+
"latest": "3.5.4",
3+
"latestDate": "2026-02-13",
4+
"dev": "3.5.4-dev-123456",
5+
"devDate": "2026-02-13",
66
"latestMessage": "",
77
"latestMessageSeverity": "info",
88
"devMessage": "",

packages/core/src/frontend.test.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ describe('Matterbridge frontend', () => {
665665
});
666666

667667
test('Frontend.start() with createServerMock', async () => {
668-
process.argv = ['node', 'frontend.test.js', '-ingress', '-novirtual', '-test', '-homedir', HOMEDIR, '-frontend', FRONTEND_PORT.toString(), '-port', MATTER_PORT.toString()];
668+
process.argv = ['node', 'frontend.test.js', '-novirtual', '-test', '-homedir', HOMEDIR, '-frontend', FRONTEND_PORT.toString(), '-port', MATTER_PORT.toString()];
669669

670670
createServerMock.mockImplementationOnce(() => {
671671
throw new Error('Test error');
@@ -685,8 +685,8 @@ describe('Matterbridge frontend', () => {
685685
expect(loggerLogSpy).toHaveBeenCalledWith(LogLevel.ERROR, `Failed to create HTTP server: Error: Test error`);
686686
});
687687

688-
test('Frontend.start() -ingress', async () => {
689-
process.argv = ['node', 'frontend.test.js', '-ingress', '-novirtual', '-test', '-homedir', HOMEDIR, '-frontend', FRONTEND_PORT.toString(), '-port', MATTER_PORT.toString()];
688+
test('Frontend.start()', async () => {
689+
process.argv = ['node', 'frontend.test.js', '-novirtual', '-test', '-homedir', HOMEDIR, '-frontend', FRONTEND_PORT.toString(), '-port', MATTER_PORT.toString()];
690690
frontend.start(FRONTEND_PORT);
691691
await new Promise<void>((resolve) => {
692692
frontend.once('server_listening', () => resolve());
@@ -697,12 +697,6 @@ describe('Matterbridge frontend', () => {
697697
expect((matterbridge as any).frontend.expressApp).toBeDefined();
698698
expect((matterbridge as any).frontend.webSocketServer).toBeDefined();
699699
expect(startSpy).toHaveBeenNthCalledWith(1, FRONTEND_PORT);
700-
expect(loggerLogSpy).toHaveBeenCalledWith(LogLevel.DEBUG, `Initializing the frontend http server on port ${YELLOW}${FRONTEND_PORT}${db}`);
701-
expect(loggerLogSpy).toHaveBeenCalledWith(
702-
LogLevel.INFO,
703-
expect.stringContaining(`The frontend http server is listening on ${UNDERLINE}http://0.0.0.0:${FRONTEND_PORT}${UNDERLINEOFF}${rs}`),
704-
);
705-
// expect(loggerLogSpy).toHaveBeenCalledWith(LogLevel.INFO, expect.stringContaining(`The WebSocketServer is listening`));
706700

707701
// Test httpServer on error
708702
const errorEACCES = new Error('Test error');
@@ -717,7 +711,7 @@ describe('Matterbridge frontend', () => {
717711
expect(loggerLogSpy).toHaveBeenCalledWith(LogLevel.ERROR, `Port ${FRONTEND_PORT} is already in use`);
718712
});
719713

720-
test('Frontend.stop() -ingress', async () => {
714+
test('Frontend.stop() II', async () => {
721715
// Stop the frontend
722716
await matterbridge.frontend.stop();
723717

packages/core/src/frontend.ts

Lines changed: 30 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -373,31 +373,21 @@ export class Frontend extends EventEmitter<FrontendEvents> {
373373
}
374374

375375
// Listen on the specified port
376-
if (hasParameter('ingress')) {
377-
// We limit to all ipv4 addresses when running in ingress mode (Home Assistant add-on)
378-
this.httpServer.listen(this.port, '0.0.0.0', () => {
379-
this.log.info(`The frontend http server is listening on ${UNDERLINE}http://0.0.0.0:${this.port}${UNDERLINEOFF}${rs}`);
380-
this.listening = true;
381-
this.emit('server_listening', 'http', this.port, '0.0.0.0');
382-
});
383-
} else {
384-
// We listen to all available addresses
385-
this.httpServer.listen(this.port, getParameter('bind'), () => {
386-
const addr = this.httpServer?.address();
387-
// istanbul ignore else
388-
if (addr && typeof addr !== 'string') {
389-
this.log.info(`The frontend http server is bound to ${addr.family} ${addr.address}:${addr.port}`);
390-
}
391-
// istanbul ignore else
392-
if (this.matterbridge.systemInformation.ipv4Address !== '' && !getParameter('bind'))
393-
this.log.info(`The frontend http server is listening on ${UNDERLINE}http://${this.matterbridge.systemInformation.ipv4Address}:${this.port}${UNDERLINEOFF}${rs}`);
394-
// istanbul ignore else
395-
if (this.matterbridge.systemInformation.ipv6Address !== '' && !getParameter('bind'))
396-
this.log.info(`The frontend http server is listening on ${UNDERLINE}http://[${this.matterbridge.systemInformation.ipv6Address}]:${this.port}${UNDERLINEOFF}${rs}`);
397-
this.listening = true;
398-
this.emit('server_listening', 'http', this.port);
399-
});
400-
}
376+
this.httpServer.listen(this.port, getParameter('bind'), () => {
377+
const addr = this.httpServer?.address();
378+
// istanbul ignore else
379+
if (addr && typeof addr !== 'string') {
380+
this.log.info(`The frontend http server is bound to ${addr.family} ${addr.address}:${addr.port}`);
381+
}
382+
// istanbul ignore else
383+
if (this.matterbridge.systemInformation.ipv4Address !== '' && !getParameter('bind'))
384+
this.log.info(`The frontend http server is listening on ${UNDERLINE}http://${this.matterbridge.systemInformation.ipv4Address}:${this.port}${UNDERLINEOFF}${rs}`);
385+
// istanbul ignore else
386+
if (this.matterbridge.systemInformation.ipv6Address !== '' && !getParameter('bind'))
387+
this.log.info(`The frontend http server is listening on ${UNDERLINE}http://[${this.matterbridge.systemInformation.ipv6Address}]:${this.port}${UNDERLINEOFF}${rs}`);
388+
this.listening = true;
389+
this.emit('server_listening', 'http', this.port);
390+
});
401391

402392
this.httpServer.on('upgrade', async (req, socket, head) => {
403393
try {
@@ -527,31 +517,21 @@ export class Frontend extends EventEmitter<FrontendEvents> {
527517
}
528518

529519
// Listen on the specified port
530-
if (hasParameter('ingress')) {
531-
// We limit to all ipv4 addresses when running in ingress mode (Home Assistant add-on)
532-
this.httpsServer.listen(this.port, '0.0.0.0', () => {
533-
this.log.info(`The frontend https server is listening on ${UNDERLINE}https://0.0.0.0:${this.port}${UNDERLINEOFF}${rs}`);
534-
this.listening = true;
535-
this.emit('server_listening', 'https', this.port, '0.0.0.0');
536-
});
537-
} else {
538-
// We listen to all available addresses
539-
this.httpsServer.listen(this.port, getParameter('bind'), () => {
540-
const addr = this.httpsServer?.address();
541-
// istanbul ignore else
542-
if (addr && typeof addr !== 'string') {
543-
this.log.info(`The frontend https server is bound to ${addr.family} ${addr.address}:${addr.port}`);
544-
}
545-
// istanbul ignore else
546-
if (this.matterbridge.systemInformation.ipv4Address !== '' && !getParameter('bind'))
547-
this.log.info(`The frontend https server is listening on ${UNDERLINE}https://${this.matterbridge.systemInformation.ipv4Address}:${this.port}${UNDERLINEOFF}${rs}`);
548-
// istanbul ignore else
549-
if (this.matterbridge.systemInformation.ipv6Address !== '' && !getParameter('bind'))
550-
this.log.info(`The frontend https server is listening on ${UNDERLINE}https://[${this.matterbridge.systemInformation.ipv6Address}]:${this.port}${UNDERLINEOFF}${rs}`);
551-
this.listening = true;
552-
this.emit('server_listening', 'https', this.port);
553-
});
554-
}
520+
this.httpsServer.listen(this.port, getParameter('bind'), () => {
521+
const addr = this.httpsServer?.address();
522+
// istanbul ignore else
523+
if (addr && typeof addr !== 'string') {
524+
this.log.info(`The frontend https server is bound to ${addr.family} ${addr.address}:${addr.port}`);
525+
}
526+
// istanbul ignore else
527+
if (this.matterbridge.systemInformation.ipv4Address !== '' && !getParameter('bind'))
528+
this.log.info(`The frontend https server is listening on ${UNDERLINE}https://${this.matterbridge.systemInformation.ipv4Address}:${this.port}${UNDERLINEOFF}${rs}`);
529+
// istanbul ignore else
530+
if (this.matterbridge.systemInformation.ipv6Address !== '' && !getParameter('bind'))
531+
this.log.info(`The frontend https server is listening on ${UNDERLINE}https://[${this.matterbridge.systemInformation.ipv6Address}]:${this.port}${UNDERLINEOFF}${rs}`);
532+
this.listening = true;
533+
this.emit('server_listening', 'https', this.port);
534+
});
555535

556536
this.httpsServer.on('upgrade', async (req, socket, head) => {
557537
try {

packages/core/src/jestutils/jestHelpers.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/*
2525
* This file contains the Jest helpers for testing the Matterbridge core package.
2626
*
27-
* 1) System Matterbridge with initialized Matterbridge instance:
27+
* 1) Matterbridge with initialized Matterbridge instance:
2828
*
2929
* beforeAll(async () => {
3030
* // Start matterbridge instance
@@ -457,19 +457,21 @@ export async function stopMatterbridge(cleanupPause: number = 10, destroyPause:
457457
* ```
458458
*/
459459
export async function createMatterbridgeEnvironment(name: string): Promise<Matterbridge> {
460+
// Create the exported log
461+
log = new AnsiLogger({ logName: name, logTimestampFormat: TimestampFormat.TIME_MILLIS, logLevel: LogLevel.DEBUG });
462+
460463
// Create a MatterbridgeEdge instance
461464
matterbridge = await Matterbridge.loadInstance(false);
462465
expect(matterbridge).toBeDefined();
463466
expect(matterbridge).toBeInstanceOf(Matterbridge);
464-
matterbridge.matterbridgeVersion = '3.5.3';
467+
matterbridge.matterbridgeVersion = '3.5.4';
465468
matterbridge.bridgeMode = 'bridge';
466469
matterbridge.rootDirectory = path.join('jest', name);
467470
matterbridge.homeDirectory = path.join('jest', name);
468471
matterbridge.matterbridgeDirectory = path.join('jest', name, '.matterbridge');
469472
matterbridge.matterbridgePluginDirectory = path.join('jest', name, 'Matterbridge');
470473
matterbridge.matterbridgeCertDirectory = path.join('jest', name, '.mattercert');
471474
matterbridge.log.logLevel = LogLevel.DEBUG;
472-
log = new AnsiLogger({ logName: name, logTimestampFormat: TimestampFormat.TIME_MILLIS, logLevel: LogLevel.DEBUG });
473475

474476
// Get the frontend, plugins and devices
475477
frontend = matterbridge.frontend;

0 commit comments

Comments
 (0)