scripts icon indicating copy to clipboard operation
scripts copied to clipboard

Do you have the idea of mirror station

Open puzzle9 opened this issue 5 years ago • 1 comments

Because of the Internet, I can't download these resources

I tried nginx However, 403 of the server will be intercepted

server {
    listen  80;
    server_name _;

    location / {
        proxy_pass https://mrchromebox.tech/;
        proxy_set_header Host "mrchromebox.tech";
    }
}

puzzle9 avatar Jul 04 '20 15:07 puzzle9

If you want to host these on your local network, you probably would need to rewrite the DNS response for mrchromebox.tech to use the scripts "as is" because they "self update" when run, but that still won't help with the binary files.

Another plan is to fork this repository, change or comment out the lines where the scripts set the base URL to mrchromebox.tech and run your webserver against your local clone of your forked project.

https://github.com/MrChromebox/scripts/blob/c0c33bab58cbc646eb38660729bd132faa8d2197/firmware-util.sh#L15

The problem is these scripts are referencing LOTS of files also hosted by MrChromebox, the lines below are used by a majority of the functions to find the right files (out of hundreds available).

https://github.com/MrChromebox/scripts/blob/c0c33bab58cbc646eb38660729bd132faa8d2197/sources.sh#L9-L15

So unless you want to only support one or two models of Chromebook/Chromebox and hardcode those into your fork of the scripts, you will need to have a fair bit of storage for the binary files.

It seems easy, that if this line was changed to script_url="${script_url:-'https://raw.githubusercontent.com/MrChromebox/scripts/master/'}" then you could do the following, but you won't have the rw_legacy/firmware binaries/etc unless you mirror the rest of the files as well.

git clone https://github.com/MrChromebox/scripts
cd scripts
python3 -m http.server &
export script_url='http://localhost:8000/'
cd; curl -LO ${script_url}/firmware-util.sh
sudo install -Dt /usr/local/bin -m 755 firmware-util.sh
sudo firmware-util.sh

dragon788 avatar Oct 25 '21 16:10 dragon788