From eed952609bb901e25a43410c1d4c8dd589daa435 Mon Sep 17 00:00:00 2001 From: Max Claus Nunes Date: Mon, 21 Mar 2016 21:48:46 -0300 Subject: [PATCH] Use tar dereference option (-h) to resolve symlinks (close #18) --- README.md | 4 ++++ index.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 52d0af6..fcfe6c6 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,10 @@ IdentityFile ~/.ssh/myprivatehost_key # otherwise will use the id_rsa key for any other host ``` +#### Symlinks + +In case you have symlink for any ssh file. Will be necessary map the volume of the symlink destination into the docker vault server. Otherwise will not be possible to resolve the symlink while copying the ssh files with the `ONVAULT` command. + ### The private keys server Run the server setting a volume to your `~/.ssh` folder: diff --git a/index.js b/index.js index 7183d79..6de406a 100644 --- a/index.js +++ b/index.js @@ -24,7 +24,7 @@ app.get('/ssh.tgz', function (req, res) { exec('mktemp -q /tmp/ssh.XXXXXX', function (err, stdout) { var file = stdout.match(/(.+)/)[0]; - exec('tar -c -z -C /vault/.ssh -f '+ file +' .', function (err, stdout, stderr) { + exec('tar -chz -C /vault/.ssh -f '+ file +' .', function (err, stdout, stderr) { var filename = path.basename(file); var mimetype = mime.lookup(file);