Ticket #367 (closed defect: fixed)

Opened 3 years ago

Last modified 22 months ago

Adding test url for servers.

Reported by: robert Owned by: robert
Priority: major Milestone: MediaMosa 3.0
Component: Core Version:
Keywords: Cc:
MoSCoW: Must Have Estimated time after impact analysis:
Related to project: none Tested: yes
Accepted: yes Estimated Hours: 0

Description

The server status page has problem with server urls and subdir;

no subdir:

http://app.acceptatie.vpcore.snkn.nl/download/{TICKET}

with subdir:

http://app.acceptatie.vpcore.snkn.nl/mysubdirinstallation/download/{TICKET}

We normally take the host (app.acceptatie.vpcore.snkn.nl) from the uri, but in case of a subdir, that not enough.

In the subdir example we can't split the host path  http://app.acceptatie.vpcore.snkn.nl/mysubdirinstallation/ from the real path download/{TICKET}.

In 2.2 status page now tries to retrieve status using the whole path, but this has problems on acceptation server and is not the right approach.

We either split the url into 2 parts;
* host + possible subdir
* real path

Or we add a new field uri for testing the server.

The clean solution is the 2 part uri. The 2nd solution, adding a new url for testing, takes less time to implement.

Attachments

mediamosa_server.png Download (41.9 KB) - added by robert 2 years ago.

Change History

Changed 3 years ago by Frans

  • moscow changed from Should Have to Must Have
  • milestone changed from MediaMosa X.X to MediaMosa 2.4

Changed 2 years ago by robert

Changed 2 years ago by robert

Lets splits this ticket in 2 fases.

First I'll explain what the problem is;

MediaMosa servers, like job servers, have a REST interface on which the MediaMosa talks to. F.e.  http://job1.mediamosa.local. This works fine. Now the problem is when a REST interface is active on a submap. Lets say  http://jobs.mediamosa.local/job1. So the REST call /version will be on this server  http://jobs.mediamosa.local/job1/version/ and should give back the current version.

Now for job servers, there is no real problem with the url. But for download, still and upload servers, its a different story. We need the URL to download REST interface.

The URL for download default is  http://[host]/download/{TICKET}
In this case its easy to figure out that  http://[host]/ is the REST interface and /download/ the REST call. But what if the REST interface has a subdir;  http://[host]/subdir/download/ and we need to send a normal request to the download REST interface. Then its not possible to split on the server URL. And '/download/' is also variable, so its not always the same. So its impossible to figure out that the REST interface is  http://[host]/subdir.

To see the problem in action; see sites/all/modules/mediamosa/core/server/mediamosa_server.inc -> get_status_enabled(). This function tries a call to the server uri and uses the 'server/status' internal REST call to get it.

What we need is to split up the URL storage into 2 parts; URL + request path. The URL will store the  http://[host]/[optional subdir] and in the 2nd the path 'download'. When we are using the complete URL, we return part1 + part2 = url. And in case we need the REST interface, we just take part1.

See attached screenshot.

In the screenshot you see the server admin edit page. Here you see the input box 'uri'. This field needs to be split up into URI and path. In uri would go  http://[host]/[subpath] and in path would go 'download/{TICKET}'

That is fase 1; change the input form and make sure the node store and revert revision works.
You need to write a update hook where you split up existing uri into 2 values. Remember that path is optional and uri will stay required. Also a clean installation needs to know there are 2 fields instead of one.

Fase 2 will be changing the code which uses the server uri. You'll need to write a function that will join 2 fields into 1 when needed. When only the REST interface uri is needed then it should only use the server uri.

The unit test under Jobs->server setup should work after the fix when using a subpath under one of your servers (will fail now).

Changed 2 years ago by forgacs

  • owner set to forgacs
  • status changed from new to assigned

Changed 2 years ago by forgacs

  • status changed from assigned to closed
  • resolution set to fixed

The development is ready.
The server URI is separated to URI and path.
Old way:

URI: http://download.mediamosa.local/download/{TICKET}

New way:

URI: http://download.mediamosa.local/
Path: {base_uri}download/{TICKET}

The db schema was changed: The mediamosa_server table has a new column: server_path.
Migration tool, hook_install and install profile were changed to the new schema.
Update hooks were implemented: add server path field, migrate the old format to the new one.
Tests were fixed to the new format.
There is a new function: mediamosa_server::get_server_url(). It creates the correct URL from the URI and the path.
The Server admin pages were improved.

Changed 2 years ago by robert

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 2 years ago by robert

  • owner changed from forgacs to robert
  • status changed from reopened to assigned

Changed 2 years ago by robert

  • status changed from assigned to closed
  • resolution set to fixed

Changed 22 months ago by forgacs

All the server URI are separated to URI and Path now:
 https://beheer.acceptatie.vpcore.snkn.nl/admin/mediamosa/config/server

Example:

URI:  http://app.acceptatie.vpcore.snkn.nl/
Path: {base_uri}still/{TICKET}

Where {base_uri} is replaced with the URI.
In this example:
 http://app.acceptatie.vpcore.snkn.nl/still/{TICKET}

We have db update hook too.

Changed 22 months ago by Frans

  • tested changed from no to yes
  • accepted changed from no to yes

Checked and Accepted.

Note: See TracTickets for help on using tickets.