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

feat(nixosConfigurations): add new machine serving {turn,signal,bootstrap}.infra.holochain.org #64

Merged
merged 32 commits into from
Mar 21, 2024

Conversation

steveej
Copy link
Member

@steveej steveej commented Mar 15, 2024

  • blanket config to get the machine up and running.
  • opinionated coturn module
    • service
    • acme cert via redirection
    • ensure cli-password is effective
  • opinionated tx5 signal server module
    • service
    • reverse TLS proxy with acme cert
  • tx5 signal server package
  • secrets for turn credentials
  • kitsune-bootstrap module with reverse TLS proxy

@steveej steveej force-pushed the turn-server branch 2 times, most recently from 5d9d7d6 to fb072ad Compare March 15, 2024 11:02
@steveej
Copy link
Member Author

steveej commented Mar 15, 2024

@ThetaSinner this server is deployed now. just needs the turn server config added.

@steveej steveej changed the title feat(nixosConfigurations): add turn-infra-holochain-org feat(nixosConfigurations): add turn-infra-holochain-org with coturn and tx5-signal-srv Mar 15, 2024
@steveej steveej requested a review from peeech March 15, 2024 21:46
disable jost-s key as i don't have it in the keychain and cannot find it
immediately.
this relies on a package in holochain/holochain so adding that too.
@steveej steveej changed the title feat(nixosConfigurations): add turn-infra-holochain-org with coturn and tx5-signal-srv feat(nixosConfigurations): add turn-infra-holochain-org serving {turn,signal,bootstra}.infra.holochain.org Mar 18, 2024
@steveej steveej changed the title feat(nixosConfigurations): add turn-infra-holochain-org serving {turn,signal,bootstra}.infra.holochain.org feat(nixosConfigurations): add new machine serving {turn,signal,bootstra}.infra.holochain.org Mar 18, 2024
Copy link

@neonphog neonphog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea how to review any of this... but our tests showed the results worked, so I guess approve 👍

@steveej steveej changed the title feat(nixosConfigurations): add new machine serving {turn,signal,bootstra}.infra.holochain.org feat(nixosConfigurations): add new machine serving {turn,signal,bootstrap}.infra.holochain.org Mar 20, 2024
Copy link
Member

@ThetaSinner ThetaSinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good! Definitely an improvement.

I have a few questions about syncing versions and quite a few general questions. Hopefully one of two useful comments in here too :)

flake.nix Show resolved Hide resolved
flake.nix Show resolved Hide resolved
flake.nix Show resolved Hide resolved
modules/flake-parts/holochain-turn-server.nix Outdated Show resolved Hide resolved
modules/flake-parts/holochain-turn-server.nix Show resolved Hide resolved
modules/nixos/kitsune-bootstrap.nix Show resolved Hide resolved
wantedBy = ["multi-user.target"];

environment = {
TMPDIR = "%T";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it ensures that TMPDIR environment variable is set to something that systemd considers temporary and writable. for some reason it wasn't set otherwise. systemd.unit or some other manual might explain why.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically the %T bit looked magical to me

modules/nixos/kitsune-bootstrap.nix Outdated Show resolved Hide resolved
modules/nixos/tx5-signal-server.nix Show resolved Hide resolved
serviceConfig = {
DynamicUser = true;
PrivateTmp = true;
ExecStartPre = pkgs.writeShellScript "tx5-start-pre" ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not possible to put this in a directory without scripting? Like /var/lib/bootstrap/config.json or somewhere like that. Not really bothered where but I think there's a way to output files to standard locations to be consumed by services with NixOS?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nix can by design only put files in the nix store. the point here isn't that it's not in the nix store though, it's that the permissions are 0400 which is enforced by the tx5-signal-srv.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in addition i also thought about how we can inject secrets into the config.json at runtime. it turns out we're not needing that now because we've got a hashed password in the config.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can create files alongside services like this https://unix.stackexchange.com/questions/500025/how-to-add-a-file-to-etc-in-nixos

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can create files alongside services like this https://unix.stackexchange.com/questions/500025/how-to-add-a-file-to-etc-in-nixos

using environment.etc, the file is going to be written to the nix store first, and then linked to from /etc with the link's permissions being adjusted. the file in the nix store will we world-readable which i'd like to avoid in this case. that's because i want to reserve the functionality of injecting secret information into this config, which should never reach the nix store in plain text.

what do you think are the downsides of the current implementation?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh okay, got it, yeah that's fine then

@steveej steveej merged commit c73d464 into develop Mar 21, 2024
1 check passed
@steveej steveej deleted the turn-server branch March 21, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dweb-reverse-tls-proxy: disko config is outdated
3 participants