Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

NixOS compatibility #376

Merged
merged 5 commits into from
Aug 25, 2015
Merged

NixOS compatibility #376

merged 5 commits into from
Aug 25, 2015

Conversation

globin
Copy link
Contributor

@globin globin commented May 15, 2015

This fixes some minor issues in regard to NixOS compatibility mostly
due to the fact that NixOS only has the binaries /usr/bin/env and /bin/sh
in deterministic absolute locations.

Additionally this removes the copying of the template to the lxc template
path, which is in a read-only mount on NixOS and a non-deterministic location.
Instead it uses the absolute path to the template which is supported since lxc 1.0.

Review on Reviewable

@globin
Copy link
Contributor Author

globin commented Jul 16, 2015

Fixed the failing test

@fgrehm
Copy link
Owner

fgrehm commented Jul 16, 2015

Sorry for the long silence but as per GH-375 I'm looking for help to maintain this plugin and for now I'm holding back from bringing in new changes =/

If you are interested on maintaining the project and keep things moving please shoot me an email or drop a message on GH-375 so I can arrange things.

Cheers 🍻

@globin
Copy link
Contributor Author

globin commented Jul 16, 2015

I've actually just started writing a comment on there, since we use this heavily @mayflower..

So we are definitely interested in keeping this alive and up to date.

I guess @fpletz, @codec, @fadenb and possibly @marco-jantke, might want to chime in, too.

What's the best way to support you?

@fgrehm
Copy link
Owner

fgrehm commented Jul 16, 2015

That is awesome! 💥 🙌 💪 🍻 🎆

Well, if you guys are up for it I can provide write access to one of you and you can start hacking away, merging PRs, closing issues... 😄 I'll be around to help out and provide feedback whenever needed but unfortunately I'm very unlikely to have the time to test changes or write code.

Once you guys are ready to cut a release, just open up PR and @ping me on it so that I can provide RubyGems.org access to someone over there too.

WDYT?

@fpletz fpletz mentioned this pull request Jul 17, 2015
@globin globin mentioned this pull request Jul 17, 2015
@fpletz
Copy link
Contributor

fpletz commented Jul 31, 2015

@globin IMHO we should remove at least the gemset.nix because the sha256sums of some git repositories are not stable and there are still some problems with SSL. We should probably wait until this is fixed in NixOS and just get the code & test fixes merged ASAP.

@@ -36,7 +36,7 @@ def sudo_wrapper

def ensure_lxc_installed!
begin
sudo_wrapper.run("/usr/bin/which", "lxc-create")
sudo_wrapper.run("/usr/bin/env", "which", "lxc-create")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we prepend "/usr/bin/env" to every path in the sudo_wrapper instead of fixing this for every command manually? There are some more similar cases in the networking code where tools like ip and brctl are called.

@fpletz fpletz self-assigned this Jul 31, 2015
Tempfile can be created in /run, too.
This fixes commands that currently rely on hardcoded paths and break
on systems like NixOS that don't have all binaries in /usr/bin etc.
@globin
Copy link
Contributor Author

globin commented Aug 2, 2015

Updated and rebased

@fpletz fpletz added this to the v1.2.0 milestone Aug 2, 2015
@krtek4
Copy link

krtek4 commented Aug 24, 2015

Definitively would love to see that in a release :)

fpletz added a commit that referenced this pull request Aug 25, 2015
@fpletz fpletz merged commit bbff802 into fgrehm:master Aug 25, 2015
@fpletz
Copy link
Contributor

fpletz commented Aug 25, 2015

👍

@mvikharev
Copy link

That breaks avoiding sudo passwords on Ubuntu 14.04 when running vagrant ssh.

$ cat /etc/sudoers.d/vagrant-lxc
# Automatically created by vagrant-lxc
mvikharev ALL=(root) NOPASSWD: /usr/local/bin/vagrant-lxc-wrapper

$ vagrant ssh
...
INFO machine: Initializing machine: default
INFO machine:   - Provider: Vagrant::LXC::Provider
INFO subprocess: Starting process: ["/usr/bin/sudo", "/usr/bin/env", "/usr/local/bin/vagrant-lxc-wrapper", "lxc-ls"]
INFO subprocess: Command not in installer, restoring original environment...
[sudo] password for mvikharev:

@ccope
Copy link
Contributor

ccope commented Sep 23, 2015

Also, I think the sudo wrapper is actually not compatible with nix. If it allows calling commands with /usr/bin/env, then an attacker could just add whatever binaries they want to the user's path and call them.

@globin globin mentioned this pull request Sep 23, 2015
@globin
Copy link
Contributor Author

globin commented Sep 24, 2015

Fix released in 1.2.1

@globin globin deleted the nixos-current branch September 24, 2015 14:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants