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

tuntox: init at 0.0.8 #32823

Closed
wants to merge 1 commit into from
Closed

tuntox: init at 0.0.8 #32823

wants to merge 1 commit into from

Conversation

fgaz
Copy link
Member

@fgaz fgaz commented Dec 18, 2017

Motivation for this change

Add the tuntox package and a systemd service to set up a server with it. I may also add a tuntox client service in the future, so the server is under the tuntox.server namespace

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
    • This causes the PreStart script to fail! Any idea why? Maybe I shouldn't create that directory that way, but I couldn't find alternatives.. or maybe /var isn't the right place?
      tuntox.service: Failed at step NAMESPACE spawning /nix/store/wa0c5wzs92ngv7qbsbi0c3dvlxwk2fs0-unit-script/bin/tuntox-pre-start: No such file or directory
      
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@grahamc
Copy link
Member

grahamc commented Dec 19, 2017

@GrahamcOfBorg eval

@orivej
Copy link
Contributor

orivej commented Dec 24, 2017

This causes the PreStart script to fail!

What causes the PreStart script to fail? How can I reproduce it?

@fgaz
Copy link
Member Author

fgaz commented Dec 24, 2017

@orivej useSandbox prevents the preStart script from creating/modifying/(accessing?) /var (edit: well, i'm not 100% sure that's the reason why it fails)

Just enable that option and set tuntox.server.enable = true and it should give that error in the journal (journalctl -b -u tuntox)

@@ -306,6 +306,7 @@
ceph = 288;
duplicati = 289;
monetdb = 290;
tuntox = 291;
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure you need the user to be a specific ID? It usually isn't necessary since the system can assign user IDs.

};

preStart = ''
mkdir -p ${persistentIdDirectory}
Copy link
Member

Choose a reason for hiding this comment

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

Instead of making the directory in a preStart you can do it in an activation script like in

system.activationScripts.mattermost = ''

src = fetchFromGitHub {
owner = "gjedeer";
repo = "tuntox";
rev = "${version}";
Copy link
Member

Choose a reason for hiding this comment

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

Can just be rev = version;.

{
options = {
services.tuntox.server = {
enable = mkOption {
Copy link
Member

Choose a reason for hiding this comment

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

Please use mkEnableOption here.

secret = mkOption {
type = types.nullOr types.str;
default = null;
description = "Shared secret used for connection authentication";
Copy link
Member

Choose a reason for hiding this comment

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

It might be good to point out that this secret will be world readable when inserted in the Nix store. Can this optionally be done with a secretFile that is stored outside the nix store?

@Ekleog
Copy link
Member

Ekleog commented Oct 16, 2018

(triage) @fgaz Are you still willing to work on this?

@fgaz
Copy link
Member Author

fgaz commented Oct 20, 2018

@Ekleog yes, but it'll have to wait a bit

@aanderse
Copy link
Member

@fgaz do you need a hand with this or are you able to continue?

@fgaz
Copy link
Member Author

fgaz commented Jun 28, 2019

@aanderse I just don't (and won't for another month) have much time to make and test those modifications. Maybe in the meantime I could split this into one pr for the package, which is quick and already reviewed, and keep this one for the module only.

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

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

@fgaz Splitting this PR into 2 sounds like a good idea if you don't have the time but want to get the package in ASAP. If you're not in a rush, though, no worries because neither are we 😄

{ stdenv, fetchFromGitHub, fetchpatch, pkgconfig, libtoxcore, libsodium, libevent }:

stdenv.mkDerivation rec {
name = "tuntox-${version}";
Copy link
Member

Choose a reason for hiding this comment

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

Please replace with pname = "tuntox"; and then you can drop name as it will be implied.


src = fetchFromGitHub {
owner = "gjedeer";
repo = "tuntox";
Copy link
Member

Choose a reason for hiding this comment

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

repo = pname; is a common pattern.

license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ fgaz ];
homepage = https://github.com/gjedeer/tuntox;
Copy link
Member

Choose a reason for hiding this comment

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

Please quote.

@ivan
Copy link
Member

ivan commented Sep 6, 2019

For the author, reviewers, and committers: this PR was scanned and appears to add a use of the deprecated types.string, which emits a warning as of #66346. Before merging, please change this to another type, possibly:

  • types.str for a single string where merging does not make sense, or cannot work
  • types.lines for multi-line configuration or scripts where merging is possible
  • types.listOf types.str for a mergeable list of strings

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@fgaz
Copy link
Member Author

fgaz commented Jun 7, 2020

Stale bot, I'll still finish this... someday

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 7, 2020
@fgaz fgaz marked this pull request as draft November 25, 2020 16:55
@stale
Copy link

stale bot commented Jun 3, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2021
@willcohen
Copy link
Contributor

@fgaz Was looking at putting together a PR for tuntox and found this draft first. Are you still interested in finishing it? I'd also be happy to start a new PR based off of this WIP branch. I've never had to create a package that creates/enables a service there so I'm a little bit less certain about fine-tuning those details, but at the very least would like to see the binaries available!

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Feb 17, 2022
@willcohen willcohen mentioned this pull request Feb 18, 2022
13 tasks
@fgaz
Copy link
Member Author

fgaz commented Feb 18, 2022

Wow, I totally forgot about this 😅

Thanks for pushing this forward @willcohen! I don't really want to finish the module for this right now, so let's go with your package!

@fgaz fgaz closed this Feb 18, 2022
@fgaz fgaz deleted the tuntox branch June 16, 2022 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet