auth: add imageFile option
This commit is contained in:
@@ -199,6 +199,13 @@ in
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
imageFile = mkOption {
|
||||||
|
type = types.nullOr lib.types.path;
|
||||||
|
description = ''
|
||||||
|
Filepath of an image which is displayed in Kanidm web GUI for a service.
|
||||||
|
'';
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -294,6 +301,7 @@ in
|
|||||||
, clientID
|
, clientID
|
||||||
, displayName
|
, displayName
|
||||||
, enablePkce
|
, enablePkce
|
||||||
|
, imageFile
|
||||||
, originLanding
|
, originLanding
|
||||||
, originUrl
|
, originUrl
|
||||||
, scopeMaps
|
, scopeMaps
|
||||||
@@ -312,8 +320,9 @@ in
|
|||||||
basicSecretFile
|
basicSecretFile
|
||||||
claimMaps
|
claimMaps
|
||||||
displayName
|
displayName
|
||||||
originUrl
|
imageFile
|
||||||
originLanding
|
originLanding
|
||||||
|
originUrl
|
||||||
scopeMaps
|
scopeMaps
|
||||||
;
|
;
|
||||||
preferShortUsername = useShortPreferredUsername;
|
preferShortUsername = useShortPreferredUsername;
|
||||||
|
@@ -87,15 +87,9 @@ lib.mkIf config.selfprivacy.sso.enable {
|
|||||||
_final: prev: {
|
_final: prev: {
|
||||||
inherit (nixpkgs-2411.legacyPackages.${prev.system}) kanidm;
|
inherit (nixpkgs-2411.legacyPackages.${prev.system}) kanidm;
|
||||||
kanidm-provision =
|
kanidm-provision =
|
||||||
nixpkgs-2411.legacyPackages.${prev.system}.kanidm-provision.overrideAttrs (_: {
|
(nixpkgs-2411.legacyPackages.${prev.system}).callPackage
|
||||||
version = "git";
|
./kanidm-provision.nix
|
||||||
src = prev.fetchFromGitHub {
|
{ };
|
||||||
owner = "oddlama";
|
|
||||||
repo = "kanidm-provision";
|
|
||||||
rev = "d1f55c9247a6b25d30bbe90a74307aaac6306db4";
|
|
||||||
hash = "sha256-cZ3QbowmWX7j1eJRiUP52ao28xZzC96OdZukdWDHfFI=";
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
52
auth/kanidm-provision.nix
Normal file
52
auth/kanidm-provision.nix
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
rustPlatform,
|
||||||
|
fetchFromGitHub,
|
||||||
|
yq,
|
||||||
|
versionCheckHook,
|
||||||
|
nix-update-script,
|
||||||
|
nixosTests,
|
||||||
|
}:
|
||||||
|
|
||||||
|
rustPlatform.buildRustPackage rec {
|
||||||
|
pname = "kanidm-provision";
|
||||||
|
version = "1.2.0";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "oddlama";
|
||||||
|
repo = "kanidm-provision";
|
||||||
|
tag = "v${version}";
|
||||||
|
hash = "sha256-+NQJEAJ0DqKEV1cYZN7CLzGoBJNUL3SQAMmxRQG5DMI=";
|
||||||
|
};
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
tomlq -ti '.package.version = "${version}"' Cargo.toml
|
||||||
|
'';
|
||||||
|
|
||||||
|
useFetchCargoVendor = true;
|
||||||
|
cargoHash = "sha256-uo/TGyfNChq/t6Dah0HhXhAwktyQk0V/wewezZuftNk=";
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
yq # for `tomlq`
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||||
|
versionCheckProgramArg = "--version";
|
||||||
|
doInstallCheck = true;
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
tests = { inherit (nixosTests) kanidm-provisioning; };
|
||||||
|
updateScript = nix-update-script { };
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "A small utility to help with kanidm provisioning";
|
||||||
|
homepage = "https://github.com/oddlama/kanidm-provision";
|
||||||
|
license = with lib.licenses; [
|
||||||
|
asl20
|
||||||
|
mit
|
||||||
|
];
|
||||||
|
maintainers = with lib.maintainers; [ oddlama ];
|
||||||
|
mainProgram = "kanidm-provision";
|
||||||
|
};
|
||||||
|
}
|
@@ -572,6 +572,16 @@ in
|
|||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
imageFile = mkOption {
|
||||||
|
description = ''
|
||||||
|
Application image to display in the WebUI.
|
||||||
|
Kanidm supports "image/jpeg", "image/png", "image/gif", "image/svg+xml", and "image/webp".
|
||||||
|
The image will be uploaded each time kanidm-provision is run.
|
||||||
|
'';
|
||||||
|
type = types.nullOr types.path;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
|
||||||
enableLocalhostRedirects = mkOption {
|
enableLocalhostRedirects = mkOption {
|
||||||
description = "Allow localhost redirects. Only for public clients.";
|
description = "Allow localhost redirects. Only for public clients.";
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
|
@@ -386,6 +386,7 @@ in
|
|||||||
|
|
||||||
selfprivacy.auth.clients."${oauthClientID}" = {
|
selfprivacy.auth.clients."${oauthClientID}" = {
|
||||||
inherit adminsGroup usersGroup;
|
inherit adminsGroup usersGroup;
|
||||||
|
imageFile = "${pkgs.forgejo.data}/public/assets/img/logo.svg";
|
||||||
subdomain = cfg.subdomain;
|
subdomain = cfg.subdomain;
|
||||||
isTokenNeeded = true;
|
isTokenNeeded = true;
|
||||||
originLanding =
|
originLanding =
|
||||||
|
Reference in New Issue
Block a user