[bin] Shorten drop's returned url to a 12-letter hex

This commit is contained in:
Sebastian Schulze 2020-02-22 17:55:11 +01:00
parent ad2d0ad7de
commit 3af1491b89
Signed by: bascht
GPG Key ID: 5BCB1D3B4D38A35A
1 changed files with 1 additions and 1 deletions

2
bin/executable_drop Executable file → Normal file
View File

@ -7,7 +7,7 @@ require 'securerandom'
require 'net/scp'
file = Pathname.new(ARGV[0])
new_name = SecureRandom.uuid + File.extname(file)
new_name = SecureRandom.hex(12) + File.extname(file)
abort "Och komm." unless file.exist? and file.readable?
url = URI.escape("https://drop.bascht.space/#{new_name}")