yamine 0.7.0 → 0.7.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1003241d7826eb9d1b2c1f511a7e9b8e99f4be0d9438d2651dd86864d3cee1cc
4
- data.tar.gz: 58ee2023a0f951f508c5032af8079d9417f97427bf76d48af08ec734661fd7a7
3
+ metadata.gz: 96bdebf9dc726c4caf747a07f2599bbde292a975e3395bd7cf43b1daf752bea3
4
+ data.tar.gz: 4abda73bc87a74f344070a3d69e87d470b788f05d04abfa4d6fb5783649fea20
5
5
  SHA512:
6
- metadata.gz: ea87625511591d754116bda3a16849466d9d982c7ba8f69a773508e36142e224e9c9a9ed96335c2f1d28c28f285116a488caa5c34d4ab7704cb06b4bb1d14a3f
7
- data.tar.gz: 701589715a07e31778aefd39c60d05f7bdd9c865d77d72517f0a3881054046067ae60c2dc3ae97ecebe6f8b1dfd238ab95de5dd12d3a163bbd0f63aefaba9f3a
6
+ metadata.gz: 627bc6d9fcb038635d90ec9b49eb7a321fae414cb58ed584b02f4bcc7fbd8fd3a49fe98b610d7fb033564c416ab8ccdbed1b87c5ef6983ef7c70023eca351110
7
+ data.tar.gz: 19a0c6f70d82fddf4385c616e820d04d00a12d60be5016a13ce12054da5bf82aeb5fc7a47940d030518645eda95dac28a1957502d7df139715da65695681863f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.1] — 2026-09-10
4
+
5
+ ### Fixed
6
+
7
+ - **`yamine start` now honors `YAMINE_PORT`.** `ensure_workstation!`
8
+ hardcoded port 443, so the documented escape hatch for CI and
9
+ sandboxes — "where 443 is impossible" — was ignored: with
10
+ `YAMINE_PORT=8443` on a non-interactive machine, `start` aborted with
11
+ "port 443 needs root to bind" and demanded sudo for a port the user
12
+ had deliberately chosen to avoid. The port and scheme now come from
13
+ the context, and an unprivileged port is started directly instead of
14
+ being treated as a setup failure. The root path is unchanged: 443 on a
15
+ non-interactive machine still points at `yamine setup`.
16
+
3
17
  ## [0.7.0] — 2026-09-10
4
18
 
5
19
  Keeping the no-port promise when the machine's recorded port goes stale,
@@ -700,9 +700,15 @@ module Yamine
700
700
 
701
701
 
702
702
  # Quiet workstation setup for `start`: trust the CA, ensure a proxy
703
- # on 443 (root service, sudo daemon fallback), and sync hosts.
704
- # Each step is idempotent; only missing pieces run. Non-interactive
705
- # CI without a proxy fails fast rather than prompting for sudo.
703
+ # on this run's port (443 by default — root service, sudo daemon
704
+ # fallback), and sync hosts. Each step is idempotent; only missing
705
+ # pieces run. Non-interactive CI without a proxy fails fast rather
706
+ # than prompting for sudo.
707
+ #
708
+ # The port comes from ctx, not a literal: YAMINE_PORT is the
709
+ # documented escape hatch for CI and sandboxes ("where 443 is
710
+ # impossible"), and hardcoding 443 here demanded root for a port
711
+ # those users had already chosen to avoid.
706
712
  def ensure_workstation!(ctx)
707
713
  # 1. CA
708
714
  unless Yamine::Certs.trusted?(ctx.store.dir)
@@ -714,19 +720,30 @@ module Yamine
714
720
  end
715
721
  end
716
722
 
717
- # 2. Proxy on 443
718
- port = 443
719
- tls = true
723
+ # 2. Proxy on the port this run wants
724
+ port = ctx.proxy_port
725
+ tls = ctx.proxy_tls
720
726
  unless Yamine::ProxyControl.listening?(port) && ProxyControl.ours?(port, tls: tls)
721
- if port < 1024 && !Yamine::ProxyControl.root? && !ctx.interactive?
722
- abort_setup("Proxy is not running and port 443 needs root to bind.", *privileged_port_hint)
727
+ privileged = port < 1024
728
+ if privileged && !Yamine::ProxyControl.root? && !ctx.interactive?
729
+ abort_setup("Proxy is not running and port #{port} needs root to bind.", *privileged_port_hint)
723
730
  end
724
731
  ok =
725
732
  if ProxyControl.root?
726
733
  Yamine::CLI::SystemCommand.ensure_root_service(ctx)
727
734
  elsif ctx.interactive?
728
735
  begin
729
- Yamine::ProxyControl.spawn_daemon(store: ctx.store, port: port, tls: tls, sudo: true)
736
+ Yamine::ProxyControl.spawn_daemon(store: ctx.store, port: port, tls: tls, sudo: privileged)
737
+ wait_for_ours(ctx, port, tls: tls)
738
+ rescue Yamine::ProxyNotRunningError, SystemCallError => e
739
+ warn " daemon start failed: #{e.message.lines.first&.strip}"
740
+ false
741
+ end
742
+ elsif !privileged
743
+ # Non-interactive but unprivileged: nothing to elevate, so
744
+ # start the daemon directly instead of failing.
745
+ begin
746
+ Yamine::ProxyControl.spawn_daemon(store: ctx.store, port: port, tls: tls, sudo: false)
730
747
  wait_for_ours(ctx, port, tls: tls)
731
748
  rescue Yamine::ProxyNotRunningError, SystemCallError => e
732
749
  warn " daemon start failed: #{e.message.lines.first&.strip}"
@@ -736,7 +753,8 @@ module Yamine
736
753
  false
737
754
  end
738
755
  unless ok
739
- abort_setup("Proxy is not running and could not be started on port 443.", *privileged_port_hint)
756
+ abort_setup("Proxy is not running and could not be started on port #{port}.",
757
+ *privileged_port_hint)
740
758
  end
741
759
  end
742
760
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yamine
4
- VERSION = "0.7.0"
4
+ VERSION = "0.7.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yamine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto