feat: remove ability to copy directly using scp/sftp
This commit is contained in:
parent
5181a3c194
commit
61902a8b5b
@ -8,8 +8,6 @@ REPO="babbarc/workspaces"
|
|||||||
BRANCH="master"
|
BRANCH="master"
|
||||||
URL="$PROTOCOL://$HOST/$REPO/raw/branch/$BRANCH"
|
URL="$PROTOCOL://$HOST/$REPO/raw/branch/$BRANCH"
|
||||||
|
|
||||||
ALLOWED_PATH="/home/infilytics/home.tar.gz"
|
|
||||||
|
|
||||||
LOG_FILE="/tmp/.gitops-router-${PERSON}.log"
|
LOG_FILE="/tmp/.gitops-router-${PERSON}.log"
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
@ -20,11 +18,6 @@ log() {
|
|||||||
|
|
||||||
log info "Received SSH_ORIGINAL_COMMAND: $SSH_ORIGINAL_COMMAND"
|
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
|
# Ensure the variable is set
|
||||||
if [[ -z "${SSH_ORIGINAL_COMMAND:-}" ]]; then
|
if [[ -z "${SSH_ORIGINAL_COMMAND:-}" ]]; then
|
||||||
log error "No SSH_ORIGINAL_COMMAND provided."
|
log error "No SSH_ORIGINAL_COMMAND provided."
|
||||||
@ -92,9 +85,6 @@ clean)
|
|||||||
status)
|
status)
|
||||||
podman images
|
podman images
|
||||||
;;
|
;;
|
||||||
scp)
|
|
||||||
log error "Invalid scp upload path: $args"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
log error "Unknown command: $command"
|
log error "Unknown command: $command"
|
||||||
exit 127
|
exit 127
|
||||||
|
Loading…
x
Reference in New Issue
Block a user