diff --git a/default.nix b/default.nix index a571cab..eb619b5 100644 --- a/default.nix +++ b/default.nix @@ -111,6 +111,7 @@ let pkgs.nil pkgs.nixpkgs-fmt pkgs.nodePackages.prettier + pkgs.nodejs_20 pkgs.upx ## Our custom scripts: @@ -128,6 +129,9 @@ let binPaths = [ pkgs.bashInteractive ## Added for bash-based CLI option completions ]; + nativeBuildInputs = [ + pkgs.openssh ## Required by the application tests + ]; }; ############ diff --git a/nix/sources.json b/nix/sources.json index f8fbf2d..6f4cde2 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": null, "owner": "NixOS", "repo": "nixpkgs", - "rev": "40d989164088db79c1895f177ee67216d91ae8a5", - "sha256": "149awch51367za8mjs2inx5m3jgijh9ibda1slf8gywc7lbalsaa", + "rev": "7644b4bc09c6329bcd82561a076fd7add697d092", + "sha256": "11ic5as26f82rcd71wag0n5p4aacb7cz4v3y3kw9p72nkv0i19wi", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/40d989164088db79c1895f177ee67216d91ae8a5.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/7644b4bc09c6329bcd82561a076fd7add697d092.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } diff --git a/src/Lhp/Remote.hs b/src/Lhp/Remote.hs index 7d17d5d..1c5fca9 100644 --- a/src/Lhp/Remote.hs +++ b/src/Lhp/Remote.hs @@ -100,6 +100,10 @@ instance Aeson.ToJSON LhpError where -- * Internal +-- | Builds 'Z.Ssh.SshConfig' value from 'Types.Host'. +-- +-- If the host does not have an SSH configuration, it will default to +-- an SSH configuration with the host name as the destination. getHostSshConfig :: Types.Host -> Z.Ssh.SshConfig getHostSshConfig Types.Host {..} = fromMaybe Z.Ssh.SshConfig {_sshConfigDestination = _hostName, _sshConfigOptions = []} _hostSsh diff --git a/website/.envrc b/website/.envrc deleted file mode 100644 index 3550a30..0000000 --- a/website/.envrc +++ /dev/null @@ -1 +0,0 @@ -use flake diff --git a/website/flake.lock b/website/flake.lock deleted file mode 100644 index 8a78cfe..0000000 --- a/website/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1709126324, - "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "d465f4819400de7c8d874d50b982301f28a84605", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1709763014, - "narHash": "sha256-CopSGZnFg+7n7WwBZ/iqIQhLJo0Xc59OWQo9zN9gmwo=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "03e303468a0b89792bc40c2f3a7cd8a322b66fad", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "release-23.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/website/flake.nix b/website/flake.nix deleted file mode 100644 index 5ef9c07..0000000 --- a/website/flake.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - description = "Nix Development Shell"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/release-23.11"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = inputs: - inputs.flake-utils.lib.eachDefaultSystem (system: - let - nixpkgs = import inputs.nixpkgs { inherit system; }; - in - { - devShell = nixpkgs.mkShell { - buildInputs = [ - nixpkgs.nodePackages.typescript-language-server - nixpkgs.nodejs_20 - nixpkgs.typescript - ]; - }; - } - ); -} diff --git a/website/src/components/report/TabulateSshKeys.tsx b/website/src/components/report/TabulateSshKeys.tsx index 0413d43..0f67859 100644 --- a/website/src/components/report/TabulateSshKeys.tsx +++ b/website/src/components/report/TabulateSshKeys.tsx @@ -3,6 +3,7 @@ import { Chip } from '@nextui-org/chip'; import { Radio, RadioGroup, Select, SelectItem, Selection } from '@nextui-org/react'; import { Table, TableBody, TableCell, TableColumn, TableHeader, TableRow } from '@nextui-org/table'; import { useEffect, useState } from 'react'; +import { toast } from 'react-toastify'; export function TabulateSshKeys({ records }: { records: SshKeysTableRecord[] }) { const [filters, setFilters] = useState boolean>>({}); @@ -135,13 +136,7 @@ export function TabulateSshKeys({ records }: { records: SshKeysTableRecord[] }) - +
Type Length @@ -164,7 +159,30 @@ export function TabulateSshKeys({ records }: { records: SshKeysTableRecord[] }) UNKNOWN )} - {record.key.fingerprint} + + {record.key.fingerprint} +
+ { + navigator.clipboard.writeText(record.key.fingerprint); + toast('Fingerprint is copied to clipboard.'); + }} + > + (copy fingerprint) + + + { + navigator.clipboard.writeText(record.key.data); + toast('Fingerprint is copied to clipboard.'); + }} + > + (copy key) + +
+
{record.seenHosts.size} {Array.from(record.seenHosts).map((h) => (