From 5bc7523bb54e960f5ac00492b16519b1bce21007 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 3 Feb 2016 19:39:00 +0100 Subject: cac-1.0.3 -> cac-api-1.1.0 --- krebs/5pkgs/cac-api/default.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 krebs/5pkgs/cac-api/default.nix (limited to 'krebs/5pkgs/cac-api/default.nix') diff --git a/krebs/5pkgs/cac-api/default.nix b/krebs/5pkgs/cac-api/default.nix new file mode 100644 index 000000000..2a32bb096 --- /dev/null +++ b/krebs/5pkgs/cac-api/default.nix @@ -0,0 +1,37 @@ +{ stdenv, fetchgit, bc, coreutils, curl, gnused, inotifyTools, jq, ncurses, sshpass, ... }: + +stdenv.mkDerivation { + name = "cac-api-1.1.0"; + + src = fetchgit { + url = http://cgit.cd.krebsco.de/cac-api; + rev = "0809fae379239687ed1170e04311dc2880ef0aba"; + sha256 = "357ced27c9ed88028967c934178a1d230bf38617a7494cd4632fabdd2a04fcdd"; + }; + + phases = [ + "unpackPhase" + "installPhase" + ]; + + installPhase = + let + path = stdenv.lib.makeSearchPath "bin" [ + bc + coreutils + curl + gnused + inotifyTools + jq + ncurses + sshpass + ]; + in + '' + mkdir -p $out/bin + cp cac-api $out/bin/cac-api + sed -i ' + s;^_cac_cli_main .*;PATH=${path}''${PATH+:$PATH} &; + ' $out/bin/cac-api + ''; +} -- cgit v1.2.3 From 48381bd8dd9607d54a936c644964ab5bac90e4a9 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 4 Feb 2016 01:20:03 +0100 Subject: cac-api: don't GET broken listtasks + use complete cert --- krebs/5pkgs/cac-api/default.nix | 47 +++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'krebs/5pkgs/cac-api/default.nix') diff --git a/krebs/5pkgs/cac-api/default.nix b/krebs/5pkgs/cac-api/default.nix index 2a32bb096..331b0853f 100644 --- a/krebs/5pkgs/cac-api/default.nix +++ b/krebs/5pkgs/cac-api/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, bc, coreutils, curl, gnused, inotifyTools, jq, ncurses, sshpass, ... }: +{ stdenv, fetchgit, bc, coreutils, curl, dash, gnused, inotifyTools, jq, ncurses, openssh, sshpass, ... }: stdenv.mkDerivation { name = "cac-api-1.1.0"; @@ -14,24 +14,29 @@ stdenv.mkDerivation { "installPhase" ]; - installPhase = - let - path = stdenv.lib.makeSearchPath "bin" [ - bc - coreutils - curl - gnused - inotifyTools - jq - ncurses - sshpass - ]; - in - '' - mkdir -p $out/bin - cp cac-api $out/bin/cac-api - sed -i ' - s;^_cac_cli_main .*;PATH=${path}''${PATH+:$PATH} &; - ' $out/bin/cac-api - ''; + installPhase = '' + mkdir -p $out/bin + { cat <<\EOF + #! ${dash}/bin/dash + export PATH=${stdenv.lib.makeSearchPath "bin" [ + bc + coreutils + curl + gnused + inotifyTools + jq + ncurses + openssh + sshpass + ]} + EOF + # [1]: Disable fetching tasks; listtasks is currently broken: + # Unknown column 'iod.apitask.cid' in 'field list' + sed ' + /^\s*tasks \\$/d; # [1] + s|\<_cac_exec curl|<${./cac.pem} & --cacert /dev/stdin| + ' cac-api + } > $out/bin/cac-api + chmod +x $out/bin/cac-api + ''; } -- cgit v1.2.3 From 1745d3efa0be1687d482077c75942cf9d6a5ecc2 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 4 Feb 2016 01:55:59 +0100 Subject: cac-cert: init --- krebs/5pkgs/cac-api/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'krebs/5pkgs/cac-api/default.nix') diff --git a/krebs/5pkgs/cac-api/default.nix b/krebs/5pkgs/cac-api/default.nix index 331b0853f..9ab6ac8b2 100644 --- a/krebs/5pkgs/cac-api/default.nix +++ b/krebs/5pkgs/cac-api/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, bc, coreutils, curl, dash, gnused, inotifyTools, jq, ncurses, openssh, sshpass, ... }: +{ stdenv, fetchgit, bc, cac-cert, coreutils, curl, dash, gnused, inotifyTools, jq, ncurses, openssh, sshpass, ... }: stdenv.mkDerivation { name = "cac-api-1.1.0"; @@ -34,7 +34,7 @@ stdenv.mkDerivation { # Unknown column 'iod.apitask.cid' in 'field list' sed ' /^\s*tasks \\$/d; # [1] - s|\<_cac_exec curl|<${./cac.pem} & --cacert /dev/stdin| + s|\<_cac_exec curl|<${cac-cert} & --cacert /dev/stdin| ' cac-api } > $out/bin/cac-api chmod +x $out/bin/cac-api -- cgit v1.2.3