齐治、h3c 堡垒机登录代理
This commit is contained in:
parent
41705b2790
commit
b4ace4f839
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
packages."${system}" = {
|
packages."${system}" = {
|
||||||
h3c = import ./h3c { inherit pkgs; };
|
h3c = import ./h3c { inherit pkgs; };
|
||||||
|
qzsec = import ./qzsec { inherit pkgs; };
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModules =
|
nixosModules =
|
||||||
|
19
qzsec/access-client/access-client
Normal file
19
qzsec/access-client/access-client
Normal 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
|
13
qzsec/access-client/access-client.desktop
Normal file
13
qzsec/access-client/access-client.desktop
Normal 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
|
33
qzsec/access-client/package.nix
Normal file
33
qzsec/access-client/package.nix
Normal 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
4
qzsec/default.nix
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
{
|
||||||
|
access-client = pkgs.callPackage ./access-client/package.nix { };
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user