From 0d4185731ca7a01dd48fbceffb5df2d52d871d51 Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Sat, 22 Mar 2025 10:30:26 +1100 Subject: [PATCH] wf work --- .github/workflows/code_checks.yml | 28 ++++++++++++++++++++++++++++ docs/REMOTE_NETWORKS.md | 7 +++++-- front/js/db_methods.js | 2 +- front/js/ui_components.js | 2 +- front/settings.php | 2 +- 5 files changed, 36 insertions(+), 5 deletions(-) create mode 100755 .github/workflows/code_checks.yml diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code_checks.yml new file mode 100755 index 00000000..5aee452b --- /dev/null +++ b/.github/workflows/code_checks.yml @@ -0,0 +1,28 @@ +name: URL Path Check +on: + push: + branches: + - main + tags: + - '*.*.*' + pull_request: + branches: + - main + + jobs: + check-url-paths: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Check for absolute path URLs + run: | + if grep -r -E "\burl:\s*['\"]\/php" --include=\*.{js,php} .; then + echo "❌ Found absolute path URLs starting with '/php/'. Please use relative paths." + exit 1 + else + echo "✅ No absolute path URLs found." + fi + diff --git a/docs/REMOTE_NETWORKS.md b/docs/REMOTE_NETWORKS.md index ec25562c..8b30f726 100755 --- a/docs/REMOTE_NETWORKS.md +++ b/docs/REMOTE_NETWORKS.md @@ -2,11 +2,14 @@ By design, local network scanners such as `arp-scan` use ARP (Address Resolution Protocol) to map IP addresses to MAC addresses on the local network. Since ARP operates at Layer 2 (Data Link Layer), it typically works only within a single broadcast domain, usually limited to a single router or network segment. -To scan multiple locally accessible network segments, add them as subnets according to the [subnets](./SUBNETS.md) documentation. +> [!NOTE] +> Ping and `ARPSCAN` use different protocols so even if you can ping devices it doesn't mean `ARPSCAN` can detect them. + +To scan multiple locally accessible network segments, add them as subnets according to the [subnets](./SUBNETS.md) documentation. If `ARPSCAN` is not suitable for your setup, read on. ## Complex Use Cases -The following network setups might make some devices undetectable. Check the specific setup to understand the cause and find potential workarounds to still report on these devices. +The following network setups might make some devices undetectable with `ARPSCAN`. Check the specific setup to understand the cause and find potential workarounds to report on these devices. ### Wi-Fi Extenders diff --git a/front/js/db_methods.js b/front/js/db_methods.js index a328eb23..3d46f17c 100755 --- a/front/js/db_methods.js +++ b/front/js/db_methods.js @@ -85,7 +85,7 @@ function renderList( // Check if database is locked function checkDbLock() { $.ajax({ - url: "/php/server/query_logs.php?file=db_is_locked.log", + url: "php/server/query_logs.php?file=db_is_locked.log", type: "GET", success: function (response) { diff --git a/front/js/ui_components.js b/front/js/ui_components.js index c7edeabb..1a5c133e 100755 --- a/front/js/ui_components.js +++ b/front/js/ui_components.js @@ -422,7 +422,7 @@ function updateModalState() { setTimeout(function() { // Fetch the content from the log file using an AJAX request $.ajax({ - url: '/php/server/query_logs.php?file=execution_queue.log', + url: 'php/server/query_logs.php?file=execution_queue.log', type: 'GET', success: function(data) { // Update the content of the HTML element (e.g., a div with id 'logContent') diff --git a/front/settings.php b/front/settings.php index e3ffce73..f29baa88 100755 --- a/front/settings.php +++ b/front/settings.php @@ -166,7 +166,7 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX // get settings from the secured graphql endpoint $.ajax({ - url: "/php/server/query_graphql.php", // Replace with your GraphQL endpoint + url: "php/server/query_graphql.php", // Replace with your GraphQL endpoint method: "POST", contentType: "application/json", data: JSON.stringify({