fix: remove hardcoded http:// prefix from archlinux_mirror URLs#1704
fix: remove hardcoded http:// prefix from archlinux_mirror URLs#1704antonym wants to merge 1 commit intodevelopmentfrom
Conversation
Fixes issue where setting archlinux_mirror to an HTTPS URL would result in malformed URLs like http://https://mirror.example.com/... Changes: - Remove hardcoded http:// prefix from archiso_http_srv parameter - Remove hardcoded http:// prefix from kernel URL - Remove hardcoded http:// prefix from initrd URL - Add http:// prefix to default archlinux mirror for backward compatibility Now respects the protocol specified in the archlinux_mirror configuration, allowing both HTTP and HTTPS mirrors to work correctly. Fixes #1703 Co-authored-by: Antony Messerli <antonym@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where setting archlinux_mirror to an HTTPS URL would result in malformed URLs due to hardcoded http:// prefixes. The fix removes the hardcoded protocol prefixes from the template and adds the protocol to the default mirror value for backward compatibility.
- Removes hardcoded
http://prefixes from the Arch Linux iPXE template - Adds
http://protocol prefix to the default Arch Linux mirror configuration - Aligns Arch Linux mirror handling with other distributions in the codebase
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| roles/netbootxyz/templates/menu/archlinux.ipxe.j2 | Removes hardcoded http:// prefixes from archiso_http_srv parameter, kernel URL, and initrd URL to respect the protocol specified in archlinux_mirror |
| roles/netbootxyz/defaults/main.yml | Adds http:// prefix to the default archlinux mirror value to maintain backward compatibility with existing configurations that don't specify a protocol |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| set params archiso_http_srv=http://${real_archlinux_mirror}/${archlinux_base_dir}/iso/${arch_version}/ archisobasedir=arch cms_verify=y ${ipparam} net.ifnames=0 {{ kernel_params }} | ||
| kernel http://${archlinux_mirror}/${dir}/${os_arch}/vmlinuz-linux ${params} | ||
| initrd http://${archlinux_mirror}/${dir}/${os_arch}/initramfs-linux.img | ||
| set params archiso_http_srv=${real_archlinux_mirror}/${archlinux_base_dir}/iso/${arch_version}/ archisobasedir=arch cms_verify=y ${ipparam} net.ifnames=0 {{ kernel_params }} |
There was a problem hiding this comment.
Inconsistent variable usage: this line uses real_archlinux_mirror while lines 40-41 use archlinux_mirror. In static IP configurations, real_archlinux_mirror contains the resolved IP address from the nslookup command (line 18), but with the protocol prefix now included in archlinux_mirror, the nslookup will fail. This could cause the archiso_http_srv parameter to receive an unresolved hostname with protocol prefix in static IP scenarios, potentially breaking the boot process.
| set params archiso_http_srv=${real_archlinux_mirror}/${archlinux_base_dir}/iso/${arch_version}/ archisobasedir=arch cms_verify=y ${ipparam} net.ifnames=0 {{ kernel_params }} | |
| set params archiso_http_srv=${archlinux_mirror}/${archlinux_base_dir}/iso/${arch_version}/ archisobasedir=arch cms_verify=y ${ipparam} net.ifnames=0 {{ kernel_params }} |
Fixes issue where setting archlinux_mirror to an HTTPS URL would result in malformed URLs like http://https://mirror.example.com/...
Changes:
Now respects the protocol specified in the archlinux_mirror configuration, allowing both HTTP and HTTPS mirrors to work correctly.
Fixes #1703