From 56461fd16508ec855b9d7a44ffbef3cde9d7309c Mon Sep 17 00:00:00 2001 From: Vehbi Sinan Tunalioglu Date: Sun, 14 Apr 2024 18:52:34 +0800 Subject: [PATCH] feat(website): add content to landing page Closes #24. --- README.md | 7 +- website/src/app/globals.css | 4 + website/src/app/page.tsx | 244 ++++++++++++++++++++++++++++++++++-- 3 files changed, 242 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 5f44e13..d114e63 100644 --- a/README.md +++ b/README.md @@ -40,10 +40,6 @@ The report contains following information for each host: ## Installation -> [!NOTE] -> -> A statically compiled executable is planed. See [Issue 32]. - Currently, the easiest way to install the command-line application is via Nix: @@ -51,6 +47,9 @@ via Nix: nix profile install --file https://github.com/vst/hostpatrol/archive/v.tar.gz app ``` +Alternatively, you can use the statically compiled binary distributed +along with each release (Linux x86_64 only). + ## Usage `hostpatrol` assumes that you are able to connect to remote hosts via SSH: diff --git a/website/src/app/globals.css b/website/src/app/globals.css index b5c61c9..7af9b64 100644 --- a/website/src/app/globals.css +++ b/website/src/app/globals.css @@ -1,3 +1,7 @@ @tailwind base; @tailwind components; @tailwind utilities; + +.text-balance { + text-wrap: balance; +} diff --git a/website/src/app/page.tsx b/website/src/app/page.tsx index 58e8671..f428b3b 100644 --- a/website/src/app/page.tsx +++ b/website/src/app/page.tsx @@ -1,18 +1,244 @@ +import { Card, CardBody, CardHeader, Code } from '@nextui-org/react'; import Link from 'next/link'; export default function Page() { return (
-
-

Landing page is coming soon...

-

- Check{' '} - - report - {' '} - page. -

+ + +
+ + Install via Nix + + + nix profile install --file https://github.com/vst/lhp/archive/v<VERSION>.tar.gz app + + + Install Statically Build Executable (x86_64) + + + +
+                {`curl -Lo /tmp/hostpatrol https://github.com/vst/hostpatrol/releases/latest/download/hostpatrol-static-linux-x86_64
+sudo install /tmp/hostpatrol /usr/local/bin/hostpatrol`}
+              
+
+
+
+ + + Configuration Example + + + +
+                {`## List of known SSH public keys for all hosts.
+knownSshKeys:
+  - gh:some-github-user
+  - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKq9bpy0IIfDnlgaTCQk0YhKyKFqInRjoqeIPlBuiFwS test-key-admin
+
+## List of hosts to patrol
+hosts:
+  - ## Name of the host (required)
+    name: somehost
+    ## SSH configuration (optional)
+    ssh:
+      ## SSH destination (required)
+      destination: root@10.10.10.10
+      ## SSH options (optional)
+      options: ["-i", "/keys/hebele.pri"]
+    ## External identifier of the host (optional)
+    id: 20b88669-743f-4ae5-9823-5aacc2df7086
+    ## External URL for the host (optional)
+    url: https://internal.documentation/hosts/somehost
+    ## List of tags for the host (optional)
+    tags:
+      - oranges
+      - strawberries
+    ## Arbitrary JSON data for the host (optional)
+    data:
+      owner: Client-1
+      cost: 50
+    ## List of known SSH public keys for the host (optional)
+    knownSshKeys:
+      - gh:another-github-user
+      - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGmlBxUagOqtWcW6B77TUL8li85ZNYx0tphd3TSx4SEB test-key-tenant
+  - name: otherhost
+    url: https://internal.documentation/hosts/otherhost
+    tags:
+      - apples
+      - strawberries`}
+              
+
+
+
+ + + Usage + + +

You can pass hosts via CLI arguments:

+ + +
{`hostpatrol compile --host my-host-1 --host my-host-2 > /tmp/hostpatrol-report.json`}
+
+ +

This command connects to hosts sequentially and ignores problematic hosts in the output.

+ +

+ To use parallel mode, use `--parallel` flag. In this case, if any of the hosts cause an error, entire + operation will fail: +

+ + +
{`hostpatrol compile --parallel --host my-host-1 --host my-host-2 > /tmp/hostpatrol-report.json`}
+
+ +

+ Alternatively, you can use the configuration file which has additional benefit of attaching static + information to your hosts such as external documentation URL and/or tags, and using SSH configuration + instead of plain host name. +

+ + +
{`hostpatrol compile --config config.yaml > /tmp/hostpatrol-report.json`}
+
+ +

..., or mix with `--host` option:

+ + +
{`hostpatrol compile --config config.yaml --host a-host --host b-host > /tmp/hostpatrol-report.json`}
+
+ +

+ You can process/analyse the JSON output itself or use{' '} + + Web application + {' '} + to list, tabulate and visualise the information. +

+
+
+
+
+ ); +} + +function Points() { + return ( +
+
+
+

Patrol Your Hosts

+ +

+ Host Patrol is a command-line tool for gathering information about your hosts via SSH. It also offers a Web + application for viewing this information in your browser. +

+ +
+ GitHub Release + GitHub Issues or Pull Requests + GitHub Issues or Pull Requests +
+
+ +
+ {points.map((point) => ( +
+
{point.name}
+
{point.description}
+
+ ))} +
); } + +const points = [ + { + name: 'Who is it for?', + description: ( + <> + Host Patrol is for people who (1) manage multiple hosts on the cloud or on their own infrastructure, (2) need to + build a registry of such hosts, but (3) want a simple, hackable and free solution. + + ), + }, + { + name: 'What does it do?', + description: ( + <> + It collects information about your hosts through SSH and offers a hosted and privacy-preserving{' '} + + Web application + {' '} + for conveniently viewing this data in your browser. + + ), + }, + { + name: 'How does it work?', + description: ( + <> + You install the Host Patrol command-line tool on your local machine, prepare a configuration file, and run the + tool with the configuration to generate a JSON file containing information about your hosts. + + ), + }, + { + name: 'How does it collect the information?', + description: ( + <> + Assuming that you can SSH to the remote host, Host Patrol issues{' '} + + simple POSIX-shell commands + {' '} + to your remote host and compiles the output into a JSON file. + + ), + }, + { + name: 'What is the status of the project?', + description: ( + <> + This project is still in its early stages and currently fulfills the author's requirements. If you are + interested in this or similar solutions, please consider{' '} + + starring it on GitHub + + . + + ), + }, + { + name: 'How can you contribute?', + description: ( + <> + This project contains Haskell, Shell scripts, Nix and Typescript. It is licensed under the{' '} + + MIT license + + . Contributions are welcome through{' '} + + issues + {' '} + or{' '} + + pull requests + {' '} + on GitHub. + + ), + }, +];