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

[Backport release-24.05] kanidm: 1.2.3 -> 1.3.3 #336528

Merged
merged 6 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions nixos/tests/kanidm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import ./make-test-python.nix ({ pkgs, ... }:
testCredentials = {
password = "Password1_cZPEwpCWvrReripJmAZdmVIZd8HHoHcl";
};

# copy certs to store to work around mount namespacing
certsPath = pkgs.runCommandNoCC "snakeoil-certs" { } ''
mkdir $out
cp ${certs."${serverDomain}".cert} $out/snakeoil.crt
cp ${certs."${serverDomain}".key} $out/snakeoil.key
'';
in
{
name = "kanidm";
Expand All @@ -19,8 +26,8 @@ import ./make-test-python.nix ({ pkgs, ... }:
domain = serverDomain;
bindaddress = "[::]:443";
ldapbindaddress = "[::1]:636";
tls_chain = certs."${serverDomain}".cert;
tls_key = certs."${serverDomain}".key;
tls_chain = "${certsPath}/snakeoil.crt";
tls_key = "${certsPath}/snakeoil.key";
};
};

Expand Down
25 changes: 18 additions & 7 deletions pkgs/by-name/ka/kanidm/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ let
in
rustPlatform.buildRustPackage rec {
pname = "kanidm";
version = "1.2.3";
version = "1.3.3";

src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-J02IbAY5lyoMaq6wJiHizqeFBd5hB6id2YMPxlPsASM=";
hash = "sha256-W5G7osV4du6w/BfyY9YrDzorcLNizRsoz70RMfO2AbY=";
};

cargoHash = "sha256-JuTKHXpEhWga2vAZhCpyPFy4w6+9UaasD70oBcrr0Rw=";
cargoHash = "sha256-gJrzOK6vPPBgsQFkKrbMql00XSfKGjgpZhYJLTURxoI=";

KANIDM_BUILD_PROFILE = "release_nixos_${arch}";

Expand All @@ -41,13 +41,17 @@ rustPlatform.buildRustPackage rec {
cpu_flags = if stdenv.isx86_64 then "x86_64_legacy" else "none";
default_config_path = "/etc/kanidm/server.toml";
default_unix_shell_path = "${lib.getBin bashInteractive}/bin/bash";
htmx_ui_pkg_path = "@htmx_ui_pkg_path@";
web_ui_pkg_path = "@web_ui_pkg_path@";
};
in
''
cp ${format profile} libs/profiles/${KANIDM_BUILD_PROFILE}.toml
substituteInPlace libs/profiles/${KANIDM_BUILD_PROFILE}.toml \
--replace '@web_ui_pkg_path@' "${placeholder "out"}/ui"
--replace '@htmx_ui_pkg_path@' "${placeholder "out"}/ui/hpkg" \
--replace '@web_ui_pkg_path@' "${placeholder "out"}/ui/pkg"

substituteInPlace Cargo.toml --replace-fail 'rust-version = "1.79"' 'rust-version = "1.77"'
'';

nativeBuildInputs = [
Expand All @@ -67,8 +71,9 @@ rustPlatform.buildRustPackage rec {
postBuild = ''
# We don't compile the wasm-part form source, as there isn't a rustc for
# wasm32-unknown-unknown in nixpkgs yet.
mkdir $out
cp -r server/web_ui/pkg $out/ui
mkdir -p $out/ui
cp -r server/web_ui/pkg $out/ui/pkg
cp -r server/core/static $out/ui/hpkg
'';

preFixup = ''
Expand All @@ -86,7 +91,13 @@ rustPlatform.buildRustPackage rec {
inherit (nixosTests) kanidm;
};

updateScript = nix-update-script { };
updateScript = nix-update-script {
# avoid spurious releases and tags such as "debs"
extraArgs = [
"-vr"
"v(.*)"
];
};
};

meta = with lib; {
Expand Down
Loading