From 022ee4d701878c185785ce72dd436639dd687199 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Mon, 30 Oct 2023 14:50:40 +0100 Subject: [PATCH] kibana7: drop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Depends on EOL software and no maintenance has been attempted to change this after a ping (https://github.com/NixOS/nixpkgs/issues/259178) Feel free to adopt and re-introduce if you care about this software. This will probably seriously hamper ELK usability in nixpkgs, but as it receives no maintenance… --- nixos/modules/module-list.nix | 1 - nixos/modules/services/search/kibana.nix | 213 ------------------ nixos/tests/elk.nix | 14 -- pkgs/development/tools/misc/kibana/7.x.nix | 60 ----- .../disable-nodejs-version-check-7.patch | 19 -- pkgs/top-level/aliases.nix | 2 + pkgs/top-level/all-packages.nix | 3 - 7 files changed, 2 insertions(+), 310 deletions(-) delete mode 100644 nixos/modules/services/search/kibana.nix delete mode 100644 pkgs/development/tools/misc/kibana/7.x.nix delete mode 100644 pkgs/development/tools/misc/kibana/disable-nodejs-version-check-7.patch diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 00da63992951..2e5b1ce90af0 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1147,7 +1147,6 @@ ./services/search/elasticsearch-curator.nix ./services/search/elasticsearch.nix ./services/search/hound.nix - ./services/search/kibana.nix ./services/search/meilisearch.nix ./services/search/opensearch.nix ./services/search/qdrant.nix diff --git a/nixos/modules/services/search/kibana.nix b/nixos/modules/services/search/kibana.nix deleted file mode 100644 index a5e132d5c38d..000000000000 --- a/nixos/modules/services/search/kibana.nix +++ /dev/null @@ -1,213 +0,0 @@ -{ config, lib, options, pkgs, ... }: - -with lib; - -let - cfg = config.services.kibana; - opt = options.services.kibana; - - ge7 = builtins.compareVersions cfg.package.version "7" >= 0; - lt6_6 = builtins.compareVersions cfg.package.version "6.6" < 0; - - cfgFile = pkgs.writeText "kibana.json" (builtins.toJSON ( - (filterAttrsRecursive (n: v: v != null && v != []) ({ - server.host = cfg.listenAddress; - server.port = cfg.port; - server.ssl.certificate = cfg.cert; - server.ssl.key = cfg.key; - - kibana.index = cfg.index; - kibana.defaultAppId = cfg.defaultAppId; - - elasticsearch.url = cfg.elasticsearch.url; - elasticsearch.hosts = cfg.elasticsearch.hosts; - elasticsearch.username = cfg.elasticsearch.username; - elasticsearch.password = cfg.elasticsearch.password; - - elasticsearch.ssl.certificate = cfg.elasticsearch.cert; - elasticsearch.ssl.key = cfg.elasticsearch.key; - elasticsearch.ssl.certificateAuthorities = cfg.elasticsearch.certificateAuthorities; - } // cfg.extraConf) - ))); - -in { - options.services.kibana = { - enable = mkEnableOption (lib.mdDoc "kibana service"); - - listenAddress = mkOption { - description = lib.mdDoc "Kibana listening host"; - default = "127.0.0.1"; - type = types.str; - }; - - port = mkOption { - description = lib.mdDoc "Kibana listening port"; - default = 5601; - type = types.port; - }; - - cert = mkOption { - description = lib.mdDoc "Kibana ssl certificate."; - default = null; - type = types.nullOr types.path; - }; - - key = mkOption { - description = lib.mdDoc "Kibana ssl key."; - default = null; - type = types.nullOr types.path; - }; - - index = mkOption { - description = lib.mdDoc "Elasticsearch index to use for saving kibana config."; - default = ".kibana"; - type = types.str; - }; - - defaultAppId = mkOption { - description = lib.mdDoc "Elasticsearch default application id."; - default = "discover"; - type = types.str; - }; - - elasticsearch = { - url = mkOption { - description = lib.mdDoc '' - Elasticsearch url. - - Defaults to `"http://localhost:9200"`. - - Don't set this when using Kibana >= 7.0.0 because it will result in a - configuration error. Use {option}`services.kibana.elasticsearch.hosts` - instead. - ''; - default = null; - type = types.nullOr types.str; - }; - - hosts = mkOption { - description = lib.mdDoc '' - The URLs of the Elasticsearch instances to use for all your queries. - All nodes listed here must be on the same cluster. - - Defaults to `[ "http://localhost:9200" ]`. - - This option is only valid when using kibana >= 6.6. - ''; - default = null; - type = types.nullOr (types.listOf types.str); - }; - - username = mkOption { - description = lib.mdDoc "Username for elasticsearch basic auth."; - default = null; - type = types.nullOr types.str; - }; - - password = mkOption { - description = lib.mdDoc "Password for elasticsearch basic auth."; - default = null; - type = types.nullOr types.str; - }; - - ca = mkOption { - description = lib.mdDoc '' - CA file to auth against elasticsearch. - - It's recommended to use the {option}`certificateAuthorities` option - when using kibana-5.4 or newer. - ''; - default = null; - type = types.nullOr types.path; - }; - - certificateAuthorities = mkOption { - description = lib.mdDoc '' - CA files to auth against elasticsearch. - - Please use the {option}`ca` option when using kibana \< 5.4 - because those old versions don't support setting multiple CA's. - - This defaults to the singleton list [ca] when the {option}`ca` option is defined. - ''; - default = lib.optional (cfg.elasticsearch.ca != null) ca; - defaultText = literalExpression '' - lib.optional (config.${opt.elasticsearch.ca} != null) ca - ''; - type = types.listOf types.path; - }; - - cert = mkOption { - description = lib.mdDoc "Certificate file to auth against elasticsearch."; - default = null; - type = types.nullOr types.path; - }; - - key = mkOption { - description = lib.mdDoc "Key file to auth against elasticsearch."; - default = null; - type = types.nullOr types.path; - }; - }; - - package = mkOption { - description = lib.mdDoc "Kibana package to use"; - default = pkgs.kibana; - defaultText = literalExpression "pkgs.kibana"; - type = types.package; - }; - - dataDir = mkOption { - description = lib.mdDoc "Kibana data directory"; - default = "/var/lib/kibana"; - type = types.path; - }; - - extraConf = mkOption { - description = lib.mdDoc "Kibana extra configuration"; - default = {}; - type = types.attrs; - }; - }; - - config = mkIf (cfg.enable) { - assertions = [ - { - assertion = ge7 -> cfg.elasticsearch.url == null; - message = - "The option services.kibana.elasticsearch.url has been removed when using kibana >= 7.0.0. " + - "Please use option services.kibana.elasticsearch.hosts instead."; - } - { - assertion = lt6_6 -> cfg.elasticsearch.hosts == null; - message = - "The option services.kibana.elasticsearch.hosts is only valid for kibana >= 6.6."; - } - ]; - systemd.services.kibana = { - description = "Kibana Service"; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" "elasticsearch.service" ]; - environment = { BABEL_CACHE_PATH = "${cfg.dataDir}/.babelcache.json"; }; - serviceConfig = { - ExecStart = - "${cfg.package}/bin/kibana" + - " --config ${cfgFile}" + - " --path.data ${cfg.dataDir}"; - User = "kibana"; - WorkingDirectory = cfg.dataDir; - }; - }; - - environment.systemPackages = [ cfg.package ]; - - users.users.kibana = { - isSystemUser = true; - description = "Kibana service user"; - home = cfg.dataDir; - createHome = true; - group = "kibana"; - }; - users.groups.kibana = {}; - }; -} diff --git a/nixos/tests/elk.nix b/nixos/tests/elk.nix index 0122bc440361..900ea6320100 100644 --- a/nixos/tests/elk.nix +++ b/nixos/tests/elk.nix @@ -119,11 +119,6 @@ let package = elk.elasticsearch; }; - kibana = { - enable = true; - package = elk.kibana; - }; - elasticsearch-curator = { enable = true; actionYAML = '' @@ -217,13 +212,6 @@ let one.wait_until_succeeds("cat /tmp/logstash.out | grep flowers") one.wait_until_succeeds("cat /tmp/logstash.out | grep -v dragons") - with subtest("Kibana is healthy"): - one.wait_for_unit("kibana.service") - one.wait_until_succeeds( - "curl --silent --show-error --fail-with-body 'http://localhost:5601/api/status'" - + " | jq -es 'if . == [] then null else .[] | .status.overall.state == \"green\" end'" - ) - with subtest("Metricbeat is running"): one.wait_for_unit("metricbeat.service") @@ -274,7 +262,6 @@ in { # name = "elk-7"; # elasticsearch = pkgs.elasticsearch7-oss; # logstash = pkgs.logstash7-oss; - # kibana = pkgs.kibana7-oss; # filebeat = pkgs.filebeat7; # metricbeat = pkgs.metricbeat7; # }; @@ -282,7 +269,6 @@ in { ELK-7 = mkElkTest "elk-7" { elasticsearch = pkgs.elasticsearch7; logstash = pkgs.logstash7; - kibana = pkgs.kibana7; filebeat = pkgs.filebeat7; metricbeat = pkgs.metricbeat7; }; diff --git a/pkgs/development/tools/misc/kibana/7.x.nix b/pkgs/development/tools/misc/kibana/7.x.nix deleted file mode 100644 index a4faa31a4214..000000000000 --- a/pkgs/development/tools/misc/kibana/7.x.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ elk7Version -, enableUnfree ? true -, lib -, stdenv -, makeWrapper -, fetchurl -, nodejs_16 -, coreutils -, which -}: - -let - nodejs = nodejs_16; - inherit (builtins) elemAt; - info = lib.splitString "-" stdenv.hostPlatform.system; - arch = elemAt info 0; - plat = elemAt info 1; - hashes = - { - x86_64-linux = "sha512-09XokG5krjxGnk34DhxpLOGRLjb2jd82uZtwGfrzSuuqMpBhkEptK2oySGxuGdHF8uowwlR5p5YO2TvBwMsWkQ=="; - x86_64-darwin = "sha512-cqRJnvu730Jfkr6vwbHUFuZube1g522cmvnDwTzhGGK6VN/7+9XL3vavqtUPDVdTLTUk+DrNiIQK7MaJH3SHMg=="; - aarch64-linux = "sha512-zhtYThz5j4+w5gI1JWSnHv709Tk23eegVsrtYmdaYhZiTw2yvCTYI5uNAfBjBr8XPdp6CKF4e6Bh2wHKDYg1mg=="; - aarch64-darwin = "sha512-cqRJnvu730Jfkr6vwbHUFuZube1g522cmvnDwTzhGGK6VN/7+9XL3vavqtUPDVdTLTUk+DrNiIQK7MaJH3SHMg=="; - }; - -in stdenv.mkDerivation rec { - pname = "kibana"; - version = elk7Version; - - src = fetchurl { - url = "https://artifacts.elastic.co/downloads/kibana/${pname}-${version}-${plat}-${arch}.tar.gz"; - hash = hashes.${stdenv.hostPlatform.system} or (throw "Unknown architecture"); - }; - - patches = [ - # Kibana specifies it specifically needs nodejs 10.15.2 but nodejs in nixpkgs is at 10.15.3. - # The test succeeds with this newer version so lets just - # disable the version check. - ./disable-nodejs-version-check-7.patch - ]; - - nativeBuildInputs = [ makeWrapper ]; - - installPhase = '' - mkdir -p $out/libexec/kibana $out/bin - mv * $out/libexec/kibana/ - rm -r $out/libexec/kibana/node - makeWrapper $out/libexec/kibana/bin/kibana $out/bin/kibana \ - --prefix PATH : "${lib.makeBinPath [ nodejs coreutils which ]}" - sed -i 's@NODE=.*@NODE=${nodejs}/bin/node@' $out/libexec/kibana/bin/kibana - ''; - - meta = with lib; { - description = "Visualize logs and time-stamped data"; - homepage = "http://www.elasticsearch.org/overview/kibana"; - license = licenses.elastic20; - maintainers = with maintainers; [ offline basvandijk ]; - platforms = with platforms; unix; - }; -} diff --git a/pkgs/development/tools/misc/kibana/disable-nodejs-version-check-7.patch b/pkgs/development/tools/misc/kibana/disable-nodejs-version-check-7.patch deleted file mode 100644 index ef4c207764c1..000000000000 --- a/pkgs/development/tools/misc/kibana/disable-nodejs-version-check-7.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/src/setup_node_env/node_version_validator.js b/src/setup_node_env/node_version_validator.js -index 3f611e5a..f5c60c85 100644 ---- a/src/setup_node_env/node_version_validator.js -+++ b/src/setup_node_env/node_version_validator.js -@@ -25,11 +25,11 @@ var pkg = require('../../package.json'); // Note: This is written in ES5 so we c - var currentVersion = process && process.version || null; - var rawRequiredVersion = pkg && pkg.engines && pkg.engines.node || null; - var requiredVersion = rawRequiredVersion ? 'v' + rawRequiredVersion : rawRequiredVersion; --var isVersionValid = !!currentVersion && !!requiredVersion && currentVersion === requiredVersion; // Validates current the NodeJS version compatibility when Kibana starts. -+var isVersionValid = !!currentVersion && !!requiredVersion; // Validates current the NodeJS version compatibility when Kibana starts. - - if (!isVersionValid) { - var errorMessage = 'Kibana does not support the current Node.js version ' + currentVersion + '. Please use Node.js ' + requiredVersion + '.'; // Actions to apply when validation fails: error report + exit. - - console.error(errorMessage); - process.exit(1); --} -\ No newline at end of file -+} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index f3db0c7c7913..ef11a1267624 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -428,6 +428,8 @@ mapAliases ({ keysmith = libsForQt5.kdeGear.keysmith; # Added 2021-07-14 kfctl = throw "kfctl is broken and has been archived by upstream" ; # Added 2023-08-21 kgx = gnome-console; # Added 2022-02-19 + kibana7 = throw "Kibana 7.x has been removed from nixpkgs as it depends on an end of life Node.js version and received no maintenance in time."; # Added 2023-30-10 + kibana = kibana7; kicad-with-packages3d = throw "'kicad-with-packages3d' has been renamed to/replaced by 'kicad'"; # Converted to throw 2023-09-10 kio-admin = libsForQt5.kdeGear.kio-admin; # Added 2023-03-18 kodiGBM = kodi-gbm; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a7716efbab3d..963f4bfdaa78 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9830,9 +9830,6 @@ with pkgs; kluctl = callPackage ../applications/networking/cluster/kluctl { }; - kibana7 = callPackage ../development/tools/misc/kibana/7.x.nix { }; - kibana = kibana7; - kibi = callPackage ../applications/editors/kibi { }; kio-fuse = libsForQt5.callPackage ../tools/filesystems/kio-fuse { };