Skip to content

Commit dd88a79

Browse files
authored
Merge pull request #25 from shellrow/dev
Update dependencies
2 parents 9dbc52f + 0665e12 commit dd88a79

File tree

19 files changed

+343
-455
lines changed

19 files changed

+343
-455
lines changed

.github/workflows/release.yml

Lines changed: 46 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
# This file was autogenerated by dist: https://github.com/astral-sh/cargo-dist
2+
#
13
# Copyright 2022-2024, axodotdev
4+
# Copyright 2025 Astral Software Inc.
25
# SPDX-License-Identifier: MIT or Apache-2.0
36
#
47
# CI that:
58
#
69
# * checks for a Git Tag that looks like a release
7-
# * builds artifacts with cargo-dist (archives, installers, hashes)
10+
# * builds artifacts with dist (archives, installers, hashes)
811
# * uploads those artifacts to temporary workflow zip
912
# * on success, uploads the artifacts to a GitHub Release
1013
#
@@ -22,10 +25,10 @@ permissions:
2225
# must be a Cargo-style SemVer Version (must have at least major.minor.patch).
2326
#
2427
# If PACKAGE_NAME is specified, then the announcement will be for that
25-
# package (erroring out if it doesn't have the given version or isn't cargo-dist-able).
28+
# package (erroring out if it doesn't have the given version or isn't dist-able).
2629
#
2730
# If PACKAGE_NAME isn't specified, then the announcement will be for all
28-
# (cargo-dist-able) packages in the workspace with that version (this mode is
31+
# (dist-able) packages in the workspace with that version (this mode is
2932
# intended for workspaces with only one dist-able package, or with all dist-able
3033
# packages versioned/released in lockstep).
3134
#
@@ -43,9 +46,9 @@ on:
4346
- '**[0-9]+.[0-9]+.[0-9]+*'
4447

4548
jobs:
46-
# Run 'cargo dist plan' (or host) to determine what tasks we need to do
49+
# Run 'dist plan' (or host) to determine what tasks we need to do
4750
plan:
48-
runs-on: "ubuntu-20.04"
51+
runs-on: "ubuntu-22.04"
4952
outputs:
5053
val: ${{ steps.plan.outputs.manifest }}
5154
tag: ${{ !github.event.pull_request && github.ref_name || '' }}
@@ -56,26 +59,27 @@ jobs:
5659
steps:
5760
- uses: actions/checkout@v4
5861
with:
62+
persist-credentials: false
5963
submodules: recursive
60-
- name: Install cargo-dist
64+
- name: Install dist
6165
# we specify bash to get pipefail; it guards against the `curl` command
6266
# failing. otherwise `sh` won't catch that `curl` returned non-0
6367
shell: bash
64-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.18.0/cargo-dist-installer.sh | sh"
65-
- name: Cache cargo-dist
68+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/cargo-dist/releases/download/v0.28.4/cargo-dist-installer.sh | sh"
69+
- name: Cache dist
6670
uses: actions/upload-artifact@v4
6771
with:
6872
name: cargo-dist-cache
69-
path: ~/.cargo/bin/cargo-dist
73+
path: ~/.cargo/bin/dist
7074
# sure would be cool if github gave us proper conditionals...
7175
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
7276
# functionality based on whether this is a pull_request, and whether it's from a fork.
7377
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
7478
# but also really annoying to build CI around when it needs secrets to work right.)
7579
- id: plan
7680
run: |
77-
cargo dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
78-
echo "cargo dist ran successfully"
81+
dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
82+
echo "dist ran successfully"
7983
cat plan-dist-manifest.json
8084
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
8185
- name: "Upload dist-manifest.json"
@@ -93,18 +97,19 @@ jobs:
9397
if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
9498
strategy:
9599
fail-fast: false
96-
# Target platforms/runners are computed by cargo-dist in create-release.
100+
# Target platforms/runners are computed by dist in create-release.
97101
# Each member of the matrix has the following arguments:
98102
#
99103
# - runner: the github runner
100-
# - dist-args: cli flags to pass to cargo dist
101-
# - install-dist: expression to run to install cargo-dist on the runner
104+
# - dist-args: cli flags to pass to dist
105+
# - install-dist: expression to run to install dist on the runner
102106
#
103107
# Typically there will be:
104108
# - 1 "global" task that builds universal installers
105109
# - N "local" tasks that build each platform's binaries and platform-specific installers
106110
matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
107111
runs-on: ${{ matrix.runner }}
112+
container: ${{ matrix.container && matrix.container.image || null }}
108113
env:
109114
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110115
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
@@ -114,9 +119,17 @@ jobs:
114119
git config --global core.longpaths true
115120
- uses: actions/checkout@v4
116121
with:
122+
persist-credentials: false
117123
submodules: recursive
118-
- name: Install cargo-dist
119-
run: ${{ matrix.install_dist }}
124+
- name: Install Rust non-interactively if not already installed
125+
if: ${{ matrix.container }}
126+
run: |
127+
if ! command -v cargo > /dev/null 2>&1; then
128+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
129+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
130+
fi
131+
- name: Install dist
132+
run: ${{ matrix.install_dist.run }}
120133
# Get the dist-manifest
121134
- name: Fetch local artifacts
122135
uses: actions/download-artifact@v4
@@ -130,8 +143,8 @@ jobs:
130143
- name: Build artifacts
131144
run: |
132145
# Actually do builds and make zips and whatnot
133-
cargo dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
134-
echo "cargo dist ran successfully"
146+
dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
147+
echo "dist ran successfully"
135148
- id: cargo-dist
136149
name: Post-build
137150
# We force bash here just because github makes it really hard to get values up
@@ -141,7 +154,7 @@ jobs:
141154
run: |
142155
# Parse out what we just built and upload it to scratch storage
143156
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
144-
jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
157+
dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
145158
echo "EOF" >> "$GITHUB_OUTPUT"
146159
147160
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
@@ -158,20 +171,21 @@ jobs:
158171
needs:
159172
- plan
160173
- build-local-artifacts
161-
runs-on: "ubuntu-20.04"
174+
runs-on: "ubuntu-22.04"
162175
env:
163176
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
164177
BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json
165178
steps:
166179
- uses: actions/checkout@v4
167180
with:
181+
persist-credentials: false
168182
submodules: recursive
169-
- name: Install cached cargo-dist
183+
- name: Install cached dist
170184
uses: actions/download-artifact@v4
171185
with:
172186
name: cargo-dist-cache
173187
path: ~/.cargo/bin/
174-
- run: chmod +x ~/.cargo/bin/cargo-dist
188+
- run: chmod +x ~/.cargo/bin/dist
175189
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
176190
- name: Fetch local artifacts
177191
uses: actions/download-artifact@v4
@@ -182,8 +196,8 @@ jobs:
182196
- id: cargo-dist
183197
shell: bash
184198
run: |
185-
cargo dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
186-
echo "cargo dist ran successfully"
199+
dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
200+
echo "dist ran successfully"
187201
188202
# Parse out what we just built and upload it to scratch storage
189203
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
@@ -208,19 +222,20 @@ jobs:
208222
if: ${{ always() && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
209223
env:
210224
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
211-
runs-on: "ubuntu-20.04"
225+
runs-on: "ubuntu-22.04"
212226
outputs:
213227
val: ${{ steps.host.outputs.manifest }}
214228
steps:
215229
- uses: actions/checkout@v4
216230
with:
231+
persist-credentials: false
217232
submodules: recursive
218-
- name: Install cached cargo-dist
233+
- name: Install cached dist
219234
uses: actions/download-artifact@v4
220235
with:
221236
name: cargo-dist-cache
222237
path: ~/.cargo/bin/
223-
- run: chmod +x ~/.cargo/bin/cargo-dist
238+
- run: chmod +x ~/.cargo/bin/dist
224239
# Fetch artifacts from scratch-storage
225240
- name: Fetch artifacts
226241
uses: actions/download-artifact@v4
@@ -231,7 +246,7 @@ jobs:
231246
- id: host
232247
shell: bash
233248
run: |
234-
cargo dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
249+
dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
235250
echo "artifacts uploaded and released successfully"
236251
cat dist-manifest.json
237252
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
@@ -264,59 +279,19 @@ jobs:
264279
265280
gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
266281
267-
publish-homebrew-formula:
268-
needs:
269-
- plan
270-
- host
271-
runs-on: "ubuntu-20.04"
272-
env:
273-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
274-
PLAN: ${{ needs.plan.outputs.val }}
275-
GITHUB_USER: "axo bot"
276-
GITHUB_EMAIL: "[email protected]"
277-
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
278-
steps:
279-
- uses: actions/checkout@v4
280-
with:
281-
repository: "shellrow/homebrew-tap-nrev"
282-
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
283-
# So we have access to the formula
284-
- name: Fetch homebrew formulae
285-
uses: actions/download-artifact@v4
286-
with:
287-
pattern: artifacts-*
288-
path: Formula/
289-
merge-multiple: true
290-
# This is extra complex because you can make your Formula name not match your app name
291-
# so we need to find releases with a *.rb file, and publish with that filename.
292-
- name: Commit formula files
293-
run: |
294-
git config --global user.name "${GITHUB_USER}"
295-
git config --global user.email "${GITHUB_EMAIL}"
296-
297-
for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith(".rb")] | any)'); do
298-
filename=$(echo "$release" | jq '.artifacts[] | select(endswith(".rb"))' --raw-output)
299-
name=$(echo "$filename" | sed "s/\.rb$//")
300-
version=$(echo "$release" | jq .app_version --raw-output)
301-
302-
git add "Formula/${filename}"
303-
git commit -m "${name} ${version}"
304-
done
305-
git push
306-
307282
announce:
308283
needs:
309284
- plan
310285
- host
311-
- publish-homebrew-formula
312286
# use "always() && ..." to allow us to wait for all publish jobs while
313287
# still allowing individual publish jobs to skip themselves (for prereleases).
314288
# "host" however must run to completion, no skipping allowed!
315-
if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }}
316-
runs-on: "ubuntu-20.04"
289+
if: ${{ always() && needs.host.result == 'success' }}
290+
runs-on: "ubuntu-22.04"
317291
env:
318292
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
319293
steps:
320294
- uses: actions/checkout@v4
321295
with:
296+
persist-credentials: false
322297
submodules: recursive

Cargo.toml

Lines changed: 15 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nrev"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
edition = "2021"
55
authors = ["shellrow <[email protected]>"]
66
description = "Simple and Fast Network Revealer/Mapper."
@@ -13,54 +13,35 @@ categories = ["network-programming"]
1313
license = "MIT"
1414

1515
[dependencies]
16+
anyhow = { version = "1" }
1617
serde = { version = "1", features = ["derive"] }
1718
serde_json = "1"
18-
netdev = { version = "0.30", features = ["serde"] }
19-
nex = { version = "0.18", features = ["serde"] }
20-
nex-socket = { version = "0.18", features = ["tls"] }
21-
privilege = "0.3"
22-
async-io = "2.3"
23-
futures-lite = "2.3"
19+
netdev = { version = "0.34", features = ["serde"] }
20+
nex = { version = "0.19.1", features = ["serde"] }
2421
futures = {version = "0.3", features = ["executor", "thread-pool"]}
22+
rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
23+
rustls-native-certs = "0.7"
24+
rustls-pemfile = "2.1"
25+
rustls-pki-types = "1.8"
2526
tokio = { version = "1" }
27+
tokio-rustls = { version = "0.26", default-features = false, features = ["ring"]}
2628
hickory-resolver = { version = "0.24" }
2729
chrono = { version = "0.4", features = ["serde"] }
28-
uuid = { version = "1.3", features = ["v4","v5","fast-rng","macro-diagnostics"] }
30+
uuid = { version = "1.16", features = ["v4","v5","fast-rng","macro-diagnostics"] }
2931
bincode = "1.3"
3032
phf = { version = "0.11", features = ["macros"] }
3133
rand = "0.8"
32-
clap = { version = "4.4", features = ["cargo"] }
33-
indicatif = "0.16"
34-
inquire = "0.6"
35-
ipnet = "2.7"
34+
clap = { version = "4.5", features = ["cargo"] }
35+
indicatif = "0.17"
36+
inquire = "0.7"
37+
ipnet = "2.11"
3638
num_cpus = "1.16"
3739
termtree = "0.5"
3840

3941
[target.'cfg(windows)'.dependencies]
40-
winreg = "0.52"
42+
winreg = "0.55"
4143

4244
# The profile that 'cargo dist' will build with
4345
[profile.dist]
4446
inherits = "release"
4547
lto = "thin"
46-
47-
# Config for 'cargo dist'
48-
[workspace.metadata.dist]
49-
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
50-
cargo-dist-version = "0.18.0"
51-
# CI backends to support
52-
ci = "github"
53-
# The installers to generate for each app
54-
#installers = ["shell", "powershell", "homebrew"]
55-
installers = ["shell", "homebrew"]
56-
# A GitHub repo to push Homebrew formulas to
57-
tap = "shellrow/homebrew-tap-nrev"
58-
# Target platforms to build apps for (Rust target-triple syntax)
59-
#targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
60-
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu"]
61-
# Publish jobs to run in CI
62-
publish-jobs = ["homebrew"]
63-
# Publish jobs to run in CI
64-
pr-run-mode = "plan"
65-
# Whether to install an updater program
66-
install-updater = false

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ curl --proto '=https' --tlsv1.2 -LsSf https://github.com/shellrow/nrev/releases/
3232
irm https://github.com/shellrow/nrev/releases/latest/download/nrev-installer.ps1 | iex
3333
```
3434

35-
### Install prebuilt binaries via Homebrew
36-
37-
```sh
38-
brew install shellrow/tap-nrev/nrev
39-
```
40-
4135
### From Releases
4236
You can download archives of precompiled binaries from the [releases](https://github.com/shellrow/nrev/releases) .
4337

dist-workspace.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[workspace]
2+
members = ["cargo:."]
3+
4+
# Config for 'dist'
5+
[dist]
6+
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
7+
cargo-dist-version = "0.28.4"
8+
# CI backends to support
9+
ci = "github"
10+
# The installers to generate for each app
11+
installers = ["shell"]
12+
#installers = ["shell", "powershell"]
13+
# Target platforms to build apps for (Rust target-triple syntax)
14+
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu"]
15+
#targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
16+
# Which actions to run on pull requests
17+
pr-run-mode = "plan"
18+
# Whether to install an updater program
19+
install-updater = false
20+
# Path that installers should place binaries in
21+
install-path = "CARGO_HOME"

src/dns/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
pub mod domain;
22
pub mod result;
33
pub mod scanner;
4-
pub mod setting;
54
use std::net::IpAddr;
65
use std::time::Duration;
76

0 commit comments

Comments
 (0)