diff --git a/.prettierignore b/.prettierignore index a8a21b4..fdce993 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,5 @@ +*.md dist-newstyle/ dist/ nix/ -*.md +website/ diff --git a/src/Lhp/Types.hs b/src/Lhp/Types.hs index 747583c..b3a3b1f 100644 --- a/src/Lhp/Types.hs +++ b/src/Lhp/Types.hs @@ -193,7 +193,7 @@ instance ADC.HasCodec Distribution where <*> ADC.requiredField "version" "Distribution version (cat /etc/os-release | grep 'VERSION=')." ADC..= _distributionVersion <*> ADC.requiredField "release" "Distribution release (cat /etc/os-release | grep 'VERSION_ID=')." ADC..= _distributionRelease <*> ADC.requiredField "codename" "Distribution codename (cat /etc/os-release | grep 'VERSION_CODENAME=')." ADC..= _distributionCodename - <*> ADC.requiredField "Description" "Distribution description (cat /etc/os-release | grep 'PRETTY_NAME=')." ADC..= _distributionDescription + <*> ADC.requiredField "description" "Distribution description (cat /etc/os-release | grep 'PRETTY_NAME=')." ADC..= _distributionDescription -- * Docker Container Information diff --git a/src/scripts/cloud.sh b/src/scripts/cloud.sh index 888f7c0..b19de05 100644 --- a/src/scripts/cloud.sh +++ b/src/scripts/cloud.sh @@ -36,7 +36,7 @@ _check_command curl # PROCEDURE # ############# -if curl --silent --fail --max-time 3 http://169.254.169.254/latest/meta-data/ami-id >/dev/null; then +if curl --silent --fail --max-time 2 http://169.254.169.254/latest/dynamic/instance-identity/document >/dev/null; then _print_var "LHP_CLOUD_NAME" "AWS" _print_var "LHP_CLOUD_ID" "$(curl -s http://169.254.169.254/latest/meta-data/instance-id)" _print_var "LHP_CLOUD_TYPE" "$(curl -s http://169.254.169.254/latest/meta-data/instance-type)" @@ -46,14 +46,14 @@ if curl --silent --fail --max-time 3 http://169.254.169.254/latest/meta-data/ami _print_var "LHP_CLOUD_LOCAL_ADDRESS" "$(curl -s http://169.254.169.254/latest/meta-data/local-ipv4)" _print_var "LHP_CLOUD_PUBLIC_HOSTNAME" "$(curl -s http://169.254.169.254/latest/meta-data/public-hostname)" _print_var "LHP_CLOUD_PUBLIC_ADDRESS" "$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)" -elif curl --silent --fail --max-time 3 http://169.254.169.254/metadata/v1/ >/dev/null; then +elif curl --silent --fail --max-time 2 http://169.254.169.254/metadata/v1/ >/dev/null; then _print_var "LHP_CLOUD_NAME" "DO" _print_var "LHP_CLOUD_ID" "$(curl -s http://169.254.169.254/metadata/v1/id)" _print_var "LHP_CLOUD_REGION" "$(curl -s http://169.254.169.254/metadata/v1/region)" _print_var "LHP_CLOUD_LOCAL_ADDRESS" "$(curl -s http://169.254.169.254/metadata/v1/interfaces/private/0/ipv4/address)" _print_var "LHP_CLOUD_PUBLIC_ADDRESS" "$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address)" _print_var "LHP_CLOUD_RESERVED_ADDRESS" "$(curl -s http://169.254.169.254/metadata/v1/reserved_ip/ipv4/ip_address)" -elif curl --silent --fail --max-time 3 http://169.254.169.254/latest/meta-data/network-config >/dev/null; then +elif curl --silent --fail --max-time 2 http://169.254.169.254/latest/meta-data/network-config >/dev/null; then _print_var "LHP_CLOUD_NAME" "HETZNER" _print_var "LHP_CLOUD_ID" "$(curl -s http://169.254.169.254/latest/meta-data/instance-id)" _print_var "LHP_CLOUD_REGION" "$(curl -s http://169.254.169.254/latest/meta-data/region)" diff --git a/website/src/components/app/-app.tsx b/website/src/components/app/-app.tsx index f0271a1..a71d70a 100644 --- a/website/src/components/app/-app.tsx +++ b/website/src/components/app/-app.tsx @@ -148,7 +148,7 @@ export function TabulateHosts({ hosts, onHostSelect }: { hosts: LhpData[]; onHos {host.kernel.machine} - {host.distribution.Description} + {host.distribution.description} {host.cloud.name} {host.hardware.cpuCount} {host.hardware.ramTotal} @@ -178,7 +178,7 @@ export function HostDetails({ host }: { host: LhpData }) { { key: 'Distribution Version ID', value: host.distribution.id }, { key: 'Distribution Version', value: host.distribution.version }, { key: 'Distribution Version Code', value: host.distribution.codename }, - { key: 'Distribution Full Name', value: host.distribution.Description }, + { key: 'Distribution Full Name', value: host.distribution.description }, { key: 'Cloud', value: host.cloud.name }, { key: 'Type', value: host.cloud.hostType }, { key: 'Region', value: host.cloud.hostRegion }, diff --git a/website/src/components/app/-data.tsx b/website/src/components/app/-data.tsx index fa4f5c4..d83dc6b 100644 --- a/website/src/components/app/-data.tsx +++ b/website/src/components/app/-data.tsx @@ -28,7 +28,7 @@ export interface LhpData { [k: string]: unknown; }; distribution: { - Description: string; + description: string; codename: null | string; id: string; name: string;