From b4fad44f1aa7d2e14cfa1916f0ab58832d013216 Mon Sep 17 00:00:00 2001 From: disk0x Date: Tue, 18 Aug 2020 20:22:42 +0200 Subject: [PATCH] Adds the alternative of the sftp command for SSH Some managed web hosts (e.g. gandi.net) do not allow uploads with scp or rsync, so the sftp command is a necessary alternative. --- pelican/tools/templates/Makefile.jinja2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pelican/tools/templates/Makefile.jinja2 b/pelican/tools/templates/Makefile.jinja2 index a60f1e16..045cf242 100644 --- a/pelican/tools/templates/Makefile.jinja2 +++ b/pelican/tools/templates/Makefile.jinja2 @@ -70,6 +70,7 @@ help: @echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 ' @echo ' make devserver [PORT=8000] serve and regenerate together ' @echo ' make ssh_upload upload the web site via SSH ' + @echo ' make sftp_upload upload the web site via sftp ' @echo ' make rsync_upload upload the web site via rsync+ssh ' {% if dropbox %} @echo ' make dropbox_upload upload the web site via Dropbox ' @@ -121,6 +122,9 @@ publish: ssh_upload: publish scp -P $(SSH_PORT) -r "$(OUTPUTDIR)"/* "$(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)" +sftp_upload: publish + printf 'put -r $(OUTPUTDIR)/*' | sftp $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) + {% set upload = upload + ["rsync_upload"] %} rsync_upload: publish rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --include tags --cvs-exclude --delete "$(OUTPUTDIR)"/ "$(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)"