From b3779c9be5032892721604f1116ff066ec46aafb Mon Sep 17 00:00:00 2001 From: Granth Bagadia <66285223+granth23@users.noreply.github.com> Date: Mon, 13 Jan 2025 08:11:56 +0000 Subject: [PATCH 1/7] Update docs and config for user working on different port/address --- docs/developers/devel-env.rst | 15 ++++++++++++--- listenbrainz/config.py.sample | 5 ++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/developers/devel-env.rst b/docs/developers/devel-env.rst index 941ce36eb1..85d650815c 100644 --- a/docs/developers/devel-env.rst +++ b/docs/developers/devel-env.rst @@ -75,7 +75,16 @@ configuration. cp listenbrainz/config.py.sample listenbrainz/config.py Now, open the new config.py file (don’t change config.py.sample) with your favorite -text editor and look for this section. +text editor. + +.. note:: + + If you are accessing your development server using a port other than ``8100``, + ensure that you update the ``SERVER_ROOT_URL`` field to reflect the appropriate port number. + If you are accessing your development server using a host other than ``localhost`` (e.g., GitHub Codespaces), + ensure that you update the ``SERVER_NAME`` and ``SERVER_ROOT_URL`` fields to reflect the appropriate host details. + +Next look for this section in the file. .. code-block:: yaml @@ -87,7 +96,7 @@ Update the strings with your client ID and secret. After doing this, your ListenBrainz development environment is able to authenticate and log in from your MusicBrainz login. -.. note:: +.. note:: Make sure the ``OAUTH_CLIENT_ID`` and ``OAUTH_CLIENT_SECRET`` parameters are set properly, failing to do so will result in a basic browser auth popup like the one below: .. image:: ../images/auth-popup.png @@ -268,7 +277,7 @@ This builds and runs the containers needed for the tests. This script configures test-specific data volumes so that test data is isolated from your development data. Note that all tests are run: Unit tests and integration tests. -To run tests faster, you can use some options to start up the test infrastructure +To run tests faster, you can use some options to start up the test infrastructure once so that subsequent running of the tests is faster: .. code-block:: bash diff --git a/listenbrainz/config.py.sample b/listenbrainz/config.py.sample index 13d06fd8e0..8ffd78a816 100644 --- a/listenbrainz/config.py.sample +++ b/listenbrainz/config.py.sample @@ -22,6 +22,9 @@ SQLALCHEMY_TIMESCALE_URI = "postgresql://listenbrainz_ts:listenbrainz_ts@lb_db/l TIMESCALE_ADMIN_URI = "postgresql://postgres:postgres@lb_db/postgres" TIMESCALE_ADMIN_LB_URI = "postgresql://postgres:postgres@lb_db/listenbrainz_ts" +# Server address +SERVER_NAME = "localhost:8100" + # MetaBrainz - used for retrieving donation info from metabrainz.org SQLALCHEMY_METABRAINZ_URI = "" @@ -211,4 +214,4 @@ REJECT_LISTENS_WITHOUT_USER_EMAIL = False REJECT_NEW_USERS_WITHOUT_EMAIL = False # base directory for user data exports -USER_DATA_EXPORT_BASE_DIR = "/code/listenbrainz/exports/" +USER_DATA_EXPORT_BASE_DIR = "/code/listenbrainz/exports/" \ No newline at end of file From d8943bf2355382f282ae761ef5020f97547ca5dc Mon Sep 17 00:00:00 2001 From: Granth Bagadia <66285223+granth23@users.noreply.github.com> Date: Mon, 13 Jan 2025 08:15:56 +0000 Subject: [PATCH 2/7] Deployment docs remove unwanted changes --- docs/developers/devel-env.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/developers/devel-env.rst b/docs/developers/devel-env.rst index 85d650815c..e6e0212bc4 100644 --- a/docs/developers/devel-env.rst +++ b/docs/developers/devel-env.rst @@ -96,7 +96,7 @@ Update the strings with your client ID and secret. After doing this, your ListenBrainz development environment is able to authenticate and log in from your MusicBrainz login. -.. note:: +.. note:: Make sure the ``OAUTH_CLIENT_ID`` and ``OAUTH_CLIENT_SECRET`` parameters are set properly, failing to do so will result in a basic browser auth popup like the one below: .. image:: ../images/auth-popup.png @@ -277,7 +277,7 @@ This builds and runs the containers needed for the tests. This script configures test-specific data volumes so that test data is isolated from your development data. Note that all tests are run: Unit tests and integration tests. -To run tests faster, you can use some options to start up the test infrastructure +To run tests faster, you can use some options to start up the test infrastructure once so that subsequent running of the tests is faster: .. code-block:: bash From 18ec98b3ca7f2ee1f88722ed15d9bff087e4db4b Mon Sep 17 00:00:00 2001 From: Granth Bagadia <66285223+granth23@users.noreply.github.com> Date: Mon, 13 Jan 2025 21:11:48 +0000 Subject: [PATCH 3/7] Docs updated --- docs/developers/devel-env.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/developers/devel-env.rst b/docs/developers/devel-env.rst index e6e0212bc4..34b4e46370 100644 --- a/docs/developers/devel-env.rst +++ b/docs/developers/devel-env.rst @@ -80,7 +80,7 @@ text editor. .. note:: If you are accessing your development server using a port other than ``8100``, - ensure that you update the ``SERVER_ROOT_URL`` field to reflect the appropriate port number. + ensure that you update all the addresses field (e.g., ``SERVER_ROOT_URL``) to reflect the appropriate port number. If you are accessing your development server using a host other than ``localhost`` (e.g., GitHub Codespaces), ensure that you update the ``SERVER_NAME`` and ``SERVER_ROOT_URL`` fields to reflect the appropriate host details. @@ -96,7 +96,7 @@ Update the strings with your client ID and secret. After doing this, your ListenBrainz development environment is able to authenticate and log in from your MusicBrainz login. -.. note:: +.. note:: Make sure the ``OAUTH_CLIENT_ID`` and ``OAUTH_CLIENT_SECRET`` parameters are set properly, failing to do so will result in a basic browser auth popup like the one below: .. image:: ../images/auth-popup.png @@ -277,7 +277,7 @@ This builds and runs the containers needed for the tests. This script configures test-specific data volumes so that test data is isolated from your development data. Note that all tests are run: Unit tests and integration tests. -To run tests faster, you can use some options to start up the test infrastructure +To run tests faster, you can use some options to start up the test infrastructure once so that subsequent running of the tests is faster: .. code-block:: bash From 4d3eb90d674dde6c7f64547883145e4f0aa94ace Mon Sep 17 00:00:00 2001 From: Granth Bagadia <66285223+granth23@users.noreply.github.com> Date: Tue, 14 Jan 2025 02:43:59 +0530 Subject: [PATCH 4/7] Config Updated --- listenbrainz/config.py.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/listenbrainz/config.py.sample b/listenbrainz/config.py.sample index 8ffd78a816..60ca3352e2 100644 --- a/listenbrainz/config.py.sample +++ b/listenbrainz/config.py.sample @@ -214,4 +214,4 @@ REJECT_LISTENS_WITHOUT_USER_EMAIL = False REJECT_NEW_USERS_WITHOUT_EMAIL = False # base directory for user data exports -USER_DATA_EXPORT_BASE_DIR = "/code/listenbrainz/exports/" \ No newline at end of file +USER_DATA_EXPORT_BASE_DIR = "/code/listenbrainz/exports/" From bd0e6a5666a31a855f95f9cc251d1254f993fac1 Mon Sep 17 00:00:00 2001 From: Granth Bagadia <66285223+granth23@users.noreply.github.com> Date: Tue, 14 Jan 2025 03:22:10 +0530 Subject: [PATCH 5/7] Update devel-env.rst --- docs/developers/devel-env.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/developers/devel-env.rst b/docs/developers/devel-env.rst index 34b4e46370..4fdf7523cc 100644 --- a/docs/developers/devel-env.rst +++ b/docs/developers/devel-env.rst @@ -96,7 +96,7 @@ Update the strings with your client ID and secret. After doing this, your ListenBrainz development environment is able to authenticate and log in from your MusicBrainz login. -.. note:: +.. note:: Make sure the ``OAUTH_CLIENT_ID`` and ``OAUTH_CLIENT_SECRET`` parameters are set properly, failing to do so will result in a basic browser auth popup like the one below: .. image:: ../images/auth-popup.png @@ -277,7 +277,7 @@ This builds and runs the containers needed for the tests. This script configures test-specific data volumes so that test data is isolated from your development data. Note that all tests are run: Unit tests and integration tests. -To run tests faster, you can use some options to start up the test infrastructure +To run tests faster, you can use some options to start up the test infrastructure once so that subsequent running of the tests is faster: .. code-block:: bash From 0e1f62cce6ad2aeb509f6c6fb25c484fdab37b15 Mon Sep 17 00:00:00 2001 From: Granth Bagadia <66285223+granth23@users.noreply.github.com> Date: Wed, 15 Jan 2025 05:10:10 +0000 Subject: [PATCH 6/7] Config and Docs Updated --- docs/developers/devel-env.rst | 9 +++++---- listenbrainz/config.py.sample | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/developers/devel-env.rst b/docs/developers/devel-env.rst index 4fdf7523cc..f47a6f3448 100644 --- a/docs/developers/devel-env.rst +++ b/docs/developers/devel-env.rst @@ -80,9 +80,10 @@ text editor. .. note:: If you are accessing your development server using a port other than ``8100``, - ensure that you update all the addresses field (e.g., ``SERVER_ROOT_URL``) to reflect the appropriate port number. + ensure that you update the ``SERVER_BASE_URL`` to reflect the appropriate port number. If you are accessing your development server using a host other than ``localhost`` (e.g., GitHub Codespaces), - ensure that you update the ``SERVER_NAME`` and ``SERVER_ROOT_URL`` fields to reflect the appropriate host details. + ensure that you uncomment and update ``SERVER_NAME``, and ensure ``SERVER_ROOT_URL``is updated + accordingly to maintain consistency and support the appropriate host details. Next look for this section in the file. @@ -96,7 +97,7 @@ Update the strings with your client ID and secret. After doing this, your ListenBrainz development environment is able to authenticate and log in from your MusicBrainz login. -.. note:: +.. note:: Make sure the ``OAUTH_CLIENT_ID`` and ``OAUTH_CLIENT_SECRET`` parameters are set properly, failing to do so will result in a basic browser auth popup like the one below: .. image:: ../images/auth-popup.png @@ -277,7 +278,7 @@ This builds and runs the containers needed for the tests. This script configures test-specific data volumes so that test data is isolated from your development data. Note that all tests are run: Unit tests and integration tests. -To run tests faster, you can use some options to start up the test infrastructure +To run tests faster, you can use some options to start up the test infrastructure once so that subsequent running of the tests is faster: .. code-block:: bash diff --git a/listenbrainz/config.py.sample b/listenbrainz/config.py.sample index 60ca3352e2..ce5a757e84 100644 --- a/listenbrainz/config.py.sample +++ b/listenbrainz/config.py.sample @@ -23,7 +23,7 @@ TIMESCALE_ADMIN_URI = "postgresql://postgres:postgres@lb_db/postgres" TIMESCALE_ADMIN_LB_URI = "postgresql://postgres:postgres@lb_db/listenbrainz_ts" # Server address -SERVER_NAME = "localhost:8100" +# SERVER_NAME = "localhost:8100" # MetaBrainz - used for retrieving donation info from metabrainz.org SQLALCHEMY_METABRAINZ_URI = "" @@ -160,7 +160,7 @@ WHITELISTED_AUTH_TOKENS = [] # SPOTIFY SPOTIFY_CLIENT_ID = 'needs a non empty default value for tests, change this' SPOTIFY_CLIENT_SECRET = 'needs a non empty default value for tests, change this' -SPOTIFY_CALLBACK_URL = 'http://localhost:8100/settings/music-services/spotify/callback/' +SPOTIFY_CALLBACK_URL = f'{SERVER_ROOT_URL}/settings/music-services/spotify/callback/' # SPOTIFY-CACHE SPOTIFY_CACHE_CLIENT_ID = 'needs a non empty default value for tests, change this' @@ -169,12 +169,12 @@ SPOTIFY_CACHE_CLIENT_SECRET = 'needs a non empty default value for tests, change # SOUNDCLOUD SOUNDCLOUD_CLIENT_ID = 'needs a non empty default value for tests, change this' SOUNDCLOUD_CLIENT_SECRET = 'needs a non empty default value for tests, change this' -SOUNDCLOUD_REDIRECT_URI = 'http://localhost:8100/settings/music-services/soundcloud/callback/' +SOUNDCLOUD_REDIRECT_URI = f'{SERVER_ROOT_URL}/settings/music-services/soundcloud/callback/' # CRITIQUEBRAINZ CRITIQUEBRAINZ_CLIENT_ID = 'needs a non empty default value for tests, change this' CRITIQUEBRAINZ_CLIENT_SECRET = 'needs a non empty default value for tests, change this' -CRITIQUEBRAINZ_REDIRECT_URI = 'http://localhost:8100/settings/music-services/critiquebrainz/callback/' +CRITIQUEBRAINZ_REDIRECT_URI = f'{SERVER_ROOT_URL}/settings/music-services/critiquebrainz/callback/' # APPLE MUSIC APPLE_MUSIC_TEAM_ID = 'needs a non empty default value for tests, change this' From 42be7abe3bba91809dafde237a8663fe5fd68b4f Mon Sep 17 00:00:00 2001 From: Granth Bagadia <66285223+granth23@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:41:30 +0530 Subject: [PATCH 7/7] Unwanted Changes --- docs/developers/devel-env.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/developers/devel-env.rst b/docs/developers/devel-env.rst index f47a6f3448..9b5d271ad4 100644 --- a/docs/developers/devel-env.rst +++ b/docs/developers/devel-env.rst @@ -97,7 +97,7 @@ Update the strings with your client ID and secret. After doing this, your ListenBrainz development environment is able to authenticate and log in from your MusicBrainz login. -.. note:: +.. note:: Make sure the ``OAUTH_CLIENT_ID`` and ``OAUTH_CLIENT_SECRET`` parameters are set properly, failing to do so will result in a basic browser auth popup like the one below: .. image:: ../images/auth-popup.png @@ -278,7 +278,7 @@ This builds and runs the containers needed for the tests. This script configures test-specific data volumes so that test data is isolated from your development data. Note that all tests are run: Unit tests and integration tests. -To run tests faster, you can use some options to start up the test infrastructure +To run tests faster, you can use some options to start up the test infrastructure once so that subsequent running of the tests is faster: .. code-block:: bash