Skip to content

Add support for local copy of artwork redirect#326

Open
adhawkins wants to merge 7 commits intometabrainz:masterfrom
adhawkins:artwork-redirect
Open

Add support for local copy of artwork redirect#326
adhawkins wants to merge 7 commits intometabrainz:masterfrom
adhawkins:artwork-redirect

Conversation

@adhawkins
Copy link
Copy Markdown
Member

@adhawkins adhawkins commented Nov 7, 2025

Adds support for running a local copy of the artwork redirect server.

Artwork redirect can be enabled using ./admin/configure add artwork-server then accessed using port 8081.

Testing

$ ./admin/configure add artwork-redirect
[...]
$ docker compose up --build -d
[...]
$ curl 'http://localhost:8081/release/a6949d8e-c1eb-4eee-a670-680d28dd80e6'
See: http://archive.org/download/mbid-a6949d8e-c1eb-4eee-a670-680d28dd80e6/index.json

If you have the CAA dump imported, you should also see images being linked to localhost:8081 from release pages.

Note: I (mwiencek) use a local compose file which overrides the musicbrainz build context to never use prebuilt images.

$ cat local/build-musicbrainz.yml 
services:
  musicbrainz:
    build:
      context: build/musicbrainz
$ cat .env
MUSICBRAINZ_DOCKER_HOST_IPADDRCOL=127.0.0.1:
NPM_CONFIG_REGISTRY=https://registry.yarnpkg.com
COMPOSE_FILE=docker-compose.yml:compose/musicbrainz-standalone.yml:compose/publishing-db-port.yml:compose/artwork-redirect.yml:local/build-musicbrainz.yml

@mwiencek
Copy link
Copy Markdown
Member

mwiencek commented Nov 7, 2025

Thanks again for submitting this!

On Matrix I suggested renaming artwork-server.yml to artwork-redirect.yml for clarity.

metabrainz/artwork-redirect#59 will also allow us to use existing environment variables in config.ini (MUSICBRAINZ_POSTGRES_SERVER, POSTGRES_USER, POSTGRES_PASSWORD, etc.). So we might want to wait for that to be merged. We could also make the port that artwork-redirect listens on configurable.

Other than that, I've already tested this locally and it works great.

@adhawkins
Copy link
Copy Markdown
Member Author

Thanks again for submitting this!

On Matrix I suggested renaming artwork-server.yml to artwork-redirect.yml for clarity.

metabrainz/artwork-redirect#59 will also allow us to use existing environment variables in config.ini (MUSICBRAINZ_POSTGRES_SERVER, POSTGRES_USER, POSTGRES_PASSWORD, etc.). So we might want to wait for that to be merged. We could also make the port that artwork-redirect listens on configurable.

Other than that, I've already tested this locally and it works great.

Good plan, I missed that when I was renaming everything. I've pushed a commit to do this (including updating the documentation).

Do you mean the port that the docker container exposes to the host? Can this be an environment variable? I'll have a play.

@mwiencek
Copy link
Copy Markdown
Member

mwiencek commented Nov 8, 2025

Do you mean the port that the docker container exposes to the host? Can this be an environment variable? I'll have a play.

Yeah, the exposed port. An environment variable would be perfect.

@adhawkins
Copy link
Copy Markdown
Member Author

Do you mean the port that the docker container exposes to the host? Can this be an environment variable? I'll have a play.

Yeah, the exposed port. An environment variable would be perfect.

Ok, I've done this also. Think we're about done here now?

mwiencek and others added 2 commits November 12, 2025 13:55
These are used to access artwork externally (e.g., in a web browser), so should
use the external host and port.
@adhawkins
Copy link
Copy Markdown
Member Author

I realised I didn't have the redirect server specified to automatically restart. I've added a commit to achieve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants