User:Derat/MusicBrainzServerDevelopmentNotes: Difference between revisions

From MusicBrainz Wiki
Jump to navigationJump to search
(Created page with "Here are some personal notes about trying to do MusicBrainz server development in June 2023. == Getting the code and setting up my local environment == I cloned the [https://...")
 
No edit summary
Line 13: Line 13:


The server doesn't seem to have search indexes by default (I think there are more steps for getting that working), so I had to look up an MBID on the real MB site: http://localhost:5000/release/15f5c2cb-41ea-3630-a0f6-2f86785cf608
The server doesn't seem to have search indexes by default (I think there are more steps for getting that working), so I had to look up an MBID on the real MB site: http://localhost:5000/release/15f5c2cb-41ea-3630-a0f6-2f86785cf608

I edited <code>root/release/add_cover_art.tt</code> in the <code>musicbrainz-server</code> repo and verified that my changes showed up at http://localhost:5000/release/15f5c2cb-41ea-3630-a0f6-2f86785cf608/add-cover-art.


== Creating an account ==
== Creating an account ==
Line 25: Line 27:
UPDATE EDITOR SET email = 'user@example.org', email_confirm_date = now() WHERE name = 'my_username';
UPDATE EDITOR SET email = 'user@example.org', email_confirm_date = now() WHERE name = 'my_username';
At this point, the server viewed my account as having been verified.
At this point, the server viewed my account as having been verified.

== Making changes ==
I edited <code>root/release/add_cover_art.tt</code> in the <code>musicbrainz-server</code> repo and verified that my changes showed up in a web browser.

Revision as of 15:20, 30 June 2023

Here are some personal notes about trying to do MusicBrainz server development in June 2023.

Getting the code and setting up my local environment

I cloned the musicbrainz-server and musicbrainz-docker repositories.

Next, I followed the instructions in the "Local development of MusicBrainz Server" section of musicbrainz-docker's README.md. I encountered a DateTime::Locale version error the first time I ran the createdb.sh command, but it worked when I ran it again.

I stepped away from the code for a few weeks at this point. When I came back, I synced both repositories and ran the following command to recreate the database:

sudo docker-compose run --rm musicbrainz recreatedb.sh -sample -fetch

I ran the following to start the containers (without detaching from the terminal, so I could watch the logs):

sudo docker-compose up

At this point, I was able to access my local server at http://localhost:5000/.

The server doesn't seem to have search indexes by default (I think there are more steps for getting that working), so I had to look up an MBID on the real MB site: http://localhost:5000/release/15f5c2cb-41ea-3630-a0f6-2f86785cf608

I edited root/release/add_cover_art.tt in the musicbrainz-server repo and verified that my changes showed up at http://localhost:5000/release/15f5c2cb-41ea-3630-a0f6-2f86785cf608/add-cover-art.

Creating an account

I added a user account via the web interface but my server wasn't able to send email messages, so I wasn't able to verify my email address (needed to perform edits).

I ran the following to connect to PostgreSQL:

sudo docker-compose run musicbrainz psql postgres -U musicbrainz -h db

Next, I ran the following to manually mark my account as being verified:

\l                -- list databases
\c musicbrainz_db -- change DB
\dt               -- list tables
UPDATE EDITOR SET email = 'user@example.org', email_confirm_date = now() WHERE name = 'my_username';

At this point, the server viewed my account as having been verified.