Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added redirect to pull non-existant local assets from live_endpoint url #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sjuerges
Copy link

@sjuerges sjuerges commented Aug 4, 2024

This PR implements #69

It achieves that the nginx can serve local assets as before, but it will send HTTP 302 redirects to the standard live_endpoint url for files that are NOT found locally.

@antonym
Copy link
Member

antonym commented Aug 9, 2024

Seemed to work, but I notice it seems to have issues with the assets that contain a part2 file. It only downloads the first part if not found locally but fails on the second part.

@sjuerges
Copy link
Author

sjuerges commented Aug 9, 2024

Weird, wasnt an issue for me, specifically tested for it:
(local):

172.18.0.5 - - [03/Aug/2024:22:02:31 +0000] "GET /asset-mirror/releases/download/Galileo-11-2023-e0c48f1f/vmlinuz HTTP/1.1" 200 12881792 "-" "iPXE/1.21.1+ (g5a9f4)"                                                                            
172.18.0.5 - - [03/Aug/2024:22:02:32 +0000] "GET /asset-mirror/releases/download/Galileo-11-2023-e0c48f1f/initrd HTTP/1.1" 200 104039372 "-" "iPXE/1.21.1+ (g5a9f4)"                                                                            
172.18.0.5 - - [03/Aug/2024:22:02:34 +0000] "GET /asset-mirror/releases/download/Galileo-11-2023-e0c48f1f//airootfs.sfs HTTP/1.1" 206 1 "-" "curl/8.4.0"                                                                                        
172.18.0.5 - - [03/Aug/2024:22:02:52 +0000] "GET /asset-mirror/releases/download/Galileo-11-2023-e0c48f1f//airootfs.sfs HTTP/1.1" 200 2097151999 "-" "curl/8.4.0"                                                                               
172.18.0.5 - - [03/Aug/2024:22:02:53 +0000] "HEAD /asset-mirror/releases/download/Galileo-11-2023-e0c48f1f//airootfs.sfs.part2 HTTP/1.1" 200 0 "-" "curl/8.4.0"                                                                                 
172.18.0.5 - - [03/Aug/2024:22:02:55 +0000] "GET /asset-mirror/releases/download/Galileo-11-2023-e0c48f1f//airootfs.sfs.part2 HTTP/1.1" 200 258531329 "-" "curl/8.4.0"  

(remote):

172.18.0.5 - - [03/Aug/2024:21:55:07 +0000] "GET /ubuntu-squash/releases/download/1.2-e7db33e3/vmlinuz HTTP/1.1" 302 145 "-" "iPXE/1.21.1+ (g5a9f4)"                                                                                            
172.18.0.5 - - [03/Aug/2024:21:55:09 +0000] "GET /ubuntu-squash/releases/download/1.2-e7db33e3/initrd HTTP/1.1" 302 145 "-" "iPXE/1.21.1+ (g5a9f4)"                                                                                             
172.18.0.5 - - [03/Aug/2024:21:55:19 +0000] "HEAD /ubuntu-squash/releases/download/1.2-e7db33e3/filesystem.squashfs HTTP/1.1" 302 0 "-" "curl/7.67.0"                                                                                           
172.18.0.5 - - [03/Aug/2024:21:55:19 +0000] "GET /ubuntu-squash/releases/download/1.2-e7db33e3/filesystem.squashfs HTTP/1.1" 302 145 "-" "curl/7.67.0"                                                                                          
172.18.0.5 - - [03/Aug/2024:21:57:05 +0000] "HEAD /ubuntu-squash/releases/download/1.2-e7db33e3/filesystem.squashfs.part2 HTTP/1.1" 302 0 "-" "curl/7.67.0"                                                                                     
172.18.0.5 - - [03/Aug/2024:21:57:05 +0000] "GET /ubuntu-squash/releases/download/1.2-e7db33e3/filesystem.squashfs.part2 HTTP/1.1" 302 145 "-" "curl/7.67.0" 

@antonym Which image did you test with, maybe I can replicate/debug?

@nrvale0
Copy link

nrvale0 commented Aug 19, 2024

Related but tangential. Hope that's ok...

If I wanted to test this using netboot.xyz running in Docker Compose would it be sufficient to just pull the branch and then use the docker-compose.yml.example? I suspect I might also have to modify the image name also? Or just do a docker build of the default Dockerfile + tags but while this branch is selected in order to pull the modified default file?

EDIT: Yes, changing to the PR branch and rebuilding the image with the same tag/name worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants