Programmatic Secret Creation


Recommended Posts

Probably easier to throw together some bash/batch script to use curl to add each one.

Something like:-

for [file in /tmp]; do
$secret=$(dd if=/dev/urandom bs=1 count=128 | md5sum) #I think by default bittorrent sync uses md5sums? Or, atleast something that [b]could[/b] be a MD5sum. You might want to change it to base64/sha512/256/128.
curl 127.0.0.1:8888 --data "whateverPostDataIsRequired&folder=$file&secret=$secret"
done

Obviously the above won't work for more than one reason (Curl is incorrect, for loop is incorrect, secret would probably fall below a secure measure, etc...), but, it gives you the idea.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.