From ae28a4e8bc0f19762ad1c144c2d2497977e4c860 Mon Sep 17 00:00:00 2001 From: Patrick <49989644+botagas@users.noreply.github.com> Date: Fri, 28 Mar 2025 02:42:27 +0200 Subject: [PATCH 01/11] Update create_database.js --- backend/create_database.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/create_database.js b/backend/create_database.js index 700d2439..86dc8b43 100644 --- a/backend/create_database.js +++ b/backend/create_database.js @@ -16,7 +16,7 @@ const client = new Client({ const createDatabase = async () => { try { await client.connect(); // gets connection - await client.query('CREATE DATABASE ' + _POSTGRES_DATABASE); // sends queries + await client.query(CREATE DATABASE IF NOT EXIST _POSTGRES_DATABASE); // sends queries return true; } catch (error) { if (!error.stack.includes('already exists')) { From 6f35953f64b364c7883a23e5e2315897e4f2c4a2 Mon Sep 17 00:00:00 2001 From: Patrick <49989644+botagas@users.noreply.github.com> Date: Fri, 28 Mar 2025 02:44:20 +0200 Subject: [PATCH 02/11] Update server.js --- backend/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/server.js b/backend/server.js index c1004a56..1503b699 100644 --- a/backend/server.js +++ b/backend/server.js @@ -50,7 +50,7 @@ const ensureSlashes = (url) => { return url; }; -const PORT = 3000; +const PORT = process.env.PORT; const LISTEN_IP = "0.0.0.0"; const JWT_SECRET = process.env.JWT_SECRET; const BASE_NAME = process.env.JS_BASE_URL ? ensureSlashes(process.env.JS_BASE_URL) : ""; From 6befafee1d582f369cdcef171703f5dc24693ce8 Mon Sep 17 00:00:00 2001 From: Patrick <49989644+botagas@users.noreply.github.com> Date: Fri, 28 Mar 2025 02:48:04 +0200 Subject: [PATCH 03/11] Update .env.example --- backend/.env.example | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/.env.example b/backend/.env.example index bd4efdbc..8396a0bc 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -7,4 +7,6 @@ POSTGRES_PORT = # your postgres port JWT_SECRET = # ultra secret word JS_GEOLITE_ACCOUNT_ID = # optional, your GeoLite account ID to show geolocation info for client IPs -JS_GEOLITE_LICENSE_KEY = # optional, your GeoLite account license key to show geolocation info for client IPs \ No newline at end of file +JS_GEOLITE_LICENSE_KEY = # optional, your GeoLite account license key to show geolocation info for client IPs + +PORT = # your jellystat port From c5af2f72ef21260a8f1ced63d9baf501b49855eb Mon Sep 17 00:00:00 2001 From: Patrick <49989644+botagas@users.noreply.github.com> Date: Fri, 28 Mar 2025 02:51:15 +0200 Subject: [PATCH 04/11] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c97d1c77..dd6ea9b2 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,10 @@ | JS_PASSWORD | `null` | `Password` | Master Override Password in case username or password used during setup is forgotten (Both `JS_USER` and `JS_PASSWORD` required to work) | | POSTGRES_DB | `jfstat` | `jfstat` | Name of postgres database | | REJECT_SELF_SIGNED_CERTIFICATES | `true` | `false` | Allow or deny self signed SSL certificates | -| JS_GEOLITE_ACCOUNT_ID | `null` | `123456` | maxmind.com user id to be used for Geolocating IP Addresses (Can be found at https://www.maxmind.com/en/accounts/current/edit) | +| JS_GEOLITE_ACCOUNT_ID | `null` | `123456` | maxmind.com user id to be used for Geolocating IP Addresses (Can be found at https://www.maxmind.com/en/accounts/current/edit) | | JS_GEOLITE_LICENSE_KEY | `null` | `ASDWdaSdawe2sd186` | License key you need to generate on maxmind to use their services | | MINIMUM_SECONDS_TO_INCLUDE_PLAYBACK | `1` | `10` | The minimum time (in seconds) to include a playback record, which can be used to exclude short playbacks | +| PORT | `3000` | `3001` | The port used by Jellystat | ## Getting Started with Development From b79e544ce092629c75886554e960813729eadb56 Mon Sep 17 00:00:00 2001 From: Patrick <49989644+botagas@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:05:28 +0200 Subject: [PATCH 05/11] Update create_database.js --- backend/create_database.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/create_database.js b/backend/create_database.js index 86dc8b43..700d2439 100644 --- a/backend/create_database.js +++ b/backend/create_database.js @@ -16,7 +16,7 @@ const client = new Client({ const createDatabase = async () => { try { await client.connect(); // gets connection - await client.query(CREATE DATABASE IF NOT EXIST _POSTGRES_DATABASE); // sends queries + await client.query('CREATE DATABASE ' + _POSTGRES_DATABASE); // sends queries return true; } catch (error) { if (!error.stack.includes('already exists')) { From f583b68d96a4b87d80cc4cc17286ee64517e3d74 Mon Sep 17 00:00:00 2001 From: Patrick <49989644+botagas@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:09:15 +0200 Subject: [PATCH 06/11] Update server.js --- backend/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/server.js b/backend/server.js index 1503b699..51e8c124 100644 --- a/backend/server.js +++ b/backend/server.js @@ -50,8 +50,8 @@ const ensureSlashes = (url) => { return url; }; -const PORT = process.env.PORT; -const LISTEN_IP = "0.0.0.0"; +const PORT = process.env.PORT || 3000; +const LISTEN_IP = process.env.LISTEN_IP || "0.0.0.0"; const JWT_SECRET = process.env.JWT_SECRET; const BASE_NAME = process.env.JS_BASE_URL ? ensureSlashes(process.env.JS_BASE_URL) : ""; From 4155137535004b743f7f84d367fd1f79c07f08c9 Mon Sep 17 00:00:00 2001 From: Patrick <49989644+botagas@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:09:49 +0200 Subject: [PATCH 07/11] Update .env.example --- backend/.env.example | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/.env.example b/backend/.env.example index 8396a0bc..8b64a061 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -9,4 +9,5 @@ JWT_SECRET = # ultra secret word JS_GEOLITE_ACCOUNT_ID = # optional, your GeoLite account ID to show geolocation info for client IPs JS_GEOLITE_LICENSE_KEY = # optional, your GeoLite account license key to show geolocation info for client IPs +LISTEN_IP = # your bind address PORT = # your jellystat port From 57c84e4c8e89a5e56c1d9434b7f220494b1b8902 Mon Sep 17 00:00:00 2001 From: Patrick <49989644+botagas@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:12:50 +0200 Subject: [PATCH 08/11] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dd6ea9b2..756bd480 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,8 @@ | JS_GEOLITE_ACCOUNT_ID | `null` | `123456` | maxmind.com user id to be used for Geolocating IP Addresses (Can be found at https://www.maxmind.com/en/accounts/current/edit) | | JS_GEOLITE_LICENSE_KEY | `null` | `ASDWdaSdawe2sd186` | License key you need to generate on maxmind to use their services | | MINIMUM_SECONDS_TO_INCLUDE_PLAYBACK | `1` | `10` | The minimum time (in seconds) to include a playback record, which can be used to exclude short playbacks | -| PORT | `3000` | `3001` | The port used by Jellystat | +| LISTEN_IP | `0.0.0.0`| `127.0.0.1` | Bind address | +| PORT | `3000` | `3001` | Port | ## Getting Started with Development From cd46587cda4722cad9d37ca1d8b5b651cd8b5fa6 Mon Sep 17 00:00:00 2001 From: Patrick <49989644+botagas@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:44:12 +0200 Subject: [PATCH 09/11] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index d11f2025..99f04c87 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,6 @@ | JS_GEOLITE_ACCOUNT_ID | `null` | `123456` | maxmind.com user id to be used for Geolocating IP Addresses (Can be found at https://www.maxmind.com/en/accounts/current/edit) | | JS_GEOLITE_LICENSE_KEY | `null` | `ASDWdaSdawe2sd186` | License key you need to generate on maxmind to use their services | | MINIMUM_SECONDS_TO_INCLUDE_PLAYBACK | `1` | `10` | The minimum time (in seconds) to include a playback record, which can be used to exclude short playbacks | -| LISTEN_IP | `0.0.0.0`| `127.0.0.1` | Bind address | | IS_EMBY_API | `false` | `true` | Set to true if using Emby instead of Jellyfin | From f3618902b9fb991e15f546de997f1e7e3e669e9d Mon Sep 17 00:00:00 2001 From: Patrick <49989644+botagas@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:44:26 +0200 Subject: [PATCH 10/11] Update .env.example --- backend/.env.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/.env.example b/backend/.env.example index 8b64a061..a490f207 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -9,5 +9,5 @@ JWT_SECRET = # ultra secret word JS_GEOLITE_ACCOUNT_ID = # optional, your GeoLite account ID to show geolocation info for client IPs JS_GEOLITE_LICENSE_KEY = # optional, your GeoLite account license key to show geolocation info for client IPs -LISTEN_IP = # your bind address -PORT = # your jellystat port +JS_LISTEN_IP = # your bind address +JS_PORT = # your jellystat port From 0191139f719fd75a2b2515ac05c151e280f0510e Mon Sep 17 00:00:00 2001 From: Patrick <49989644+botagas@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:44:44 +0200 Subject: [PATCH 11/11] Update server.js --- backend/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/server.js b/backend/server.js index 492d8d21..699646c7 100644 --- a/backend/server.js +++ b/backend/server.js @@ -53,7 +53,7 @@ const ensureSlashes = (url) => { }; -const PORT = process.env.PORT || 3000; +const JS_PORT = process.env.JS_PORT || 3000; const JS_LISTEN_IP = process.env.JS_LISTEN_IP || "0.0.0.0"; const JWT_SECRET = process.env.JWT_SECRET; const BASE_NAME = process.env.JS_BASE_URL ? ensureSlashes(process.env.JS_BASE_URL) : "";