feat: remove ability to copy directly using scp/sftp

This commit is contained in:
Pallav Vasa 2025-05-17 06:33:36 +00:00
parent 5181a3c194
commit 61902a8b5b

View File

@ -8,8 +8,6 @@ REPO="babbarc/workspaces"
BRANCH="master"
URL="$PROTOCOL://$HOST/$REPO/raw/branch/$BRANCH"
ALLOWED_PATH="/home/infilytics/home.tar.gz"
LOG_FILE="/tmp/.gitops-router-${PERSON}.log"
log() {
@ -20,11 +18,6 @@ log() {
log info "Received SSH_ORIGINAL_COMMAND: $SSH_ORIGINAL_COMMAND"
if [[ "${SSH_ORIGINAL_COMMAND:-}" == "scp -t $ALLOWED_PATH" ]]; then
exec scp -t "ALLOWED_PATH"
exit
fi
# Ensure the variable is set
if [[ -z "${SSH_ORIGINAL_COMMAND:-}" ]]; then
log error "No SSH_ORIGINAL_COMMAND provided."
@ -92,9 +85,6 @@ clean)
status)
podman images
;;
scp)
log error "Invalid scp upload path: $args"
;;
*)
log error "Unknown command: $command"
exit 127