Initial commit

This commit is contained in:
Yaser
2026-08-13 19:42:08 +03:30
commit d59bf30ef0
173 changed files with 11702 additions and 0 deletions

25
lib/tasks/vault.rake Normal file
View File

@@ -0,0 +1,25 @@
require_relative '../opendax/vault'
namespace :vault do
desc 'Initialize, unseal and set secrets for Vault'
task :setup do
vault = Opendax::Vault.new
vault_root_token = vault.setup
unless vault_root_token.nil?
@config["vault"]["root_token"] = vault_root_token
File.open(CONFIG_PATH, 'w') { |f| YAML.dump(@config, f) }
end
end
task :load_policies do
vault = Opendax::Vault.new
vault_tokens = vault.load_policies(@config["app"]["name"], @config["vault"]["root_token"])
unless vault_tokens.empty?
vault_tokens.each do |k, v|
@config["vault"][k] = v
File.open(CONFIG_PATH, 'w') { |f| YAML.dump(@config, f) }
end
end
end
end