Merge pull request #63957 from aanderse/trac-httpd
nixos/httpd: remove broken trac subservice
This commit is contained in:
commit
434667420e
@ -318,6 +318,11 @@
|
||||
The <literal>mercurial</literal> <literal>httpd.extraSubservice</literal> has been removed from nixpkgs due to lack of maintainer.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The <literal>trac</literal> <literal>httpd.extraSubservice</literal> has been removed from nixpkgs because it was unmaintained.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -1,121 +0,0 @@
|
||||
{ config, lib, pkgs, serverInfo, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
# Build a Subversion instance with Apache modules and Swig/Python bindings.
|
||||
subversion = pkgs.subversion.override {
|
||||
bdbSupport = true;
|
||||
httpServer = true;
|
||||
pythonBindings = true;
|
||||
apacheHttpd = httpd;
|
||||
};
|
||||
|
||||
httpd = serverInfo.serverConfig.package;
|
||||
|
||||
versionPre24 = versionOlder httpd.version "2.4";
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
options = {
|
||||
|
||||
projectsLocation = mkOption {
|
||||
description = "URL path in which Trac projects can be accessed";
|
||||
default = "/projects";
|
||||
};
|
||||
|
||||
projects = mkOption {
|
||||
description = "List of projects that should be provided by Trac. If they are not defined yet empty projects are created.";
|
||||
default = [];
|
||||
example =
|
||||
[ { identifier = "myproject";
|
||||
name = "My Project";
|
||||
databaseURL="postgres://root:password@/tracdb";
|
||||
subversionRepository="/data/subversion/myproject";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
user = mkOption {
|
||||
default = "wwwrun";
|
||||
description = "User account under which Trac runs.";
|
||||
};
|
||||
|
||||
group = mkOption {
|
||||
default = "wwwrun";
|
||||
description = "Group under which Trac runs.";
|
||||
};
|
||||
|
||||
ldapAuthentication = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
description = "Enable the ldap authentication in trac";
|
||||
};
|
||||
|
||||
url = mkOption {
|
||||
default = "ldap://127.0.0.1/dc=example,dc=co,dc=ke?uid?sub?(objectClass=inetOrgPerson)";
|
||||
description = "URL of the LDAP authentication";
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
default = "Trac server";
|
||||
description = "AuthName";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
extraModules = singleton
|
||||
{ name = "python"; path = "${pkgs.mod_python}/modules/mod_python.so"; };
|
||||
|
||||
extraConfig = ''
|
||||
<Location ${config.projectsLocation}>
|
||||
SetHandler mod_python
|
||||
PythonHandler trac.web.modpython_frontend
|
||||
PythonOption TracEnvParentDir /var/trac/projects
|
||||
PythonOption TracUriRoot ${config.projectsLocation}
|
||||
PythonOption PYTHON_EGG_CACHE /var/trac/egg-cache
|
||||
</Location>
|
||||
${if config.ldapAuthentication.enable then ''
|
||||
<LocationMatch "^${config.projectsLocation}[^/]+/login$">
|
||||
AuthType Basic
|
||||
AuthName "${config.ldapAuthentication.name}"
|
||||
AuthBasicProvider "ldap"
|
||||
AuthLDAPURL "${config.ldapAuthentication.url}"
|
||||
${if versionPre24 then "authzldapauthoritative Off" else ""}
|
||||
require valid-user
|
||||
</LocationMatch>
|
||||
'' else ""}
|
||||
'';
|
||||
|
||||
globalEnvVars = singleton
|
||||
{ name = "PYTHONPATH";
|
||||
value =
|
||||
makeSearchPathOutput "lib" "lib/${pkgs.python.libPrefix}/site-packages"
|
||||
[ pkgs.mod_python
|
||||
pkgs.pythonPackages.trac
|
||||
pkgs.pythonPackages.setuptools
|
||||
pkgs.pythonPackages.genshi
|
||||
pkgs.pythonPackages.psycopg2
|
||||
subversion
|
||||
];
|
||||
};
|
||||
|
||||
startupScript = pkgs.writeScript "activateTrac" ''
|
||||
mkdir -p /var/trac
|
||||
chown ${config.user}:${config.group} /var/trac
|
||||
|
||||
${concatMapStrings (project:
|
||||
''
|
||||
if [ ! -d /var/trac/${project.identifier} ]
|
||||
then
|
||||
export PYTHONPATH=${pkgs.pythonPackages.psycopg2}/lib/${pkgs.python.libPrefix}/site-packages
|
||||
${pkgs.pythonPackages.trac}/bin/trac-admin /var/trac/${project.identifier} initenv "${project.name}" "${project.databaseURL}" svn "${project.subversionRepository}"
|
||||
fi
|
||||
'' ) (config.projects)}
|
||||
'';
|
||||
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
import ./make-test.nix ({ pkgs, ... }: {
|
||||
name = "trac";
|
||||
meta = with pkgs.stdenv.lib.maintainers; {
|
||||
maintainers = [ eelco ];
|
||||
};
|
||||
|
||||
nodes = {
|
||||
storage =
|
||||
{ ... }:
|
||||
{ services.nfs.server.enable = true;
|
||||
services.nfs.server.exports = ''
|
||||
/repos 192.168.1.0/255.255.255.0(rw,no_root_squash)
|
||||
'';
|
||||
services.nfs.server.createMountPoints = true;
|
||||
};
|
||||
|
||||
postgresql =
|
||||
{ pkgs, ... }:
|
||||
{ services.postgresql.enable = true;
|
||||
services.postgresql.package = pkgs.postgresql;
|
||||
services.postgresql.enableTCPIP = true;
|
||||
services.postgresql.authentication = ''
|
||||
# Generated file; do not edit!
|
||||
local all all trust
|
||||
host all all 127.0.0.1/32 trust
|
||||
host all all ::1/128 trust
|
||||
host all all 192.168.1.0/24 trust
|
||||
'';
|
||||
};
|
||||
|
||||
webserver =
|
||||
{ pkgs, ... }:
|
||||
{ fileSystems = pkgs.lib.mkVMOverride
|
||||
[ { mountPoint = "/repos";
|
||||
device = "storage:/repos";
|
||||
fsType = "nfs";
|
||||
}
|
||||
];
|
||||
services.httpd.enable = true;
|
||||
services.httpd.adminAddr = "root@localhost";
|
||||
services.httpd.extraSubservices = [ { serviceType = "trac"; } ];
|
||||
environment.systemPackages = [ pkgs.pythonPackages.trac pkgs.subversion ];
|
||||
};
|
||||
|
||||
client =
|
||||
{ ... }:
|
||||
{ imports = [ ./common/x11.nix ];
|
||||
services.xserver.desktopManager.plasma5.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
testScript =
|
||||
''
|
||||
startAll;
|
||||
|
||||
$postgresql->waitForUnit("postgresql");
|
||||
$postgresql->succeed("createdb trac");
|
||||
|
||||
$webserver->succeed("mkdir -p /repos/trac");
|
||||
$webserver->succeed("svnadmin create /repos/trac");
|
||||
|
||||
$webserver->waitForUnit("httpd");
|
||||
$webserver->waitForFile("/var/trac");
|
||||
$webserver->succeed("mkdir -p /var/trac/projects/test");
|
||||
$webserver->succeed("PYTHONPATH=${pkgs.pythonPackages.psycopg2}/lib/${pkgs.python.libPrefix}/site-packages trac-admin /var/trac/projects/test initenv Test postgres://root\@postgresql/trac svn /repos/trac");
|
||||
|
||||
$client->waitForX;
|
||||
$client->execute("konqueror http://webserver/projects/test &");
|
||||
$client->waitForWindow(qr/Test.*Konqueror/);
|
||||
$client->sleep(30); # loading takes a long time
|
||||
|
||||
$client->screenshot("screen");
|
||||
'';
|
||||
})
|
Loading…
Reference in New Issue
Block a user