diff options
author | IkiWiki <ikiwiki.info> | 2019-09-02 13:51:05 -0400 |
---|---|---|
committer | IkiWiki <ikiwiki.info> | 2019-09-02 13:51:05 -0400 |
commit | 258fc3d7f7ba7983dcd3dac1429936227233eaf2 (patch) | |
tree | cf45cc431b692e07811a8e3d8f62abd5937755ec /backend/resilient | |
parent | 1e6e19dad98f517152aeba4e4f60a87a7731d648 (diff) | |
download | standingwithresilience-258fc3d7f7ba7983dcd3dac1429936227233eaf2.tar.gz standingwithresilience-258fc3d7f7ba7983dcd3dac1429936227233eaf2.zip |
fix ssh behavior on old ssh versions
Diffstat (limited to 'backend/resilient')
-rw-r--r-- | backend/resilient/__init__.py | 14 |
1 files changed, 5 insertions, 9 deletions
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 |