messhy 0.9.2 → 0.9.4

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: fbcab708f43ed1ee21e30b2162ce6ec7aa4e762dfebeea5874d4f0f7d55a46d1
4
- data.tar.gz: 5085a9ad4d3f8429e22544d32ca60275eda1079934f4dd63c5a80dd54c0944ec
3
+ metadata.gz: 39d99fb8d9e331c652ea366eee1768ddcc2edb92ba88b4d7fe800e74007f20dc
4
+ data.tar.gz: 87ccbe020145c5d4e22b7091dbd39a73a526b4426d5fc95197c3690b320b2b2d
5
5
  SHA512:
6
- metadata.gz: 490c2acab762f4f14b39731a1c33408b0e9131316dff4f52ec2b1083d0b03273e475709d47a435cf7566f524013bff90ae7fb4cdb70cfbf5d2b4fc15fe62def8
7
- data.tar.gz: 2f29f271a42b84f6f9b205233c175f203fa0a69efe5fc65b119e570a2029cafc2a8e6b4f4cc725aa7da6ac07eabf8216e7c745cf53d66ada9e53e88a89ae649a
6
+ metadata.gz: c99a4e7db66587958fa8241c49276dbc7937698905251f8a041a57d3c14817f12237146768d3c7471ac186f699cb97a7112639fae716f19c9e5c9afcc1b76789
7
+ data.tar.gz: d33017e2f63b3715145e8cec2133a67235ec44a64fa6c39d9e11700c9eac3e10e5b478632da4333e9c81db9dfb00d7f351cb6a51cb372e01986be6afb770669b
data/CHANGELOG.md CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.9.4] - 2026-12-03
11
+
12
+ ### Security
13
+
14
+ - Require Net::SSH 8.1.2 or newer for SSH connections.
15
+
16
+ ## [0.9.3] - 2026-10-05
17
+
18
+ ### Fixed
19
+
20
+ - Keep temporary WireGuard configurations private during reconciliation and
21
+ remove them after successful updates or failed updates with rollback.
22
+
10
23
  ## [0.9.2] - 2026-10-02
11
24
 
12
25
  ### Changed
data/README.md CHANGED
@@ -1,10 +1,9 @@
1
1
  # messhy
2
2
 
3
- > WireGuard VPN mesh for secure private networking. Simple, fast, zero-config.
3
+ A Ruby gem that configures a WireGuard mesh across hosts you control. Every node
4
+ connects directly to every other node.
4
5
 
5
- A Ruby gem that sets up a full WireGuard VPN mesh across any VMs. Every node connects directly to every other node, creating a secure private network.
6
-
7
- ## Why messhy?
6
+ ## How it works
8
7
 
9
8
  Messhy generates WireGuard keys and peer configuration, installs it over SSH,
10
9
  and gives each node a stable private address. It is intended for small fleets
@@ -103,6 +102,13 @@ Apply DNS without touching WireGuard:
103
102
  messhy dns --environment=production
104
103
  ```
105
104
 
105
+ Use `messhy reconcile --environment=production` to update active peers without
106
+ restarting their WireGuard interfaces. Reconciliation uploads configuration
107
+ inside a private temporary directory and passes a separate owner-only file to
108
+ `wg syncconf`. Both temporary files are removed after a successful update or
109
+ a failed update with rollback. The installed and previous configurations remain
110
+ root-owned with mode `0600`.
111
+
106
112
  ## Secret Management
107
113
 
108
114
  `messhy setup` stores generated WireGuard key pairs inside `.secrets/wireguard/*.yml` with `0600` permissions. Each node gets its own YAML file (`.secrets/wireguard/<node>.yml`) and all peer pre‑shared keys live in `.secrets/wireguard/psks.yml`. The directory is gitignored by default, and the Rails generator ensures the ignore rules are present in your application. After provisioning, copy the YAML files into 1Password (or another vault) and remove them from disk if you do not want long‑lived local copies.
@@ -127,11 +127,22 @@ module Messhy
127
127
  end
128
128
 
129
129
  def reconcile_config(node_name, config_content)
130
- temp_file = '/tmp/messhy-wg0.conf'
131
- script = reconcile_script(temp_file)
130
+ executor = self
132
131
  execute_on_node(node_name) do
133
- upload! StringIO.new(config_content), temp_file
134
- execute :sudo, :bash, '-lc', Shellwords.escape(script)
132
+ temp_directory = capture(:mktemp, '-d', '/tmp/messhy-reconcile.XXXXXXXXXX').strip
133
+ unless temp_directory.match?(%r{\A/tmp/messhy-reconcile\.[A-Za-z0-9]+\z})
134
+ raise Error, 'Could not create a private WireGuard upload directory'
135
+ end
136
+
137
+ temp_file = File.join(temp_directory, 'wg0.conf')
138
+ begin
139
+ upload! StringIO.new(config_content), temp_file
140
+ script = executor.send(:reconcile_script, temp_file)
141
+ execute :sudo, :bash, '-lc', Shellwords.escape(script)
142
+ ensure
143
+ execute :rm, '-f', temp_file
144
+ execute :rmdir, temp_directory
145
+ end
135
146
  end
136
147
  end
137
148
 
@@ -397,9 +408,11 @@ module Messhy
397
408
  target=/etc/wireguard/wg0.conf
398
409
  candidate=/etc/wireguard/wg0.next.conf
399
410
  previous=/etc/wireguard/wg0.conf.previous
400
- stripped=/tmp/messhy-wg0.stripped
411
+ stripped=$(mktemp /tmp/messhy-wg0.XXXXXXXXXX)
412
+ trap 'rm -f "$stripped"' EXIT
413
+ trap 'exit 1' HUP INT TERM
401
414
 
402
- install -o root -g root -m 600 #{temp_file} "$candidate"
415
+ install -o root -g root -m 600 #{Shellwords.escape(temp_file)} "$candidate"
403
416
  wg-quick strip "$candidate" > "$stripped"
404
417
 
405
418
  if systemctl is-active --quiet wg-quick@wg0; then
@@ -421,7 +434,6 @@ module Messhy
421
434
  fi
422
435
  fi
423
436
 
424
- rm -f "$stripped" #{temp_file}
425
437
  SCRIPT
426
438
  end
427
439
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Messhy
4
- VERSION = '0.9.2'
4
+ VERSION = '0.9.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: messhy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - BoringCache
@@ -37,6 +37,20 @@ dependencies:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '1.4'
40
+ - !ruby/object:Gem::Dependency
41
+ name: net-ssh
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 8.1.2
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 8.1.2
40
54
  - !ruby/object:Gem::Dependency
41
55
  name: sshkit
42
56
  requirement: !ruby/object:Gem::Requirement
@@ -99,7 +113,7 @@ homepage: https://github.com/boringcache/messhy
99
113
  licenses:
100
114
  - MIT
101
115
  metadata:
102
- source_code_uri: https://github.com/boringcache/messhy/tree/v0.9.2
116
+ source_code_uri: https://github.com/boringcache/messhy/tree/v0.9.4
103
117
  documentation_uri: https://github.com/boringcache/messhy/blob/main/README.md
104
118
  changelog_uri: https://github.com/boringcache/messhy/blob/main/CHANGELOG.md
105
119
  bug_tracker_uri: https://github.com/boringcache/messhy/issues