Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions Formula/f/fnox.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
class Fnox < Formula
desc "Fort Knox for your secrets - flexible secret management tool"
homepage "https://fnox.jdx.dev/"
url "https://github.com/jdx/fnox/archive/refs/tags/v1.2.3.tar.gz"
sha256 "a71ace05facbea5238ac6dbeb457dcbda179d9db4d4904f5e7ea59d3a23599d3"
license "MIT"
head "https://github.com/jdx/fnox.git", branch: "main"

livecheck do
url :stable
strategy :github_latest
end

depends_on "rust" => :build

on_linux do
depends_on "openssl@3"
end
Comment on lines +16 to +18
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The openssl@3 dependency is declared in the on_linux block but is unconditionally used in the install method via Formula['openssl@3']. Consider adding a guard to ensure the formula reference only occurs when the dependency is actually declared, or move the dependency outside the platform-specific block with appropriate conditions.

Copilot uses AI. Check for mistakes.

def install

Check failure on line 20 in Formula/f/fnox.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

`brew install --verbose --formula --build-bottle fnox` failed on macOS Sonoma (14) on Apple Silicon!

Compiling data-encoding v2.9.0 Finished `release` profile [optimized] target(s) in 5m 27s Installing /opt/homebrew/Cellar/fnox/1.2.3/bin/fnox Installed package `fnox v1.2.3 (/private/tmp/fnox-20251101-8257-9yyv7z/fnox-1.2.3)` (executable `fnox`) warning: be sure to add `/opt/homebrew/Cellar/fnox/1.2.3/bin` to your PATH to be able to run the installed binaries Error: fnox::io::error × I/O error: No such file or directory (os error 2) ╰─▶ No such file or directory (os error 2) ::error::Failure while executing; `\{\"SHELL\"\ =\>\ \"bash\"\} /opt/homebrew/Cellar/fnox/1.2.3/bin/fnox completion bash` exited with 1. Here's the output:%0A
# Ensure that the `openssl` crate picks up the intended library on Linux
ENV["OPENSSL_DIR"] = Formula["openssl@3"].opt_prefix.to_s if OS.linux?
ENV["OPENSSL_NO_VENDOR"] = "1"

system "cargo", "install", *std_cargo_args

generate_completions_from_executable(bin/"fnox", "completion")
end

test do
assert_match "fnox #{version}", shell_output("#{bin}/fnox --version")

# Generate test age key using system age-keygen
test_key = shell_output("age-keygen")
test_key_line = test_key.lines.grep(/^# public key:/).first.sub(/^# public key: /, "").strip
secret_key_line = test_key.lines.grep(/^AGE-SECRET-KEY-/).first.strip

# Test with age encryption
(testpath/"fnox.toml").write <<~TOML
[providers]
age = { type = "age", recipients = ["#{test_key_line}"] }

[secrets]
TEST_SECRET = { provider = "age", value = "test-value" }
TOML

# Set the secret properly so it gets encrypted
ENV["FNOX_AGE_KEY"] = secret_key_line
system bin/"fnox", "set", "TEST_SECRET", "test-value", "--provider", "age"

# Test list shows the secret
output = shell_output("#{bin}/fnox list")
assert_match "TEST_SECRET", output

# Test list --values shows decrypted value
output = shell_output("FNOX_AGE_KEY='#{secret_key_line}' #{bin}/fnox list --values")
assert_match "TEST_SECRET.*test-value", output
end
end
Loading