0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

* Create a user "mediawiki" and give root and wwwrun ident-based

access.

svn path=/nixos/trunk/; revision=18779
This commit is contained in:
Eelco Dolstra 2009-12-03 11:56:03 +00:00
parent c7e0a7b31c
commit 9f8fc09fc3
2 changed files with 14 additions and 3 deletions

View file

@ -111,8 +111,7 @@ in
};
dbUser = mkOption {
default = "wwwrun";
example = "mediawiki";
default = "mediawiki";
description = "The user name for accessing the database.";
};
@ -179,7 +178,11 @@ in
if ! ${pkgs.postgresql}/bin/psql -l | grep -q ' ${config.dbName} ' ; then
${pkgs.postgresql}/bin/createuser --no-superuser --no-createdb --no-createrole "${config.dbUser}" || true
${pkgs.postgresql}/bin/createdb "${config.dbName}" -O "${config.dbUser}"
${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} "${config.dbUser}" -c "(echo 'CREATE LANGUAGE plpgsql;'; cat ${mediawikiRoot}/maintenance/postgres/tables.sql; echo 'CREATE TEXT SEARCH CONFIGURATION public.default ( COPY = pg_catalog.english );'; echo COMMIT) | ${pkgs.postgresql}/bin/psql ${config.dbName}"
( echo 'CREATE LANGUAGE plpgsql;'
cat ${mediawikiRoot}/maintenance/postgres/tables.sql
echo 'CREATE TEXT SEARCH CONFIGURATION public.default ( COPY = pg_catalog.english );'
echo COMMIT
) | ${pkgs.postgresql}/bin/psql -U "${config.dbUser}" "${config.dbName}"
fi
'');
}