From 58393c6e79c1ebc0232af9b21b6db3fc43800a7a Mon Sep 17 00:00:00 2001 From: Ben Letchford Date: Tue, 22 Oct 2019 09:26:52 +1100 Subject: [PATCH] Document file download feature and bump version. --- README.md | 29 +++++++++++++++++++++++++++++ package.json | 5 +++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5c13055..414a8ce 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,35 @@ the user like this (Only while running wetty as a non root account): This is not a required feature and the security implications for passing the password in the url will have to be considered by the user +### File Downloading + +Wetty supports file downloads by printing terminal escape sequences between a +base64 encoded file. + +The terminal escape sequences used are `^[[5i` and `^[[4i` (VT100 for "enter +auto print" and "exit auto print" respectively - +https://vt100.net/docs/tp83/appendixc.html). + +An example of a helper script that prints the terminal escape characters and +base64s stdin: + +``` +$ cat wetty-download.sh +#!/bin/sh +echo '^[[5i'$(cat /dev/stdin | base64)'^[[4i' +``` + +You are then able to download files via wetty! + +``` +$ cat my-pdf-file.pdf | ./wetty-download.sh +``` + +Wetty will then issue a popup like the following that links to a local file +blob: + +`Download ready: file-20191015233654.pdf` + ## Run wetty behind nginx or apache As said earlier you can use a proxy to add https to WeTTy. diff --git a/package.json b/package.json index f3c35fa..82ea695 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wetty", - "version": "1.1.7", + "version": "1.1.8", "description": "WeTTY = Web + TTY. Terminal access in browser over http/https", "homepage": "https://github.com/krishnasrinivas/wetty", "repository": { @@ -128,6 +128,7 @@ "Strubbl ", "koushikmln ", "mirtouf ", - "nosemeocurrenada " + "nosemeocurrenada ", + "Ben Letchford " ] }