This commit is contained in:
awei
2025-06-15 17:13:26 +08:00
parent 21f4026106
commit cb8fe9f52e
11 changed files with 153 additions and 210 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# 定义变量
DOMAIN="image.deepseak.icu" # 请替换为你的域名
DOMAIN="registry.deepseak.icu" # 请替换为你的域名
EMAIL="hpuzhagnwei@163.com" # 请替换为你的邮箱地址
# 检查 Certbot 是否安装

View File

@@ -13,8 +13,8 @@ import (
func main() {
// 硬编码目录配置
dirs := map[string]string{
"/bbs": "/files/active/www/active", // 修改右侧路径
"/active": "/files/bbs/www/bbs", // 添加新条目
"/bbs": "/files/bbs/www/bbs", // 修改右侧路径
"/active": "/files/active/www/active", // 添加新条目
}
port := 8080 // 固定端口

View File

@@ -18,67 +18,20 @@ localIP = "127.0.0.1"
localPort = 443
remotePort = 443
[[proxies]]
name = "tailscale3478u"
type = "udp"
localIP = "127.0.0.1"
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

20
gobaseimg/Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
# 使用华为云镜像源的 golang 1.24 作为基础镜像
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/golang:1.24.3-alpine3.21
# 设置环境变量
ENV GOPROXY=https://goproxy.cn,direct
ENV GO111MODULE=on
# 安装必要的 Go 工具
RUN go install golang.org/x/tools/gopls@latest && \
go install github.com/go-delve/delve/cmd/dlv@latest
# 设置工作目录
WORKDIR /workspace
# 设置容器启动命令
CMD ["/bin/bash"]

View File

@@ -0,0 +1,23 @@
version: '3.8'
services:
mongodb:
image: mongodb/mongodb-community-server:7.0-ubuntu2204
container_name: mongodb
environment:
MONGODB_INITDB_ROOT_USERNAME: root
MONGODB_INITDB_ROOT_PASSWORD: 123456
TZ: Asia/Shanghai
ports:
- "27017:27017"
volumes:
- ./data:/data/db
- ./config:/etc/mongo
- ./logs:/var/log/mongodb
command: mongod --bind_ip_all
restart: unless-stopped
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 30s

17
nginx/conf.d/membank.conf Normal file
View File

@@ -0,0 +1,17 @@
server {
listen 80;
server_name membank.deepseak.icu;
location / {
proxy_pass http://127.0.0.1:10001;
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;
# 添加代理超时配置
proxy_connect_timeout 60s;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
}
}

View File

@@ -0,0 +1,30 @@
server {
listen 443 ssl;
server_name registry.deepseak.icu;
ssl_certificate /etc/letsencrypt/live/registry.deepseak.icu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/registry.deepseak.icu/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
client_max_body_size 500m;
location / {
proxy_pass http://127.0.0.1:3005;
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;
proxy_connect_timeout 60s;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
}
}
# HTTP redirect to HTTPS
server {
listen 80;
server_name registry.deepseak.icu;
return 301 https://$server_name$request_uri;
}

View File

@@ -1,45 +0,0 @@
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;
}
}

View File

@@ -0,0 +1,14 @@
version: '3.8'
services:
registry:
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/registry:2.8.1
container_name: registry
restart: always
environment:
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
volumes:
- ./auth:/auth
- ./data:/var/lib/registry
ports:
- "3005:5000"

View File

@@ -1,113 +1,58 @@
---
# headscale will look for a configuration file named `config.yaml` (or `config.json`) in the following order:
#
# - `/etc/headscale`
# - `~/.headscale`
# - current working directory
# - 当前工作目录
# The url clients will connect to.
# Typically this will be a domain like:
#
# https://myheadscale.example.com:443
#
# 服务端URL客户端将连接到的地址
server_url: http://0.0.0.0:8080
# Address to listen to / bind to on the server
#
# For production:
# 服务监听地址
listen_addr: 0.0.0.0:8080
#isten_addr: 127.0.0.1:8080
# Address to listen to /metrics, you may want
# to keep this endpoint private to your internal
# network
#
# 指标监听地址(建议保持内网访问)
metrics_listen_addr: 127.0.0.1:9090
# Address to listen for gRPC.
# gRPC is used for controlling a headscale server
# remotely with the CLI
# Note: Remote access _only_ works if you have
# valid certificates.
#
# For production:
# gRPC监听地址用于远程CLI控制
grpc_listen_addr: 0.0.0.0:50443
#rpc_listen_addr: 127.0.0.1:50443
# Allow the gRPC admin interface to run in INSECURE
# mode. This is not recommended as the traffic will
# be unencrypted. Only enable if you know what you
# are doing.
# 允许不安全的gRPC连接不建议生产环境使用
grpc_allow_insecure: true
# The Noise section includes specific configuration for the
# TS2021 Noise protocol
# Noise协议配置
noise:
# The Noise private key is used to encrypt the
# traffic between headscale and Tailscale clients when
# using the new Noise-based protocol.
# 噪声协议私钥路径
private_key_path: /var/lib/headscale/noise_private.key
# List of IP prefixes to allocate tailaddresses from.
# Each prefix consists of either an IPv4 or IPv6 address,
# and the associated prefix length, delimited by a slash.
# It must be within IP ranges supported by the Tailscale
# client - i.e., subnets of 100.64.0.0/10 and fd7a:115c:a1e0::/48.
# See below:
# IPv6: https://github.com/tailscale/tailscale/blob/22ebb25e833264f58d7c3f534a8b166894a89536/net/tsaddr/tsaddr.go#LL81C52-L81C71
# IPv4: https://github.com/tailscale/tailscale/blob/22ebb25e833264f58d7c3f534a8b166894a89536/net/tsaddr/tsaddr.go#L33
# Any other range is NOT supported, and it will cause unexpected issues.
# IP地址分配前缀
prefixes:
v4: 100.64.0.0/10
v6: fd7a:115c:a1e0::/48
# Strategy used for allocation of IPs to nodes, available options:
# - sequential (default): assigns the next free IP from the previous given IP.
# - random: assigns the next free IP from a pseudo-random IP generator (crypto/rand).
# IP分配策略sequential顺序或 random随机
allocation: sequential
# DERP is a relay system that Tailscale uses when a direct
# connection cannot be established.
# https://tailscale.com/blog/how-tailscale-works/#encrypted-tcp-relays-derp
#
# headscale needs a list of DERP servers that can be presented
# to the clients.
# DERP中继服务器配置
derp:
server:
# If enabled, runs the embedded DERP server and merges it into the rest of the DERP config
# The Headscale server_url defined above MUST be using https, DERP requires TLS to be in place
# 启用内置DERP服务器
enabled: true
# Region ID to use for the embedded DERP server.
# The local DERP prevails if the region ID collides with other region ID coming from
# the regular DERP config.
# 区域ID避免与公共DERP区域冲突
region_id: 999
# Region code and name are displayed in the Tailscale UI to identify a DERP region
# 区域代码和名称显示在客户端UI中
region_code: "headscale"
region_name: "Headscale Embedded DERP"
# Listens over UDP at the configured address for STUN connections - to help with NAT traversal.
# When the embedded DERP server is enabled stun_listen_addr MUST be defined.
#
# For more details on how this works, check this great article: https://tailscale.com/blog/how-tailscale-works/
# STUN服务监听地址用于NAT穿透
stun_listen_addr: "0.0.0.0:3478"
# Private key used to encrypt the traffic between headscale DERP
# and Tailscale clients.
# The private key file will be autogenerated if it's missing.
#
# DERP服务器私钥路径
private_key_path: /var/lib/headscale/derp_server_private.key
# This flag can be used, so the DERP map entry for the embedded DERP server is not written automatically,
# it enables the creation of your very own DERP map entry using a locally available file with the parameter DERP.paths
# If you enable the DERP server and set this to false, it is required to add the DERP server to the DERP map using DERP.paths
# 自动添加内置DERP区域到DERP映射
automatically_add_embedded_derp_region: true
# For better connection stability (especially when using an Exit-Node and DNS is not working),
# it is possible to optionally add the public IPv4 and IPv6 address to the Derp-Map using:
ipv4: 1.2.3.4
ipv6: 2001:db8::1
# 公网IPv4/IPv6地址提高连接稳定性
ipv4: 47.239.121.24
# ipv6: 2001:db8::1
# List of externally available DERP maps encoded in JSON
# urls:
@@ -149,29 +94,16 @@ database:
# GORM configuration settings.
gorm:
# Enable prepared statements.
prepare_stmt: true
# Enable parameterized queries.
parameterized_queries: true
# Skip logging "record not found" errors.
skip_err_record_not_found: true
# Threshold for slow queries in milliseconds.
slow_threshold: 1000
prepare_stmt: true # 启用预处理语句
parameterized_queries: true # 启用参数化查询
skip_err_record_not_found: true # 跳过"记录未找到"错误
slow_threshold: 1000 # 慢查询阈值(毫秒)
# SQLite config
sqlite:
path: /var/lib/headscale/db.sqlite
# Enable WAL mode for SQLite. This is recommended for production environments.
# https://www.sqlite.org/wal.html
write_ahead_log: true
# Maximum number of WAL file frames before the WAL file is automatically checkpointed.
# https://www.sqlite.org/c3ref/wal_autocheckpoint.html
# Set to 0 to disable automatic checkpointing.
wal_autocheckpoint: 1000
write_ahead_log: true # 启用WAL模式生产推荐
wal_autocheckpoint: 1000 # WAL自动检查点阈值
# # Postgres config
# Please note that using Postgres is highly discouraged as it is only supported for legacy reasons.
@@ -277,10 +209,8 @@ dns:
# List of DNS servers to expose to clients.
nameservers:
global:
- 1.1.1.1
- 1.0.0.1
- 2606:4700:4700::1111
- 2606:4700:4700::1001
- 114.114.114.114
# NextDNS (see https://tailscale.com/kb/1218/nextdns/).
# "abc123" is example NextDNS ID, replace with yours.

View File

@@ -15,7 +15,7 @@ services:
- "3008:8080" # Headscale API端口
- "9090:9090" # Metrics监控端口
- "3478:3478" # STUN 端口
- "41641:41641" # DERP中继端口可选若Derper独立部署则无需映射
# - "41641:41641" # DERP中继端口可选若Derper独立部署则无需映射
- "12345:12345" # STUN 端口
- "8881:8881" # DERP 端口
- "50443:50443"
@@ -57,3 +57,4 @@ services:
# common314 5b6ed5947149bc2b6d203da688afa8d5969844af8151302e
# 9900k 734511957cbece2ae36622adf50a8ec6842d08fb771c771d
# 12600k-rocky-client 5b37e0d239b44f1ac514603d4f6f3629bc9c21aa0321e97d