memry

2.0.1 • Public • Published

mem'ry npm downloads dependencies travis

logo

mem'ry was written for situations where you have to transfer files between two untrusted servers without the risk of compromising your private keys by forwarding your ssh-agent (no sane person would do that, right?).

You don't need to install any software on the sending system since standard curl is sufficient. It also works on systems that are running low on disk as there's no need to create temporary files, multiple files can be uploaded by packing them with tar, writing the archive to stdout and streaming it into curl.

Basically, it's nc file transfer for http(s) (except that you actually know if a file was transferred completely or partially).

Installation

npm install -g memry

Usage

# upload one file
curl -sST- http://127.0.0.1:8018 < file.bin
# upload multiple files
tar cvvJ files/*.bin.part | curl -T- http://127.0.0.1:8018
# upload log files only readable by root on systems that don't allow ssh as root
sudo tar cvvJ /var/log/nginx | curl -T- http://127.0.0.1:8018
# upload a single file with working progress bar
curl -T file.bin http://127.0.0.1:8018
# create auth file
memry htpasswd foo >> auth.txt
# upload with authentication
curl -T file.bin -u foo https://127.0.0.1:8018

Usage with docker

docker build -t memry .
mkdir storage
docker run --rm -p 80:8018 -v `pwd`/storage:/storage memry

# Start with authentication
echo bar | memry htpasswd foo >> auth.txt
echo buzz | docker run -i --rm memry htpasswd fizz >> auth.txt
docker run --rm -p 80:8018 -v `pwd`/storage:/storage  \
    -v `pwd`/auth.txt:/auth.txt:ro \
    memry -a /auth.txt

# Start with https
openssl req -nodes -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -subj /CN=localhost
docker run --rm -p 443:8018 -v `pwd`/storage:/storage  \
    -v `pwd`/cert.pem:/cert.pem:ro -v `pwd`/key.pem:/key.pem:ro \
    memry --tls-cert /cert.pem --tls-key /key.pem

Trivia

mem'ry is an archaic term for "memory". The caption in the image reads "The tapir sent from Bengkulu to Calcutta in 1816" and is about 200 years old.

License

GPLv3

Package Sidebar

Install

npm i memry

Weekly Downloads

5

Version

2.0.1

License

GPL-3.0

Last publish

Collaborators

  • kpcyrd