In the source of my fork, it has been adjusted to support the Chinese environment.
And also added the API interface of pdf, which can also be used to convert pdf.
Original Rendertron GitHub link
https://github.com/GoogleChrome/rendertron
The source of my fork has adjusted the Chinese environment, you can refer to the settings on my GitHub.
In addition, I also adjusted the source and added the pdf API, so if I use my source to build image, there will be an extra pdf button.
https://github.com/DevinY/rendertron
Error about 'ECONNREFUSED':
When your kernel lacks user namespace support or when you try to access a service in a container, you will encounter an ECONNREFUSED error,Here are two recommended ways to resolve this issue:
- [Recommended] - Use Jessie Frazelle' seccomp profile with the
-security-opt
flag - Use the
--cap-add SYS_ADMIN
flag
wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json
docker run -it -p 8080:8080 --security-opt seccomp=$HOME/chrome.json --name rendertron-container rendertron
2. The container of the image file created and executed using SYS_ADMIN:
docker run -it -p 8080:8080 --cap-add SYS_ADMIN --name rendertron-container rendertron
About Chinese Support
You may have noticed that the image built in the original docker environment is in English.
Therefore, it is also in English when capturing pictures through the API (test URL):
https://render-tron.appspot.com/screenshot/https://www.google.com
If you don't want to build the image yourself
You can directly use the image I built first,
The execution method is as follows:
1. First download chrome.json to the home directory of your host ( you only need to do it once, if you use a Mac system without wget installed, please use other methods to download the json file ):
wget https://raw.githubusercontent.com/jfrazelle/dotfiles/master/etc/docker/seccomp/chrome.json -O ~/chrome.json
2. Create a container. Here I added the --rm parameter. When stopping, I want to remove the container. Try the function of capturing pictures, and it will be in Chinese.
docker run --rm -it -p 8080:8080 --security-opt seccomp=$HOME/chrome.json --name rendertron-container deviny/rendertron
Note:
If you use npm install
to install and use npm start
to execute,
If your system environment is Chinese, Chinese can be displayed.
npm start
> bot-render@1.0.0 start /Users/devin/rendertron
> node src/main.js
Chrome launched with debugging on port 54791
Listening on port 3000
For a detailed introduction on how rendertron is actually used, please see the video below:
No Comment
Post your comment