diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e902f2a..c8a58f4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,7 +48,7 @@ jobs: echo installer_count=forced >> "$GITHUB_OUTPUT" echo rootshell_count=forced >> "$GITHUB_OUTPUT" else - echo "code_count=$(git diff --name-only $lcommit...HEAD | grep -e ^bin -e ^installer -e ^lib -e ^rootshell -e ^telcom-parser | wc -l)" >> "$GITHUB_OUTPUT" + echo "code_count=$(git diff --name-only $lcommit...HEAD | grep -e ^bin -e ^installer -e ^check -e ^lib -e ^rootshell -e ^telcom-parser | wc -l)" >> "$GITHUB_OUTPUT" echo "daemon_count=$(git diff --name-only $lcommit...HEAD | grep -e ^bin -e ^lib -e ^telcom-parser | wc -l)" >> "$GITHUB_OUTPUT" echo "web_count=$(git diff --name-only $lcommit...HEAD | grep -e ^bin/web | wc -l)" >> "$GITHUB_OUTPUT" echo "docs_count=$(git diff --name-only $lcommit...HEAD | grep -e ^book.toml -e ^doc | wc -l)" >> "$GITHUB_OUTPUT" @@ -117,7 +117,7 @@ jobs: run: cargo fmt --all --check - name: Check run: | - pushd bin/web + pushd daemon/web npm install npm run build popd @@ -254,7 +254,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Build rayhunter-daemon (armv7) run: | - pushd bin/web + pushd daemon/web npm install npm run build popd @@ -345,7 +345,7 @@ jobs: run: chmod +x installer-*/installer rayhunter-check-*/rayhunter-check rayhunter-daemon-*/rayhunter-daemon - name: Get Rayhunter version id: get_version - run: echo "VERSION=$(grep '^version' bin/Cargo.toml | head -n 1 | cut -d'"' -f2)" >> $GITHUB_ENV + run: echo "VERSION=$(grep '^version' daemon/Cargo.toml | head -n 1 | cut -d'"' -f2)" >> $GITHUB_ENV - name: Setup versioned release directory run: | platform="${{ matrix.platform }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba0dd14..886f9f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,8 +16,8 @@ jobs: - uses: actions/checkout@v4 - name: Ensure all Cargo.toml files have the same version defined. run: | - defined_versions=$(find lib bin installer rootshell telcom-parser -name Cargo.toml -exec grep ^version {} \; | sort -u | wc -l) - find lib bin installer rootshell telcom-parser -name Cargo.toml -exec grep ^version {} \; + defined_versions=$(find lib check daemon installer rootshell telcom-parser -name Cargo.toml -exec grep ^version {} \; | sort -u | wc -l) + find lib check daemon installer rootshell telcom-parser -name Cargo.toml -exec grep ^version {} \; echo number of defined versions = $defined_versions if [ $defined_versions != "1" ] then diff --git a/Cargo.lock b/Cargo.lock index 5d29c75..fc4e09a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2364,6 +2364,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "rayhunter-check" +version = "0.4.0" +dependencies = [ + "clap", + "futures", + "log", + "rayhunter", + "simple_logger", + "tokio", +] + [[package]] name = "rayhunter-daemon" version = "0.4.0" @@ -2372,7 +2384,6 @@ dependencies = [ "async_zip", "axum", "chrono", - "clap", "env_logger 0.11.8", "futures", "futures-macro", @@ -2383,7 +2394,6 @@ dependencies = [ "rayhunter", "serde", "serde_json", - "simple_logger", "tempfile", "thiserror 1.0.69", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 204db37..2b32938 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,8 @@ members = [ "lib", - "bin", + "daemon", + "check", "rootshell", "telcom-parser", "installer", diff --git a/bin/src/check.rs b/check/src/main.rs similarity index 100% rename from bin/src/check.rs rename to check/src/main.rs diff --git a/bin/Cargo.toml b/daemon/Cargo.toml similarity index 86% rename from bin/Cargo.toml rename to daemon/Cargo.toml index f329256..09e7a2b 100644 --- a/bin/Cargo.toml +++ b/daemon/Cargo.toml @@ -11,14 +11,6 @@ wingtech = ["rayhunter/wingtech"] default = ["orbic"] -[[bin]] -name = "rayhunter-daemon" -path = "src/daemon.rs" - -[[bin]] -name = "rayhunter-check" -path = "src/check.rs" - [dependencies] rayhunter = { path = "../lib" } toml = "0.8.8" @@ -35,10 +27,8 @@ include_dir = "0.7.3" chrono = { version = "0.4.31", features = ["serde"] } tokio-stream = { version = "0.1.14", default-features = false } futures = { version = "0.3.30", default-features = false } -clap = { version = "4.5.2", features = ["derive"] } serde_json = "1.0.114" image = { version = "0.25.1", default-features = false, features = ["png", "gif"] } tempfile = "3.10.1" -simple_logger = "5.0.0" async_zip = { version = "0.0.17", features = ["tokio"] } anyhow = "1.0.98" diff --git a/bin/images/eff.png b/daemon/images/eff.png similarity index 100% rename from bin/images/eff.png rename to daemon/images/eff.png diff --git a/bin/images/orca.gif b/daemon/images/orca.gif similarity index 100% rename from bin/images/orca.gif rename to daemon/images/orca.gif diff --git a/bin/src/analysis.rs b/daemon/src/analysis.rs similarity index 100% rename from bin/src/analysis.rs rename to daemon/src/analysis.rs diff --git a/bin/src/config.rs b/daemon/src/config.rs similarity index 100% rename from bin/src/config.rs rename to daemon/src/config.rs diff --git a/bin/src/diag.rs b/daemon/src/diag.rs similarity index 100% rename from bin/src/diag.rs rename to daemon/src/diag.rs diff --git a/bin/src/display/generic_framebuffer.rs b/daemon/src/display/generic_framebuffer.rs similarity index 100% rename from bin/src/display/generic_framebuffer.rs rename to daemon/src/display/generic_framebuffer.rs diff --git a/bin/src/display/mod.rs b/daemon/src/display/mod.rs similarity index 100% rename from bin/src/display/mod.rs rename to daemon/src/display/mod.rs diff --git a/bin/src/display/orbic.rs b/daemon/src/display/orbic.rs similarity index 100% rename from bin/src/display/orbic.rs rename to daemon/src/display/orbic.rs diff --git a/bin/src/display/tplink.rs b/daemon/src/display/tplink.rs similarity index 100% rename from bin/src/display/tplink.rs rename to daemon/src/display/tplink.rs diff --git a/bin/src/display/tplink_framebuffer.rs b/daemon/src/display/tplink_framebuffer.rs similarity index 100% rename from bin/src/display/tplink_framebuffer.rs rename to daemon/src/display/tplink_framebuffer.rs diff --git a/bin/src/display/tplink_onebit.rs b/daemon/src/display/tplink_onebit.rs similarity index 100% rename from bin/src/display/tplink_onebit.rs rename to daemon/src/display/tplink_onebit.rs diff --git a/bin/src/display/wingtech.rs b/daemon/src/display/wingtech.rs similarity index 100% rename from bin/src/display/wingtech.rs rename to daemon/src/display/wingtech.rs diff --git a/bin/src/dummy_analyzer.rs b/daemon/src/dummy_analyzer.rs similarity index 100% rename from bin/src/dummy_analyzer.rs rename to daemon/src/dummy_analyzer.rs diff --git a/bin/src/error.rs b/daemon/src/error.rs similarity index 100% rename from bin/src/error.rs rename to daemon/src/error.rs diff --git a/bin/src/key_input.rs b/daemon/src/key_input.rs similarity index 100% rename from bin/src/key_input.rs rename to daemon/src/key_input.rs diff --git a/bin/src/daemon.rs b/daemon/src/main.rs similarity index 100% rename from bin/src/daemon.rs rename to daemon/src/main.rs diff --git a/bin/src/pcap.rs b/daemon/src/pcap.rs similarity index 100% rename from bin/src/pcap.rs rename to daemon/src/pcap.rs diff --git a/bin/src/qmdl_store.rs b/daemon/src/qmdl_store.rs similarity index 100% rename from bin/src/qmdl_store.rs rename to daemon/src/qmdl_store.rs diff --git a/bin/src/server.rs b/daemon/src/server.rs similarity index 100% rename from bin/src/server.rs rename to daemon/src/server.rs diff --git a/bin/src/stats.rs b/daemon/src/stats.rs similarity index 100% rename from bin/src/stats.rs rename to daemon/src/stats.rs diff --git a/bin/web/.gitignore b/daemon/web/.gitignore similarity index 100% rename from bin/web/.gitignore rename to daemon/web/.gitignore diff --git a/bin/web/.npmrc b/daemon/web/.npmrc similarity index 100% rename from bin/web/.npmrc rename to daemon/web/.npmrc diff --git a/bin/web/.prettierignore b/daemon/web/.prettierignore similarity index 100% rename from bin/web/.prettierignore rename to daemon/web/.prettierignore diff --git a/bin/web/.prettierrc b/daemon/web/.prettierrc similarity index 100% rename from bin/web/.prettierrc rename to daemon/web/.prettierrc diff --git a/bin/web/eslint.config.js b/daemon/web/eslint.config.js similarity index 100% rename from bin/web/eslint.config.js rename to daemon/web/eslint.config.js diff --git a/bin/web/package.json b/daemon/web/package.json similarity index 100% rename from bin/web/package.json rename to daemon/web/package.json diff --git a/bin/web/postcss.config.js b/daemon/web/postcss.config.js similarity index 100% rename from bin/web/postcss.config.js rename to daemon/web/postcss.config.js diff --git a/bin/web/src/app.css b/daemon/web/src/app.css similarity index 100% rename from bin/web/src/app.css rename to daemon/web/src/app.css diff --git a/bin/web/src/app.d.ts b/daemon/web/src/app.d.ts similarity index 100% rename from bin/web/src/app.d.ts rename to daemon/web/src/app.d.ts diff --git a/bin/web/src/app.html b/daemon/web/src/app.html similarity index 100% rename from bin/web/src/app.html rename to daemon/web/src/app.html diff --git a/bin/web/src/lib/analysis.spec.svelte.ts b/daemon/web/src/lib/analysis.spec.svelte.ts similarity index 100% rename from bin/web/src/lib/analysis.spec.svelte.ts rename to daemon/web/src/lib/analysis.spec.svelte.ts diff --git a/bin/web/src/lib/analysis.svelte.ts b/daemon/web/src/lib/analysis.svelte.ts similarity index 100% rename from bin/web/src/lib/analysis.svelte.ts rename to daemon/web/src/lib/analysis.svelte.ts diff --git a/bin/web/src/lib/analysisManager.svelte.ts b/daemon/web/src/lib/analysisManager.svelte.ts similarity index 100% rename from bin/web/src/lib/analysisManager.svelte.ts rename to daemon/web/src/lib/analysisManager.svelte.ts diff --git a/bin/web/src/lib/components/AnalysisStatus.svelte b/daemon/web/src/lib/components/AnalysisStatus.svelte similarity index 100% rename from bin/web/src/lib/components/AnalysisStatus.svelte rename to daemon/web/src/lib/components/AnalysisStatus.svelte diff --git a/bin/web/src/lib/components/AnalysisTable.svelte b/daemon/web/src/lib/components/AnalysisTable.svelte similarity index 100% rename from bin/web/src/lib/components/AnalysisTable.svelte rename to daemon/web/src/lib/components/AnalysisTable.svelte diff --git a/bin/web/src/lib/components/AnalysisView.svelte b/daemon/web/src/lib/components/AnalysisView.svelte similarity index 100% rename from bin/web/src/lib/components/AnalysisView.svelte rename to daemon/web/src/lib/components/AnalysisView.svelte diff --git a/bin/web/src/lib/components/ConfigForm.svelte b/daemon/web/src/lib/components/ConfigForm.svelte similarity index 100% rename from bin/web/src/lib/components/ConfigForm.svelte rename to daemon/web/src/lib/components/ConfigForm.svelte diff --git a/bin/web/src/lib/components/DeleteAllButton.svelte b/daemon/web/src/lib/components/DeleteAllButton.svelte similarity index 100% rename from bin/web/src/lib/components/DeleteAllButton.svelte rename to daemon/web/src/lib/components/DeleteAllButton.svelte diff --git a/bin/web/src/lib/components/DeleteButton.svelte b/daemon/web/src/lib/components/DeleteButton.svelte similarity index 100% rename from bin/web/src/lib/components/DeleteButton.svelte rename to daemon/web/src/lib/components/DeleteButton.svelte diff --git a/bin/web/src/lib/components/DownloadLink.svelte b/daemon/web/src/lib/components/DownloadLink.svelte similarity index 100% rename from bin/web/src/lib/components/DownloadLink.svelte rename to daemon/web/src/lib/components/DownloadLink.svelte diff --git a/bin/web/src/lib/components/ManifestCard.svelte b/daemon/web/src/lib/components/ManifestCard.svelte similarity index 100% rename from bin/web/src/lib/components/ManifestCard.svelte rename to daemon/web/src/lib/components/ManifestCard.svelte diff --git a/bin/web/src/lib/components/ManifestTable.svelte b/daemon/web/src/lib/components/ManifestTable.svelte similarity index 100% rename from bin/web/src/lib/components/ManifestTable.svelte rename to daemon/web/src/lib/components/ManifestTable.svelte diff --git a/bin/web/src/lib/components/ManifestTableRow.svelte b/daemon/web/src/lib/components/ManifestTableRow.svelte similarity index 100% rename from bin/web/src/lib/components/ManifestTableRow.svelte rename to daemon/web/src/lib/components/ManifestTableRow.svelte diff --git a/bin/web/src/lib/components/RecordingControls.svelte b/daemon/web/src/lib/components/RecordingControls.svelte similarity index 100% rename from bin/web/src/lib/components/RecordingControls.svelte rename to daemon/web/src/lib/components/RecordingControls.svelte diff --git a/bin/web/src/lib/components/SystemStatsTable.svelte b/daemon/web/src/lib/components/SystemStatsTable.svelte similarity index 100% rename from bin/web/src/lib/components/SystemStatsTable.svelte rename to daemon/web/src/lib/components/SystemStatsTable.svelte diff --git a/bin/web/src/lib/index.ts b/daemon/web/src/lib/index.ts similarity index 100% rename from bin/web/src/lib/index.ts rename to daemon/web/src/lib/index.ts diff --git a/bin/web/src/lib/manifest.svelte.ts b/daemon/web/src/lib/manifest.svelte.ts similarity index 100% rename from bin/web/src/lib/manifest.svelte.ts rename to daemon/web/src/lib/manifest.svelte.ts diff --git a/bin/web/src/lib/ndjson.spec.ts b/daemon/web/src/lib/ndjson.spec.ts similarity index 100% rename from bin/web/src/lib/ndjson.spec.ts rename to daemon/web/src/lib/ndjson.spec.ts diff --git a/bin/web/src/lib/ndjson.ts b/daemon/web/src/lib/ndjson.ts similarity index 100% rename from bin/web/src/lib/ndjson.ts rename to daemon/web/src/lib/ndjson.ts diff --git a/bin/web/src/lib/systemStats.ts b/daemon/web/src/lib/systemStats.ts similarity index 100% rename from bin/web/src/lib/systemStats.ts rename to daemon/web/src/lib/systemStats.ts diff --git a/bin/web/src/lib/utils.svelte.ts b/daemon/web/src/lib/utils.svelte.ts similarity index 100% rename from bin/web/src/lib/utils.svelte.ts rename to daemon/web/src/lib/utils.svelte.ts diff --git a/bin/web/src/routes/+layout.js b/daemon/web/src/routes/+layout.js similarity index 100% rename from bin/web/src/routes/+layout.js rename to daemon/web/src/routes/+layout.js diff --git a/bin/web/src/routes/+layout.svelte b/daemon/web/src/routes/+layout.svelte similarity index 100% rename from bin/web/src/routes/+layout.svelte rename to daemon/web/src/routes/+layout.svelte diff --git a/bin/web/src/routes/+page.svelte b/daemon/web/src/routes/+page.svelte similarity index 100% rename from bin/web/src/routes/+page.svelte rename to daemon/web/src/routes/+page.svelte diff --git a/bin/web/static/favicon.png b/daemon/web/static/favicon.png similarity index 100% rename from bin/web/static/favicon.png rename to daemon/web/static/favicon.png diff --git a/bin/web/static/rayhunter_icon.png b/daemon/web/static/rayhunter_icon.png similarity index 100% rename from bin/web/static/rayhunter_icon.png rename to daemon/web/static/rayhunter_icon.png diff --git a/bin/web/static/rayhunter_orca_only.png b/daemon/web/static/rayhunter_orca_only.png similarity index 100% rename from bin/web/static/rayhunter_orca_only.png rename to daemon/web/static/rayhunter_orca_only.png diff --git a/bin/web/static/rayhunter_text.png b/daemon/web/static/rayhunter_text.png similarity index 100% rename from bin/web/static/rayhunter_text.png rename to daemon/web/static/rayhunter_text.png diff --git a/bin/web/svelte.config.js b/daemon/web/svelte.config.js similarity index 100% rename from bin/web/svelte.config.js rename to daemon/web/svelte.config.js diff --git a/bin/web/tailwind.config.ts b/daemon/web/tailwind.config.ts similarity index 100% rename from bin/web/tailwind.config.ts rename to daemon/web/tailwind.config.ts diff --git a/bin/web/tsconfig.json b/daemon/web/tsconfig.json similarity index 100% rename from bin/web/tsconfig.json rename to daemon/web/tsconfig.json diff --git a/bin/web/vite.config.ts b/daemon/web/vite.config.ts similarity index 100% rename from bin/web/vite.config.ts rename to daemon/web/vite.config.ts diff --git a/make.sh b/make.sh index a7833a4..b774f0b 100755 --- a/make.sh +++ b/make.sh @@ -1,5 +1,5 @@ #!/bin/bash -e -pushd bin/web +pushd daemon/web npm run build popd cargo build --profile firmware --bin rayhunter-daemon --target="armv7-unknown-linux-musleabihf" #--features debug