Merge pull request #29073 from Mic92/mongodb/2.4.8

mfi-controller: remove
This commit is contained in:
Jörg Thalheim 2017-09-07 20:31:19 +01:00 committed by GitHub
commit 56ccd27dee
6 changed files with 0 additions and 211 deletions

View File

@ -254,7 +254,6 @@
hydra-queue-runner = 235;
hydra-www = 236;
syncthing = 237;
mfi = 238;
caddy = 239;
taskd = 240;
factorio = 241;
@ -522,7 +521,6 @@
octoprint = 230;
radicale = 234;
syncthing = 237;
#mfi = 238; # unused
caddy = 239;
taskd = 240;
factorio = 241;

View File

@ -1,100 +0,0 @@
{ config, lib, pkgs, utils, ... }:
with lib;
let
name = "Ubiquiti mFi Controller";
cfg = config.services.mfi;
stateDir = "/var/lib/mfi";
# XXX 2 runtime exceptions using jre8: JSPException on GET / ; can't initialize ./data/keystore on first run.
cmd = "@${pkgs.jre7}/bin/java java -jar ${stateDir}/lib/ace.jar";
mountPoints = [
{ what = "${pkgs.mfi}/dl"; where = "${stateDir}/dl"; }
{ what = "${pkgs.mfi}/lib"; where = "${stateDir}/lib"; }
{ what = "${pkgs.mongodb248}/bin"; where = "${stateDir}/bin"; }
{ what = "${cfg.dataDir}"; where = "${stateDir}/data"; }
];
systemdMountPoints = map (m: "${utils.escapeSystemdPath m.where}.mount") mountPoints;
ports = [ 6080 6880 6443 6843 ];
in
{
options = {
services.mfi = {
enable = mkEnableOption name;
openPorts = mkOption {
type = types.bool;
default = true;
description = "Whether to open TCP ports ${concatMapStrings (a: "${toString a} ") ports}for the services.";
};
dataDir = mkOption {
type = types.str;
default = "${stateDir}/data";
description = ''
Where to store the database and other data.
This directory will be bind-mounted to ${stateDir}/data as part of the service startup.
'';
};
};
};
config = mkIf cfg.enable {
networking.firewall.allowedTCPPorts = mkIf config.services.mfi.openPorts ports;
users.users.mfi = {
uid = config.ids.uids.mfi;
description = "mFi controller daemon user";
home = "${stateDir}";
};
# We must create the binary directories as bind mounts instead of symlinks
# This is because the controller resolves all symlinks to absolute paths
# to be used as the working directory.
systemd.mounts = map ({ what, where }: {
bindsTo = [ "mfi.service" ];
partOf = [ "mfi.service" ];
unitConfig.RequiresMountsFor = stateDir;
options = "bind";
what = what;
where = where;
}) mountPoints;
systemd.services.mfi = {
description = "mFi controller daemon";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ] ++ systemdMountPoints;
partOf = systemdMountPoints;
bindsTo = systemdMountPoints;
unitConfig.RequiresMountsFor = stateDir;
preStart = ''
# Clear ./webapps each run.
rm -rf "${stateDir}/webapps"
mkdir -p "${stateDir}/webapps"
ln -s "${pkgs.mfi}/webapps/ROOT.war" "${stateDir}/webapps"
# Copy initial config only once.
test -e "${stateDir}/conf" || cp -ar "${pkgs.mfi}/conf" "${stateDir}/conf"
test -e "${stateDir}/data" || cp -ar "${pkgs.mfi}/data" "${stateDir}/data"
# Fix Permissions.
# (Bind-mounts cause errors; ignore exit codes)
chown -fR mfi: "${stateDir}" || true
chmod -fR u=rwX,go= "${stateDir}" || true
'';
postStop = ''
rm -rf "${stateDir}/webapps"
'';
serviceConfig = {
Type = "simple";
ExecStart = "${cmd} start";
ExecStop = "${cmd} stop";
User = "mfi";
PermissionsStartOnly = true;
UMask = "0077";
WorkingDirectory = "${stateDir}";
};
};
};
}

View File

@ -1,28 +0,0 @@
{ stdenv, callPackage, fetchFromGitHub, python, ... } @ args:
with stdenv.lib;
let
version = "3.14.5.10";
sha256 = "08vhl84166x13b3cbx8y0g99yqx772zd33gawsa1nxqkyrykql6k";
in
(callPackage ./generic.nix (args // {
inherit version sha256;
})).overrideDerivation (oldAttrs:{
patchPhase = [
oldAttrs.patchPhase
"sed -i 's,#!/usr/bin/python,#!${python}/bin/python,' build/gyp_v8"
];
# http://code.google.com/p/v8/issues/detail?id=2149
NIX_CFLAGS_COMPILE = concatStringsSep " " [
oldAttrs.NIX_CFLAGS_COMPILE
"-Wno-unused-local-typedefs"
"-Wno-aggressive-loop-optimizations"
];
src = fetchFromGitHub {
owner = "v8";
repo = "v8";
rev = "${version}";
inherit sha256;
};
})

View File

@ -1,28 +0,0 @@
{ stdenv, fetchurl, unzip }:
stdenv.mkDerivation rec {
name = "mfi-controller-${version}";
version = "2.1.11";
src = fetchurl {
url = "https://dl.ubnt.com/mfi/${version}/mFi.unix.zip";
sha256 = "0b9q6025zf9zjzq8dcmcyai8rslx67g52j41gacxsk9i5dspmw90";
};
buildInputs = [ unzip ];
dontBuild = true;
installPhase = ''
mkdir -p $out
cp -ar conf data dl lib webapps $out
'';
meta = with stdenv.lib; {
homepage = http://www.ubnt.com/;
description = "Controller for Ubiquiti mFi devices";
license = licenses.unfree;
platforms = platforms.unix;
maintainers = with maintainers; [ elitak ];
};
}

View File

@ -1,45 +0,0 @@
# This derivation was resurrected from 4c8ec5e12e187347fd97b1a1a9a43eb19e009ed0
# by elitak for use with the Ubiquiti mFi Controller package, which breaks at
# runtime on mongodb3+ and jre8+. We will need to pull in sufficiently old
# versions of boost and v8 to build this, as well.
{ stdenv, fetchurl, scons, boost155, v8_3_14, gperftools, pcre-cpp, snappy }:
with stdenv.lib;
let
version = "2.4.8";
in
stdenv.mkDerivation rec {
name = "mongodb-${version}";
src = fetchurl {
url = "http://downloads.mongodb.org/src/mongodb-src-r${version}.tar.gz";
sha256 = "1p6gnharypglfp39halp72fig96fqjhakyy7m76a1prxwpjkqw7x";
};
nativeBuildInputs = [ scons boost155 v8_3_14 gperftools pcre-cpp snappy ];
postPatch = ''
substituteInPlace SConstruct \
--replace "Environment( BUILD_DIR" "Environment( ENV = os.environ, BUILD_DIR" \
--replace 'CCFLAGS=["-Werror", "-pipe"]' 'CCFLAGS=["-pipe"]'
'';
NIX_CFLAGS_COMPILE = "-Wno-unused-local-typedefs";
buildPhase = ''
export SCONSFLAGS="-j$NIX_BUILD_CORES"
scons all --use-system-all
'';
installPhase = ''
mkdir -p $out/lib
scons install --use-system-all --full --prefix=$out
'';
meta = {
description = "A scalable, high-performance, open source NoSQL database";
homepage = http://www.mongodb.org;
license = licenses.agpl3;
maintainers = with maintainers; [ bluescreen303 elitak ];
platforms = platforms.linux;
};
}

View File

@ -10630,10 +10630,6 @@ with pkgs;
gnutls = gnutls;
});
v8_3_14 = callPackage ../development/libraries/v8/3.14.nix {
inherit (python2Packages) python gyp;
};
v8_3_16_14 = callPackage ../development/libraries/v8/3.16.14.nix {
inherit (python2Packages) python gyp;
cctools = darwin.cctools;
@ -11336,8 +11332,6 @@ with pkgs;
meteor = callPackage ../servers/meteor/default.nix { };
mfi = callPackage ../servers/mfi { };
minio = callPackage ../servers/minio { };
# Backwards compatibility.
@ -11479,8 +11473,6 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) Security;
};
mongodb248 = callPackage ../servers/nosql/mongodb/2.4.8.nix { };
percona-server56 = callPackage ../servers/sql/percona/5.6.x.nix { };
percona-server = percona-server56;