dash 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/bin/dash +2 -2
  4. data/lib/{kamal → dash}/cli/accessory.rb +24 -24
  5. data/lib/dash/cli/alias/command.rb +10 -0
  6. data/lib/{kamal → dash}/cli/app/assets.rb +2 -2
  7. data/lib/{kamal → dash}/cli/app/boot.rb +15 -15
  8. data/lib/{kamal → dash}/cli/app/error_pages.rb +6 -6
  9. data/lib/{kamal → dash}/cli/app/rollout_boot.rb +6 -6
  10. data/lib/{kamal → dash}/cli/app/ssl_certificates.rb +3 -3
  11. data/lib/{kamal → dash}/cli/app.rb +86 -86
  12. data/lib/{kamal → dash}/cli/base.rb +71 -47
  13. data/lib/dash/cli/build/clone.rb +59 -0
  14. data/lib/{kamal → dash}/cli/build/port_forwarding.rb +1 -1
  15. data/lib/{kamal → dash}/cli/build.rb +45 -45
  16. data/lib/{kamal → dash}/cli/doctor/config_checks.rb +3 -3
  17. data/lib/{kamal → dash}/cli/doctor/endpoint_checks.rb +25 -7
  18. data/lib/{kamal → dash}/cli/doctor/host_checks.rb +18 -18
  19. data/lib/{kamal → dash}/cli/doctor.rb +9 -9
  20. data/lib/{kamal → dash}/cli/healthcheck/barrier.rb +2 -2
  21. data/lib/{kamal → dash}/cli/healthcheck/drift_error.rb +2 -2
  22. data/lib/dash/cli/healthcheck/error.rb +2 -0
  23. data/lib/{kamal → dash}/cli/healthcheck/poller.rb +7 -7
  24. data/lib/{kamal → dash}/cli/lock.rb +1 -1
  25. data/lib/dash/cli/main/migrate.rb +77 -0
  26. data/lib/{kamal → dash}/cli/main.rb +77 -66
  27. data/lib/{kamal → dash}/cli/proxy/drift.rb +3 -3
  28. data/lib/{kamal → dash}/cli/proxy/loadbalancer_claim.rb +3 -3
  29. data/lib/{kamal → dash}/cli/proxy/loadbalancer_reboot.rb +22 -22
  30. data/lib/{kamal → dash}/cli/proxy/reboot.rb +15 -15
  31. data/lib/{kamal → dash}/cli/proxy.rb +166 -154
  32. data/lib/{kamal → dash}/cli/prune.rb +10 -10
  33. data/lib/{kamal → dash}/cli/registry.rb +11 -11
  34. data/lib/{kamal → dash}/cli/secrets.rb +3 -3
  35. data/lib/{kamal → dash}/cli/server.rb +14 -14
  36. data/lib/{kamal → dash}/cli/templates/deploy.yml +4 -4
  37. data/lib/dash/cli/templates/sample_hooks/docker-setup.sample +3 -0
  38. data/lib/dash/cli/templates/sample_hooks/post-app-boot.sample +3 -0
  39. data/lib/dash/cli/templates/sample_hooks/post-app-stop.sample +9 -0
  40. data/lib/dash/cli/templates/sample_hooks/post-deploy.sample +14 -0
  41. data/lib/dash/cli/templates/sample_hooks/post-proxy-deploy.sample +3 -0
  42. data/lib/dash/cli/templates/sample_hooks/post-proxy-reboot.sample +3 -0
  43. data/lib/dash/cli/templates/sample_hooks/pre-app-boot.sample +3 -0
  44. data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-app-stop.sample +2 -2
  45. data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-build.sample +8 -8
  46. data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-connect.sample +8 -8
  47. data/lib/{kamal → dash}/cli/templates/sample_hooks/pre-deploy.sample +9 -9
  48. data/lib/dash/cli/templates/sample_hooks/pre-proxy-deploy.sample +3 -0
  49. data/lib/dash/cli/templates/sample_hooks/pre-proxy-reboot.sample +3 -0
  50. data/lib/{kamal → dash}/cli/templates/secrets +6 -6
  51. data/lib/{kamal → dash}/cli.rb +2 -2
  52. data/lib/{kamal → dash}/commander/specifics.rb +2 -2
  53. data/lib/{kamal → dash}/commander.rb +31 -23
  54. data/lib/{kamal → dash}/commands/accessory/proxy.rb +1 -1
  55. data/lib/{kamal → dash}/commands/accessory.rb +2 -2
  56. data/lib/{kamal → dash}/commands/app/assets.rb +1 -1
  57. data/lib/{kamal → dash}/commands/app/containers.rb +1 -1
  58. data/lib/{kamal → dash}/commands/app/error_pages.rb +2 -2
  59. data/lib/{kamal → dash}/commands/app/execution.rb +1 -1
  60. data/lib/{kamal → dash}/commands/app/images.rb +1 -1
  61. data/lib/{kamal → dash}/commands/app/logging.rb +1 -1
  62. data/lib/{kamal → dash}/commands/app/proxy.rb +1 -1
  63. data/lib/{kamal → dash}/commands/app.rb +1 -1
  64. data/lib/{kamal → dash}/commands/auditor.rb +3 -7
  65. data/lib/{kamal → dash}/commands/base.rb +39 -3
  66. data/lib/{kamal → dash}/commands/builder/base.rb +2 -2
  67. data/lib/{kamal → dash}/commands/builder/clone.rb +3 -3
  68. data/lib/{kamal → dash}/commands/builder/cloud.rb +1 -1
  69. data/lib/{kamal → dash}/commands/builder/hybrid.rb +1 -1
  70. data/lib/{kamal → dash}/commands/builder/local.rb +1 -1
  71. data/lib/{kamal → dash}/commands/builder/pack.rb +1 -1
  72. data/lib/{kamal → dash}/commands/builder/remote.rb +1 -1
  73. data/lib/{kamal → dash}/commands/builder.rb +7 -7
  74. data/lib/{kamal → dash}/commands/docker.rb +1 -1
  75. data/lib/{kamal → dash}/commands/hook.rb +1 -1
  76. data/lib/{kamal → dash}/commands/loadbalancer.rb +9 -8
  77. data/lib/{kamal → dash}/commands/lock.rb +2 -2
  78. data/lib/{kamal → dash}/commands/proxy/cert_transfer.rb +2 -2
  79. data/lib/{kamal → dash}/commands/proxy.rb +20 -10
  80. data/lib/{kamal → dash}/commands/prune.rb +1 -1
  81. data/lib/dash/commands/registry.rb +44 -0
  82. data/lib/{kamal → dash}/commands/server.rb +1 -5
  83. data/lib/dash/commands.rb +2 -0
  84. data/lib/{kamal → dash}/configuration/accessory.rb +11 -11
  85. data/lib/{kamal → dash}/configuration/alias.rb +3 -3
  86. data/lib/{kamal → dash}/configuration/boot.rb +2 -2
  87. data/lib/{kamal → dash}/configuration/builder.rb +7 -7
  88. data/lib/{kamal → dash}/configuration/docs/builder.yml +3 -3
  89. data/lib/{kamal → dash}/configuration/docs/configuration.yml +12 -5
  90. data/lib/{kamal → dash}/configuration/docs/env.yml +10 -10
  91. data/lib/{kamal → dash}/configuration/docs/proxy.yml +31 -8
  92. data/lib/{kamal → dash}/configuration/docs/registry.yml +5 -5
  93. data/lib/{kamal → dash}/configuration/env/tag.rb +2 -2
  94. data/lib/{kamal → dash}/configuration/env.rb +5 -5
  95. data/lib/{kamal → dash}/configuration/loadbalancer.rb +3 -3
  96. data/lib/{kamal → dash}/configuration/logging.rb +3 -3
  97. data/lib/{kamal → dash}/configuration/output.rb +4 -4
  98. data/lib/{kamal → dash}/configuration/proxy/acme.rb +4 -3
  99. data/lib/{kamal → dash}/configuration/proxy/boot.rb +7 -7
  100. data/lib/{kamal → dash}/configuration/proxy/run.rb +11 -11
  101. data/lib/{kamal → dash}/configuration/proxy.rb +15 -15
  102. data/lib/{kamal → dash}/configuration/registry.rb +3 -3
  103. data/lib/{kamal → dash}/configuration/role/healthcheck.rb +3 -3
  104. data/lib/{kamal → dash}/configuration/role.rb +12 -12
  105. data/lib/{kamal → dash}/configuration/servers.rb +4 -4
  106. data/lib/{kamal → dash}/configuration/ssh.rb +2 -2
  107. data/lib/{kamal → dash}/configuration/sshkit.rb +2 -2
  108. data/lib/{kamal → dash}/configuration/validation.rb +2 -2
  109. data/lib/{kamal → dash}/configuration/validator/accessory.rb +1 -1
  110. data/lib/{kamal → dash}/configuration/validator/alias.rb +2 -2
  111. data/lib/{kamal → dash}/configuration/validator/builder.rb +1 -1
  112. data/lib/dash/configuration/validator/configuration.rb +6 -0
  113. data/lib/{kamal → dash}/configuration/validator/env.rb +2 -2
  114. data/lib/{kamal → dash}/configuration/validator/proxy.rb +8 -8
  115. data/lib/{kamal → dash}/configuration/validator/registry.rb +1 -1
  116. data/lib/{kamal → dash}/configuration/validator/role.rb +1 -1
  117. data/lib/{kamal → dash}/configuration/validator/servers.rb +1 -1
  118. data/lib/{kamal → dash}/configuration/validator.rb +4 -4
  119. data/lib/{kamal → dash}/configuration/volume.rb +2 -2
  120. data/lib/{kamal → dash}/configuration.rb +39 -29
  121. data/lib/{kamal → dash}/docker.rb +1 -1
  122. data/lib/{kamal → dash}/env_file.rb +1 -1
  123. data/lib/{kamal → dash}/git.rb +1 -1
  124. data/lib/{kamal → dash}/otel_shipper.rb +3 -3
  125. data/lib/{kamal → dash}/output/base_logger.rb +1 -1
  126. data/lib/{kamal → dash}/output/file_logger.rb +1 -1
  127. data/lib/{kamal → dash}/output/formatter.rb +1 -1
  128. data/lib/{kamal → dash}/output/otel_logger.rb +3 -3
  129. data/lib/dash/project_directory.rb +28 -0
  130. data/lib/{kamal → dash}/secrets/adapters/aws_secrets_manager.rb +1 -1
  131. data/lib/{kamal → dash}/secrets/adapters/base.rb +2 -2
  132. data/lib/{kamal → dash}/secrets/adapters/bitwarden.rb +1 -1
  133. data/lib/{kamal → dash}/secrets/adapters/bitwarden_secrets_manager.rb +1 -1
  134. data/lib/{kamal → dash}/secrets/adapters/doppler.rb +1 -1
  135. data/lib/{kamal → dash}/secrets/adapters/enpass.rb +1 -1
  136. data/lib/{kamal → dash}/secrets/adapters/gcp_secret_manager.rb +1 -1
  137. data/lib/{kamal → dash}/secrets/adapters/last_pass.rb +1 -1
  138. data/lib/{kamal → dash}/secrets/adapters/one_password.rb +2 -2
  139. data/lib/{kamal → dash}/secrets/adapters/passbolt.rb +1 -1
  140. data/lib/{kamal → dash}/secrets/adapters/test.rb +1 -1
  141. data/lib/{kamal → dash}/secrets/adapters.rb +2 -2
  142. data/lib/{kamal → dash}/secrets/dotenv/inline_command_substitution.rb +2 -2
  143. data/lib/{kamal → dash}/secrets.rb +6 -6
  144. data/lib/{kamal → dash}/tags.rb +8 -3
  145. data/lib/{kamal → dash}/utils/sensitive.rb +1 -1
  146. data/lib/{kamal → dash}/utils.rb +15 -5
  147. data/lib/dash/version.rb +3 -0
  148. data/lib/{kamal.rb → dash.rb} +4 -4
  149. metadata +156 -154
  150. data/lib/kamal/cli/alias/command.rb +0 -10
  151. data/lib/kamal/cli/build/clone.rb +0 -59
  152. data/lib/kamal/cli/healthcheck/error.rb +0 -2
  153. data/lib/kamal/cli/templates/sample_hooks/docker-setup.sample +0 -3
  154. data/lib/kamal/cli/templates/sample_hooks/post-app-boot.sample +0 -3
  155. data/lib/kamal/cli/templates/sample_hooks/post-app-stop.sample +0 -9
  156. data/lib/kamal/cli/templates/sample_hooks/post-deploy.sample +0 -14
  157. data/lib/kamal/cli/templates/sample_hooks/post-proxy-deploy.sample +0 -3
  158. data/lib/kamal/cli/templates/sample_hooks/post-proxy-reboot.sample +0 -3
  159. data/lib/kamal/cli/templates/sample_hooks/pre-app-boot.sample +0 -3
  160. data/lib/kamal/cli/templates/sample_hooks/pre-proxy-deploy.sample +0 -3
  161. data/lib/kamal/cli/templates/sample_hooks/pre-proxy-reboot.sample +0 -3
  162. data/lib/kamal/commands/registry.rb +0 -38
  163. data/lib/kamal/commands.rb +0 -2
  164. data/lib/kamal/configuration/validator/configuration.rb +0 -6
  165. data/lib/kamal/version.rb +0 -3
  166. /data/lib/{kamal → dash}/configuration/docs/accessory.yml +0 -0
  167. /data/lib/{kamal → dash}/configuration/docs/alias.yml +0 -0
  168. /data/lib/{kamal → dash}/configuration/docs/boot.yml +0 -0
  169. /data/lib/{kamal → dash}/configuration/docs/logging.yml +0 -0
  170. /data/lib/{kamal → dash}/configuration/docs/output.yml +0 -0
  171. /data/lib/{kamal → dash}/configuration/docs/role.yml +0 -0
  172. /data/lib/{kamal → dash}/configuration/docs/servers.yml +0 -0
  173. /data/lib/{kamal → dash}/configuration/docs/ssh.yml +0 -0
  174. /data/lib/{kamal → dash}/configuration/docs/sshkit.yml +0 -0
  175. /data/lib/{kamal → dash}/sshkit_with_ext.rb +0 -0
@@ -1,4 +1,4 @@
1
- class Kamal::Cli::Prune < Kamal::Cli::Base
1
+ class Dash::Cli::Prune < Dash::Cli::Base
2
2
  desc "all", "Prune unused images and stopped containers"
3
3
  def all
4
4
  modify(lock: true, server_lock: true) do
@@ -10,10 +10,10 @@ class Kamal::Cli::Prune < Kamal::Cli::Base
10
10
  desc "images", "Prune unused images"
11
11
  def images
12
12
  modify(lock: true, server_lock: true) do
13
- on(KAMAL.hosts) do
14
- execute *KAMAL.auditor.record("Pruned images"), verbosity: :debug
15
- execute *KAMAL.prune.dangling_images
16
- execute *KAMAL.prune.tagged_images
13
+ on(DASH.hosts) do
14
+ execute *DASH.auditor.record("Pruned images"), verbosity: :debug
15
+ execute *DASH.prune.dangling_images
16
+ execute *DASH.prune.tagged_images
17
17
  end
18
18
  end
19
19
  end
@@ -21,15 +21,15 @@ class Kamal::Cli::Prune < Kamal::Cli::Base
21
21
  desc "containers", "Prune all stopped containers, except the last n per role (default 5)"
22
22
  option :retain, type: :numeric, default: nil, desc: "Number of containers to retain per role"
23
23
  def containers
24
- retain = options.fetch(:retain, KAMAL.config.retain_containers)
24
+ retain = options.fetch(:retain, DASH.config.retain_containers)
25
25
  raise "retain must be at least 1" if retain < 1
26
26
 
27
27
  modify(lock: true, server_lock: true) do
28
- on(KAMAL.hosts) do |host|
29
- execute *KAMAL.auditor.record("Pruned containers"), verbosity: :debug
28
+ on(DASH.hosts) do |host|
29
+ execute *DASH.auditor.record("Pruned containers"), verbosity: :debug
30
30
 
31
- KAMAL.roles_on(host).each do |role|
32
- execute *KAMAL.prune.app_containers(retain: retain, role: role)
31
+ DASH.roles_on(host).each do |role|
32
+ execute *DASH.prune.app_containers(retain: retain, role: role)
33
33
  end
34
34
  end
35
35
  end
@@ -1,15 +1,15 @@
1
- class Kamal::Cli::Registry < Kamal::Cli::Base
1
+ class Dash::Cli::Registry < Dash::Cli::Base
2
2
  desc "setup", "Setup local registry or log in to remote registry locally and remotely"
3
3
  option :skip_local, aliases: "-L", type: :boolean, default: false, desc: "Skip local login"
4
4
  option :skip_remote, aliases: "-R", type: :boolean, default: false, desc: "Skip remote login"
5
5
  def setup
6
6
  ensure_docker_installed unless options[:skip_local]
7
7
 
8
- if KAMAL.registry.local?
9
- run_locally { execute *KAMAL.registry.setup } unless options[:skip_local]
8
+ if DASH.registry.local?
9
+ run_locally { execute *DASH.registry.setup } unless options[:skip_local]
10
10
  else
11
- run_locally { execute *KAMAL.registry.login } unless options[:skip_local]
12
- on(KAMAL.hosts) { execute *KAMAL.registry.login } unless options[:skip_remote]
11
+ run_locally { execute *DASH.registry.login } unless options[:skip_local]
12
+ on(DASH.hosts) { execute *DASH.registry.login } unless options[:skip_remote]
13
13
  end
14
14
  end
15
15
 
@@ -17,11 +17,11 @@ class Kamal::Cli::Registry < Kamal::Cli::Base
17
17
  option :skip_local, aliases: "-L", type: :boolean, default: false, desc: "Skip local login"
18
18
  option :skip_remote, aliases: "-R", type: :boolean, default: false, desc: "Skip remote login"
19
19
  def remove
20
- if KAMAL.registry.local?
21
- run_locally { execute *KAMAL.registry.remove, raise_on_non_zero_exit: false } unless options[:skip_local]
20
+ if DASH.registry.local?
21
+ run_locally { execute *DASH.registry.remove, raise_on_non_zero_exit: false } unless options[:skip_local]
22
22
  else
23
- run_locally { execute *KAMAL.registry.logout } unless options[:skip_local]
24
- on(KAMAL.hosts) { execute *KAMAL.registry.logout } unless options[:skip_remote]
23
+ run_locally { execute *DASH.registry.logout } unless options[:skip_local]
24
+ on(DASH.hosts) { execute *DASH.registry.logout } unless options[:skip_remote]
25
25
  end
26
26
  end
27
27
 
@@ -29,7 +29,7 @@ class Kamal::Cli::Registry < Kamal::Cli::Base
29
29
  option :skip_local, aliases: "-L", type: :boolean, default: false, desc: "Skip local login"
30
30
  option :skip_remote, aliases: "-R", type: :boolean, default: false, desc: "Skip remote login"
31
31
  def login
32
- if KAMAL.registry.local?
32
+ if DASH.registry.local?
33
33
  raise "Cannot use login command with a local registry. Use `dash registry setup` instead."
34
34
  end
35
35
 
@@ -40,7 +40,7 @@ class Kamal::Cli::Registry < Kamal::Cli::Base
40
40
  option :skip_local, aliases: "-L", type: :boolean, default: false, desc: "Skip local login"
41
41
  option :skip_remote, aliases: "-R", type: :boolean, default: false, desc: "Skip remote login"
42
42
  def logout
43
- if KAMAL.registry.local?
43
+ if DASH.registry.local?
44
44
  raise "Cannot use logout command with a local registry. Use `dash registry remove` instead."
45
45
  end
46
46
 
@@ -1,4 +1,4 @@
1
- class Kamal::Cli::Secrets < Kamal::Cli::Base
1
+ class Dash::Cli::Secrets < Dash::Cli::Base
2
2
  desc "fetch [SECRETS...]", "Fetch secrets from a vault"
3
3
  option :adapter, type: :string, aliases: "-a", required: true, desc: "Which vault adapter to use"
4
4
  option :account, type: :string, required: false, desc: "The account identifier or username"
@@ -30,14 +30,14 @@ class Kamal::Cli::Secrets < Kamal::Cli::Base
30
30
 
31
31
  desc "print", "Print the secrets (for debugging)"
32
32
  def print
33
- KAMAL.config.secrets.to_h.each do |key, value|
33
+ DASH.config.secrets.to_h.each do |key, value|
34
34
  puts "#{key}=#{value}"
35
35
  end
36
36
  end
37
37
 
38
38
  private
39
39
  def initialize_adapter(adapter)
40
- Kamal::Secrets::Adapters.lookup(adapter)
40
+ Dash::Secrets::Adapters.lookup(adapter)
41
41
  end
42
42
 
43
43
  def return_or_puts(value, inline: nil)
@@ -1,4 +1,4 @@
1
- class Kamal::Cli::Server < Kamal::Cli::Base
1
+ class Dash::Cli::Server < Dash::Cli::Base
2
2
  desc "exec", "Run a custom command on the server (use --help to show options)"
3
3
  option :interactive, type: :boolean, aliases: "-i", default: false, desc: "Run the command interactively (use for console/bash)"
4
4
  option :raw, type: :boolean, default: false, desc: "Output raw, unmodified stdout"
@@ -12,22 +12,22 @@ class Kamal::Cli::Server < Kamal::Cli::Base
12
12
  with_raw_output(raw) do
13
13
  pre_connect_if_required
14
14
 
15
- cmd = Kamal::Utils.join_commands(cmd)
16
- hosts = KAMAL.hosts
15
+ cmd = Dash::Utils.join_commands(cmd)
16
+ hosts = DASH.hosts
17
17
  quiet = options[:quiet]
18
18
 
19
19
  case
20
20
  when options[:interactive]
21
- host = KAMAL.primary_host
21
+ host = DASH.primary_host
22
22
 
23
23
  say "Running '#{cmd}' on #{host} interactively...", :magenta
24
24
 
25
- run_locally { exec KAMAL.server.run_over_ssh(cmd, host: host) }
25
+ run_locally { exec DASH.server.run_over_ssh(cmd, host: host) }
26
26
  else
27
27
  say "Running '#{cmd}' on #{hosts.join(', ')}...", :magenta
28
28
 
29
29
  on(hosts) do |host|
30
- execute *KAMAL.auditor.record("Executed cmd '#{cmd}' on #{host}"), verbosity: :debug
30
+ execute *DASH.auditor.record("Executed cmd '#{cmd}' on #{host}"), verbosity: :debug
31
31
  puts_by_host host, capture_with_info(cmd, strip: !raw), quiet: quiet, raw: raw
32
32
  end
33
33
  end
@@ -39,17 +39,17 @@ class Kamal::Cli::Server < Kamal::Cli::Base
39
39
  modify(lock: true) do
40
40
  missing = []
41
41
 
42
- on(KAMAL.hosts) do |host|
43
- unless execute(*KAMAL.docker.installed?, raise_on_non_zero_exit: false)
44
- if execute(*KAMAL.docker.superuser?, raise_on_non_zero_exit: false)
42
+ on(DASH.hosts) do |host|
43
+ unless execute(*DASH.docker.installed?, raise_on_non_zero_exit: false)
44
+ if execute(*DASH.docker.superuser?, raise_on_non_zero_exit: false)
45
45
  info "Missing Docker on #{host}. Installing…"
46
- execute *KAMAL.docker.install
46
+ execute *DASH.docker.install
47
47
 
48
- unless execute(*KAMAL.docker.root?, raise_on_non_zero_exit: false) ||
49
- execute(*KAMAL.docker.in_docker_group?, raise_on_non_zero_exit: false)
50
- execute *KAMAL.docker.add_to_docker_group
48
+ unless execute(*DASH.docker.root?, raise_on_non_zero_exit: false) ||
49
+ execute(*DASH.docker.in_docker_group?, raise_on_non_zero_exit: false)
50
+ execute *DASH.docker.add_to_docker_group
51
51
  begin
52
- execute *KAMAL.docker.refresh_session
52
+ execute *DASH.docker.refresh_session
53
53
  rescue IOError
54
54
  info "Session refreshed due to group change."
55
55
  end
@@ -30,9 +30,9 @@ registry:
30
30
  # server: registry.digitalocean.com / ghcr.io / ...
31
31
  # username: my-user
32
32
 
33
- # Always use an access token rather than real password (pulled from .kamal/secrets).
33
+ # Always use an access token rather than real password (pulled from .dash/secrets).
34
34
  # password:
35
- # - KAMAL_REGISTRY_PASSWORD
35
+ # - DASH_REGISTRY_PASSWORD
36
36
 
37
37
  # Configure builder setup.
38
38
  builder:
@@ -41,7 +41,7 @@ builder:
41
41
  # args:
42
42
  # RUBY_VERSION: <%= ENV["RBENV_VERSION"] || ENV["rvm_ruby_string"] || "#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}" %>
43
43
 
44
- # Inject ENV variables into containers (secrets come from .kamal/secrets).
44
+ # Inject ENV variables into containers (secrets come from .dash/secrets).
45
45
  #
46
46
  # env:
47
47
  # clear:
@@ -77,7 +77,7 @@ builder:
77
77
  # limit: 10 # Can also specify as a percentage of total hosts, such as "25%"
78
78
  # wait: 2
79
79
 
80
- # Use accessory services (secrets come from .kamal/secrets).
80
+ # Use accessory services (secrets come from .dash/secrets).
81
81
  #
82
82
  # accessories:
83
83
  # db:
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env sh
2
+
3
+ echo "Docker set up on $DASH_HOSTS..."
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env sh
2
+
3
+ echo "Booted app version $DASH_VERSION on $DASH_HOSTS..."
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env sh
2
+
3
+ # Runs on each host just after the previous container has been stopped.
4
+ #
5
+ # NOTE: $DASH_VERSION is the version that was STOPPED, not the one being deployed.
6
+ #
7
+ # A failure here is logged and the deploy continues.
8
+
9
+ echo "Stopped $DASH_ROLE version $DASH_VERSION on $DASH_HOSTS"
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env sh
2
+
3
+ # A sample post-deploy hook
4
+ #
5
+ # These environment variables are available:
6
+ # DASH_RECORDED_AT
7
+ # DASH_PERFORMER
8
+ # DASH_VERSION
9
+ # DASH_HOSTS
10
+ # DASH_ROLES (if set)
11
+ # DASH_DESTINATION (if set)
12
+ # DASH_RUNTIME
13
+
14
+ echo "$DASH_PERFORMER deployed $DASH_VERSION to $DASH_DESTINATION in $DASH_RUNTIME seconds"
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env sh
2
+
3
+ echo "Routed traffic for $DASH_ROLE version $DASH_VERSION on $DASH_HOSTS"
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env sh
2
+
3
+ echo "Rebooted kamal-proxy on $DASH_HOSTS"
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env sh
2
+
3
+ echo "Booting app version $DASH_VERSION on $DASH_HOSTS..."
@@ -4,9 +4,9 @@
4
4
  # version is already live. Use it to drain the old container: unsubscribe a queue
5
5
  # group, deregister from service discovery, wait for in-flight jobs.
6
6
  #
7
- # NOTE: $KAMAL_VERSION is the version being STOPPED, not the one being deployed.
7
+ # NOTE: $DASH_VERSION is the version being STOPPED, not the one being deployed.
8
8
  #
9
9
  # A failure here is logged and the deploy continues -- the old container is
10
10
  # stopped either way.
11
11
 
12
- echo "Draining $KAMAL_ROLE version $KAMAL_VERSION on $KAMAL_HOSTS..."
12
+ echo "Draining $DASH_ROLE version $DASH_VERSION on $DASH_HOSTS..."
@@ -9,12 +9,12 @@
9
9
  # 4. The version we are deploying matches the remote
10
10
  #
11
11
  # These environment variables are available:
12
- # KAMAL_RECORDED_AT
13
- # KAMAL_PERFORMER
14
- # KAMAL_VERSION
15
- # KAMAL_HOSTS
16
- # KAMAL_ROLES (if set)
17
- # KAMAL_DESTINATION (if set)
12
+ # DASH_RECORDED_AT
13
+ # DASH_PERFORMER
14
+ # DASH_VERSION
15
+ # DASH_HOSTS
16
+ # DASH_ROLES (if set)
17
+ # DASH_DESTINATION (if set)
18
18
 
19
19
  if [ -n "$(git status --porcelain)" ]; then
20
20
  echo "Git checkout is not clean, aborting..." >&2
@@ -43,8 +43,8 @@ if [ -z "$remote_head" ]; then
43
43
  exit 1
44
44
  fi
45
45
 
46
- if [ "$KAMAL_VERSION" != "$remote_head" ]; then
47
- echo "Version ($KAMAL_VERSION) does not match remote HEAD ($remote_head), aborting..." >&2
46
+ if [ "$DASH_VERSION" != "$remote_head" ]; then
47
+ echo "Version ($DASH_VERSION) does not match remote HEAD ($remote_head), aborting..." >&2
48
48
  exit 1
49
49
  fi
50
50
 
@@ -5,15 +5,15 @@
5
5
  # Warms DNS before connecting to hosts in parallel
6
6
  #
7
7
  # These environment variables are available:
8
- # KAMAL_RECORDED_AT
9
- # KAMAL_PERFORMER
10
- # KAMAL_VERSION
11
- # KAMAL_HOSTS
12
- # KAMAL_ROLES (if set)
13
- # KAMAL_DESTINATION (if set)
14
- # KAMAL_RUNTIME
8
+ # DASH_RECORDED_AT
9
+ # DASH_PERFORMER
10
+ # DASH_VERSION
11
+ # DASH_HOSTS
12
+ # DASH_ROLES (if set)
13
+ # DASH_DESTINATION (if set)
14
+ # DASH_RUNTIME
15
15
 
16
- hosts = ENV["KAMAL_HOSTS"].split(",")
16
+ hosts = ENV["DASH_HOSTS"].split(",")
17
17
  results = nil
18
18
  max = 3
19
19
 
@@ -7,17 +7,17 @@
7
7
  # Fails unless the combined status is "success"
8
8
  #
9
9
  # These environment variables are available:
10
- # KAMAL_RECORDED_AT
11
- # KAMAL_PERFORMER
12
- # KAMAL_VERSION
13
- # KAMAL_HOSTS
14
- # KAMAL_COMMAND
15
- # KAMAL_SUBCOMMAND
16
- # KAMAL_ROLES (if set)
17
- # KAMAL_DESTINATION (if set)
10
+ # DASH_RECORDED_AT
11
+ # DASH_PERFORMER
12
+ # DASH_VERSION
13
+ # DASH_HOSTS
14
+ # DASH_COMMAND
15
+ # DASH_SUBCOMMAND
16
+ # DASH_ROLES (if set)
17
+ # DASH_DESTINATION (if set)
18
18
 
19
19
  # Only check the build status for production deployments
20
- if ENV["KAMAL_COMMAND"] == "rollback" || ENV["KAMAL_DESTINATION"] != "production"
20
+ if ENV["DASH_COMMAND"] == "rollback" || ENV["DASH_DESTINATION"] != "production"
21
21
  exit 0
22
22
  end
23
23
 
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env sh
2
+
3
+ echo "Routing traffic for $DASH_ROLE version $DASH_VERSION on $DASH_HOSTS..."
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env sh
2
+
3
+ echo "Rebooting kamal-proxy on $DASH_HOSTS..."
@@ -2,21 +2,21 @@
2
2
  # and accessories/*/env/secret in config/deploy.yml. All secrets should be pulled from either
3
3
  # password manager, ENV, or a file. DO NOT ENTER RAW CREDENTIALS HERE! This file needs to be safe for git.
4
4
  #
5
- # When deploying with destinations, shared secrets can go in .kamal/secrets-common and
6
- # destination-specific secrets in .kamal/secrets.<destination>. This .kamal/secrets file is used
5
+ # When deploying with destinations, shared secrets can go in .dash/secrets-common and
6
+ # destination-specific secrets in .dash/secrets.<destination>. This .dash/secrets file is used
7
7
  # only when no destination is selected.
8
8
 
9
9
  # Option 1: Read secrets from the environment
10
- # KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD
10
+ # DASH_REGISTRY_PASSWORD=$DASH_REGISTRY_PASSWORD
11
11
 
12
12
  # Option 2: Read secrets via a command
13
13
  # RAILS_MASTER_KEY=$(cat config/master.key)
14
- # KAMAL_REGISTRY_PASSWORD=$(rails credentials:fetch kamal.registry_password)
14
+ # DASH_REGISTRY_PASSWORD=$(rails credentials:fetch dash.registry_password)
15
15
 
16
16
  # Option 3: Read secrets via dash secrets helpers
17
17
  # These will handle logging in and fetching the secrets in as few calls as possible
18
18
  # There are adapters for 1Password, LastPass + Bitwarden
19
19
  #
20
- # SECRETS=$(dash secrets fetch --adapter 1password --account my-account --from MyVault/MyItem KAMAL_REGISTRY_PASSWORD RAILS_MASTER_KEY)
21
- # KAMAL_REGISTRY_PASSWORD=$(dash secrets extract KAMAL_REGISTRY_PASSWORD $SECRETS)
20
+ # SECRETS=$(dash secrets fetch --adapter 1password --account my-account --from MyVault/MyItem DASH_REGISTRY_PASSWORD RAILS_MASTER_KEY)
21
+ # DASH_REGISTRY_PASSWORD=$(dash secrets extract DASH_REGISTRY_PASSWORD $SECRETS)
22
22
  # RAILS_MASTER_KEY=$(dash secrets extract RAILS_MASTER_KEY $SECRETS)
@@ -1,4 +1,4 @@
1
- module Kamal::Cli
1
+ module Dash::Cli
2
2
  class BootError < StandardError; end
3
3
  class HookError < StandardError; end
4
4
  class LockError < StandardError; end
@@ -7,4 +7,4 @@ module Kamal::Cli
7
7
  end
8
8
 
9
9
  # SSHKit uses instance eval, so we need a global const for ergonomics
10
- KAMAL = Kamal::Commander.new
10
+ DASH = Dash::Commander.new
@@ -1,6 +1,6 @@
1
- class Kamal::Commander::Specifics
1
+ class Dash::Commander::Specifics
2
2
  attr_reader :primary_host, :primary_role, :hosts, :roles
3
- delegate :stable_sort!, to: Kamal::Utils
3
+ delegate :stable_sort!, to: Dash::Utils
4
4
 
5
5
  def initialize(config, specific_hosts, specific_roles)
6
6
  @config, @specific_hosts, @specific_roles = config, specific_hosts, specific_roles
@@ -4,7 +4,7 @@ require "active_support/core_ext/object/blank"
4
4
  require "active_support/broadcast_logger"
5
5
  require "active_support/notifications"
6
6
 
7
- class Kamal::Commander
7
+ class Dash::Commander
8
8
  attr_accessor :verbosity, :holding_lock, :holding_server_lock, :connected, :logging, :lock_wait, :lock_wait_timeout, :lock_wait_interval
9
9
  attr_reader :specific_roles, :specific_hosts
10
10
  delegate :hosts, :roles, :primary_host, :primary_role, :roles_on, :app_hosts, :proxy_hosts, :accessory_hosts, to: :specifics
@@ -15,8 +15,8 @@ class Kamal::Commander
15
15
 
16
16
  def reset
17
17
  self.verbosity = :info
18
- self.holding_lock = ENV["KAMAL_LOCK"] == "true"
19
- self.holding_server_lock = ENV["KAMAL_SERVER_LOCK"] == "true"
18
+ self.holding_lock = env_flag("DASH_LOCK", "KAMAL_LOCK")
19
+ self.holding_server_lock = env_flag("DASH_SERVER_LOCK", "KAMAL_SERVER_LOCK")
20
20
  self.connected = false
21
21
  self.logging = false
22
22
  self.lock_wait = false
@@ -30,7 +30,7 @@ class Kamal::Commander
30
30
  end
31
31
 
32
32
  def config
33
- @config ||= Kamal::Configuration.create_from(**@config_kwargs.to_h).tap do |config|
33
+ @config ||= Dash::Configuration.create_from(**@config_kwargs.to_h).tap do |config|
34
34
  @config_kwargs = nil
35
35
  configure_sshkit_with(config)
36
36
  end
@@ -56,7 +56,7 @@ class Kamal::Commander
56
56
  def specific_roles=(role_names)
57
57
  @specifics = nil
58
58
  @specific_roles = if role_names.present?
59
- filtered = Kamal::Utils.filter_specific_items(role_names, config.roles)
59
+ filtered = Dash::Utils.filter_specific_items(role_names, config.roles)
60
60
  raise ArgumentError, "No --roles match for #{role_names.join(',')}" if filtered.empty?
61
61
  filtered
62
62
  end
@@ -65,7 +65,7 @@ class Kamal::Commander
65
65
  def specific_hosts=(hosts)
66
66
  @specifics = nil
67
67
  @specific_hosts = if hosts.present?
68
- filtered = Kamal::Utils.filter_specific_items(hosts, config.all_hosts)
68
+ filtered = Dash::Utils.filter_specific_items(hosts, config.all_hosts)
69
69
  raise ArgumentError, "No --hosts match for #{hosts.join(',')}" if filtered.empty?
70
70
  filtered
71
71
  end
@@ -83,61 +83,61 @@ class Kamal::Commander
83
83
  end
84
84
 
85
85
  def app(role: nil, host: nil)
86
- Kamal::Commands::App.new(config, role: role, host: host)
86
+ Dash::Commands::App.new(config, role: role, host: host)
87
87
  end
88
88
 
89
89
  def accessory(name)
90
- Kamal::Commands::Accessory.new(config, name: name)
90
+ Dash::Commands::Accessory.new(config, name: name)
91
91
  end
92
92
 
93
93
  def auditor(**details)
94
- Kamal::Commands::Auditor.new(config, **details)
94
+ Dash::Commands::Auditor.new(config, **details)
95
95
  end
96
96
 
97
97
  def builder
98
- @commands[:builder] ||= Kamal::Commands::Builder.new(config)
98
+ @commands[:builder] ||= Dash::Commands::Builder.new(config)
99
99
  end
100
100
 
101
101
  def docker
102
- @commands[:docker] ||= Kamal::Commands::Docker.new(config)
102
+ @commands[:docker] ||= Dash::Commands::Docker.new(config)
103
103
  end
104
104
 
105
105
  def hook
106
- @commands[:hook] ||= Kamal::Commands::Hook.new(config)
106
+ @commands[:hook] ||= Dash::Commands::Hook.new(config)
107
107
  end
108
108
 
109
109
  def lock
110
- @commands[:lock] ||= Kamal::Commands::Lock.new(config)
110
+ @commands[:lock] ||= Dash::Commands::Lock.new(config)
111
111
  end
112
112
 
113
113
  # Guards the kamal-proxy container, which a host runs once for every
114
114
  # destination deployed onto it. Every destination contends for this one.
115
115
  def server_lock
116
- @commands[:server_lock] ||= Kamal::Commands::Lock.new(config, scope: :server)
116
+ @commands[:server_lock] ||= Dash::Commands::Lock.new(config, scope: :server)
117
117
  end
118
118
 
119
119
  def proxy(host)
120
- Kamal::Commands::Proxy.new(config, host: host)
120
+ Dash::Commands::Proxy.new(config, host: host)
121
121
  end
122
122
 
123
123
  def loadbalancer_config
124
- @loadbalancer_config ||= Kamal::Configuration::Loadbalancer.new(config: config, proxy_config: config.proxy.proxy_config, secrets: config.secrets)
124
+ @loadbalancer_config ||= Dash::Configuration::Loadbalancer.new(config: config, proxy_config: config.proxy.proxy_config, secrets: config.secrets)
125
125
  end
126
126
 
127
127
  def loadbalancer
128
- @commands[:loadbalancer] ||= Kamal::Commands::Loadbalancer.new(config, loadbalancer_config: loadbalancer_config)
128
+ @commands[:loadbalancer] ||= Dash::Commands::Loadbalancer.new(config, loadbalancer_config: loadbalancer_config)
129
129
  end
130
130
 
131
131
  def prune
132
- @commands[:prune] ||= Kamal::Commands::Prune.new(config)
132
+ @commands[:prune] ||= Dash::Commands::Prune.new(config)
133
133
  end
134
134
 
135
135
  def registry
136
- @commands[:registry] ||= Kamal::Commands::Registry.new(config)
136
+ @commands[:registry] ||= Dash::Commands::Registry.new(config)
137
137
  end
138
138
 
139
139
  def server
140
- @commands[:server] ||= Kamal::Commands::Server.new(config)
140
+ @commands[:server] ||= Dash::Commands::Server.new(config)
141
141
  end
142
142
 
143
143
  def alias(name)
@@ -148,7 +148,7 @@ class Kamal::Commander
148
148
  if @config
149
149
  @config.aliases[name]&.command
150
150
  else
151
- raw_config = Kamal::Configuration.load_raw_config(**@config_kwargs.to_h.slice(:config_file, :destination))
151
+ raw_config = Dash::Configuration.load_raw_config(**@config_kwargs.to_h.slice(:config_file, :destination))
152
152
  raw_config[:aliases]&.dig(name)
153
153
  end
154
154
  end
@@ -227,7 +227,7 @@ class Kamal::Commander
227
227
 
228
228
  config.output.loggers.each { |logger| output_logger.broadcast_to(logger) }
229
229
 
230
- SSHKit.config.output = Kamal::Output::Formatter.new($stdout, output_logger)
230
+ SSHKit.config.output = Dash::Output::Formatter.new($stdout, output_logger)
231
231
 
232
232
  at_exit { @output_logger&.close }
233
233
  rescue => e
@@ -236,6 +236,14 @@ class Kamal::Commander
236
236
  end
237
237
 
238
238
  def specifics
239
- @specifics ||= Kamal::Commander::Specifics.new(config, specific_hosts, specific_roles)
239
+ @specifics ||= Dash::Commander::Specifics.new(config, specific_hosts, specific_roles)
240
+ end
241
+
242
+ # First name that is set wins, so DASH_* takes precedence over the legacy
243
+ # KAMAL_* twin rather than either one merely being truthy. Dash::Tags#env
244
+ # writes both with the same value, so they only disagree when an operator
245
+ # sets one by hand.
246
+ def env_flag(*names)
247
+ names.filter_map { |name| ENV[name] }.first == "true"
240
248
  end
241
249
  end
@@ -1,4 +1,4 @@
1
- module Kamal::Commands::Accessory::Proxy
1
+ module Dash::Commands::Accessory::Proxy
2
2
  delegate :container_name, to: :"config.proxy_boot", prefix: :proxy
3
3
 
4
4
  def deploy(target:)
@@ -1,4 +1,4 @@
1
- class Kamal::Commands::Accessory < Kamal::Commands::Base
1
+ class Dash::Commands::Accessory < Dash::Commands::Base
2
2
  include Proxy
3
3
 
4
4
  attr_reader :accessory_config
@@ -20,7 +20,7 @@ class Kamal::Commands::Accessory < Kamal::Commands::Base
20
20
  *network_args,
21
21
  *config.logging_args,
22
22
  *publish_args,
23
- *([ "--env", "KAMAL_HOST=\"#{host}\"" ] if host),
23
+ *([ "--env", "DASH_HOST=\"#{host}\"", "--env", "KAMAL_HOST=\"#{host}\"" ] if host),
24
24
  *env_args,
25
25
  *volume_args,
26
26
  *label_args,
@@ -1,4 +1,4 @@
1
- module Kamal::Commands::App::Assets
1
+ module Dash::Commands::App::Assets
2
2
  def extract_assets
3
3
  asset_container = "#{role.container_prefix}-assets"
4
4
 
@@ -1,4 +1,4 @@
1
- module Kamal::Commands::App::Containers
1
+ module Dash::Commands::App::Containers
2
2
  DOCKER_HEALTH_LOG_FORMAT = "'{{json .State.Health}}'"
3
3
 
4
4
  def list_containers
@@ -1,9 +1,9 @@
1
- module Kamal::Commands::App::ErrorPages
1
+ module Dash::Commands::App::ErrorPages
2
2
  def create_error_pages_directory
3
3
  make_directory(config.proxy_boot.error_pages_directory)
4
4
  end
5
5
 
6
6
  def clean_up_error_pages
7
- [ :find, config.proxy_boot.error_pages_directory, "-mindepth", "1", "-maxdepth", "1", "!", "-name", KAMAL.config.version, "-exec", "rm", "-rf", "{} +" ]
7
+ [ :find, config.proxy_boot.error_pages_directory, "-mindepth", "1", "-maxdepth", "1", "!", "-name", DASH.config.version, "-exec", "rm", "-rf", "{} +" ]
8
8
  end
9
9
  end
@@ -1,4 +1,4 @@
1
- module Kamal::Commands::App::Execution
1
+ module Dash::Commands::App::Execution
2
2
  def execute_in_existing_container(*command, interactive: false, env:)
3
3
  docker :exec,
4
4
  (docker_interactive_args if interactive),
@@ -1,4 +1,4 @@
1
- module Kamal::Commands::App::Images
1
+ module Dash::Commands::App::Images
2
2
  def list_images
3
3
  docker :image, :ls, config.repository
4
4
  end
@@ -1,4 +1,4 @@
1
- module Kamal::Commands::App::Logging
1
+ module Dash::Commands::App::Logging
2
2
  def logs(container_id: nil, timestamps: true, since: nil, lines: nil, grep: nil, grep_options: nil)
3
3
  pipe \
4
4
  container_id_command(container_id),