This commit is contained in:
cutemeli
2025-12-22 10:35:30 +00:00
parent 0bfc6c8425
commit 5ce7ca2c5d
38927 changed files with 0 additions and 4594700 deletions

View File

@@ -1,48 +0,0 @@
#!/bin/bash
# Copyright 1999-2023. Plesk International GmbH. All rights reserved.
PN=$(basename $0)
die ()
{
echo "$@" 1>&2;
exit 1
}
usage()
{
cat << EOT
Usage: $PN <user> <working-dir> [<gitarg1> <gitarg2>...]
Execute git command with user rights in selected working directory
EOT
}
if [ "$#" -le 3 ]; then
usage
exit 1
fi
username="$1"
if ! id "$username" >/dev/null 2>&1; then
die "Unknown user $username"
fi
shift
workdir="$1"
shift
git_cmd=$(command -v git)
if [ "$?" != "0" ]; then
die "Command git does not found"
fi
export PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin"
export GIT_SSH="/usr/local/psa/admin/sbin/modules/git/git_ssh"
export GIT_SSH_VARIANT=ssh
export PRESERVE_ENV="GIT_SSH,GIT_ASKPASS,GIT_PASS"
HOME=$(eval echo ~"$username")
export HOME
umask 022
/usr/local/psa/admin/sbin/filemng "$username" exec "$workdir" "$git_cmd" "$@"

View File

@@ -1,73 +0,0 @@
#!/bin/bash
# Copyright 1999-2016. Parallels IP Holdings GmbH. All Rights Reserved.
usage()
{
echo "Usage: $0 [-p <port>] <hostname> [<args>...]" >&2
exit 2
}
update_known_hosts()
{
local port= server= offset=0
if [ "$1" = "-o" ]; then
offset=2
fi
option_arg_num=$((offset+1))
if [ "${!option_arg_num}" = "-p" ]; then
port_offset=$((offset+2))
server_offset=$((offset+3))
port="${!port_offset}"
server="${!server_offset}"
else
server_offset=$((offset+1))
server="${!server_offset}"
fi
local hostname="`echo "$server" | cut -d@ -f2`"
local server_addr="$hostname${port:+:$port}"
KNOWN_HOSTS="`readlink -m ~/.ssh/git_known_hosts${port:+_with_port_$port}`"
if [ -f "$KNOWN_HOSTS" ] && [ -n "`ssh-keygen -F "$hostname" -f "$KNOWN_HOSTS"`" ]; then
echo "Public key for the server at '$server_addr' is already known in '$KNOWN_HOSTS'." >&2
return 0
fi
echo "Server at '$server_addr' is seen for the first time." >&2
echo "Adding its public key to the list of known hosts in '$KNOWN_HOSTS'." >&2
local key="`ssh-keyscan ${port:+-p $port} -H "$hostname"`"
[ -n "$key" ] || {
echo "Failed to gather public SSH host key for the '$server_addr'." >&2
return 1
}
mkdir -p -m0700 "`dirname "$KNOWN_HOSTS"`"
echo "$key" >> "$KNOWN_HOSTS" || {
echo "Failed to add public SSH host key for the '$server_addr' into '$KNOWN_HOSTS'." >&2
return 1
}
return 0
}
[ $# -ge 1 ] || usage
KNOWN_HOSTS=
update_known_hosts "$@"
[ -f "$KNOWN_HOSTS" ] || {
echo "Known hosts file '$KNOWN_HOSTS' doesn't exist" >&2
exit 1
}
if [ -z "$PLESK_SSH_KEY_PATH" ]
then
ssh -o UserKnownHostsFile="$KNOWN_HOSTS" -o StrictHostKeyChecking=yes -o HashKnownHosts=yes -o BatchMode=yes "$@"
else
ssh -i "$PLESK_SSH_KEY_PATH" -o UserKnownHostsFile="$KNOWN_HOSTS" -o StrictHostKeyChecking=yes -o HashKnownHosts=yes -o BatchMode=yes "$@"
fi

View File

@@ -1,8 +0,0 @@
#!/bin/bash
set -eu
if [ "${1:-}" = "remove" ] ; then
plesk sbin package --remove plesk-git-http || :
else
plesk sbin package --install git plesk-git-http
fi