Commit Graph

41 Commits (main)
 

Author SHA1 Message Date
dadevel 121288feb9
add exec command 2 weeks ago
UpYoursMicrosoft 150a052211
support moving interfaces into default netns
Closes #23.
2 months ago
Sebastian b84edfd253
readme: add hint for selinux context 4 months ago
Dmitry Vodopyanov 5a3d297d82
handle empty ip netns output
This patch fixes the crash which happens during execution of `wg-netns list`.
The crash happens if nothing else from `wg-netns` is executed on machine yet,
i.e., after the reboot. In that case, `ip -json netns` returns an empty string,
not `[]`, so we get an exception if we pass empty line into `json.loads()`.

```
$ export WG_VERBOSE=1
$ /home/user/.local/bin/wg-netns list
> ip -json netns
error: Expecting value: line 1 column 1 (char 0) (JSONDecodeError)
Traceback (most recent call last):
  File "/home/user/.local/bin/wg-netns", line 391, in <module>
    main()
  File "/home/user/.local/bin/wg-netns", line 27, in main
    cli(sys.argv[1:])
  File "/home/user/.local/bin/wg-netns", line 93, in cli
    data = json.loads(output)
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
```
5 months ago
dadevel 9d27593150
systemd: partially revert hardening
Remove some hardening options introduced with commit a4c991a. Fixes #20.
8 months ago
dependabot[bot] 6d209c1e18 Bump pyyaml from 6.0 to 6.0.1
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 6.0 to 6.0.1.
- [Changelog](https://github.com/yaml/pyyaml/blob/6.0.1/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/6.0...6.0.1)

---
updated-dependencies:
- dependency-name: pyyaml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
9 months ago
dadevel 0f9510f9a6
enable dependabot 11 months ago
dadevel 32c02b558c
wg-resolve: support ipv6 dns lookup 11 months ago
dadevel da967b34d3
update wg-resolve to work together with wg-netns
Resolves #18.
11 months ago
dadevel 008833d7fc
release v2.3.0 11 months ago
Rafael Ristovski b0e7fcdda8
retrieve current username correctly
`os.getlogin()` does not work in some cases, however `getpass.getuser()` does.
Closes #17.
11 months ago
Marek Küthe a4c991a499
systemd: harden service
Resolves #13, closes #16.
11 months ago
Marek Küthe 0896151668
systemd: specify config directory mode
Fixes #14, closes #15.
11 months ago
dadevel 1d1c87dd13
configure wg interface in base netns
Resolves #12.
11 months ago
dadevel 49f7138323
bump dependencies 11 months ago
dadevel 0e55f3fcf8
resolve type linting errors 11 months ago
dadevel 2bbc743d9b
release v2.2.2 1 year ago
Alex Leigh eff7413c79 make private key optional
Allows private keys to be set in a post-up command and left out of config files.
1 year ago
dadevel 79c3c81397
release v2.2.1 1 year ago
Jendrik Weise 6486b2fad1 add base_netns functionality
Allows to specify the netns in which the WireGuard interface
is initialized. This allows for multi-hop VPNs.
1 year ago
dadevel 41665ca136
add list and switch commands 2 years ago
dadevel 2542d9f4cd
readme: add example to start firefox in netns
Thanks to @dontdieych. Closes #7.
2 years ago
Chris Bouchard 56a9e4fbe6
add option to run shell hooks in host netns
Closes #6.
2 years ago
dadevel baa1d01a49
package with poetry 2 years ago
dadevel cd0248f36a
add extras 2 years ago
dadevel da6e84552b
make interface.public_key and peer.name optional
Thanks to @phromo for the hint.
2 years ago
dadevel 59a67b445c
rewrite with dataclasses
Adds 'managed' option and yaml support, renames env vars and can load profiles by name.
Closes #4.
2 years ago
dadevel 42f67672f0
readme: use more descriptive variable names in port forwarding example 3 years ago
dadevel 53c026ba9d
fix error when dns-server option is not provided
Fixes #2
3 years ago
dadevel 0846b786bf
add option to overwrite automatic routes from allowed-ips 3 years ago
dadevel c4c272b2eb
add setup script 3 years ago
dadevel c383e75597
handle missing allowed-ips key with grace 3 years ago
dadevel 33ccc0aee7
fix undefined SHELL variable 3 years ago
dadevel b19054c788
enable detailed logging in systemd service 3 years ago
dadevel 812e027bc0 rewrite for v1
Allow multiple interfaces per namespace.
Change configuration format to json.
3 years ago
dadevel e225ad0bfe
readme: document netns port forwarding with socat 3 years ago
dadevel 28fcee3191
setup loopback interface and split up functions 3 years ago
dadevel f09e4e3a89
fix key length error when preshared-key isnt specified 3 years ago
dadevel 19230eab45
add python3.7 compatibility 3 years ago
dadevel 0515fafaf8
provide optional systemd service 3 years ago
dadevel f97b258b26
initial commit 3 years ago