Skip to content

Commit 165053e

Browse files
authored
Merge pull request #1 from jokob-sk/main
Merge latest Changes from Upstream
2 parents 82041f3 + 130c406 commit 165053e

56 files changed

Lines changed: 2312 additions & 488 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ RUN chmod +x /entrypoint.sh /root-entrypoint.sh /entrypoint.d/*.sh && \
281281

282282
RUN apk add --no-cache git nano vim jq php83-pecl-xdebug py3-pip nodejs sudo gpgconf pytest \
283283
pytest-cov zsh alpine-zsh-config shfmt github-cli py3-yaml py3-docker-py docker-cli docker-cli-buildx \
284-
docker-cli-compose shellcheck py3-psutil
284+
docker-cli-compose shellcheck py3-psutil chromium chromium-chromedriver
285285

286286
# Install hadolint (Dockerfile linter)
287287
RUN curl -L https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64 -o /usr/local/bin/hadolint && \
@@ -307,6 +307,6 @@ RUN mkdir -p /workspaces && \
307307
chown netalertx:netalertx /home/netalertx && \
308308
sed -i -e 's#/app:#/workspaces:#' /etc/passwd && \
309309
find /opt/venv -type d -exec chmod o+rwx {} \;
310-
310+
311311
USER netalertx
312312
ENTRYPOINT ["/bin/sh","-c","sleep infinity"]

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848

4949
"postCreateCommand": {
50-
"Install Pip Requirements": "/opt/venv/bin/pip3 install pytest docker debugpy",
50+
"Install Pip Requirements": "/opt/venv/bin/pip3 install pytest docker debugpy selenium",
5151
"Workspace Instructions": "printf '\n\n� DevContainer Ready! Starting Services...\n\n📁 To access /tmp folders in the workspace:\n File → Open Workspace from File → NetAlertX.code-workspace\n\n📖 See .devcontainer/WORKSPACE.md for details\n\n'"
5252
},
5353
"postStartCommand": {

.devcontainer/resources/devcontainer-Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ RUN chmod +x /entrypoint.sh /root-entrypoint.sh /entrypoint.d/*.sh && \
2828

2929
RUN apk add --no-cache git nano vim jq php83-pecl-xdebug py3-pip nodejs sudo gpgconf pytest \
3030
pytest-cov zsh alpine-zsh-config shfmt github-cli py3-yaml py3-docker-py docker-cli docker-cli-buildx \
31-
docker-cli-compose shellcheck py3-psutil
31+
docker-cli-compose shellcheck py3-psutil chromium chromium-chromedriver
3232

3333
# Install hadolint (Dockerfile linter)
3434
RUN curl -L https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64 -o /usr/local/bin/hadolint && \
@@ -54,6 +54,6 @@ RUN mkdir -p /workspaces && \
5454
chown netalertx:netalertx /home/netalertx && \
5555
sed -i -e 's#/app:#/workspaces:#' /etc/passwd && \
5656
find /opt/venv -type d -exec chmod o+rwx {} \;
57-
57+
5858
USER netalertx
5959
ENTRYPOINT ["/bin/sh","-c","sleep infinity"]

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Backend loop phases (see `server/__main__.py` and `server/plugin.py`): `once`, `
6565
- Run a plugin manually: `python3 front/plugins/<code_name>/script.py` (ensure `sys.path` includes `/app/front/plugins` and `/app/server` like the template).
6666
- Testing: pytest available via Alpine packages. Tests live in `test/`; app code is under `server/`. PYTHONPATH is preconfigured to include workspace and `/opt/venv` site‑packages.
6767
- **Subprocess calls:** ALWAYS set explicit timeouts. Default to 60s minimum unless plugin config specifies otherwise. Nested subprocess calls (e.g., plugins calling external tools) need their own timeout - outer plugin timeout won't save you.
68+
- you need to set the BACKEND_API_URL setting (e.g. in teh app.conf file or via the APP_CONF_OVERRIDE env variable) to the backend api port url , e.g. https://something-20212.app.github.dev/ depending on your github codespace url.
6869

6970
## What “done right” looks like
7071
- When adding a plugin, start from `front/plugins/__template`, implement with `plugin_helper`, define manifest settings, and wire phase via `<PREF>_RUN`. Verify logs in `/tmp/log/plugins/` and data in `api/*.json`.

docs/DEBUG_INVALID_JSON.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Check the the HTTP response of the failing backend call by following these steps
99

1010
- Copy the URL causing the error and enter it in the address bar of your browser directly and hit enter. The copied URLs could look something like this (notice the query strings at the end):
1111
- `http://<server>:20211/api/table_devices.json?nocache=1704141103121`
12-
- `http://<server>:20211/php/server/devices.php?action=getDevicesTotals`
1312

1413

1514
- Post the error response in the existing issue thread on GitHub or create a new issue and include the redacted response of the failing query.

docs/REVERSE_PROXY.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Reverse Proxy Configuration
22

3+
> [!TIP]
4+
> You will need to specify the `BACKEND_API_URL` setting if you are running reverse proxies. This is the URL that points to the backend server url (including your `GRAPHQL_PORT`)
5+
>
6+
> ![BACKEND_API_URL setting](./img/REVERSE_PROXY/BACKEND_API_URL.png)
7+
> ![NPM set up](./img/REVERSE_PROXY/nginx_proxy_manager_npm.png)
8+
9+
## NGINX HTTP Configuration (Direct Path)
10+
311
> Submitted by amazing [cvc90](https://github.com/cvc90) 🙏
412
513
> [!NOTE]
@@ -10,8 +18,6 @@
1018
1119
<br/>
1220

13-
## NGINX HTTP Configuration (Direct Path)
14-
1521
1. On your NGINX server, create a new file called /etc/nginx/sites-available/netalertx
1622

1723
2. In this file, paste the following code:
18.2 KB
Loading
41.6 KB
Loading

front/appEventsCore.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@
2323
2424
$(document).ready(function () {
2525
26-
const protocol = window.location.protocol.replace(':', '');
27-
const host = window.location.hostname;
2826
const apiToken = getSetting("API_TOKEN");
29-
const port = getSetting("GRAPHQL_PORT");
30-
const graphqlUrl = `${protocol}://${host}:${port}/graphql`;
27+
const apiBase = getApiBase();
28+
const graphqlUrl = `${apiBase}/graphql`;
3129
3230
$('#appevents-table').DataTable({
3331
processing: true,

front/deviceDetails.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ function initializeTabs () {
418418
// Get data from the server
419419
const apiToken = getSetting("API_TOKEN");
420420

421-
const apiBase = getApiBase();
422-
const url = `${apiBase}/device/${getMac()}?period=${encodeURIComponent(period)}`;
421+
const apiBaseUrl = getApiBase();
422+
const url = `${apiBaseUrl}/device/${getMac()}?period=${encodeURIComponent(period)}`;
423423

424424
const response = await fetch(url, {
425425
method: "GET",

0 commit comments

Comments
 (0)