随笔 - 48, 文章 - 0, 评论 - 2, 阅读 - 15703
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

一键部署测试环境

Posted on   青柠时光  阅读(24)  评论(0编辑  收藏  举报

地址:https://github.com/forthcoming/bus/edit/main/Readme.md

## 功能点

* **mongo单节点**
* **redis单节点**
* **redis集群**
* **mysql单节点**
* **nginx**
* **miniconda**
* **supervisor**
* **clash**
* **tor**

## 环境准备

```shell
curl -fsSL https://get.docker.com | sh # 安装docker
```

## 启动

```shell
docker compose up -d # compose.yaml目录下执行
```

## 测试

```shell
mongo -uroot -proot # mongodb://root:root@localhost:27017
```

```shell
redis-cli
```

```shell
redis-cli -c -p 7000
```

```shell
mysql -h127.0.0.1 -uroot -proot
```

```python
# 浏览器设置好代理即可访问外网
# clash: 7890是https代理,7891是http代理
# tor: 9050是socks5代理,*hadowsocks也是socks5代理
# privoxy: 8118是https代理
# export https_proxy=http://127.0.0.1:7890;export http_proxy=http://127.0.0.1:7891; # 终端使用代理(或添加到~/.bashrc)

# socks5代理性能优于http(s)代理,有些应用只支持https,或者访问被墙的网站,需要将https代理转换成socks5代理给tor使用
# clash作为tor的后置代理,用于FQ,privoxy作为tor的前置代理,将https代理转换为socks5代理

# privoxy主要配置如下:
# listen-address 0.0.0.0:8118 # 0.0.0.0意思是同一局域网下的其他设备都能使用该代理
# forward-socks5t / 127.0.0.1:9050 . # 将https代理转换成tor的socks5代理

import requests

# 测试clash
r = requests.get('https://google.com', proxies={"https": "127.0.0.1:7890"})
print(r.text)

# 测试tor
r = requests.get('https://httpbin.org/ip', proxies={"http": "socks5://127.0.0.1:9050"})
print(r.text)

# 测试privoxy
r = requests.get('https://check.torproject.org', proxies={"https": "127.0.0.1:8118"})
print(r.text)
```

相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
点击右上角即可分享
微信分享提示