Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[change] Wireguard: do not remove default options #299

Merged
merged 1 commit into from
Jun 11, 2024
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
5 changes: 0 additions & 5 deletions netjsonconfig/backends/wireguard/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ def __intermediate_vpn(self, config, remove=None):
config[self._forward_property_map[option]] = config.pop(option)
else:
config.pop(option, None)
# Remove default options
if config.get('Table') == 'auto':
config.pop('Table')
if config.get('MTU') == 1280:
config.pop('MTU')
config['peers'] = self.__intermediate_peers(config.get('peers', []))
return self.sorted_dict(config)

Expand Down
2 changes: 2 additions & 0 deletions tests/wireguard/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ def test_confs(self):
PreDown = ip rule delete ipproto tcp dport 22 table 1234
PrivateKey = QFdbnuYr7rrF4eONCAs7FhZwP7BXX/jD/jq2LXCpaXI=
SaveConfig = true
Table = auto

# wireguard config: test2

[Interface]
Address = 10.0.1.1/24
DNS = 10.0.1.1,10.0.0.1
ListenPort = 40843
MTU = 1280
PrivateKey = AFdbnuYr7rrF4eONCAs7FhZwP7BXX/jD/jq2LXCpaXI=
Table = 1234
"""
Expand Down
Loading