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

traefik: init at 1.3.8 #29243

Merged
merged 3 commits into from Sep 21, 2017
Merged

traefik: init at 1.3.8 #29243

merged 3 commits into from Sep 21, 2017

Conversation

moredhel
Copy link
Member

@moredhel moredhel commented Sep 11, 2017

Motivation for this change

Traefik is used as a reverse proxy alternative to other tools such as nginx/caddy.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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.

@Mic92 Mic92 changed the title Traefik init at 1.3.8 traefik: init at 1.3.8 Sep 11, 2017
@Mic92
Copy link
Member

Mic92 commented Sep 11, 2017

I would prefer if traefik would be build from source instead. In the past I opened a pull request so that traefik would vendorize all their source: traefik/traefik#969,
so it should be easy to build it from the release source tarball.

@moredhel
Copy link
Member Author

Of course, I'll look into it.

@moredhel
Copy link
Member Author

@Mic92 I have updated to building traefik from source. There are a couple of things which feel a little hacky, but I couldn't find any docs on how to go about it.

I would appreciate any feedback on changes to make it more idiomatic.

Thanks

buildInputs = [ go-bindata ];
sourceRoot = ".";
postUnpack = ''
files=`ls`
Copy link
Member

Choose a reason for hiding this comment

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

Indent this multiline string by two spaces, and do the same for buildPhase and installPhase.


meta = with stdenv.lib; {
homepage = https://traefik.io;
description = "Træfik, a modern reverse proxy";
Copy link
Member

Choose a reason for hiding this comment

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

The description should not start with the package name, so just "A modern reverse proxy" is good.

buildInputs = [ go-bindata ];
sourceRoot = ".";
postUnpack = ''
files=`ls`
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if there is a nix way to do this but you probably at least want ls -A here to also get hidden files too. If find is available here (I'm not sure if it is?), then it may be more correct or robust to use it instead:

find . -maxdepth 1 -not -path . -not path ./traefik -exec mv {} traefik \;

Otherwise if still using mv, it may be safer (in case of any 'unexpected' ls output, not sure) to use the -t option:

mv -t traefik $files

this way gethostbyname() works as indented
@Mic92
Copy link
Member

Mic92 commented Sep 19, 2017

I reworked the package. Should be less hacky now.

@moredhel
Copy link
Member Author

Thanks @Mic92 & @vyp for the help.

Mic92, it looks considerably better now, and more robust!

What needs to be done next to move this forward?

@Mic92 Mic92 merged commit 31b7bc4 into NixOS:master Sep 21, 2017
@Mic92
Copy link
Member

Mic92 commented Sep 21, 2017

Maybe a nixos module?

@moredhel
Copy link
Member Author

That is my next change, I'll start working on it

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

4 participants