2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, home ? "/var/lib/crowd"
|
2016-10-17 11:51:06 +01:00
|
|
|
, port ? 8092, proxyUrl ? null, openidPassword ? "WILL_NEVER_BE_SET" }:
|
2016-10-09 11:29:48 +01:00
|
|
|
|
2022-07-21 13:53:56 +01:00
|
|
|
let
|
|
|
|
optionalWarning = cond: msg:
|
|
|
|
if cond then lib.warn msg
|
|
|
|
else lib.id;
|
|
|
|
in
|
|
|
|
|
|
|
|
optionalWarning (openidPassword != "WILL_NEVER_BE_SET") "Using `crowdProperties` is deprecated!"
|
|
|
|
(stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "atlassian-crowd";
|
2022-07-20 18:37:02 +01:00
|
|
|
version = "5.0.1";
|
2016-10-09 11:29:48 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "https://www.atlassian.com/software/crowd/downloads/binary/${pname}-${version}.tar.gz";
|
2022-07-20 18:37:02 +01:00
|
|
|
sha256 = "sha256-ccXSNuiXP0+b9WObboikqVd0nKH0Fi2gMVEF3+WAx5M=";
|
2016-10-09 11:29:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
mv apache-tomcat/conf/server.xml apache-tomcat/conf/server.xml.dist
|
|
|
|
ln -s /run/atlassian-crowd/server.xml apache-tomcat/conf/server.xml
|
|
|
|
|
2019-01-07 18:13:21 +00:00
|
|
|
rm -rf apache-tomcat/{logs,work}
|
|
|
|
ln -s /run/atlassian-crowd/logs apache-tomcat/logs
|
2016-10-09 11:29:48 +01:00
|
|
|
ln -s /run/atlassian-crowd/work apache-tomcat/work
|
|
|
|
|
2016-10-17 11:51:06 +01:00
|
|
|
ln -s /run/atlassian-crowd/database database
|
|
|
|
|
2016-10-09 11:29:48 +01:00
|
|
|
substituteInPlace apache-tomcat/bin/startup.sh --replace start run
|
|
|
|
|
|
|
|
echo "crowd.home=${home}" > crowd-webapp/WEB-INF/classes/crowd-init.properties
|
2016-10-17 11:51:06 +01:00
|
|
|
substituteInPlace build.properties \
|
|
|
|
--replace "openidserver.url=http://localhost:8095/openidserver" \
|
|
|
|
"openidserver.url=http://localhost:${toString port}/openidserver"
|
|
|
|
substituteInPlace crowd-openidserver-webapp/WEB-INF/classes/crowd.properties \
|
|
|
|
--replace "http://localhost:8095/" \
|
|
|
|
"http://localhost:${toString port}/"
|
|
|
|
sed -r -i crowd-openidserver-webapp/WEB-INF/classes/crowd.properties \
|
|
|
|
-e 's,application.password\s+password,application.password ${openidPassword},'
|
2021-01-15 07:07:56 +00:00
|
|
|
'' + lib.optionalString (proxyUrl != null) ''
|
2016-10-17 11:51:06 +01:00
|
|
|
sed -i crowd-openidserver-webapp/WEB-INF/classes/crowd.properties \
|
|
|
|
-e 's,http://localhost:${toString port}/openidserver,${proxyUrl}/openidserver,'
|
2016-10-09 11:29:48 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
cp -rva . $out
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-10-09 11:29:48 +01:00
|
|
|
description = "Single sign-on and identity management tool";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.atlassian.com/software/crowd";
|
2016-10-09 11:29:48 +01:00
|
|
|
license = licenses.unfree;
|
2022-08-03 13:13:56 +01:00
|
|
|
maintainers = with maintainers; [ globin ];
|
2016-10-09 11:29:48 +01:00
|
|
|
};
|
2022-07-21 13:53:56 +01:00
|
|
|
})
|