From b52aedc76701b3e42acdb34ad2513b119dbaf7e0 Mon Sep 17 00:00:00 2001 From: IkiWiki Date: Mon, 2 Sep 2019 12:54:51 -0400 Subject: work towards referencing bsv --- backend/dep/build_ikiwiki.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 backend/dep/build_ikiwiki.sh (limited to 'backend/dep') diff --git a/backend/dep/build_ikiwiki.sh b/backend/dep/build_ikiwiki.sh new file mode 100755 index 0000000..38d6692 --- /dev/null +++ b/backend/dep/build_ikiwiki.sh @@ -0,0 +1,12 @@ +#!/bin/env bash + +SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +cd "$SCRIPTDIR"/ikiwiki && +{ PERL5LIB=`pwd` PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'CPAN::Shell->notest("install", "Bundle::IkiWiki")'; } && +#PERL5LIB=`pwd` PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'CPAN::Shell->notest("install", "Bundle::IkiWiki::Extras")' && +perl Makefile.PL PREFIX= INSTALL_BASE= && +make && + +echo To run ikiwiki: && +echo "PERL5LIB='$(pwd)' '$(pwd)/'ikiwiki.out" -- cgit v1.2.3 From 258fc3d7f7ba7983dcd3dac1429936227233eaf2 Mon Sep 17 00:00:00 2001 From: IkiWiki Date: Mon, 2 Sep 2019 13:51:05 -0400 Subject: fix ssh behavior on old ssh versions --- backend/dep/build_ikiwiki.sh | 2 +- backend/resilient/__init__.py | 14 +++++--------- backend/wrapped_ssh.sh | 6 ++++++ 3 files changed, 12 insertions(+), 10 deletions(-) create mode 100755 backend/wrapped_ssh.sh (limited to 'backend/dep') diff --git a/backend/dep/build_ikiwiki.sh b/backend/dep/build_ikiwiki.sh index 38d6692..3635e40 100755 --- a/backend/dep/build_ikiwiki.sh +++ b/backend/dep/build_ikiwiki.sh @@ -1,6 +1,6 @@ #!/bin/env bash -SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +SCRIPTDIR="$( cd "$( dirname "$0" )" >/dev/null 2>&1 && pwd )" cd "$SCRIPTDIR"/ikiwiki && { PERL5LIB=`pwd` PERL_MM_USE_DEFAULT=1 perl -MCPAN -e 'CPAN::Shell->notest("install", "Bundle::IkiWiki")'; } && diff --git a/backend/resilient/__init__.py b/backend/resilient/__init__.py index d44e914..e2b40c7 100644 --- a/backend/resilient/__init__.py +++ b/backend/resilient/__init__.py @@ -25,7 +25,7 @@ html_path = os.path.normpath(os.path.join(root_path, 'html')) wiki_src_path = os.path.normpath(os.path.join(root_path, 'wiki')) git_path = os.path.normpath(os.path.join(root_path, '.git')) -ssh_config_path = os.path.join(auth_path, "ssh-config") +ssh_wrap_path = os.path.join(backend_path, "wrapped_ssh.sh") for auth_subpath, auth_subpaths, auth_subfiles in os.walk(auth_path): for auth_subfile in auth_subfiles: @@ -83,21 +83,17 @@ class git: def pull(self): if self.remote == None: return False - # TODO: GIT_SSH_COMMAND needs new version of git - # to make it work on old versions, path ssh_config_path on environment - # and use a wrapper script that calls ssh -F - # then place path to wrapper script in os.environ["GIT_SSH"] - os.environ["GIT_SSH_COMMAND"] = "ssh -F %s" % ssh_config_path + os.environ["GIT_SSH"] = ssh_wrap_path status = os.system("git pull %s master" % self.remote) - del os.environ["GIT_SSH_COMMAND"] + del os.environ["GIT_SSH"] return status == 0 def push(self): if self.push_remote == None: return False - os.environ["GIT_SSH_COMMAND"] = "ssh -F %s" % ssh_config_path + os.environ["GIT_SSH"] = ssh_wrap_path status = os.system("git push %s master" % self.push_remote) - del os.environ["GIT_SSH_COMMAND"] + del os.environ["GIT_SSH"] return status == 0 diff --git a/backend/wrapped_ssh.sh b/backend/wrapped_ssh.sh new file mode 100755 index 0000000..8281e9d --- /dev/null +++ b/backend/wrapped_ssh.sh @@ -0,0 +1,6 @@ +#!/bin/env sh + +SCRIPTDIR="$( cd "$( dirname "$0" )" >/dev/null 2>&1 && pwd )" + +ssh -F "$SCRIPTDIR"/auth/ssh-config "$@" + -- cgit v1.2.3