File size: 1,211 Bytes
390dc9b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# fly.toml 配置示例
# 部署前,复制此文件为fly.toml并根据需要修改

app = "simple-clash-relay" # 修改为您的应用名称
primary_region = "hkg" # 选择最近的地区(香港示例)

[build]
  # 使用Dockerfile
  dockerfile = "Dockerfile"

[env]
  # 公共环境变量 (不包含敏密信息)
  FLASK_PORT = "8000"
  CLASH_PROXY_PORT = "7890"
  CLASH_API_PORT = "9090"
  # 不要在这里设置SUB_URL和API_KEY,应该使用secrets设置

# API服务 - 暴露为HTTPS
[[services]]
  internal_port = 8000
  protocol = "tcp"
  
  [[services.ports]]
    port = 80
    handlers = ["http"]
    force_https = true
  
  [[services.ports]]
    port = 443
    handlers = ["tls", "http"]
  
  # 健康检查配置
  [[services.http_checks]]
    interval = "10s"
    timeout = "2s"
    grace_period = "30s"
    method = "get"
    path = "/health"
    protocol = "http"

# Clash代理服务 - 暴露为TCP
[[services]]
  internal_port = 7890
  protocol = "tcp"
  
  [[services.ports]]
    port = 7890
    # 不设置handlers,表示原生TCP

# 可选:持久化卷挂载
# [mounts]
#   source = "clash_data"
#   destination = "/app/data"