2
0
mirror of https://github.com/dadevel/wg-netns synced 2024-10-30 21:20:12 +00:00
Commit Graph

38 Commits

Author SHA1 Message Date
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)
```
2023-11-26 19:24:28 +01:00
dadevel
9d27593150
systemd: partially revert hardening
Remove some hardening options introduced with commit a4c991a. Fixes #20.
2023-08-31 16:34:07 +02:00
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>
2023-07-19 10:22:47 +02:00
dadevel
0f9510f9a6
enable dependabot 2023-06-15 20:06:40 +02:00
dadevel
32c02b558c
wg-resolve: support ipv6 dns lookup 2023-05-31 16:35:08 +02:00
dadevel
da967b34d3
update wg-resolve to work together with wg-netns
Resolves #18.
2023-05-29 12:46:19 +02:00
dadevel
008833d7fc
release v2.3.0 2023-05-25 22:56:53 +02:00
Rafael Ristovski
b0e7fcdda8
retrieve current username correctly
`os.getlogin()` does not work in some cases, however `getpass.getuser()` does.
Closes #17.
2023-05-25 22:56:38 +02:00
Marek Küthe
a4c991a499
systemd: harden service
Resolves #13, closes #16.
2023-05-25 22:56:17 +02:00
Marek Küthe
0896151668
systemd: specify config directory mode
Fixes #14, closes #15.
2023-05-25 22:55:57 +02:00
dadevel
1d1c87dd13
configure wg interface in base netns
Resolves #12.
2023-05-25 22:16:57 +02:00
dadevel
49f7138323
bump dependencies 2023-05-25 22:16:57 +02:00
dadevel
0e55f3fcf8
resolve type linting errors 2023-05-25 22:16:57 +02:00
dadevel
2bbc743d9b
release v2.2.2 2023-03-19 15:12:57 +01:00
Alex Leigh
eff7413c79 make private key optional
Allows private keys to be set in a post-up command and left out of config files.
2023-03-19 15:08:24 +01:00
dadevel
79c3c81397
release v2.2.1 2023-02-16 09:23:09 +01:00
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.
2023-02-15 10:15:59 +01:00
dadevel
41665ca136
add list and switch commands 2022-10-17 21:00:01 +02:00
dadevel
2542d9f4cd
readme: add example to start firefox in netns
Thanks to @dontdieych. Closes #7.
2022-10-02 18:24:02 +02:00
Chris Bouchard
56a9e4fbe6
add option to run shell hooks in host netns
Closes #6.
2022-10-02 18:19:11 +02:00
dadevel
baa1d01a49
package with poetry 2022-07-10 12:48:20 +02:00
dadevel
cd0248f36a
add extras 2022-03-20 22:15:28 +01:00
dadevel
da6e84552b
make interface.public_key and peer.name optional
Thanks to @phromo for the hint.
2022-02-14 19:35:42 +01:00
dadevel
59a67b445c
rewrite with dataclasses
Adds 'managed' option and yaml support, renames env vars and can load profiles by name.
Closes #4.
2022-01-26 10:55:32 +01:00
dadevel
42f67672f0
readme: use more descriptive variable names in port forwarding example 2021-08-04 08:43:31 +02:00
dadevel
53c026ba9d
fix error when dns-server option is not provided
Fixes #2
2021-08-04 08:33:41 +02:00
dadevel
0846b786bf
add option to overwrite automatic routes from allowed-ips 2021-06-20 21:03:45 +02:00
dadevel
c4c272b2eb
add setup script 2021-05-28 11:37:51 +02:00
dadevel
c383e75597
handle missing allowed-ips key with grace 2020-12-10 22:22:01 +01:00
dadevel
33ccc0aee7
fix undefined SHELL variable 2020-12-10 22:22:01 +01:00
dadevel
b19054c788
enable detailed logging in systemd service 2020-12-10 22:21:15 +01:00
dadevel
812e027bc0 rewrite for v1
Allow multiple interfaces per namespace.
Change configuration format to json.
2020-12-09 21:55:26 +00:00
dadevel
e225ad0bfe
readme: document netns port forwarding with socat 2020-11-30 13:11:47 +01:00
dadevel
28fcee3191
setup loopback interface and split up functions 2020-11-16 09:11:39 +01:00
dadevel
f09e4e3a89
fix key length error when preshared-key isnt specified 2020-11-15 22:42:30 +01:00
dadevel
19230eab45
add python3.7 compatibility 2020-11-15 22:41:42 +01:00
dadevel
0515fafaf8
provide optional systemd service 2020-11-15 17:13:46 +01:00
dadevel
f97b258b26
initial commit 2020-11-15 17:04:55 +01:00