diff --git a/frpc-client/frpc.toml b/frpc-client/frpc.toml index 2c2f03a..9489074 100644 --- a/frpc-client/frpc.toml +++ b/frpc-client/frpc.toml @@ -19,10 +19,66 @@ localPort = 443 remotePort = 443 [[proxies]] -name = "zerotier" +name = "tailscale3478u" type = "udp" localIP = "127.0.0.1" -localPort = 9993 -remotePort = 9993 +localPort = 3478 +remotePort = 3478 + +[[proxies]] +name = "tailscale3478t" +type = "tcp" +localIP = "127.0.0.1" +localPort = 3478 +remotePort = 3478 + +[[proxies]] +name = "tailscale50443t" +type = "tcp" +localIP = "127.0.0.1" +localPort = 50443 +remotePort = 50443 + +[[proxies]] +name = "tailscale41641u" +type = "udp" +localIP = "127.0.0.1" +localPort = 41641 +remotePort = 41641 + +[[proxies]] +name = "tailscale50443u" +type = "udp" +localIP = "127.0.0.1" +localPort = 50443 +remotePort = 50443 + +[[proxies]] +name = "tailscale12345u" +type = "udp" +localIP = "127.0.0.1" +localPort = 12345 +remotePort = 12345 + +[[proxies]] +name = "tailscale12345" +type = "tcp" +localIP = "127.0.0.1" +localPort = 12345 +remotePort = 12345 + +[[proxies]] +name = "tailscale8881t" +type = "tcp" +localIP = "127.0.0.1" +localPort = 8881 +remotePort = 8881 + +[[proxies]] +name = "tailscale8881u" +type = "udp" +localIP = "127.0.0.1" +localPort = 8881 +remotePort = 8881 diff --git a/nginx/conf.d/tailscale.conf b/nginx/conf.d/tailscale.conf new file mode 100644 index 0000000..d2e09d0 --- /dev/null +++ b/nginx/conf.d/tailscale.conf @@ -0,0 +1,45 @@ +server { + listen 443 ssl; + server_name tailscale.deepseak.icu; + + ssl_certificate /etc/letsencrypt/live/tailscale.deepseak.icu/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/tailscale.deepseak.icu/privkey.pem; + + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + + + client_max_body_size 5m; + + # 匹配 /web 开头的请求 + location ^~ /web { + proxy_pass http://localhost:3009; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + # ... 原有跨域配置保持不变 ... + } + + + + + # 匹配其他请求 + location / { + proxy_pass http://localhost:3008; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + + } + + +} + + diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 8489e28..cae2956 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -13,7 +13,7 @@ events { http { include /etc/nginx/mime.types; default_type application/octet-stream; - + include /etc/nginx/conf.d/*.conf; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; @@ -121,7 +121,7 @@ http { # 增加一个空的server,用于申请证书 server { listen 80; - server_name active.deepseak.icu; + server_name aaa.deepseak.icu; } } diff --git a/nginx/tailscale.conf b/nginx/tailscale.conf deleted file mode 100644 index ddaa696..0000000 --- a/nginx/tailscale.conf +++ /dev/null @@ -1,27 +0,0 @@ -server { - listen 30080; - server_name localhost; - - location / { - # 代理配置 - proxy_pass http://localhost:3008; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - # 跨域配置 - add_header 'Access-Control-Allow-Origin' '*' always; - add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always; - add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always; - - # 处理 OPTIONS 请求 - if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain; charset=utf-8'; - add_header 'Content-Length' 0; - return 204; - } - } -} diff --git a/nginx/updateConfig.sh b/nginx/updateConfig.sh index 08f24c1..3505cde 100644 --- a/nginx/updateConfig.sh +++ b/nginx/updateConfig.sh @@ -1,9 +1,17 @@ #!/bin/bash -# 备份并覆盖所有.conf配置文件 -for conf in *.conf; do - cp "/etc/nginx/$conf" "/etc/nginx/${conf}.bak" 2>/dev/null || true - cp "$conf" /etc/nginx/ +# 创建 conf.d 目录(如果不存在) +mkdir -p /etc/nginx/conf.d + +# 备份并覆盖 nginx.conf 文件 +cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak +cp nginx.conf /etc/nginx/ + +# 备份并覆盖 conf.d 目录下的所有 .conf 文件 +for conf in conf.d/*.conf; do + filename=$(basename "$conf") + cp "/etc/nginx/conf.d/$filename" "/etc/nginx/conf.d/${filename}.bak" 2>/dev/null || true + cp "$conf" /etc/nginx/conf.d/ done # 测试并重载配置 @@ -11,8 +19,12 @@ if nginx -t; then systemctl reload nginx echo "配置已生效,HTTPS已启用" else - echo "配置测试失败,正在恢复所有备份" - for conf in *.conf; do - mv -f "/etc/nginx/${conf}.bak" "/etc/nginx/$conf" 2>/dev/null || true + echo "配置测试失败,已恢复备份" + # 恢复 nginx.conf 备份 + cp /etc/nginx/nginx.conf.bak /etc/nginx/nginx.conf + # 恢复 conf.d 目录下的所有 .conf 文件备份 + for conf in conf.d/*.conf; do + filename=$(basename "$conf") + mv -f "/etc/nginx/conf.d/${filename}.bak" "/etc/nginx/conf.d/$filename" 2>/dev/null || true done fi \ No newline at end of file diff --git a/tailscale/config.yaml b/tailscale/config.yaml index 44037fe..9e97fba 100644 --- a/tailscale/config.yaml +++ b/tailscale/config.yaml @@ -38,7 +38,7 @@ grpc_listen_addr: 0.0.0.0:50443 # mode. This is not recommended as the traffic will # be unencrypted. Only enable if you know what you # are doing. -grpc_allow_insecure: false +grpc_allow_insecure: true # The Noise section includes specific configuration for the # TS2021 Noise protocol @@ -110,8 +110,8 @@ derp: ipv6: 2001:db8::1 # List of externally available DERP maps encoded in JSON - urls: - - https://controlplane.tailscale.com/derpmap/default + # urls: + # - https://controlplane.tailscale.com/derpmap/default # Locally available DERP map files encoded in YAML # @@ -144,7 +144,7 @@ database: type: sqlite # Enable debug mode. This setting requires the log.level to be set to "debug" or "trace". - debug: false + debug: true # GORM configuration settings. gorm: @@ -396,9 +396,9 @@ logtail: # Enable logtail for this headscales clients. # As there is currently no support for overriding the log server in headscale, this is # disabled by default. Enabling this will make your clients send logs to Tailscale Inc. - enabled: false + enabled: true # Enabling this option makes devices prefer a random port for WireGuard traffic over the # default static port 41641. This option is intended as a workaround for some buggy # firewall devices. See https://tailscale.com/kb/1181/firewalls/ for more information. -randomize_client_port: false \ No newline at end of file +randomize_client_port: false diff --git a/tailscale/docker-compose.yml b/tailscale/docker-compose.yml index fb2ae09..a5e7f3c 100644 --- a/tailscale/docker-compose.yml +++ b/tailscale/docker-compose.yml @@ -14,7 +14,13 @@ services: ports: - "3008:8080" # Headscale API端口 - "9090:9090" # Metrics监控端口 - - "50443:50443" # DERP中继端口(可选,若Derper独立部署则无需映射) + - "3478:3478" # STUN 端口 + - "41641:41641" # DERP中继端口(可选,若Derper独立部署则无需映射) + - "12345:12345" # STUN 端口 + - "8881:8881" # DERP 端口 + - "50443:50443" + + cap_add: - NET_ADMIN sysctls: @@ -45,4 +51,9 @@ services: - HEADSCALE_API_URL=http://headscale:8080 - HEADSCALE_API_KEY=QC33VFzaUw.u1qwXFap0QpFAQnwkdGuUyvpspL15185A5JnWeFpt_c # Revert to original variable name ports: - - "8000:8000" # 访问地址:http://<服务器IP>:8000/web \ No newline at end of file + - "3009:8000" # 访问地址:http://<服务器IP>:8000/web + + + +# common314 5b6ed5947149bc2b6d203da688afa8d5969844af8151302e +# 9900k 734511957cbece2ae36622adf50a8ec6842d08fb771c771d