diff --git a/docs/DEBUG_INVALID_JSON.md b/docs/DEBUG_INVALID_JSON.md index 00b82b0b..c6ef3ad2 100755 --- a/docs/DEBUG_INVALID_JSON.md +++ b/docs/DEBUG_INVALID_JSON.md @@ -9,7 +9,6 @@ Check the the HTTP response of the failing backend call by following these steps - 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): - `http://:20211/api/table_devices.json?nocache=1704141103121` - - `http://:20211/php/server/devices.php?action=getDevicesTotals` - 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. diff --git a/docs/REVERSE_PROXY.md b/docs/REVERSE_PROXY.md index ee12c11d..77ef1934 100755 --- a/docs/REVERSE_PROXY.md +++ b/docs/REVERSE_PROXY.md @@ -1,5 +1,13 @@ # Reverse Proxy Configuration +> [!TIP] +> 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`) +> +> ![BACKEND_API_URL setting](./img/REVERSE_PROXY/BACKEND_API_URL.png) +> ![NPM set up](./img/REVERSE_PROXY/nginx_proxy_manager_npm.png) + +## NGINX HTTP Configuration (Direct Path) + > Submitted by amazing [cvc90](https://github.com/cvc90) 🙏 > [!NOTE] @@ -10,8 +18,6 @@
-## NGINX HTTP Configuration (Direct Path) - 1. On your NGINX server, create a new file called /etc/nginx/sites-available/netalertx 2. In this file, paste the following code: diff --git a/docs/img/REVERSE_PROXY/BACKEND_API_URL.png b/docs/img/REVERSE_PROXY/BACKEND_API_URL.png new file mode 100644 index 00000000..951a83cc Binary files /dev/null and b/docs/img/REVERSE_PROXY/BACKEND_API_URL.png differ diff --git a/docs/img/REVERSE_PROXY/nginx_proxy_manager_npm.png b/docs/img/REVERSE_PROXY/nginx_proxy_manager_npm.png new file mode 100644 index 00000000..0a5d1bfc Binary files /dev/null and b/docs/img/REVERSE_PROXY/nginx_proxy_manager_npm.png differ diff --git a/front/deviceDetails.php b/front/deviceDetails.php index 36a77b85..7c9f3e2d 100755 --- a/front/deviceDetails.php +++ b/front/deviceDetails.php @@ -418,8 +418,8 @@ async function renderSmallBoxes() { // Get data from the server const apiToken = getSetting("API_TOKEN"); - const apiBase = getApiBase(); - const url = `${apiBase}/device/${getMac()}?period=${encodeURIComponent(period)}`; + const apiBaseUrl = getApiBase(); + const url = `${apiBaseUrl}/device/${getMac()}?period=${encodeURIComponent(period)}`; const response = await fetch(url, { method: "GET", diff --git a/front/deviceDetailsEdit.php b/front/deviceDetailsEdit.php index cd654b4e..caade6da 100755 --- a/front/deviceDetailsEdit.php +++ b/front/deviceDetailsEdit.php @@ -46,8 +46,8 @@ function getDeviceData() { const apiToken = getSetting("API_TOKEN"); let period = $("#period").val() - const apiBase = getApiBase(); - const url = `${apiBase}/device/${mac}?period=${encodeURIComponent(period)}`; + const apiBaseUrl = getApiBase(); + const url = `${apiBaseUrl}/device/${mac}?period=${encodeURIComponent(period)}`; // get data from server $.ajax({ @@ -89,7 +89,7 @@ function getDeviceData() { ] }; - const graphQlUrl = `${apiBase}/graphql`; + const graphQlUrl = `${apiBaseUrl}/graphql`; $.ajax({ url: graphQlUrl, @@ -354,7 +354,7 @@ function setDeviceData(direction = '', refreshCallback = '') { showSpinner(); const apiToken = getSetting("API_TOKEN"); // dynamic token - const apiBase = getApiBase(); + const apiBaseUrl = getApiBase(); mac = $('#NEWDEV_devMac').val(); @@ -402,7 +402,7 @@ function setDeviceData(direction = '', refreshCallback = '') { $.ajax({ - url: `${apiBase}/device/${encodeURIComponent(mac)}`, + url: `${apiBaseUrl}/device/${encodeURIComponent(mac)}`, type: "POST", headers: { "Authorization": "Bearer " + apiToken, diff --git a/front/deviceDetailsEvents.php b/front/deviceDetailsEvents.php index 69a6d96d..b11e4b52 100755 --- a/front/deviceDetailsEvents.php +++ b/front/deviceDetailsEvents.php @@ -50,8 +50,8 @@ function loadEventsData() { const apiToken = getSetting("API_TOKEN"); - const apiBase = getApiBase(); - const url = `${apiBase}/dbquery/read`; + const apiBaseUrl = getApiBase(); + const url = `${apiBaseUrl}/dbquery/read`; $.ajax({ url: url, diff --git a/front/deviceDetailsPresence.php b/front/deviceDetailsPresence.php index e8bdbae7..7c4833f2 100755 --- a/front/deviceDetailsPresence.php +++ b/front/deviceDetailsPresence.php @@ -38,8 +38,8 @@ function loadPresenceData() { const apiToken = getSetting("API_TOKEN"); - const apiBase = getApiBase(); - const url = `${apiBase}/sessions/calendar`; + const apiBaseUrl = getApiBase(); + const url = `${apiBaseUrl}/sessions/calendar`; $('#calendar').fullCalendar('removeEventSources'); diff --git a/front/deviceDetailsSessions.php b/front/deviceDetailsSessions.php index ddb5806c..ed9a0487 100755 --- a/front/deviceDetailsSessions.php +++ b/front/deviceDetailsSessions.php @@ -105,8 +105,8 @@ function loadSessionsData() { // Build API base const apiToken = getSetting("API_TOKEN"); - const apiBase = getApiBase(); - const url = `${apiBase}/sessions/${getMac()}?period=${encodeURIComponent(period)}`; + const apiBaseUrl = getApiBase(); + const url = `${apiBaseUrl}/sessions/${getMac()}?period=${encodeURIComponent(period)}`; // Call API with Authorization header $.ajax({ diff --git a/front/deviceDetailsTools.php b/front/deviceDetailsTools.php index b30e8fbd..0c0756ac 100755 --- a/front/deviceDetailsTools.php +++ b/front/deviceDetailsTools.php @@ -210,20 +210,17 @@