Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:darix:restic
minio
minio-generate-keys
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File minio-generate-keys of Package minio
#!/usr/bin/ruby require 'base64' require 'securerandom' secretKeyMaxLen = 40 accessKeyMaxLen = 20 def get_access_key(length) alphaNumericTable = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" alphaNumericTableLen = alphaNumericTable.size SecureRandom.random_bytes(length).unpack("C*").map do |byte| idx = byte % 64 idx = SecureRandom.random_number(alphaNumericTableLen) if idx >= alphaNumericTableLen alphaNumericTable[idx] end.join end def get_secret_key(length) random_bytes=SecureRandom.random_bytes(length) return Base64.encode64(random_bytes).chomp().slice(0,length) end access_key = get_access_key(accessKeyMaxLen) secret_key = get_secret_key(secretKeyMaxLen) fname = ARGV.first fc = File.read(fname) fc = fc.gsub('ACCESS_KEY', access_key) fc = fc.gsub('SECRET_KEY', secret_key) File.open(fname, 'w') do |f| f.write(fc) end
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor