SFTP action step


#1

I mentioned this in a recent blog post, so I should repeat it here. It would be helpful to have action steps for uploading to/downloading from SFTP in a manner similar to the steps for interacting with Dropbox and the other cloud storage services. Or maybe an SSH action step like the one in Shortcuts, which we could use for uploads and downloads and would be more flexible overall.


#2

I’d like this too. I have a couple of places where it would come in handy.

I think SSH in particular would also open up some other useful possibilities.


#3

Seconded (or thirded as the case may be). You know my current workflow which is to use a Shortcut and the SSH action, it works well - but simplifying my workflow to one action would be greatly appreciated!


#4

WebDAV not an option to enable on the servers you need to contact? I’ve played with FTP action steps, but not been able to get decent performance and reliability across servers. Still so many quirky FTP implementations and it’s more overhead to establish the session, etc.

Not saying it won’t happen, but I’ve not be happy with what I’ve been able to do to ship any of it.


#5

I have several Macs that I can use SFTP/SSH to but not WebDAV, so I’d definitely add a +1 to this.

You could always make sure that it works for connecting to a Mac and then tell everyone who complains it doesn’t work with Lin*x to upgrade to a Mac :wink:


#6

I have two problems with WebDAV:

First, my own incompetence. I have years of experience setting up SSH access and none with WebDAV. I’m worried I wouldn’t be able to get the same combination of security and flexibility as I have with SSH. I did consider WebDAV for a recent action, but decided to run an SSH Shortcut instead because of this concern.

Second, my plans include setting up a new server as a sort of remote Linux machine. I wouldn’t want to install a web server on it just for WebDAV. Again, I’d stick with the Shortcut solution or export my drafts to something like Coda rather than set up WebDAV.


#7

WebDAV doesn’t work for me.

I have a number of actions that I use to manipulate configuration files on systems that I work with (for example, taking a file a reformatting it to make is readable by naive users). Having a way to automatically pick up and send files within Drafts will save a lot of time.

The systems are Linux based and I can’t add packages to them. SSH and SFTP are natively supported.


#8

SSH please. Right now I’m using a javascript action that invokes a Shortcuts cut to do the SSH work.

I don’t know whether to share this as it has a corequisite Shortcuts cut. Further this cut has my credentials and target machine name embedded in it as I can’t pass more than one parameter* into a Shortcuts cut (so far as I know). Stripping them out wouldn’t be a pain; I just don’t like the method.

* The one parameter I am passing is, of course, the SSH command stream.


#9

Combine your parameters into a single string parameter with known separators (e.g. new line, pipe, unusual string), then split that out again within Shortcuts into a list.

If you have lots of parameters, build some JSON around it and then process it in Shortcuts as a dictionary.

I think any non-text content would either need to be base encoded or accessible online to be used with this approach.


#10

Right. Confecting JSON and unpacking it in my Shortcuts cut had occurred to me.

Another alternative is Pythonista and Paramiko. A third is via Prompt, but I’m not sure how well that would work.


#11

I don’t think Prompt is particularly “scriptable” or automation-friendly.


#12

I just played with Prompt via Launch Center Pro and I found two issues with it:

  1. You have to press a button in Prompt to actually initiate the connection.
  2. It doesn’t look like you can pass in commands.

So, I agree the Prompt URL scheme support isn’t particularly useful.