easy_caddy 0.1.2 → 0.1.3
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 +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +16 -1
- data/lib/easy_caddy/caddy.rb +10 -0
- data/lib/easy_caddy/cli.rb +6 -0
- data/lib/easy_caddy/commands/retrust.rb +26 -0
- data/lib/easy_caddy/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1fc68745e7124d44c7ab78398914db35245df3a6b006f828980bf821a8706ba4
|
|
4
|
+
data.tar.gz: 00dfd873695bba44c3ba3bc5fd9d5b4230d3e82c909974a6c41bfa8da00301da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d2a4144a2b580373b6a634c42eaf6412bc68fd3148f1b87f0601ae937bd5d941b51215592a56fffa73a5443adfc43f36bd86118cbdf22a3dd568dffa4416c48
|
|
7
|
+
data.tar.gz: 870dd719e3eae7a6a44b50e0230af97f926caa945f05be3856d9cad9a7ad4617eb389a9e2e7e46621e7c48d3ebccc7d1dbaf5b1656b944324e74bac597463a63
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.3] — 2026-06-13
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `ecaddy retrust` — re-trust the local Caddy CA certificate. Runs `caddy untrust`
|
|
13
|
+
then `caddy trust` in sequence, fixing `net::ERR_CERT_DATE_INVALID` errors that
|
|
14
|
+
appear when the local CA expires in the system keychain. Both steps trigger the
|
|
15
|
+
native macOS password prompt.
|
|
16
|
+
|
|
8
17
|
## [0.1.2] — 2026-06-09
|
|
9
18
|
|
|
10
19
|
### Added
|
|
@@ -63,5 +72,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
63
72
|
`SIGTERM`/`SIGINT`, and unregisters on exit — designed to drop into a
|
|
64
73
|
Procfile alongside the Rails server.
|
|
65
74
|
|
|
75
|
+
[0.1.3]: https://github.com/pniemczyk/easy_caddy/releases/tag/v0.1.3
|
|
66
76
|
[0.1.2]: https://github.com/pniemczyk/easy_caddy/releases/tag/v0.1.2
|
|
67
77
|
[0.1.0]: https://github.com/pniemczyk/easy_caddy/releases/tag/v0.1.0
|
data/README.md
CHANGED
|
@@ -268,11 +268,26 @@ ecaddy reload
|
|
|
268
268
|
|
|
269
269
|
---
|
|
270
270
|
|
|
271
|
+
### `ecaddy retrust`
|
|
272
|
+
|
|
273
|
+
Re-trust the local Caddy CA certificate. Run this when your browser shows
|
|
274
|
+
`net::ERR_CERT_DATE_INVALID` on a `*.localhost` site — it means the local CA
|
|
275
|
+
has expired in the system keychain.
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
ecaddy retrust
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Runs `caddy untrust` (removes the old cert) then `caddy trust` (re-installs it).
|
|
282
|
+
macOS will prompt for your password for each keychain operation.
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
271
286
|
### `ecaddy version`
|
|
272
287
|
|
|
273
288
|
```bash
|
|
274
289
|
ecaddy version
|
|
275
|
-
# ecaddy 0.1.
|
|
290
|
+
# ecaddy 0.1.3
|
|
276
291
|
```
|
|
277
292
|
|
|
278
293
|
## Global config layout
|
data/lib/easy_caddy/caddy.rb
CHANGED
|
@@ -78,6 +78,16 @@ module EasyCaddy
|
|
|
78
78
|
[out, $CHILD_STATUS.success?]
|
|
79
79
|
end
|
|
80
80
|
|
|
81
|
+
def self.untrust
|
|
82
|
+
system("#{BINARY} untrust")
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# @return [Array(String, Boolean)] combined output and whether the command succeeded
|
|
86
|
+
def self.untrust_with_output
|
|
87
|
+
out = `#{BINARY} untrust 2>&1`
|
|
88
|
+
[out, $CHILD_STATUS.success?]
|
|
89
|
+
end
|
|
90
|
+
|
|
81
91
|
ADMIN_ENDPOINT = 'http://localhost:2019/pki/ca/local'
|
|
82
92
|
|
|
83
93
|
# Polls Caddy's admin API until it responds or the timeout elapses.
|
data/lib/easy_caddy/cli.rb
CHANGED
|
@@ -15,6 +15,7 @@ require_relative 'commands/ensure'
|
|
|
15
15
|
require_relative 'commands/run'
|
|
16
16
|
require_relative 'commands/logs'
|
|
17
17
|
require_relative 'commands/audit'
|
|
18
|
+
require_relative 'commands/retrust'
|
|
18
19
|
|
|
19
20
|
module EasyCaddy
|
|
20
21
|
class CLI < Thor
|
|
@@ -99,6 +100,11 @@ module EasyCaddy
|
|
|
99
100
|
Commands::Audit.new(site: options[:site], fix: options[:fix]).call
|
|
100
101
|
end
|
|
101
102
|
|
|
103
|
+
desc 'retrust', 'Re-trust local CA certificate (fixes net::ERR_CERT_DATE_INVALID)'
|
|
104
|
+
def retrust
|
|
105
|
+
Commands::Retrust.new.call
|
|
106
|
+
end
|
|
107
|
+
|
|
102
108
|
desc 'version', 'Print ecaddy version'
|
|
103
109
|
def version
|
|
104
110
|
puts "ecaddy #{EasyCaddy::VERSION}"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative '../caddy'
|
|
4
|
+
require_relative '../error'
|
|
5
|
+
|
|
6
|
+
module EasyCaddy
|
|
7
|
+
module Commands
|
|
8
|
+
class Retrust
|
|
9
|
+
def call
|
|
10
|
+
raise Error, 'Caddy is not running. Start it with: brew services start caddy' unless Caddy.running?
|
|
11
|
+
|
|
12
|
+
puts ' Removing local CA from trust store...'
|
|
13
|
+
puts ' (you may be prompted for your password)'
|
|
14
|
+
output, success = Caddy.untrust_with_output
|
|
15
|
+
raise Error, "caddy untrust failed:\n#{output}" unless success
|
|
16
|
+
|
|
17
|
+
puts ' Re-trusting local CA...'
|
|
18
|
+
puts ' (you may be prompted for your password)'
|
|
19
|
+
output, success = Caddy.trust_with_output
|
|
20
|
+
raise Error, "caddy trust failed:\n#{output}" unless success
|
|
21
|
+
|
|
22
|
+
puts ' Done. Reload your browser — the certificate is now trusted.'
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
data/lib/easy_caddy/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: easy_caddy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pawel Niemczyk
|
|
@@ -134,6 +134,7 @@ files:
|
|
|
134
134
|
- lib/easy_caddy/commands/register_helpers.rb
|
|
135
135
|
- lib/easy_caddy/commands/reload.rb
|
|
136
136
|
- lib/easy_caddy/commands/remove.rb
|
|
137
|
+
- lib/easy_caddy/commands/retrust.rb
|
|
137
138
|
- lib/easy_caddy/commands/run.rb
|
|
138
139
|
- lib/easy_caddy/commands/setup.rb
|
|
139
140
|
- lib/easy_caddy/commands/status.rb
|