Feature #8639

Write a mirror pool dispatcher script

Added by intrigeri 2015-01-09 16:44:41 . Updated 2016-06-26 11:15:18 .

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Infrastructure
Target version:
Start date:
2015-01-09
Due date:
2016-04-15
% Done:

100%

Feature Branch:
451f:mirror-pool-dispatcher/master
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Deliverable for:
269


Subtasks


Related issues

Blocked by Tails - Feature #8637: Design how to convey the mirror pool's configuration to the dispatcher script Resolved 2015-01-09 2016-04-15
Blocks Tails - Feature #8640: Have the mirror pool dispatcher library audited Resolved 2016-05-10
Blocked by Tails - Feature #10294: Define format for per-mirror hostname Resolved 2015-09-28

History

#1 Updated by intrigeri 2015-01-09 16:44:55

  • blocked by Feature #8637: Design how to convey the mirror pool's configuration to the dispatcher script added

#2 Updated by intrigeri 2015-01-09 16:45:54

  • blocks Feature #8640: Have the mirror pool dispatcher library audited added

#3 Updated by intrigeri 2015-05-28 15:15:36

  • Target version changed from Sustainability_M1 to Tails_1.7

#4 Updated by intrigeri 2015-05-28 15:15:54

  • blocks #8668 added

#5 Updated by Anonymous 2015-05-28 23:51:07

Hi again,

I’ve written a very small and simple PHP draft here: https://tails.boum.org/blueprint/HTTP_mirror_pool/#index4h1
Simplicity might be the best idea, though, as the code needs to be audited (Feature #8640) before it can be used.

Best regards,
Tobias Frei

#6 Updated by Anonymous 2015-06-17 08:43:08

Hi Tobias,

thank you very much. I think we need to wait for https://labs.riseup.net/code/issues/8637 to be resolved though before being able to effectively write this script.

Cheers!

#7 Updated by intrigeri 2015-08-02 09:56:32

  • Due date set to 2016-04-15

#8 Updated by Anonymous 2015-09-26 14:56:07

  • Subject changed from Write a server-side mirror pool dispatcher script to Write a mirror pool dispatcher script

#9 Updated by Anonymous 2015-09-27 03:58:22

  • Status changed from Confirmed to In Progress
  • % Done changed from 0 to 10

#10 Updated by intrigeri 2015-09-28 02:12:22

Do you need a Git repo for that code? If yes: how do you want to call it?

#11 Updated by Anonymous 2015-09-28 03:06:09

good plan. let’s call it “mirror-pool-dispatcher” ?

#12 Updated by intrigeri 2015-09-28 03:13:47

> good plan. let’s call it “mirror-pool-dispatcher” ?

You got it: tails@git.tails.boum.org:mirror-pool-dispatcher.git

#13 Updated by intrigeri 2015-09-28 03:20:42

  • blocked by Feature #10294: Define format for per-mirror hostname added

#14 Updated by intrigeri 2015-09-28 03:22:11

  • % Done changed from 10 to 0

Please use a directory structure in that repo that’s compatible with using it as an ikiwiki overlay. See promotion-material.git for inspiration. I guess we’ll want to ship the code in wiki/src/lib/js/... or similar.

#15 Updated by intrigeri 2015-09-28 04:29:24

First bit of nitpicking: please make sure that all names in the code and API use an accurate nomenclature wrt. hostname vs. URL; we’ll be handling both kinds of entities, better avoid any confusion :)

#16 Updated by intrigeri 2015-10-05 11:04:59

May you please push the latest working version of the library, so that I can check the API and point Giorgio to it (Feature #10284, which is kinda urgent since Giorgio is supposed to be writing the extension as we speak)?

#17 Updated by intrigeri 2015-10-05 11:07:51

  • Description updated

#18 Updated by intrigeri 2015-10-05 11:08:44

  • % Done changed from 0 to 10

#19 Updated by Anonymous 2015-10-06 09:38:01

intrigeri wrote:
> May you please push the latest working version of the library, so that I can check the API and point Giorgio to it (Feature #10284, which is kinda urgent since Giorgio is supposed to be writing the extension as we speak)?

I will do that tomorrow, I would like to fix some things before doing so, otherwise there is no use in publishing it.

#20 Updated by Anonymous 2015-11-19 03:15:34

  • Priority changed from Normal to Elevated
  • Target version changed from Tails_1.7 to Tails_1.8

Still stuck with some details here. Raising prio.

#21 Updated by intrigeri 2015-12-19 08:40:04

  • Target version changed from Tails_1.8 to Tails_2.0

I wonder if we should perhaps simply bump this to 2.2?

#22 Updated by Anonymous 2016-02-04 12:09:34

  • Target version changed from Tails_2.0 to Tails_2.2

bumping to 2.2 because 2.0 is too late anyway.

#23 Updated by Anonymous 2016-03-18 23:31:42

  • Target version changed from Tails_2.2 to Tails_2.3

#24 Updated by Anonymous 2016-04-06 07:55:45

  • % Done changed from 10 to 50
  • Feature Branch set to mirror-pool-dispatcher/master

The script itself is ready.

I still need to apply it to the website - and modify it to work for other relevant usecases (Feature #11109)

#25 Updated by intrigeri 2016-04-13 17:24:53

> I still need to apply it to the website

FTR, this is tracked on Feature #8642 where I did the bulk of the work :)

#26 Updated by intrigeri 2016-04-14 20:18:30

On Feature #8640#note-13 geb wrote:

> * max_weight, url_fallback and mirrors.json could be global variable wrote in CAPS on top of the code for readability.

I agree it feels wrong to hard-code these constants directly in the functions. u, what do you think?

> * getRandomMirrorUrlPrefix() could be split in two functions, one that generate the new array, one that select it.

I personally see the array format, and its generation process, as an internal implementation detail of getRandomMirrorUrlPrefix(), and I see little value in extracting the generation part: it’s not as if that part of the code was useful, nor had an easy to define semantics, in isolation. YMMV :)

> * get(path) could maybe be avoided by using