[ agent ] 优化部分内容

This commit is contained in:
zeaslity
2024-06-28 17:26:02 +08:00
parent c889b516e5
commit 1c092a77b3
13 changed files with 283 additions and 81 deletions

View File

@@ -6,6 +6,10 @@ services:
ports:
- 3002:3000
environment:
- OPENAI_API_KEY=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
- OPENAI_API_KEY=sk-proj-lCRIbBe3ex7VJP5GzAklT3BlbkFJbOcB4cXRQKk7pNZjBCHM
- GOOGLE_API_KEY=AIzaSyDWb85Lv7qxz9XK0u3DKX35rY8OhN73nVM
- ANTHROPIC_API_KEY=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
- ANTHROPIC_API_VERSION=3
- CODE=lovemm.23
- HIDE_USER_API_KEY=1
- HIDE_USER_API_KEY=1
- CUSTOM_MODELS=-gpt-4,-gpt-4-0613,-gpt-4-32k,-gpt-4-32k-0613,-gpt-4-turbo,-gpt-4-turbo-preview,-gpt-4-turbo-2024-04-09,-gpt-3.5-turbo-1106,-gpt-4-vision-preview,-claude-instant-1.2,-claude-2.0,-claude-2.1,-claude-3-haiku-20240307,-gemini-pro-vision,-gemini-1.0-pro,-gpt-4-turbo-2024-04-09

View File

@@ -0,0 +1,27 @@
# 参考 https://www.boris1993.com/self-hosting-tailscale-derp.html
# /etc/systemd/system/derper-server.service
[Unit]
# 服务名字
Description=Tailscale DERP Server
# 在网络服务启动后启动这个服务
After=network.target
[Service]
# 改成你的用户名
User=root
# 总是自动重新启动
Restart=always
# 重启前等待5秒
RestartSec=5
# 启动derper的命令跟上面测试用的命令一样
ExecStart=/root/go/bin/derper -c=/root/app-install/derper/derper.conf -hostname derper.107421.xyz -a :21443 -certmode manual -certdir /root/app-install/derper/
# 停止derper的命令
ExecStop=/bin/kill $MAINPID
# 赋予CAP_NET_BIND_SERVICE这个capability
#AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,21 @@
{
// 前略
"derpMap": {
// 如果想要所有节点只使用自建中继的话,就启用这条配置
// "OmitDefaultRegions": true,
"Regions": {
"HongKong": {
"RegionID": 900,
"RegionCode": "Tencent-HongKong",
"Nodes": [
{
"Name": "Tencent-HongKong",
"RegionID": 900,
"HostName": "derper.107421.xyz",
"DERPPort": 21443,
},
],
}
},
},
}

View File

@@ -9,8 +9,8 @@
#
# https://myheadscale.example.com:443
#
#server_url: http://127.0.0.1:8080
server_url: https://tailscale.107421.xyz
server_url: http://127.0.0.1:8080
#server_url: https://tailscale.107421.xyz
# Address to listen to / bind to on the server
#
@@ -55,7 +55,7 @@ noise:
# and the associated prefix length, delimited by a slash.
ip_prefixes:
- fd7a:115c:a1e0::/48
- 10.20.0.0/16
- 100.74.0.0/16
# DERP is a relay system that Tailscale uses when a direct
# connection cannot be established.
@@ -96,7 +96,8 @@ derp:
#
# paths:
# - /etc/headscale/derp-example.yaml
paths: []
paths:
- /root/app-install/derper/derper-map.yaml
# If enabled, a worker will be set up to periodically
# refresh the given sources and update the derpmap
@@ -196,8 +197,8 @@ acl_policy_path: ""
dns_config:
# List of DNS servers to expose to clients.
nameservers:
- 8.8.8.8
- 1.1.1.1
- 8.8.8.8
- 223.5.5.5
- 8.8.4.4

View File

@@ -1,35 +0,0 @@
{
"Regions": {
"9002": {
"RegionID": 9002,
"RegionCode": "seoul",
"RegionName": "Oracle Seoul 2",
"Nodes": [
{
"Name": "seoul-2",
"RegionID": 9002,
"DERPPort": 32345,
"HostName": "140.238.30.110",
"IPv4": "140.238.30.110",
"IPv6": "2603:c022:8008:8923:c24a:27b6:b3de:ab91",
"InsecureForTests": true
}
]
},
"7001": {
"RegionID": 7001,
"RegionCode": "tc-hk",
"RegionName": "Tencent HongKong",
"Nodes": [
{
"Name": "tc-hk",
"RegionID": 7001,
"DERPPort": 32345,
"HostName": "43.154.83.213",
"IPv4": "43.154.83.213",
"InsecureForTests": true
}
]
}
}
}

View File

@@ -5,11 +5,9 @@ map $http_upgrade $connection_upgrade {
}
server {
listen 80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
listen 22443 ssl http2;
listen [::]:22443 ssl http2;
ssl_certificate /etc/nginx/conf.d/ssl_key/tailscale.107421.xyz.cert.pem;
ssl_certificate_key /etc/nginx/conf.d/ssl_key/tailscale.107421.xyz.key.pem;
@@ -20,12 +18,11 @@ server {
server_name tailscale.107421.xyz;
location /deperconfig {
root /root/deper;
location /derper {
root /root/app-install/;
autoindex on; # 开启目录浏览功能;
}
location / {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
@@ -40,5 +37,4 @@ server {
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
}
}