From 1c092a77b377d404d0def3a2bc49c21dd1f73401 Mon Sep 17 00:00:00 2001 From: zeaslity Date: Fri, 28 Jun 2024 17:26:02 +0800 Subject: [PATCH] =?UTF-8?q?[=20agent=20]=20=E4=BC=98=E5=8C=96=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/dataSources.local.xml | 2 +- Public/init-script-wdd.sh | 2 +- ...用的配置.json => 1-边际节点使用的Xray配置.json} | 36 ++++- .../Xray-终级方案/Shanghai-实际中转使用.json | 47 ++++++- .../Tokyo2-实际使用的Xray配置.json | 25 ---- .../Xray-终级方案/xjyd-gpu实际使用的代理.json | 125 ++++++++++++++++++ 常用脚本/uav脚本/uav关闭一些后端.sh | 13 ++ .../openai-web-dockercompose.yaml | 8 +- .../tailscale全互联/derper-new-tc-hk.sh | 27 ++++ .../tailscale全互联/derper-server-map.yaml | 21 +++ .../tailscale全互联/headscale-config.yaml | 11 +- .../headscale-pureIP-config-剔除上海.json | 35 ----- .../Oracle-Cloud/tailscale全互联/nginx-proxy.conf | 12 +- 13 files changed, 283 insertions(+), 81 deletions(-) rename v2ray示例/Xray-终级方案/{Osaka-1使用的配置.json => 1-边际节点使用的Xray配置.json} (50%) delete mode 100644 v2ray示例/Xray-终级方案/Tokyo2-实际使用的Xray配置.json create mode 100644 v2ray示例/Xray-终级方案/xjyd-gpu实际使用的代理.json create mode 100644 常用脚本/uav脚本/uav关闭一些后端.sh create mode 100644 部署应用/Oracle-Cloud/tailscale全互联/derper-new-tc-hk.sh create mode 100644 部署应用/Oracle-Cloud/tailscale全互联/derper-server-map.yaml delete mode 100644 部署应用/Oracle-Cloud/tailscale全互联/headscale-pureIP-config-剔除上海.json diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml index 4929923..ca1717b 100644 --- a/.idea/dataSources.local.xml +++ b/.idea/dataSources.local.xml @@ -1,6 +1,6 @@ - + #@ diff --git a/Public/init-script-wdd.sh b/Public/init-script-wdd.sh index c6546b9..7492698 100644 --- a/Public/init-script-wdd.sh +++ b/Public/init-script-wdd.sh @@ -10,7 +10,7 @@ docker_version=20.10.10 #oss_url_prefix="http://42.192.52.227:9000/octopus" oss_url_prefix="https://oss-s1.107421.xyz" 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 agent_config_url=https://happybirthday.107421.xyz/agent-config agent_version_url=https://happybirthday.107421.xyz/agent-version diff --git a/v2ray示例/Xray-终级方案/Osaka-1使用的配置.json b/v2ray示例/Xray-终级方案/1-边际节点使用的Xray配置.json similarity index 50% rename from v2ray示例/Xray-终级方案/Osaka-1使用的配置.json rename to v2ray示例/Xray-终级方案/1-边际节点使用的Xray配置.json index 71ec506..a01b4f1 100644 --- a/v2ray示例/Xray-终级方案/Osaka-1使用的配置.json +++ b/v2ray示例/Xray-终级方案/1-边际节点使用的Xray配置.json @@ -1,6 +1,7 @@ { "inbounds": [ { + "tag": "proxy", "protocol": "socks", "listen": "0.0.0.0", "port": 1234, @@ -10,16 +11,27 @@ "ip": "127.0.0.1", "userLevel": 0 } + }, + { + "protocol": "socks", + "tag": "cloudflare", + "listen": "0.0.0.0", + "port": 1235, + "settings": { + "auth": "noauth", + "udp": true, + "userLevel": 0 + } } ], "outbounds": [ { + "tag": "cloudflare", "protocol": "socks", "settings": { "servers": [ { "address": "127.0.0.1", - "ota": false, "port": 40000, "level": 0 } @@ -34,8 +46,28 @@ } }, { + "tag": "proxy", "protocol": "freedom" } - ] + ], + "routing": { + "domainStrategy": "IPIfNonMatch", + "rules": [ + { + "type": "field", + "inboundTag": [ + "cloudflare" + ], + "outboundTag": "cloudflare" + }, + { + "type": "field", + "inboundTag": [ + "proxy" + ], + "outboundTag": "proxy" + } + ] + } } diff --git a/v2ray示例/Xray-终级方案/Shanghai-实际中转使用.json b/v2ray示例/Xray-终级方案/Shanghai-实际中转使用.json index 416e804..541adea 100644 --- a/v2ray示例/Xray-终级方案/Shanghai-实际中转使用.json +++ b/v2ray示例/Xray-终级方案/Shanghai-实际中转使用.json @@ -1,7 +1,17 @@ { "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, "listen": "0.0.0.0", "protocol": "socks", @@ -24,6 +34,31 @@ "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": [ @@ -81,11 +116,19 @@ "domainStrategy": "IPIfNonMatch", "domainMatcher": "mph", "rules": [ + { + "type": "field", + "outboundTag": "proxy", + "inboundTag": [ + "proxy-socks", + "proxy-http" + ] + }, { "type": "field", "outboundTag": "direct", "inboundTag": [ - "proxy" + "direct" ] } ] diff --git a/v2ray示例/Xray-终级方案/Tokyo2-实际使用的Xray配置.json b/v2ray示例/Xray-终级方案/Tokyo2-实际使用的Xray配置.json deleted file mode 100644 index 4c1c405..0000000 --- a/v2ray示例/Xray-终级方案/Tokyo2-实际使用的Xray配置.json +++ /dev/null @@ -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" - } - ] -} \ No newline at end of file diff --git a/v2ray示例/Xray-终级方案/xjyd-gpu实际使用的代理.json b/v2ray示例/Xray-终级方案/xjyd-gpu实际使用的代理.json new file mode 100644 index 0000000..e1f58f5 --- /dev/null +++ b/v2ray示例/Xray-终级方案/xjyd-gpu实际使用的代理.json @@ -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" + ] + } + ] + } +} \ No newline at end of file diff --git a/常用脚本/uav脚本/uav关闭一些后端.sh b/常用脚本/uav脚本/uav关闭一些后端.sh new file mode 100644 index 0000000..99a8d31 --- /dev/null +++ b/常用脚本/uav脚本/uav关闭一些后端.sh @@ -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 \ No newline at end of file diff --git a/部署应用/Oracle-Cloud/openai-reverse-proxy/openai-web-dockercompose.yaml b/部署应用/Oracle-Cloud/openai-reverse-proxy/openai-web-dockercompose.yaml index ce1af86..4c73e2b 100644 --- a/部署应用/Oracle-Cloud/openai-reverse-proxy/openai-web-dockercompose.yaml +++ b/部署应用/Oracle-Cloud/openai-reverse-proxy/openai-web-dockercompose.yaml @@ -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 \ No newline at end of file + - 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 \ No newline at end of file diff --git a/部署应用/Oracle-Cloud/tailscale全互联/derper-new-tc-hk.sh b/部署应用/Oracle-Cloud/tailscale全互联/derper-new-tc-hk.sh new file mode 100644 index 0000000..57b8a5b --- /dev/null +++ b/部署应用/Oracle-Cloud/tailscale全互联/derper-new-tc-hk.sh @@ -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 diff --git a/部署应用/Oracle-Cloud/tailscale全互联/derper-server-map.yaml b/部署应用/Oracle-Cloud/tailscale全互联/derper-server-map.yaml new file mode 100644 index 0000000..973cb62 --- /dev/null +++ b/部署应用/Oracle-Cloud/tailscale全互联/derper-server-map.yaml @@ -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, + }, + ], + } + }, + }, +} diff --git a/部署应用/Oracle-Cloud/tailscale全互联/headscale-config.yaml b/部署应用/Oracle-Cloud/tailscale全互联/headscale-config.yaml index 97f9771..49d2b67 100644 --- a/部署应用/Oracle-Cloud/tailscale全互联/headscale-config.yaml +++ b/部署应用/Oracle-Cloud/tailscale全互联/headscale-config.yaml @@ -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 diff --git a/部署应用/Oracle-Cloud/tailscale全互联/headscale-pureIP-config-剔除上海.json b/部署应用/Oracle-Cloud/tailscale全互联/headscale-pureIP-config-剔除上海.json deleted file mode 100644 index 3a39d56..0000000 --- a/部署应用/Oracle-Cloud/tailscale全互联/headscale-pureIP-config-剔除上海.json +++ /dev/null @@ -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 - } - ] - } - } -} diff --git a/部署应用/Oracle-Cloud/tailscale全互联/nginx-proxy.conf b/部署应用/Oracle-Cloud/tailscale全互联/nginx-proxy.conf index f33f65c..e529a40 100644 --- a/部署应用/Oracle-Cloud/tailscale全互联/nginx-proxy.conf +++ b/部署应用/Oracle-Cloud/tailscale全互联/nginx-proxy.conf @@ -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; } - }