2012-05-24 16:48:31 +02:00
|
|
|
Introduction
|
|
|
|
============
|
|
|
|
|
|
|
|
This file contains instructions for setting up a local version of the
|
2024-06-28 10:39:59 -05:00
|
|
|
coverartarchive.org and eventartarchive.org services. These services
|
|
|
|
consist of several parts:
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:39:59 -05:00
|
|
|
1. MusicBrainz Server (this allows image uploads)
|
2024-06-28 10:16:22 -05:00
|
|
|
2. artwork-indexer (updates image metadata on the archive.org servers)
|
|
|
|
3. artwork-redirect (image redirect service)
|
2024-06-28 10:39:59 -05:00
|
|
|
4. Internet Archive S3 storage
|
2012-05-24 16:48:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
Storage
|
|
|
|
=======
|
|
|
|
|
2024-06-28 10:39:59 -05:00
|
|
|
For development we need a place to store the images. Obviously, a
|
2012-05-24 16:48:31 +02:00
|
|
|
development server should not upload images to the actual
|
2024-06-28 10:39:59 -05:00
|
|
|
Internet Archive storage.
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2012-06-19 15:32:49 +02:00
|
|
|
We provide a simple Plack script which emulates just enough of the
|
2024-06-28 10:39:59 -05:00
|
|
|
Internet Archive S3 protocol to use it with MusicBrainz Server.
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
Figure out where you want to store uploaded images, and set the
|
|
|
|
`SSSSSS_STORAGE` environment variable to that location:
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
$ SSSSSS_STORAGE=./ssssss plackup --port 5050 -r contrib/ssssss.psgi
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2012-06-19 15:32:49 +02:00
|
|
|
Note that we're specifying a port here. We need the default port
|
2024-06-28 10:39:59 -05:00
|
|
|
(5000) for MusicBrainz Server.
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:39:59 -05:00
|
|
|
Now that you're running this script, MusicBrainz Server should be able to
|
2024-06-28 10:16:22 -05:00
|
|
|
upload images and indexes to `http://localhost:5050/$BUCKET`, where
|
|
|
|
`$BUCKET` is the bucket name.
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2013-07-25 10:34:31 +02:00
|
|
|
To simulate a 503 Slow Down error, run slowdown.psgi instead of ssssss.psgi:
|
|
|
|
|
|
|
|
$ plackup --port 5050 contrib/slowdown.psgi
|
|
|
|
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
artwork-indexer
|
|
|
|
===============
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
Download and setup the artwork-indexer.
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
$ git clone https://github.com/metabrainz/artwork-indexer.git
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
Follow the [installation instructions in the README](https://github.com/metabrainz/artwork-indexer?tab=readme-ov-file#installation).
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
Configure where indexes should be uploaded to by changing `url` under the
|
|
|
|
`[s3]` section:
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
[s3]
|
|
|
|
url=http://localhost:5050/{bucket}?file={file}
|
2015-03-06 11:54:59 -06:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
Also ensure that the configured values for `caa_access`, `caa_secret`,
|
|
|
|
`eaa_access`, and `eaa_secret` under the `[s3]` section match the
|
|
|
|
corresponding values in your DBDefs.pm:
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
sub COVER_ART_ARCHIVE_ACCESS_KEY { }
|
|
|
|
sub COVER_ART_ARCHIVE_SECRET_KEY { }
|
|
|
|
sub EVENT_ART_ARCHIVE_ACCESS_KEY { }
|
|
|
|
sub EVENT_ART_ARCHIVE_SECRET_KEY { }
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
It's fine to leave them blank in both config files.
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
Finally, start the indexer:
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
(.venv) $ python indexer.py
|
2012-05-24 16:48:31 +02:00
|
|
|
|
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
artwork-redirect
|
|
|
|
================
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
Download and setup the artwork-redirect service:
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
$ git clone https://github.com/metabrainz/artwork-redirect.git
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
Follow the [installation instructions in the README](https://github.com/metabrainz/artwork-redirect?tab=readme-ov-file#option-2-manual).
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
Configure where indexes and images are redirected to by changing
|
|
|
|
`download_prefix` under the `[ia]` section:
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
[ia]
|
|
|
|
download_prefix=http://localhost:5050/
|
2012-05-24 16:48:31 +02:00
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
This should be the location where ssssss.psgi is storing uploaded images.
|
2012-05-24 16:48:31 +02:00
|
|
|
|
|
|
|
And start the server:
|
|
|
|
|
2024-06-28 10:16:22 -05:00
|
|
|
(.venv) $ python artwork_redirect_server.py
|
2012-05-24 16:48:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
MusicBrainz Server
|
|
|
|
==================
|
|
|
|
|
2024-06-28 10:39:59 -05:00
|
|
|
Now that all of that is configured, you can point MusicBrainz Server to
|
|
|
|
the upload and download URLs for your local image archive. Change
|
2012-05-24 16:48:31 +02:00
|
|
|
the following values in lib/DBDefs.pm:
|
|
|
|
|
2024-01-21 22:52:12 -06:00
|
|
|
sub INTERNET_ARCHIVE_UPLOAD_PREFIXER { shift; sprintf("//localhost:5050/%s", shift) }
|
|
|
|
sub COVER_ART_ARCHIVE_DOWNLOAD_PREFIX { "http://localhost:8080" }
|
|
|
|
sub EVENT_ART_ARCHIVE_DOWNLOAD_PREFIX { "http://localhost:8080" }
|