1
0

齐治、h3c 堡垒机登录代理

This commit is contained in:
Sense T 2025-03-01 17:25:37 +08:00
parent 41705b2790
commit b4ace4f839
5 changed files with 70 additions and 0 deletions

View File

@ -28,6 +28,7 @@
packages."${system}" = {
h3c = import ./h3c { inherit pkgs; };
qzsec = import ./qzsec { inherit pkgs; };
};
nixosModules =

View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
URL="$1"
ARGS=$(echo $URL | sed 's|accessclient://||' | base64 -d | minideflate -d )
APP=$(echo $ARGS | jq -r.app)
if [ "$APP" != "putty" ]; then
echo "Unsupported app, should be putty."
sleep 5
exit 1
fi
HOSTNAME=$(echo $ARGS | jq -r .hn)
PORT_NUM=$(echo $ARGS | jq -r .pn)
USERNAME=$(echo $ARGS | jq -r .un)
PASSWORD=$(echo $ARGS | jq -r .pw)
passh -p "$PASSWORD" ssh -o StrictHostKeyChecking=no -o HostKeyAlgorithms=+ssh-rsa -p $PORT_NUM $USERNAME@$HOSTNAME

View File

@ -0,0 +1,13 @@
[Desktop Entry]
Type=Application
Version=@VERSION
Name=Access Client
GenericName=Access Client
Comment=Resource monitor that shows usage and stats for processor, memory, disks, network and processes
Comment[zh_CN]=H3C
Terminal=true
Categories=System;ConsoleOnly;
Keywords=system;h3c;
NoDisplay=true
Exec=@EXEC
MimeType=x-scheme-handler/accessclient

View File

@ -0,0 +1,33 @@
{
stdenv,
jq,
zlib-ng,
passh,
...
}:
let
bin = ./access-client;
desktop = ./access-client.desktop;
in
stdenv.mkDerivation rec {
pname = "access-client";
version = "1.0.0";
buildInputs = [
jq
zlib-ng
passh
];
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out/bin
cp -rv "${bin}" $out/bin
chmod +x $out/bin/*
mkdir -p $out/share/applications
cp -rv "${desktop}" $out/share/applications
'';
}

4
qzsec/default.nix Normal file
View File

@ -0,0 +1,4 @@
{ pkgs }:
{
access-client = pkgs.callPackage ./access-client/package.nix { };
}