artefactual / archivematica-storage-service

Archivematica storage service
http://www.archivematica.org
GNU Affero General Public License v3.0
34 stars 43 forks source link

Problem: pipelines are not always discoverable #236

Open sevein opened 6 years ago

sevein commented 6 years ago

SS stores the remote_name of a pipeline when it's created for consequent API access, e.g. re-ingest.

remote_name = models.CharField(
    max_length=256,
    default=None,
    null=True,
    blank=True,
    help_text="Host or IP address of the pipeline server for making API calls.")

This field is also editable from the web interface.

When a pipeline is created via the SS API, this field is populated after the REMOTE_ADDR header unless the client provides a value via the remote_name property.

The problem is that the dashboard doesn't allow users to provide a custom value so SS always fallbacks to the value found in the REMOTE_ADDR header which is problematic under some circumstances.

jrwdunham commented 6 years ago

Assuming a URL is scheme:[//[user[:password]@]host[:port]][/path][?query][#fragment], are you proposing adding a new attribute to Pipeline so that Pipeline().remote_url must be a valid scheme:[//host[:port]]?

Or are you thinking of modifying the logic around Pipeline().remote_name so we can accept both scheme-less and schemed URLs?

sevein commented 6 years ago

Or are you thinking of modifying the logic around Pipeline().remote_name so we can accept both scheme-less and schemed URLs?

I didn't think much about it but I like the way ^ sounds. It would mean that we can solve the problem without a database migration - is that ok?

jrwdunham commented 6 years ago

Sounds good to me.

sevein commented 6 years ago

I think that this issue needs to remain open until SS learns a new parameter that allows the user to indicate the URI of the pipeline in the create pipeline endpoint. This parameter should be provided by Archivematica when it performs the self-registration process.

sevein commented 6 years ago

@sromkey, I think that we can close this issue.

SS v0.11 included https://github.com/artefactual/archivematica-storage-service/pull/267 which made the following changes:

I think that these changes together already enabled the dashboard to provide a URI as the remote name. The remaining changes (provide a URI) need to happen in the AM repo.