diff options
-rw-r--r-- | CHANGES.md | 11 | ||||
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | lib/leap_cli/commands/ca.rb | 27 | ||||
-rw-r--r-- | lib/leap_cli/commands/run.rb | 4 |
4 files changed, 39 insertions, 6 deletions
@@ -27,7 +27,8 @@ You will need the new version of leap_cli: workstation$ sudo gem install leap_cli --version=1.9 -Because 0.9 does not use submodules anymore, you must remove them before pulling the latest leap_platform from git: +Because 0.9 does not use submodules anymore, you must remove them before pulling +the latest leap_platform from git: cd leap_platform for dir in $(git submodule | awk '{print $2}'); do @@ -39,6 +40,14 @@ Alternately, just clone a fresh leap_platform: git clone https://leap.se/git/leap_platform +Known Issues: + +* When upgrading, sometimes systemd does not report the correct state of a + daemon. The daemon will be not running, but systemd thinks it is. The symptom + of this is that a deploy will succeed but `leap test` will fail. To fix, you + can run `systemctl stop DAEMON` and then `systemctl start DAEMON` on the + affected host (systemctl restart seems to work less reliably). + Includes: * leap_web: 0.8 @@ -82,6 +82,9 @@ Contributing In order to validate the syntax and style guide compliance before you commit, see https://github.com/pixelated-project/puppet-git-hooks#installation +Please fork https://0xacab.org/leap/platform to open a merge request, +and pick the `Platform runner (greyhound)` at https://0xacab.org/YOUR_USERNAME/platform/runners +in order to run a CI build for your merge request. Changes ================================ diff --git a/lib/leap_cli/commands/ca.rb b/lib/leap_cli/commands/ca.rb index d9ffa6a4..3c5fc7d5 100644 --- a/lib/leap_cli/commands/ca.rb +++ b/lib/leap_cli/commands/ca.rb @@ -225,12 +225,25 @@ module LeapCli; module Commands end end + def assert_no_errors!(msg) + yield + rescue StandardError => exc + bail! :error, msg do + log exc.to_s + end + end + def do_renew_cert(global, options, args) require 'leap_cli/acme' require 'leap_cli/ssh' require 'socket' require 'net/http' + csr = nil + account_key = nil + cert = nil + acme = nil + # # sanity check the domain # @@ -243,10 +256,14 @@ module LeapCli; module Commands # assert_files_exist!([:commercial_key, domain], [:commercial_csr, domain], :msg => 'Please create the CSR first with `leap cert csr %s`' % domain) - csr = Acme.load_csr(read_file!([:commercial_csr, domain])) + assert_no_errors!("Could not load #{path([:commercial_csr, domain])}") do + csr = Acme.load_csr(read_file!([:commercial_csr, domain])) + end assert_files_exist!(:acme_key, :msg => "Please run `leap cert register` first. This only needs to be done once.") - account_key = Acme.load_private_key(read_file!(:acme_key)) + assert_no_errors!("Could not load #{path(:acme_key)}") do + account_key = Acme.load_private_key(read_file!(:acme_key)) + end # # check authorization for this domain @@ -272,8 +289,12 @@ module LeapCli; module Commands end log :fetching, "new certificate from letsencrypt.org" - cert = acme.get_certificate(csr) + assert_no_errors!("could not renew certificate") do + cert = acme.get_certificate(csr) + end + log 'success', color: :green, style: :bold write_file!([:commercial_cert, domain], cert.fullchain_to_pem) + log 'You should now run `leap deploy` to deploy the new certificate.' end # diff --git a/lib/leap_cli/commands/run.rb b/lib/leap_cli/commands/run.rb index a12af60e..cad9b7a0 100644 --- a/lib/leap_cli/commands/run.rb +++ b/lib/leap_cli/commands/run.rb @@ -5,7 +5,7 @@ module LeapCli; module Commands "For example, `leap run 'uname -a' webapp`" arg_name 'COMMAND FILTER' command :run do |c| - c.switch 'stream', :default => false, :desc => 'If set, stream the output as it arrives. (default: --no-stream)' + c.switch 'stream', :default => false, :desc => 'If set, stream the output as it arrives. (default: --stream for a single node, --no-stream for multiple nodes)' c.flag 'port', :arg_name => 'SSH_PORT', :desc => 'Override default SSH port used when trying to connect to the server.' c.action do |global, options, args| run_shell_command(global, options, args) @@ -20,7 +20,7 @@ module LeapCli; module Commands filter = args[1..-1] cmd = global[:force] ? cmd : LeapCli::SSH::Options.sanitize_command(cmd) nodes = manager.filter!(filter) - if options[:stream] + if nodes.size == 1 || options[:stream] stream_command(nodes, cmd, options) else capture_command(nodes, cmd, options) |