From 4509637a6af277606332274a1e8cfc93f7fec628 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 20 Apr 2014 18:38:59 -0400 Subject: webapp: Support using git-annex on a remote server, which was installed from the standalone tarball or OSX app, and so does not have git-annex in PATH (and may also not have git or rsync in PATH). * webapp: Support using git-annex on a remote server, which was installed from the standalone tarball or OSX app, and so does not have git-annex in PATH (and may also not have git or rsync in PATH). * standalone tarball, OSX app: Install a ~/.ssh/git-annex-wrapper, which can be used to run git-annex, git, rsync, etc. --- standalone/linux/skel/runshell | 15 +++++++++++++++ standalone/osx/git-annex.app/Contents/MacOS/runshell | 15 +++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'standalone') diff --git a/standalone/linux/skel/runshell b/standalone/linux/skel/runshell index 4481b0d7f..73703358d 100755 --- a/standalone/linux/skel/runshell +++ b/standalone/linux/skel/runshell @@ -34,11 +34,26 @@ if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then ( echo "#!/bin/sh" echo "set -e" + echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then" echo "exec $base/runshell git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\"" + echo "else" + echo "exec $base/runshell git-annex-shell -c \"\$@\"" + echo "fi" ) > "$HOME/.ssh/git-annex-shell" chmod +x "$HOME/.ssh/git-annex-shell" fi +# And this shim is used by the webapp when adding a remote ssh server. +if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then + mkdir "$HOME/.ssh" >/dev/null 2>&1 || true + ( + echo "#!/bin/sh" + echo "set -e" + echo "exec $base/runshell \"\$@\"" + ) > "$HOME/.ssh/git-annex-wrapper" + chmod +x "$HOME/.ssh/git-annex-wrapper" +fi + # Put our binaries first, to avoid issues with out of date or incompatable # system binaries. ORIG_PATH="$PATH" diff --git a/standalone/osx/git-annex.app/Contents/MacOS/runshell b/standalone/osx/git-annex.app/Contents/MacOS/runshell index 9f1457e25..c5d689c6e 100755 --- a/standalone/osx/git-annex.app/Contents/MacOS/runshell +++ b/standalone/osx/git-annex.app/Contents/MacOS/runshell @@ -36,11 +36,26 @@ if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then ( echo "#!/bin/sh" echo "set -e" + echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then" echo "exec $base/runshell git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\"" + echo "else" + echo "exec $base/runshell git-annex-shell -c \"\$@\"" + echo "fi" ) > "$HOME/.ssh/git-annex-shell" chmod +x "$HOME/.ssh/git-annex-shell" fi +# And this shim is used by the webapp when adding a remote ssh server. +if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then + mkdir "$HOME/.ssh" >/dev/null 2>&1 || true + ( + echo "#!/bin/sh" + echo "set -e" + echo "exec $base/runshell \"\$@\"" + ) > "$HOME/.ssh/git-annex-wrapper" + chmod +x "$HOME/.ssh/git-annex-wrapper" +fi + # Put our binaries first, to avoid issues with out of date or incompatable # system binaries. ORIG_PATH="$PATH" -- cgit v1.2.3