Module: Arcanus
- Defined in:
- lib/arcanus.rb,
lib/arcanus/ui.rb,
lib/arcanus/cli.rb,
lib/arcanus/key.rb,
lib/arcanus/repo.rb,
lib/arcanus/chest.rb,
lib/arcanus/input.rb,
lib/arcanus/utils.rb,
lib/arcanus/output.rb,
lib/arcanus/version.rb,
lib/arcanus/constants.rb,
lib/arcanus/error_handler.rb
Overview
Global application constants.
Defined Under Namespace
Modules: Command, Errors, Utils Classes: CLI, Chest, ErrorHandler, Input, Key, Output, Repo, UI
Constant Summary collapse
- VERSION =
'1.3.0'.freeze
- EXECUTABLE_NAME =
'arcanus'.freeze
- CHEST_FILE_PATH =
File.join('.arcanus', 'chest.yaml').freeze
- LOCKED_KEY_PATH =
File.join('.arcanus', 'protected.key').freeze
- UNLOCKED_KEY_PATH =
File.join('.arcanus', 'unprotected.key').freeze
- REPO_URL =
'https://github.com/brigade/arcanus'.freeze
- BUG_REPORT_URL =
"#{REPO_URL}/issues".freeze
Class Method Summary collapse
-
.chest ⇒ Arcanus::Chest
Returns the Arcanus chest, providing access to encrypted secrets.
-
.load ⇒ Object
Loads Arcanus chest and decrypts secrets.
Class Method Details
.chest ⇒ Arcanus::Chest
Returns the Arcanus chest, providing access to encrypted secrets.
20 21 22 23 |
# File 'lib/arcanus.rb', line 20 def chest Arcanus.load unless @chest @chest end |
.load ⇒ Object
Loads Arcanus chest and decrypts secrets.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/arcanus.rb', line 28 def load @repo = Repo.new unless File.directory?(@repo.arcanus_dir) raise Errors::UsageError, 'Arcanus has not been initialized in this repository. ' \ 'Run `arcanus setup`' end if File.exist?(@repo.unlocked_key_path) key = Arcanus::Key.from_file(@repo.unlocked_key_path) elsif ENV['ARCANUS_PASSWORD'] key = Arcanus::Key.from_protected_file(@repo.locked_key_path, ENV['ARCANUS_PASSWORD']) else raise Errors::UsageError, 'Arcanus key has not been unlocked. ' \ 'Run `arcanus unlock` or specify password via ARCANUS_PASSWORD environment variable' end @chest = Chest.new(key: key, chest_file_path: @repo.chest_file_path) end |