* Allow Mediawiki (and other PHP applications) to send email through

the `sendmail' command (i.e. ssmtp).  This is hacky - there should
  be some global config value that specifies the path to sendmail,
  which the ssmtp module and others can then set.

svn path=/nixos/trunk/; revision=18777
This commit is contained in:
Eelco Dolstra 2009-12-03 08:25:16 +00:00
parent f99d9b0658
commit 81c3454cdb
2 changed files with 17 additions and 80 deletions

View File

@ -464,84 +464,6 @@ in
'';
};
subservices = {
# !!! remove this
subversion = {
enable = mkOption {
default = false;
description = "
Whether to enable the Subversion subservice in the webserver.
";
};
notificationSender = mkOption {
default = "svn-server@example.org";
example = "svn-server@example.org";
description = "
The email address used in the Sender field of commit
notification messages sent by the Subversion subservice.
";
};
userCreationDomain = mkOption {
default = "example.org";
example = "example.org";
description = "
The domain from which user creation is allowed. A client can
only create a new user account if its IP address resolves to
this domain.
";
};
autoVersioning = mkOption {
default = false;
description = "
Whether you want the Subversion subservice to support
auto-versioning, which enables Subversion repositories to be
mounted as read/writable file systems on operating systems that
support WebDAV.
";
};
dataDir = mkOption {
default = "/no/such/path/exists";
description = "
Place to put SVN repository.
";
};
organization = {
name = mkOption {
default = null;
description = "
Name of the organization hosting the Subversion service.
";
};
url = mkOption {
default = null;
description = "
URL of the website of the organization hosting the Subversion service.
";
};
logo = mkOption {
default = null;
description = "
Logo the organization hosting the Subversion service.
";
};
};
};
};
}
# Include the options shared between the main server and virtual hosts.
@ -590,7 +512,20 @@ in
# with coverage enabled.
GCOV_PREFIX = "/tmp/coverage-data";
PATH = "${pkgs.coreutils}/bin:${pkgs.gnugrep}/bin:${concatStringsSep ":" (concatMap (svc: svc.extraServerPath) allSubservices)}";
PATH = concatStringsSep ":" (
[ "${pkgs.coreutils}/bin" "${pkgs.gnugrep}/bin" ]
++ # Needed for PHP's mail() function. !!! Probably the
# ssmtp module should export the path to sendmail in
# some way.
optional config.networking.defaultMailServer.directDelivery "${pkgs.ssmtp}/sbin"
++ (concatMap (svc: svc.extraServerPath) allSubservices) );
PHPRC = pkgs.writeText "php.ini"
''
; Needed for PHP's mail() function.
sendmail_path = sendmail -t -i
'';
} // (listToAttrs (concatMap (svc: svc.globalEnvVars) allSubservices));
preStart =

View File

@ -41,6 +41,9 @@ let
$wgDBserver = "";
$wgDBuser = "wwwrun";
$wgDBname = "mediawiki";
$wgEmergencyContact = "${serverInfo.serverConfig.adminAddr}";
$wgPasswordSender = $wgEmergencyContact;
?>
'';
@ -172,5 +175,4 @@ in
${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} wwwrun -c "(echo 'CREATE LANGUAGE plpgsql;'; cat /nix/store/q9gdf3f4362yhsdi8inlhpk26d9b8af6-mediawiki-1.15.1/maintenance/postgres/tables.sql; echo 'CREATE TEXT SEARCH CONFIGURATION public.default ( COPY = pg_catalog.english );'; echo COMMIT) | ${pkgs.postgresql}/bin/psql mediawiki"
fi
'';
}