about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/atlassian/crowd.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/servers/atlassian/crowd.nix
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/servers/atlassian/crowd.nix')
-rw-r--r--nixpkgs/pkgs/servers/atlassian/crowd.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/atlassian/crowd.nix b/nixpkgs/pkgs/servers/atlassian/crowd.nix
new file mode 100644
index 000000000000..4ad0388e8db4
--- /dev/null
+++ b/nixpkgs/pkgs/servers/atlassian/crowd.nix
@@ -0,0 +1,50 @@
+{ stdenv, fetchurl, home ? "/var/lib/crowd"
+, port ? 8092, proxyUrl ? null, openidPassword ? "WILL_NEVER_BE_SET" }:
+
+stdenv.mkDerivation rec {
+  name = "atlassian-crowd-${version}";
+  version = "3.2.5";
+
+  src = fetchurl {
+    url = "https://www.atlassian.com/software/crowd/downloads/binary/${name}.tar.gz";
+    sha256 = "1h8kxh89d2wm0hkgrzx5dnnfy8sbhpgisgdwn3srhb4js8h4qil6";
+  };
+
+  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
+
+    rm -rf apache-tomcat/work
+    ln -s /run/atlassian-crowd/work apache-tomcat/work
+
+    ln -s /run/atlassian-crowd/database database
+
+    substituteInPlace apache-tomcat/bin/startup.sh --replace start run
+
+    echo "crowd.home=${home}" > crowd-webapp/WEB-INF/classes/crowd-init.properties
+    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,'
+  '';
+
+  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 ];
+  };
+}