[ 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

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="dataSourceStorageLocal" created-in="IU-241.14494.240"> <component name="dataSourceStorageLocal" created-in="IU-241.17011.79">
<data-source name="腾讯云-成都" uuid="79c9466f-d8a3-418a-b54a-f6e314306a0c"> <data-source name="腾讯云-成都" uuid="79c9466f-d8a3-418a-b54a-f6e314306a0c">
<database-info product="MySQL" version="8.0.27" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-java-8.0.25 (Revision: 08be9e9b4cba6aa115f9b27b215887af40b159e0)" dbms="MYSQL" exact-version="8.0.27" exact-driver-version="8.0"> <database-info product="MySQL" version="8.0.27" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-java-8.0.25 (Revision: 08be9e9b4cba6aa115f9b27b215887af40b159e0)" dbms="MYSQL" exact-version="8.0.27" exact-driver-version="8.0">
<extra-name-characters>#@</extra-name-characters> <extra-name-characters>#@</extra-name-characters>

View File

@@ -10,7 +10,7 @@ docker_version=20.10.10
#oss_url_prefix="http://42.192.52.227:9000/octopus" #oss_url_prefix="http://42.192.52.227:9000/octopus"
oss_url_prefix="https://oss-s1.107421.xyz" oss_url_prefix="https://oss-s1.107421.xyz"
modify_ssh_port=22333 modify_ssh_port=22333
octopus_agent_path=/usr/local/etc/octpus-agent octopus_agent_path=/usr/local/etc/octopus-agent
octopus_agent_url=https://happybirthday.107421.xyz/octopus-agent octopus_agent_url=https://happybirthday.107421.xyz/octopus-agent
agent_config_url=https://happybirthday.107421.xyz/agent-config agent_config_url=https://happybirthday.107421.xyz/agent-config
agent_version_url=https://happybirthday.107421.xyz/agent-version agent_version_url=https://happybirthday.107421.xyz/agent-version

View File

@@ -1,6 +1,7 @@
{ {
"inbounds": [ "inbounds": [
{ {
"tag": "proxy",
"protocol": "socks", "protocol": "socks",
"listen": "0.0.0.0", "listen": "0.0.0.0",
"port": 1234, "port": 1234,
@@ -10,16 +11,27 @@
"ip": "127.0.0.1", "ip": "127.0.0.1",
"userLevel": 0 "userLevel": 0
} }
},
{
"protocol": "socks",
"tag": "cloudflare",
"listen": "0.0.0.0",
"port": 1235,
"settings": {
"auth": "noauth",
"udp": true,
"userLevel": 0
}
} }
], ],
"outbounds": [ "outbounds": [
{ {
"tag": "cloudflare",
"protocol": "socks", "protocol": "socks",
"settings": { "settings": {
"servers": [ "servers": [
{ {
"address": "127.0.0.1", "address": "127.0.0.1",
"ota": false,
"port": 40000, "port": 40000,
"level": 0 "level": 0
} }
@@ -34,8 +46,28 @@
} }
}, },
{ {
"tag": "proxy",
"protocol": "freedom" "protocol": "freedom"
} }
],
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"type": "field",
"inboundTag": [
"cloudflare"
],
"outboundTag": "cloudflare"
},
{
"type": "field",
"inboundTag": [
"proxy"
],
"outboundTag": "proxy"
}
] ]
}
} }

View File

@@ -1,7 +1,17 @@
{ {
"inbounds": [ "inbounds": [
{ {
"tag": "socks", "tag": "proxy-http",
"port": 22889,
"listen": "0.0.0.0",
"protocol": "http",
"settings": {
"allowTransparent": true,
"userLevel": 0
}
},
{
"tag": "proxy-socks",
"port": 22888, "port": 22888,
"listen": "0.0.0.0", "listen": "0.0.0.0",
"protocol": "socks", "protocol": "socks",
@@ -24,6 +34,31 @@
"udp": true, "udp": true,
"allowTransparent": false "allowTransparent": false
} }
},
{
"tag": "direct",
"port": 22887,
"listen": "0.0.0.0",
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
],
"routeOnly": false
},
"settings": {
"auth": "password",
"accounts": [
{
"user": "zeaslity",
"pass": "lovemm.23"
}
],
"udp": true,
"allowTransparent": false
}
} }
], ],
"outbounds": [ "outbounds": [
@@ -81,11 +116,19 @@
"domainStrategy": "IPIfNonMatch", "domainStrategy": "IPIfNonMatch",
"domainMatcher": "mph", "domainMatcher": "mph",
"rules": [ "rules": [
{
"type": "field",
"outboundTag": "proxy",
"inboundTag": [
"proxy-socks",
"proxy-http"
]
},
{ {
"type": "field", "type": "field",
"outboundTag": "direct", "outboundTag": "direct",
"inboundTag": [ "inboundTag": [
"proxy" "direct"
] ]
} }
] ]

View File

@@ -1,25 +0,0 @@
{
"log": {
"access": "/var/log/xray/access.log",
"error": "/var/log/xray/error.log",
"loglevel": "warning"
},
"inbounds": [
{
"protocol": "socks",
"listen": "0.0.0.0",
"port": 1234,
"settings": {
"auth": "noauth",
"udp": true,
"ip": "127.0.0.1",
"userLevel": 0
}
}
],
"outbounds": [
{
"protocol": "freedom"
}
]
}

View File

@@ -0,0 +1,125 @@
{
"inbounds": [
{
"tag": "proxy-socks",
"port": 22888,
"listen": "127.0.0.1",
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
],
"routeOnly": false
},
"settings": {
"auth": "password",
"accounts": [
{
"user": "zeaslity",
"pass": "lovemm.23"
}
],
"udp": true,
"allowTransparent": false
}
},
{
"tag": "direct",
"port": 22887,
"listen": "0.0.0.0",
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
],
"routeOnly": false
},
"settings": {
"auth": "password",
"accounts": [
{
"user": "zeaslity",
"pass": "lovemm.23"
}
],
"udp": true,
"allowTransparent": false
}
}
],
"outbounds": [
{
"tag": "proxy",
"protocol": "trojan",
"settings": {
"servers": [
{
"address": "140.238.14.103",
"method": "chacha20",
"ota": false,
"password": "V2ryStr0ngP0ss",
"port": 443,
"level": 1
}
]
},
"streamSettings": {
"network": "tcp",
"security": "tls",
"tlsSettings": {
"allowInsecure": false,
"serverName": "xx.s4.cc.hh.107421.xyz",
"show": false
}
},
"mux": {
"enabled": false,
"concurrency": -1
}
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "block",
"protocol": "blackhole",
"settings": {
"response": {
"type": "http"
}
}
}
],
"dns": {
"servers": [
"1.1.1.1",
"8.8.8.8"
]
},
"routing": {
"domainStrategy": "IPIfNonMatch",
"domainMatcher": "mph",
"rules": [
{
"type": "field",
"outboundTag": "proxy",
"inboundTag": [
"proxy-socks"
]
},
{
"type": "field",
"outboundTag": "direct",
"inboundTag": [
"direct"
]
}
]
}
}

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
namespace=zjjt
all_error_app_list=(cmii-uav-user cmii-uav-oauth cmii-admin-user cmii-admin-gateway cmii-uav-gateway cmii-uav-cloud-live cmii-uav-material-warehouse)
for app in ${all_error_app_list[@]};do
echo "current app is ${app}"
old_replicas=$(kubectl -n ${namespace} get deployment ${app} -o jsonpath='{.spec.replicas}')
kubectl -n ${namespace} scale deployment ${app} --replicas=0
sleep 1
kubectl -n ${namespace} scale deployment ${app} --replicas=${old_replicas}
done

View File

@@ -6,6 +6,10 @@ services:
ports: ports:
- 3002:3000 - 3002:3000
environment: 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 - 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 # https://myheadscale.example.com:443
# #
#server_url: http://127.0.0.1:8080 server_url: http://127.0.0.1:8080
server_url: https://tailscale.107421.xyz #server_url: https://tailscale.107421.xyz
# Address to listen to / bind to on the server # Address to listen to / bind to on the server
# #
@@ -55,7 +55,7 @@ noise:
# and the associated prefix length, delimited by a slash. # and the associated prefix length, delimited by a slash.
ip_prefixes: ip_prefixes:
- fd7a:115c:a1e0::/48 - 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 # DERP is a relay system that Tailscale uses when a direct
# connection cannot be established. # connection cannot be established.
@@ -96,7 +96,8 @@ derp:
# #
# paths: # paths:
# - /etc/headscale/derp-example.yaml # - /etc/headscale/derp-example.yaml
paths: [] paths:
- /root/app-install/derper/derper-map.yaml
# If enabled, a worker will be set up to periodically # If enabled, a worker will be set up to periodically
# refresh the given sources and update the derpmap # refresh the given sources and update the derpmap
@@ -196,8 +197,8 @@ acl_policy_path: ""
dns_config: dns_config:
# List of DNS servers to expose to clients. # List of DNS servers to expose to clients.
nameservers: nameservers:
- 8.8.8.8
- 1.1.1.1 - 1.1.1.1
- 8.8.8.8
- 223.5.5.5 - 223.5.5.5
- 8.8.4.4 - 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 { server {
listen 80;
listen [::]:80;
listen 443 ssl http2; listen 22443 ssl http2;
listen [::]:443 ssl http2; listen [::]:22443 ssl http2;
ssl_certificate /etc/nginx/conf.d/ssl_key/tailscale.107421.xyz.cert.pem; 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; ssl_certificate_key /etc/nginx/conf.d/ssl_key/tailscale.107421.xyz.key.pem;
@@ -20,12 +18,11 @@ server {
server_name tailscale.107421.xyz; server_name tailscale.107421.xyz;
location /deperconfig { location /derper {
root /root/deper; root /root/app-install/;
autoindex on; # 开启目录浏览功能; autoindex on; # 开启目录浏览功能;
} }
location / { location / {
proxy_pass http://127.0.0.1:8080; proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1; proxy_http_version 1.1;
@@ -40,5 +37,4 @@ server {
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
} }
} }