Upgrading Shiro
mkdir shiro
cd shiro
wget https://raw.githubusercontent.com/Innei/Shiro/main/docker-compose.yml
wget https://raw.githubusercontent.com/Innei/Shiro/main/.env.template .env
vim .env # 修改你的 ENV 变量
docker compose up -d
docker compose pull # 后续更新镜像
Trouble Accessing TMDB
Solution 1
The simplest solution would be to set up a proxy for the server, but I didn't go with that because maintaining proxy rules and subscriptions on the server is a hassle.
Solution 2
Use a Cloudflare Worker to proxy requests to TMDB. The idea is to send requests headed for TMDB to Cloudflare first and let Cloudflare fetch the data for us. Cloudflare isn't blocked by the GFW, but the default workers.dev domain is, so you'll need to attach your own domain.
- Register a domain
Use NameSilo to register a domain. There are plenty of tutorials online for registering and then transferring it to Cloudflare, so I won't repeat the steps here;
- Create a Worker in Cloudflare. Here, I heavily modified Innei's code and deployed it to the Worker.
Once it's set up, it should look roughly like this:

image-20240821005837320
- Bind the domain from step 1 to the current Worker. Once that's done, it should look roughly like this:

image-20240821005940495
- Now you can access the TMDB API through your custom domain:
https://xxxxxx.xxx/api/tmdb/movie/1299537?language=zh-CN
Set up a reverse proxy from Shiro's access URL to the Worker you just deployed.
YAMLlocation /api/tmdb { proxy_pass http://liuyaowen.top; proxy_set_header Host liuyaowen.top; }Note that the proxy_set_header Host liuyaowen.top; line above must be changed, or you'll get the Please enable cookies. Error 1001 page.
Finally, when you visit your notes, you'll notice, huh, why is this cross-origin? That's because your Cloudflare domain and your website's domain are different, so you need to configure CORS: set your domain in Cloudflare and add a transform rule.

image-20240821010506038
All set—you can now enjoy using TMDB's LinkCard component.
Shiro Notes