nixpkgs/pkgs/servers/atlassian/crowd.nix

52 lines
2 KiB
Nix
Raw Normal View History

2016-10-17 12:51:06 +02:00
{ stdenv, fetchurl, home ? "/var/lib/crowd"
, port ? 8092, proxyUrl ? null, openidPassword ? "WILL_NEVER_BE_SET" }:
2016-10-09 12:29:48 +02:00
stdenv.mkDerivation rec {
name = "atlassian-crowd-${version}";
2019-06-12 17:44:49 +02:00
version = "3.4.5";
2016-10-09 12:29:48 +02:00
src = fetchurl {
url = "https://www.atlassian.com/software/crowd/downloads/binary/${name}.tar.gz";
2019-06-12 17:44:49 +02:00
sha256 = "1k72aar68iqiaf0l75i6pp81dpsllqkp69f70hja754hrzvhz8j3";
2016-10-09 12:29:48 +02:00
};
phases = [ "unpackPhase" "buildPhase" "installPhase" "fixupPhase" ];
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 19:13:21 +01:00
rm -rf apache-tomcat/{logs,work}
ln -s /run/atlassian-crowd/logs apache-tomcat/logs
2016-10-09 12:29:48 +02:00
ln -s /run/atlassian-crowd/work apache-tomcat/work
2016-10-17 12:51:06 +02:00
ln -s /run/atlassian-crowd/database database
2016-10-09 12:29:48 +02: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 12:51:06 +02: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},'
'' + stdenv.lib.optionalString (proxyUrl != null) ''
sed -i crowd-openidserver-webapp/WEB-INF/classes/crowd.properties \
-e 's,http://localhost:${toString port}/openidserver,${proxyUrl}/openidserver,'
2016-10-09 12:29:48 +02:00
'';
installPhase = ''
cp -rva . $out
'';
meta = with stdenv.lib; {
description = "Single sign-on and identity management tool";
homepage = https://www.atlassian.com/software/crowd;
license = licenses.unfree;
maintainers = with maintainers; [ fpletz globin ];
};
}