crowd module: fix OpenID server
This commit is contained in:
parent
5306122333
commit
d8ef63fc73
@ -6,7 +6,12 @@ let
|
|||||||
|
|
||||||
cfg = config.services.crowd;
|
cfg = config.services.crowd;
|
||||||
|
|
||||||
pkg = pkgs.atlassian-crowd;
|
pkg = pkgs.atlassian-crowd.override {
|
||||||
|
home = cfg.home;
|
||||||
|
port = cfg.listenPort;
|
||||||
|
proxyUrl = "${cfg.proxy.scheme}://${cfg.proxy.name}:${toString cfg.proxy.port}";
|
||||||
|
openidPassword = cfg.openidPassword;
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -45,6 +50,11 @@ in
|
|||||||
description = "Port to listen on.";
|
description = "Port to listen on.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
openidPassword = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
description = "Application password for OpenID server.";
|
||||||
|
};
|
||||||
|
|
||||||
catalinaOptions = mkOption {
|
catalinaOptions = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [];
|
default = [];
|
||||||
@ -119,10 +129,10 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
preStart = ''
|
preStart = ''
|
||||||
mkdir -p ${cfg.home}/{logs,work}
|
mkdir -p ${cfg.home}/{logs,work,database}
|
||||||
|
|
||||||
mkdir -p /run/atlassian-crowd
|
mkdir -p /run/atlassian-crowd
|
||||||
ln -sf ${cfg.home}/{work,server.xml} /run/atlassian-crowd
|
ln -sf ${cfg.home}/{database,work,server.xml} /run/atlassian-crowd
|
||||||
|
|
||||||
chown -R ${cfg.user} ${cfg.home}
|
chown -R ${cfg.user} ${cfg.home}
|
||||||
|
|
||||||
@ -134,7 +144,6 @@ in
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
script = "${pkg}/start_crowd.sh";
|
script = "${pkg}/start_crowd.sh";
|
||||||
#stopScript = "${pkg}/bin/stop_crowd.sh";
|
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = cfg.user;
|
User = cfg.user;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{ stdenv, fetchurl, home ? "/var/lib/crowd" }:
|
{ stdenv, fetchurl, home ? "/var/lib/crowd"
|
||||||
|
, port ? 8092, proxyUrl ? null, openidPassword ? "WILL_NEVER_BE_SET" }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "atlassian-crowd-${version}";
|
name = "atlassian-crowd-${version}";
|
||||||
@ -18,9 +19,22 @@ stdenv.mkDerivation rec {
|
|||||||
rm -rf apache-tomcat/work
|
rm -rf apache-tomcat/work
|
||||||
ln -s /run/atlassian-crowd/work 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
|
substituteInPlace apache-tomcat/bin/startup.sh --replace start run
|
||||||
|
|
||||||
echo "crowd.home=${home}" > crowd-webapp/WEB-INF/classes/crowd-init.properties
|
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 = ''
|
installPhase = ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user