Replace rubygems.org with taobao mirror to resolve network error in China

AI-generated summary

The discussion revolves around resolving the network error in China caused by rubygems.org being hosted on Amazon S3, which is blocked by the Great Firewall of China (GFW). fantasticfears provides a guide to replace rubygems.org with a Taobao mirror using a Docker installation. The guide involves adding a template to the app.yml file and rebuilding or bootstrapping the app.

xhh and ntrrobng suggest correcting the template file path to “templates/web.china.template.yml”, which has been implemented. Hyan thanks fantasticfears for the tip and raises concerns about potential service requests in the Discourse source code that could be blocked by the GFW, affecting self-hosted services in mainland China.

rubygems.org hosts its resource in Amazon S3 which is disturbed by GFW. So gem and bundle complain from time to time.

This guide assumes you used docker installation. This guide also has a version in Chinese. 中文指南

Add a template

Open your congiruation file, say, app.yml.

Add a reference to the china template:

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/sshd.template.yml"
  - "templates/web.template.yml"
  - "templates/web.china.yml"

Bootstrap docker container

Rebuild your app

./launcher rebuild app

Or bootstrap:

./launcher bootstrap app

You are done! Everything should work then.

7 Likes

I think the template file’s path should be “templates/web.china.template.yml”.

1 Like

it looks like this suggestion has been implemented. could you update the original topic so that it reflects the appropriate fix?

2 Likes

Hi @fantasticfears Thanks share this tips. I’m going to self-host Discourse to avoid Discourse-host issue like blocked from access and performance.
Do you know if Discouse source code itself has any service request that blocked by GFW. if it’s does a self-host cannot guarantee the sevice in mainland China.

ps. https://meta.discoursecn.org/t/discourse/28 is not available now.