The incident started when I saw a video on Bilibili:
The video mentioned that "we used container technology to run a complete Baota". This reminded me of a previous Bthost virtual hosting sales system, but I couldn't open the sales address mentioned in the video. I didn't try it out, but I saw in the video that it was still a virtual hosting mode with a bound domain name, and no other functions were demonstrated.
Idea:#
I have no way to deeply research how it works. I am not a technical person, and below is my personal idea. What I thought of is to use Docker containers to install multiple Baota instances and only expose the Baota login port for easy user access. If the main server has multiple IPs, assign each container a separate IP, or sell individual private network servers. If users need to access from the public network, they need to use a reverse proxy service. Alternatively, set up a reverse proxy server and map port 80 of each container to a fixed port on the server, and then use the reverse proxy to proxy port 80 to achieve the use of port 80 by each container. The same applies if the container uses other ports, as Linux can open more than 60,000 ports.
According to my reverse proxy idea, server A is used to host the containers, and server B is the reverse proxy. Container 1 needs to use port 80, so port 80 is mapped to port 801 on server A, and server B reverse proxies port 801 of server A to port 80 externally. If container 1 needs to use port 7788, port 7788 is mapped to port 8010, and server B reverse proxies port 8010 of server A to port 7788 externally.
Usage tutorial:#
First, install Docker and Docker-Compose: https://k7blog.com/NVEpVnWHFmd
Then, install Dockge: a beautiful and easy-to-use Docker Compose management platform https://k7blog.com/Dockge-yi-ge-mei-guan--yi-yong-de-Docker-Compose-guan-li-ping-tai
Open the IP+5001 port, create an admin user, and log in. Click "Compose" in the upper right corner to create a container template.
Fill in the compose.yaml with the following content. Since the default port for the Baota Docker image is 8888, if the external mapping is 8881, then the "ports" should be filled with 8881:8888.
version: "3.8"
services:
baota:
image: btpanel/baota
restart: unless-stopped
ports:
- 8888:8888
networks: {}
The container is now running, and you can access Baota using the IP+port. The default installation seems to be version 7.9.4, and you need the official Baota account password to log in. I directly installed the cracked version. Click "bash" to enter the terminal.
Enter the following command to update Baota to the latest cracked version:
curl http://io.bt.sy/install/update6.sh|bash
It seems that the default generated password is incorrect, and the terminal of this Dockge cannot paste, so the command can only be manually entered. Execute bt 5
to change the password, then execute bt 14
to view the default information of Baota, and then restart the container (Baota won't work without restarting). The tutorial ends here!
Future plans:#
I rented a high-performance 4h16g server from Vultr for $120 per month. Currently, I plan to experiment with the following and document the results:
- Can individual containers access the external network using a private network tunnel? 👌
- Can the Baota container function properly? 👌
- Test deploying PHP, Java, Node, Go, and other projects. 👌
- Will the containers affect each other? 👌
- How is the performance usage? 👌
Test the reverse proxy mode I mentioned above.
As for why I'm doing this, when I first started using the Internet, there were many experts who shared high-quality resources for free and provided free virtual hosting for us novices. There were also many interesting open-source projects. As I played around, I also wanted to contribute something to the Internet. If what I said is feasible, I happen to have some idle servers with annual fees that I can provide for free to everyone to play with.
Follow-up:#
Follow-up 1:#
Currently, I have tested 1. Can individual containers access the external network using a private network tunnel? and 5. How is the performance usage?
I followed the tutorial here: https://www.ywbj.cc/?p=985 to set up a simple private network tunnel, and the tunnel was successful. However, all my domain names have CF's CDN added, which uses a fully encrypted protocol. Both the browser-CF server and CF server-source server require SSL certificates. The browser-CF server part is handled by CF, but I need to handle the certificate between the CF server and the source server. I added the certificate inside the container, but it didn't work. This is currently a problem that needs to be solved.
As for performance, it's not considered a successful test yet. My host machine only has Docker installed, and I have set up three containers, each with Nginx and MySQL installed. I have optimized MySQL to use 8-16GB of memory. Currently, it is using around 2.5GB of memory and around 22.5GB of storage space. Memory usage is still quite high. On my personal server, which runs Nginx and MySQL and also hosts Cloudreve cloud storage and several other Docker containers, it only uses around 1.5GB of memory.
Next time I experiment, I will test whether the reverse proxy mode I mentioned earlier is feasible.
Follow-up 2:#
It's late at night and I couldn't sleep, so I rented an 8h16g server to continue testing. Currently, I am testing 3. Test deploying PHP, Java, Node, Go, and other projects.
I set up a Cloudreve cloud storage project, and it runs without any issues. The only thing is that the first time I use the container Baota terminal, it lags for a few minutes, but it works fine afterwards.
Then I set up a WordPress blog, and the test was also successful. So far, it seems that deploying other Java and Go projects is also problem-free. (I also installed Docker, but it didn't work as I expected.)
Most of the functions of the container Baota seem to work fine, except for some system functions that give errors, probably because I am using a cracked version of the Baota panel. As for whether the containers affect each other, I haven't encountered such a situation so far. I was most worried about files getting mixed up, but that hasn't happened. The only drawback is that it uses quite a bit of memory. Other than that, everything is fine. In the future, I plan to write a script to automatically set up container Baota and upgrade it to the cracked version.
Currently, I have some idle servers, but they are all low-end 4h4g servers. I am testing using high-performance and compute-intensive servers. This reminded me of an article I wrote before: "Want to Play with High-Performance Servers Without Money? Linode's $100 Credit is Awesome!" https://k7blog.com/wW3yPIMyzmd I can spend a little money to buy some accounts and set up servers for free, then experiment with container Baota and study a management panel for the LoveFRP private network tunnel. I can find a server with a good network or collect some free tunneling services, and provide them for free to everyone. This way, I can satisfy the expandability of playable servers and use them like normal machines, just a bit more complicated to set up, after all, they are free!
Later, I realized that my reverse proxy idea is the same as the effect of the private network tunnel, except that it can solve the certificate problem I encountered during testing. I won't test the other aspects for now. This article ends here, and my experimentation ends here. Next, I will figure out how to set up container Baota for self-service use by everyone. If I can't figure it out, I might abandon this plan. Waiting for my follow-up actions!!!