-
Notifications
You must be signed in to change notification settings - Fork 1
/
justfile
85 lines (67 loc) · 2.15 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# List available recipes
help:
just -l
# Build all targets in debug mode
@build:
cargo build --release --all-targets
# Build all targets in release mode
@release:
cargo build --release --all-targets
# Build documentation for all crates
@doc *FLAGS:
cargo doc --release --no-deps --workspace {{FLAGS}}
# Run the same checks we run in CI
@ci: test
cargo clippy --workspace
cargo +nightly fmt --check
cargo deny check licenses
# Get security advisories from cargo-deny
@security:
cargo deny check advisories
# Run tests with nextest
@test:
cargo nextest run --all-targets
# Lint and automatically fix what we can fix
@lint:
cargo clippy --fix --allow-dirty --allow-staged --all-targets
cargo +nightly fmt --all
# Install required linting/testing tools via cargo.
@install-tools:
rustup install nightly
cargo install cargo-nextest
cargo install cargo-deny
# Check for unused dependencies.
check-unused:
cargo +nightly udeps --all
# Everyone loves Lady Gaga, right?
@dance:
open "https://www.youtube.com/watch?v=2Abk1jAONjw"
@run-dev:
zellij --layout dev-layout.kdl
tailscale *ARGS:
just tailscale-run cargo run --bin serval-agent -- {{ARGS}}
tailscale-monitor *ARGS:
just tailscale-run cargo run --bin serval -- monitor {{ARGS}}
tailscale-run *CMD:
#!/usr/bin/env bash
if [ $(uname) == "Darwin" ]; then
echo "Serval doesn't currently work properly on a Mac when run against Tailscale using IPv6; aborting."
exit 1
fi
ADDR=$(tailscale ip --6 2>/dev/null)
if [ "$?" -ne 0 ]; then
echo This command requires the Tailscale CLI tool to be installed:
echo https://tailscale.com/kb/1080/cli/
exit 1
fi
if [ "${ADDR}" == "" ]; then
echo Tailscale does not have an IPv6 address; aborting.
exit 1
fi
CROSSWIND_PID=$(pgrep crosswind)
if [ "$?" -ne 0 ]; then
echo "💨 Running Serval over your tailnet requires crosswind to be running; check out" >&2
echo "💨 https://github.com/serval/crosswind and run \`just tailscale\` if you haven't already." >&2
echo "" >&2
fi
MESH_INTERFACE="${ADDR}" {{CMD}}