0605
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# 定义变量
|
# 定义变量
|
||||||
DOMAIN="image.deepseak.icu" # 请替换为你的域名
|
DOMAIN="registry.deepseak.icu" # 请替换为你的域名
|
||||||
EMAIL="hpuzhagnwei@163.com" # 请替换为你的邮箱地址
|
EMAIL="hpuzhagnwei@163.com" # 请替换为你的邮箱地址
|
||||||
|
|
||||||
# 检查 Certbot 是否安装
|
# 检查 Certbot 是否安装
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
// 硬编码目录配置
|
// 硬编码目录配置
|
||||||
dirs := map[string]string{
|
dirs := map[string]string{
|
||||||
"/bbs": "/files/active/www/active", // 修改右侧路径
|
"/bbs": "/files/bbs/www/bbs", // 修改右侧路径
|
||||||
"/active": "/files/bbs/www/bbs", // 添加新条目
|
"/active": "/files/active/www/active", // 添加新条目
|
||||||
}
|
}
|
||||||
|
|
||||||
port := 8080 // 固定端口
|
port := 8080 // 固定端口
|
||||||
|
|||||||
@@ -18,67 +18,20 @@ localIP = "127.0.0.1"
|
|||||||
localPort = 443
|
localPort = 443
|
||||||
remotePort = 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
20
gobaseimg/Dockerfile
Normal 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"]
|
||||||
23
mongodb/docker-compose.yml
Normal file
23
mongodb/docker-compose.yml
Normal 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
17
nginx/conf.d/membank.conf
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
30
nginx/conf.d/registry.conf
Normal file
30
nginx/conf.d/registry.conf
Normal 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;
|
||||||
|
}
|
||||||
@@ -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;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
14
registry/docker-compose.yml
Normal file
14
registry/docker-compose.yml
Normal 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"
|
||||||
@@ -1,113 +1,58 @@
|
|||||||
---
|
---
|
||||||
# headscale will look for a configuration file named `config.yaml` (or `config.json`) in the following order:
|
|
||||||
#
|
|
||||||
# - `/etc/headscale`
|
# - `/etc/headscale`
|
||||||
# - `~/.headscale`
|
# - `~/.headscale`
|
||||||
# - current working directory
|
# - 当前工作目录
|
||||||
|
|
||||||
# The url clients will connect to.
|
|
||||||
# Typically this will be a domain like:
|
|
||||||
#
|
#
|
||||||
# https://myheadscale.example.com:443
|
# https://myheadscale.example.com:443
|
||||||
#
|
#
|
||||||
|
# 服务端URL(客户端将连接到的地址)
|
||||||
server_url: http://0.0.0.0:8080
|
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
|
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
|
metrics_listen_addr: 127.0.0.1:9090
|
||||||
|
|
||||||
# Address to listen for gRPC.
|
# gRPC监听地址(用于远程CLI控制)
|
||||||
# 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_listen_addr: 0.0.0.0:50443
|
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
|
# 允许不安全的gRPC连接(不建议生产环境使用)
|
||||||
# mode. This is not recommended as the traffic will
|
|
||||||
# be unencrypted. Only enable if you know what you
|
|
||||||
# are doing.
|
|
||||||
grpc_allow_insecure: true
|
grpc_allow_insecure: true
|
||||||
|
|
||||||
# The Noise section includes specific configuration for the
|
# Noise协议配置
|
||||||
# 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
|
private_key_path: /var/lib/headscale/noise_private.key
|
||||||
|
|
||||||
# List of IP prefixes to allocate tailaddresses from.
|
# IP地址分配前缀
|
||||||
# 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.
|
|
||||||
prefixes:
|
prefixes:
|
||||||
v4: 100.64.0.0/10
|
v4: 100.64.0.0/10
|
||||||
v6: fd7a:115c:a1e0::/48
|
v6: fd7a:115c:a1e0::/48
|
||||||
|
# IP分配策略:sequential(顺序)或 random(随机)
|
||||||
# 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).
|
|
||||||
allocation: sequential
|
allocation: sequential
|
||||||
|
|
||||||
# DERP is a relay system that Tailscale uses when a direct
|
# DERP中继服务器配置
|
||||||
# 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:
|
server:
|
||||||
# If enabled, runs the embedded DERP server and merges it into the rest of the DERP config
|
# 启用内置DERP服务器
|
||||||
# The Headscale server_url defined above MUST be using https, DERP requires TLS to be in place
|
|
||||||
enabled: true
|
enabled: true
|
||||||
|
# 区域ID(避免与公共DERP区域冲突)
|
||||||
# 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.
|
|
||||||
region_id: 999
|
region_id: 999
|
||||||
|
# 区域代码和名称(显示在客户端UI中)
|
||||||
# Region code and name are displayed in the Tailscale UI to identify a DERP region
|
|
||||||
region_code: "headscale"
|
region_code: "headscale"
|
||||||
region_name: "Headscale Embedded DERP"
|
region_name: "Headscale Embedded DERP"
|
||||||
|
# STUN服务监听地址(用于NAT穿透)
|
||||||
# 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_listen_addr: "0.0.0.0:3478"
|
stun_listen_addr: "0.0.0.0:3478"
|
||||||
|
# DERP服务器私钥路径
|
||||||
# Private key used to encrypt the traffic between headscale DERP
|
|
||||||
# and Tailscale clients.
|
|
||||||
# The private key file will be autogenerated if it's missing.
|
|
||||||
#
|
|
||||||
private_key_path: /var/lib/headscale/derp_server_private.key
|
private_key_path: /var/lib/headscale/derp_server_private.key
|
||||||
|
# 自动添加内置DERP区域到DERP映射
|
||||||
# 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
|
|
||||||
automatically_add_embedded_derp_region: true
|
automatically_add_embedded_derp_region: true
|
||||||
|
# 公网IPv4/IPv6地址(提高连接稳定性)
|
||||||
# For better connection stability (especially when using an Exit-Node and DNS is not working),
|
ipv4: 47.239.121.24
|
||||||
# it is possible to optionally add the public IPv4 and IPv6 address to the Derp-Map using:
|
# ipv6: 2001:db8::1
|
||||||
ipv4: 1.2.3.4
|
|
||||||
ipv6: 2001:db8::1
|
|
||||||
|
|
||||||
# List of externally available DERP maps encoded in JSON
|
# List of externally available DERP maps encoded in JSON
|
||||||
# urls:
|
# urls:
|
||||||
@@ -149,29 +94,16 @@ database:
|
|||||||
# GORM configuration settings.
|
# GORM configuration settings.
|
||||||
gorm:
|
gorm:
|
||||||
# Enable prepared statements.
|
# Enable prepared statements.
|
||||||
prepare_stmt: true
|
prepare_stmt: true # 启用预处理语句
|
||||||
|
parameterized_queries: true # 启用参数化查询
|
||||||
# Enable parameterized queries.
|
skip_err_record_not_found: true # 跳过"记录未找到"错误
|
||||||
parameterized_queries: true
|
slow_threshold: 1000 # 慢查询阈值(毫秒)
|
||||||
|
|
||||||
# Skip logging "record not found" errors.
|
|
||||||
skip_err_record_not_found: true
|
|
||||||
|
|
||||||
# Threshold for slow queries in milliseconds.
|
|
||||||
slow_threshold: 1000
|
|
||||||
|
|
||||||
# SQLite config
|
# SQLite config
|
||||||
sqlite:
|
sqlite:
|
||||||
path: /var/lib/headscale/db.sqlite
|
path: /var/lib/headscale/db.sqlite
|
||||||
|
write_ahead_log: true # 启用WAL模式(生产推荐)
|
||||||
# Enable WAL mode for SQLite. This is recommended for production environments.
|
wal_autocheckpoint: 1000 # WAL自动检查点阈值
|
||||||
# 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
|
|
||||||
|
|
||||||
# # Postgres config
|
# # Postgres config
|
||||||
# Please note that using Postgres is highly discouraged as it is only supported for legacy reasons.
|
# 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.
|
# List of DNS servers to expose to clients.
|
||||||
nameservers:
|
nameservers:
|
||||||
global:
|
global:
|
||||||
- 1.1.1.1
|
- 114.114.114.114
|
||||||
- 1.0.0.1
|
|
||||||
- 2606:4700:4700::1111
|
|
||||||
- 2606:4700:4700::1001
|
|
||||||
|
|
||||||
# NextDNS (see https://tailscale.com/kb/1218/nextdns/).
|
# NextDNS (see https://tailscale.com/kb/1218/nextdns/).
|
||||||
# "abc123" is example NextDNS ID, replace with yours.
|
# "abc123" is example NextDNS ID, replace with yours.
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ services:
|
|||||||
- "3008:8080" # Headscale API端口
|
- "3008:8080" # Headscale API端口
|
||||||
- "9090:9090" # Metrics监控端口
|
- "9090:9090" # Metrics监控端口
|
||||||
- "3478:3478" # STUN 端口
|
- "3478:3478" # STUN 端口
|
||||||
- "41641:41641" # DERP中继端口(可选,若Derper独立部署则无需映射)
|
# - "41641:41641" # DERP中继端口(可选,若Derper独立部署则无需映射)
|
||||||
- "12345:12345" # STUN 端口
|
- "12345:12345" # STUN 端口
|
||||||
- "8881:8881" # DERP 端口
|
- "8881:8881" # DERP 端口
|
||||||
- "50443:50443"
|
- "50443:50443"
|
||||||
@@ -57,3 +57,4 @@ services:
|
|||||||
|
|
||||||
# common314 5b6ed5947149bc2b6d203da688afa8d5969844af8151302e
|
# common314 5b6ed5947149bc2b6d203da688afa8d5969844af8151302e
|
||||||
# 9900k 734511957cbece2ae36622adf50a8ec6842d08fb771c771d
|
# 9900k 734511957cbece2ae36622adf50a8ec6842d08fb771c771d
|
||||||
|
# 12600k-rocky-client 5b37e0d239b44f1ac514603d4f6f3629bc9c21aa0321e97d
|
||||||
|
|||||||
Reference in New Issue
Block a user