Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/docker-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,15 @@ describe('docker-manager', () => {

expect(env.AWF_ENABLE_HOST_ACCESS).toBeUndefined();
});

it('should set AWF_ENABLE_HOST_ACCESS to 1 via safety net when allowHostServicePorts is set without enableHostAccess', () => {
const config = { ...mockConfig, allowHostServicePorts: '5432,6379' };
const result = generateDockerCompose(config, mockNetworkConfig);
const env = result.services.agent.environment as Record<string, string>;

expect(env.AWF_ENABLE_HOST_ACCESS).toBe('1');
expect(env.AWF_HOST_SERVICE_PORTS).toBe('5432,6379');
});
});

describe('NO_PROXY baseline', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/docker-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ export function generateDockerCompose(
// Ensure host access is enabled (setup-iptables.sh requires AWF_ENABLE_HOST_ACCESS)
// The CLI auto-enables this, but this is a safety net for programmatic usage
if (!environment.AWF_ENABLE_HOST_ACCESS) {
environment.AWF_ENABLE_HOST_ACCESS = 'true';
environment.AWF_ENABLE_HOST_ACCESS = '1';
}
}

Expand Down
Loading