Fix problem with unprivileged user deployments

This commit is contained in:
Sander van der Burg 2020-06-19 22:52:20 +02:00 committed by Sander van der Burg
parent daefbcf612
commit e089b3b24d
3 changed files with 8 additions and 5 deletions

View File

@ -19,6 +19,7 @@ in
dysnomia = pkgs.dysnomia.override (origArgs: {
enableApacheWebApplication = true;
});
inherit forceDisableUserChange;
};
simpleAppservingTomcat = import ./simple-appserving-tomcat.nix {

View File

@ -4,6 +4,8 @@
let
mysqlSocket = "${runtimeDir}/mysqld${instanceSuffix}/mysqld${instanceSuffix}.sock";
mysqlUsername = "root";
pkg = mysqlConstructorFun {
inherit port instanceSuffix;
postInstall = ''
@ -11,7 +13,7 @@ let
mkdir -p $out/etc/dysnomia/containers
cat > $out/etc/dysnomia/containers/mysql-database${instanceSuffix} <<EOF
mysqlPort=${toString port}
mysqlUsername=root
mysqlUsername="${mysqlUsername}"
mysqlPassword=
mysqlSocket=${mysqlSocket}
EOF
@ -26,7 +28,7 @@ rec {
name = "mysql${instanceSuffix}";
mysqlPort = port;
inherit pkg type mysqlSocket;
inherit pkg type mysqlSocket mysqlUsername;
providesContainer = "mysql-database${instanceSuffix}";
}

View File

@ -1,4 +1,4 @@
{apacheConstructorFun, dysnomia}:
{apacheConstructorFun, dysnomia, forceDisableUserChange}:
{instanceSuffix ? "", port ? 80, modules ? [], serverName ? "localhost", serverAdmin, documentRoot ? ./webapp, extraConfig ? "", enableCGI ? false, enablePHP ? false, filesetOwner ? null, type}:
let
@ -20,8 +20,8 @@ let
in
{
name = "simpleWebappApache${instanceSuffix}";
inherit pkg type port;
inherit pkg type port documentRoot;
providesContainer = "apache-webapplication";
} // (if filesetOwner == null then {} else {
} // (if forceDisableUserChange || filesetOwner == null then {} else {
inherit filesetOwner;
})