Skip to content

Commit

Permalink
Add keygen command. (#9)
Browse files Browse the repository at this point in the history
* Keygen skeleton.

* [keygen] Implement the basic features

* [keygen] synchronize files before exiting

* [keygen] Add help documentation

* [keygen] Generate '.ds' files for KSKs

* [keygen] Use 'display_as_bind()'

* [keygen] Add support for symlinks (Unix only)

* [keygen] Improve errors and support '.ds' symlinks

* Implement ldns-specific parsing for 'keygen'

* [keygen] Implement '-v' with version info

* [keygen] Add 'cfg(unix)' in ldns-parsing

* [keygen] Correctly handle duplicate options in ldns parsing

* Revert "[keygen] Implement '-v' with version info"

This reverts commit 643ab86.

See: <#9 (comment)>

* [keygen] Integrate the use of 'Env'

* [workflows/ci] Add OpenSSL installation steps

* [workflows/ci] Integrate OpenSSL for 'minimal_versions'

* [keygen] Improve the 'dnst' interface

* [keygen] Satisfy clippy

* [keygen] Simplify symlink CLI

* Add basic filesystem operations to 'Env'

* [keygen] Use symlink ops provided by 'Env'

* [keygen] Add basic tests for argument parsing

* [keygen] Add tests

* [keygen] Satisfy 'minimal-versions'

* [keygen] Satisfy clippy

* [keygen] Add Windows-specific missing branch

* [keygen] Document parsing for 'symlink'

* [keygen] Report error on '-r'

* [env] Refactor util fns into a 'util' module

* [keygen::symlink] Mark params as used, for Windows

* [keygen] Fix double error message

See: <#9 (comment)>

* [keygen] Use 'Args::Report'

* [keygen] Allow invalid HTML in docs for Clap

* Use 'domain'-style imports

* [keygen] Use uppercase for expected clap values

* [keygen] use lowercase value names in Clap

---------

Co-authored-by: arya dradjica <[email protected]>
  • Loading branch information
ximon18 and bal-e authored Dec 2, 2024
1 parent 7e2b9a6 commit 617b623
Show file tree
Hide file tree
Showing 11 changed files with 936 additions and 16 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,30 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [1.78.0, stable, beta, nightly]
env:
RUSTFLAGS: "-D warnings"
# We use 'vcpkg' to install OpenSSL on Windows.
VCPKG_ROOT: "${{ github.workspace }}\\vcpkg"
VCPKGRS_TRIPLET: x64-windows-release
# Ensure that OpenSSL is dynamically linked.
VCPKGRS_DYNAMIC: 1
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Install Rust
uses: hecrj/setup-rust-action@v2
with:
rust-version: ${{ matrix.rust }}
- if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y libssl-dev
- if: matrix.os == 'windows-latest'
id: vcpkg
uses: johnwason/vcpkg-action@v6
with:
pkgs: openssl
triplet: ${{ env.VCPKGRS_TRIPLET }}
token: ${{ github.token }}
github-binarycache: true
- if: matrix.rust == 'stable'
run: rustup component add clippy
- if: matrix.rust == 'stable'
Expand All @@ -36,6 +53,8 @@ jobs:
uses: hecrj/setup-rust-action@v2
with:
rust-version: "1.78.0"
- name: Install OpenSSL
run: sudo apt-get install -y libssl-dev
- name: Install nightly Rust
run: rustup install nightly
- name: Check with minimal-versions
Expand Down
135 changes: 128 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,25 @@ default-run = "dnst"
name = "ldns"
path = "src/bin/ldns.rs"

[features]
default = ["openssl", "ring"]

# Cryptographic backends
openssl = ["domain/openssl"]
ring = ["domain/ring"]

[dependencies]
clap = { version = "4.3.4", features = ["cargo", "derive"] }
domain = { version = "0.10.3", git = "https://github.com/NLnetLabs/domain.git", branch = "initial-nsec3-generation", features = ["unstable-validator", "zonefile"] }
domain = { git = "https://github.com/NLnetLabs/domain.git", branch = "initial-nsec3-generation", features = [
"bytes",
"zonefile",
"unstable-sign",
"unstable-validate",
"unstable-validator",
] }
lexopt = "0.3.0"

[dev-dependencies]
test_bin = "0.4.0"
tempfile = "3.14.0"
regex = "1.11.1"
Loading

0 comments on commit 617b623

Please sign in to comment.