homebox icon indicating copy to clipboard operation
homebox copied to clipboard

Allow apt mirrors

Open diffway opened this issue 1 year ago • 8 comments

diffway avatar Apr 06 '24 19:04 diffway

Again, thanks for this MR, that could be useful to many users.

Would you mind extending this idea a little, please ?

  • If we want to let the user replace deb.debian.org by another mirror, then we need to organise this differently, IMHO. For instance, by creating a mirror variable, with the default being deb.debian.org, and then, allow the users to override them.
  • Second, as this is a very sensitive value, then I would like to check that the value is valid before deploying the sources.list file, for instance by downloading first the release file (e.g. https://debian.mirror.serversaustralia.com.au/debian/dists/bookworm/Release)
  • Last but not least, documentation will need to mention this at least.

Again, thanks for your idea, I never thought about this.

progmaticltd avatar Apr 07 '24 17:04 progmaticltd

  1. Added mirror variable to 'system settings' of each config/defaults/version-*.yml file, added discriptive comment.

  2. My skills at ansible are not very strong, so maybe checking code could be done more efficiently, but it passes:

ROLE=bootstrap ansible-playbook -e version=small check.yml
...
TASK [bootstrap : Initialise and update the packages repository] ***********************************
included: ~/Projects/homebox-all/homebox/roles/bootstrap/tasks/check/apt.yml for homebox

TASK [bootstrap : Check apt mirror is valid for us] ************************************************
ok: [homebox] => (item=bookworm)
ok: [homebox] => (item=bookworm-updates)
ok: [homebox] => (item=bookworm-backports)

TASK [bootstrap : Check if we can run apt update without error] ************************************
...
  1. Added to section System settings which is IMO self descriptive. Also I'am not sure how to rebuild readthedocs.

diffway avatar Apr 08 '24 19:04 diffway

Thank you! Sorry for the late answer, I will check this asap.

progmaticltd avatar Apr 10 '24 19:04 progmaticltd

@progmaticltd, I've implemented everything as discussed.

diffway avatar May 09 '24 22:05 diffway

Hello, diffway, sorry for the late answer. Thank you very much, I am testing it right now, and I will come back to you. The only issue I found so far, is the fact that https does not work with all the mirrors.

arodier avatar May 25 '24 18:05 arodier

Actually, don't do anything, I can automatically detect if the mirror is only compatible with http and write the template accordingly.

arodier avatar May 30 '24 11:05 arodier