add module to generate zerotier configuration #22

Merged
Mic92 merged 6 commits from zerotier into main 2023-07-25 17:14:27 +00:00
Owner
No description provided.
Mic92 reviewed 2023-07-25 11:51:02 +00:00
@ -0,0 +90,4 @@
controller_port = find_free_port(range(10000, 65535))
zerotier_exe = shutil.which("zerotier-one")
if zerotier_exe is None:
raise Exception("cannot find zerotier-one executable")
Author
Owner

@DavHau I am already not a fan of 100% test coverage. It does not seem practical to setup tests for every error path. It would just result in a slow and harder to maintain test suite that test things that don't matter.

@DavHau I am already not a fan of 100% test coverage. It does not seem practical to setup tests for every error path. It would just result in a slow and harder to maintain test suite that test things that don't matter.
Owner

OK, my intention was not to enforce actual 100% coverage. More like making it an explicit decision to not cover something, by having to put a pragma: no cover comment somewhere.

We can remove the coverage enforcement, but then the coverage will most likely converge towards 0%, don't you think so?

OK, my intention was not to enforce actual 100% coverage. More like making it an explicit decision to not cover something, by having to put a `pragma: no cover` comment somewhere. We can remove the coverage enforcement, but then the coverage will most likely converge towards 0%, don't you think so?
Owner

Via #21 I also now added the html coverage output by default.
If you keep your browser open, then it should be simple to find the lines to exclude quickly.

Via https://git.clan.lol/clan/clan-core/pulls/21 I also now added the html coverage output by default. If you keep your browser open, then it should be simple to find the lines to exclude quickly.
Mic92 marked this conversation as resolved
Mic92 force-pushed zerotier from 9ca0f585d4 to 27d376fe1f 2023-07-25 11:54:21 +00:00 Compare
Mic92 force-pushed zerotier from 27d376fe1f to 8ae99ac9d7 2023-07-25 12:08:21 +00:00 Compare
Mic92 force-pushed zerotier from 8ae99ac9d7 to 5ec203681f 2023-07-25 12:08:52 +00:00 Compare
lassulus reviewed 2023-07-25 14:22:11 +00:00
@ -0,0 +86,4 @@
# This check could be racy but it's unlikely in practice
controller_port = find_free_port(range(10000, 65535))
zerotier_exe = shutil.which("zerotier-one")
if zerotier_exe is None:
Owner

why not use nix shell here? we did that in the clan ssh command, and it seems like a cool way

why not use nix shell here? we did that in the clan ssh command, and it seems like a cool way
Author
Owner

Would this not quite hard to test in a nix-build?

Would this not quite hard to test in a nix-build?
Owner

We can build a python function which would check if its installed (then we can supply the packages in a test) or get it when it's not there?

We can build a python function which would check if its installed (then we can supply the packages in a test) or get it when it's not there?
Author
Owner

Problem is though that we might get a binary that is not build with nix and that behaves differently. How would you check that we only get the binary that we provided ourself? Someone could for example do nix-shell -p bubblewrap and than run our tool.

Problem is though that we might get a binary that is not build with nix and that behaves differently. How would you check that we only get the binary that we provided ourself? Someone could for example do nix-shell -p bubblewrap and than run our tool.
Owner

But that is fine and we get a fast cli

But that is fine and we get a fast cli
Owner

Also the python function can check if the file begins with /nix/store

Also the python function can check if the file begins with /nix/store
Author
Owner

done.

done.
Mic92 marked this conversation as resolved
lassulus reviewed 2023-07-25 14:22:55 +00:00
@ -0,0 +99,4 @@
home = tempdir / "zerotier-one"
home.mkdir()
cmd = [
"bwrap",
Owner

same here, I guess we can hardcode some dependencies, but only if we need them in more than 1 codepath?

same here, I guess we can hardcode some dependencies, but only if we need them in more than 1 codepath?
Mic92 marked this conversation as resolved
Mic92 force-pushed zerotier from e1c388136c to 98593fc284 2023-07-25 16:21:57 +00:00 Compare
Mic92 force-pushed zerotier from 98593fc284 to cfd7db6388 2023-07-25 16:23:28 +00:00 Compare
Mic92 force-pushed zerotier from cfd7db6388 to 729a2837e7 2023-07-25 16:57:48 +00:00 Compare
Mic92 force-pushed zerotier from 4215a28dd2 to b9c2a131bc 2023-07-25 17:07:51 +00:00 Compare
Mic92 force-pushed zerotier from b9c2a131bc to 821ff71e4a 2023-07-25 17:13:28 +00:00 Compare
Mic92 merged commit 817a2f9196 into main 2023-07-25 17:14:27 +00:00
Mic92 deleted branch zerotier 2023-07-25 17:15:14 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: clan/clan-core#22
No description provided.