Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ca89dde
Add Rust CLI for interacting with keys server
danielemery Jun 23, 2025
cb17e90
Introduce keys subcommand
danielemery Jun 24, 2025
32b1890
Add PGP keys and known hosts subcommands to CLI
danielemery Jun 24, 2025
bd3fe0a
Split main.rs into modular components
danielemery Jun 24, 2025
170d1e4
Add config file support for default server URL
danielemery Jun 24, 2025
e9e9541
Add SSH keys sync with warning for unmanaged keys
danielemery Jun 24, 2025
661d6a5
Add rust tests and builds to github actions
danielemery Jun 24, 2025
882585b
Run `deno fmt` to fix failing check
danielemery Jun 25, 2025
c329684
Rename keys-cli to keys
danielemery Jun 25, 2025
a73a6bb
Include cli build and release creation as part of publish job
danielemery Jun 25, 2025
faea831
Improve test coverage of ssh_keys and fix duplicate module
danielemery Jun 25, 2025
00f8bd0
Add test coverage to the known-hosts subcommand
danielemery Jun 25, 2025
e65c16f
Add test coverage to the pgp subcommand
danielemery Jun 25, 2025
de3f559
Add the cargo lockfile
danielemery Jul 22, 2025
a17f7b0
Fix crate version and addition
danielemery Jul 22, 2025
5844d8a
Improve/reorder README.md file to have important information first
danielemery Jul 22, 2025
4e8cc85
Improve terminal output when syncing
danielemery Jul 22, 2025
57d3396
Remove duplicate tests
danielemery Jul 22, 2025
95b9b2c
Add user@host comments to SSH keys and auto-update existing key comments
danielemery Jul 25, 2025
82cd126
Add unit tests for the config module
danielemery Jul 25, 2025
7f80f12
Add basic nix setup for the cli
danielemery Sep 9, 2025
cd4ea12
Add known hosts file writing feature to cli
danielemery Sep 9, 2025
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
8 changes: 7 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@
"extensions": [
"denoland.vscode-deno",
"doppler.doppler-vscode",
"ms-azuretools.vscode-docker"
"ms-azuretools.vscode-docker",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml"
]
}
},
"features": {
"ghcr.io/itsmechlark/features/doppler:2": {
"version": "latest"
},
"ghcr.io/devcontainers/features/rust:1": {
"version": "latest",
"profile": "default"
}
},
"portsAttributes": {
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+*"

permissions:
contents: write
packages: write

env:
Expand Down Expand Up @@ -79,3 +80,64 @@ jobs:
chart: ./helm
version: ${{ steps.version.outputs.full }}
appVersion: ${{ steps.version.outputs.full }}

rust-cli-build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: nowsprinting/check-version-format-action@v3
id: version
with:
prefix: "v"

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Build Rust CLI
working-directory: ./cli
run: cargo build --release

- name: Upload Rust CLI binary
uses: actions/upload-artifact@v4
with:
name: keys-cli-${{ steps.version.outputs.full }}
path: cli/target/release/keys
retention-days: 30

github-release:
needs:
- docker-publish
- helm-publish
- rust-cli-build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: nowsprinting/check-version-format-action@v3
id: version
with:
prefix: "v"

- name: Download Rust CLI binary
uses: actions/download-artifact@v4
with:
name: keys-cli-${{ steps.version.outputs.full }}
path: ./artifacts

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.full }}
name: Release ${{ steps.version.outputs.full }}
generate_release_notes: true
files: |
./artifacts/keys
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,49 @@ jobs:
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
flags: deno-server

test-rust-cli:
runs-on: ubuntu-latest

steps:
- name: Setup repo
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov

- name: Check Rust formatting
working-directory: ./cli
run: cargo fmt --all -- --check

- name: Lint with clippy
working-directory: ./cli
run: cargo clippy --all-targets -- -D warnings

- name: Build Rust CLI
working-directory: ./cli
run: cargo build

- name: Run Rust tests with coverage
working-directory: ./cli
run: cargo llvm-cov --lcov --output-path lcov.info

- name: Upload Rust coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./cli/lcov.info
flags: rust-cli
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ machine. This is currently done with manual curl commands, and not typically
automated with a CRON due to the risk of losing access to machines as a result
of the service being down or misconfigured.

In the future ([#24](https://github.com/danielemery/keys/issues/24)) a cli tool
will be provided to safely manage the `authorized_keys` file with guards in
place to prevent loss of access.
A CLI tool is now available to interact with the keys server. See the
[CLI README](/cli/README.md) for more information on installation and usage.

### Get all listed keys

Expand Down
2 changes: 2 additions & 0 deletions cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target/
**/*.rs.bk
Loading
Loading