craigsapp / website-polish-scores

Front-end for digital transcriptions of the Polish Music Heritage in Open Access project
https://polishscores.org
3 stars 1 forks source link

Add main/mirror digital score server #194

Closed craigsapp closed 2 years ago

craigsapp commented 2 years ago

Add main/mirror digital scores server and allow selecting between them when loading the front-end website.

craigsapp commented 2 years ago

Implemented with commit https://github.com/craigsapp/website-polish-scores/commit/4471170c791fdbe3aa1886dbd9dd42b2502f5f28

There are two copies of the front-end: https://polishscores.org which is located on the NIFC network, and a copy served by Github Pages: https://polishscores.humdrum.org Both of these website are currently using the main data server by default (humdrum.nifc.pl which is on the NIFC network), but either one can switch to the mirror site in California: data.nifc.humdrum.org). To do so, the main method will be to add the CGI parameter mirror to the URL:

https://polishscores.org?mirror

https://polishscores.humdrum.org?mirror

To see which data server is being used, check the console. Firstly when the mirror server is selected, the following message will be displayed on the console:

Screen Shot 2022-09-05 at 12 07 11 PM

And secondly, all of the data index downloads report where they are coming from:

Screen Shot 2022-09-05 at 12 09 06 PM

So there are two independent ways to access the POPC2 website. The primary method is:

https://polishscores.org

This uses the front-end and back-end components on the same computer on the NIFC network in Poland.

The second fully independent mirror method:

https://polishscores.humdrum.org?mirror

This uses the Github front-end and the California backend.

Hybrid systems are possible, but probably not useful since the NIFC's websites are on the same (virtual) computer and would likely have problems at the same time:

https://polishscores.org?mirror

https://polishscores.humdrum.org

The second front-end website could be adjusted to use the mirror site by default, but then that would make copying the website to the primary location more complex, since a setting in the repository would need changing.

craigsapp commented 2 years ago

Another use of the main/mirror servers is to test timing for downloading indexes and other data from each source, which will be dependent on the computer speed, its internet load, and distance to the user, etc.

craigsapp commented 2 years ago

Also, the data server can be changed at any time by running one of these commands in the console:

popc2.SelectMainDataServer()
popc2.SelectMirrorDataServer()

Although these functions will not be too useful compared to the CGI selection of the data source since the data indexes are loaded before these function can be run manually (but the individual scores will start to be loaded from the alternate source after running one of the above functions).