Hi,
Sometimes when I perform upgrades via the web UI, discourse tells me to run
cd /var/discourse
git pull
./launcher rebuild app
Since the rebuild
process connects to github several times and github is half-blocked in China, where my server is hosted, I have to setup http/https proxy to better access github. Here is a comparison between visiting youtube w/o proxy and w/ proxy:
root@iosre:/var/discourse# wget https://youtube.com
--2021-06-10 23:55:05-- https://youtube.com/
Resolving youtube.com (youtube.com)... 66.220.152.17, 2001::3d6f:fadc
Connecting to youtube.com (youtube.com)|66.220.152.17|:443... ^C
root@iosre:/var/discourse# export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7891
root@iosre:/var/discourse# wget https://youtube.com
--2021-06-10 23:56:12-- https://youtube.com/
Connecting to 127.0.0.1:7890... connected.
Proxy request sent, awaiting response... 301 Moved Permanently
Location: https://www.youtube.com/ [following]
--2021-06-10 23:56:13-- https://www.youtube.com/
Connecting to 127.0.0.1:7890... connected.
Proxy request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: âindex.htmlâ
index.html [ <=> ] 510.58K 813KB/s in 0.6s
2021-06-10 23:56:14 (813 KB/s) - âindex.htmlâ saved [522830]
However when I run ./launcher rebuild image
, the script will enter the app and perform all operations inside the docker, where the network environment is different from the proxied host, and Iâm not able to access youtube, so rebuild will fail most of the time.
root@iosre:/var/discourse# ./launcher enter app
root@iosre-app:/var/www/discourse# wget https://youtube.com
--2021-06-10 15:59:57-- https://youtube.com/
Resolving youtube.com (youtube.com)... 69.171.248.128, 2001::d238:33c1
Connecting to youtube.com (youtube.com)|69.171.248.128|:443... ^C
root@iosre-app:/var/www/discourse# export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7891
root@iosre-app:/var/www/discourse# wget https://youtube.com
--2021-06-10 16:00:10-- https://youtube.com/
Connecting to 127.0.0.1:7890... failed: Connection refused.
My question is, what can I do to make use of the host proxy inside the docker, especially in ./launcher rebuild app
?