OmniRoute Fly.io 部署指南
v3.8.1Last updated: 2026-05-13
Was this page helpful?
Loading OmniRoute...
。
已确认包含以下关键项:
app = 'omniroute' primary_region = 'sin' [[mounts]] source = 'data' destination = '/data' [processes] app = 'node run-standalone.mjs' [http_service] internal_port = 20128 [env] TZ = "Asia/Shanghai" HOST = "0.0.0.0" HOSTNAME = "0.0.0.0" BIND = "0.0.0.0"
pwsh -Command "iwr https://fly.io/install.ps1 -useb | iex"
二进制并放到 中。
flyctl auth login
flyctl auth whoami flyctl version
git clone https://github.com/diegosouzapw/OmniRoute.git cd OmniRoute
,重点看这一行:
app = 'omniroute'
app = 'omniroute-yourname'
一致的应用
- ,不要和
混淆
flyctl apps create omniroute
替换成你的名字。
flyctl deploy
应用上实际部署:
,因为本次部署按需求不使用它。
指向你公开的 HTTPS 域名 (set to the public HTTPS domain / defina para o domínio HTTPS público)
flyctl secrets set NEXT_PUBLIC_BASE_URL=https://omniroute.fly.dev -a omniroute
)。
- 在 provider 控制台配置回调 URL (configure the callback URL on the provider console / configure a URL de callback no painel do provider)
<NEXT_PUBLIC_BASE_URL>/api/oauth/<provider>/callback
与 provider 控制台中注册的回调 URL 不一致,OAuth 流程会在浏览器回跳阶段失败 (mismatch between and the registered callback URL will cause OAuth to fail at the browser redirect step / divergência entre e a URL de callback registrada quebra o OAuth no redirect do navegador)。
$apiKeySecret = [Convert]::ToHexString((1..32 | ForEach-Object { Get-Random -Minimum 0 -Maximum 256 })).ToLower()
$jwtSecret = [Convert]::ToHexString((1..64 | ForEach-Object { Get-Random -Minimum 0 -Maximum 256 })).ToLower()
$machineIdSalt = [Convert]::ToHexString((1..32 | ForEach-Object { Get-Random -Minimum 0 -Maximum 256 })).ToLower()
$storageKey = [Convert]::ToHexString((1..32 | ForEach-Object { Get-Random -Minimum 0 -Maximum 256 })).ToLower()
$wsBridgeSecret = [Convert]::ToHexString((1..32 | ForEach-Object { Get-Random -Minimum 0 -Maximum 256 })).ToLower()
flyctl secrets set `
API_KEY_SECRET=$apiKeySecret `
JWT_SECRET=$jwtSecret `
MACHINE_ID_SALT=$machineIdSalt `
STORAGE_ENCRYPTION_KEY=$storageKey `
OMNIROUTE_WS_BRIDGE_SECRET=$wsBridgeSecret `
DATA_DIR=/data `
NEXT_PUBLIC_BASE_URL=https://omniroute.fly.dev `
-a omniroute
生成 (on Linux / macOS, you can also use / em Linux / macOS, também é possível usar ):
flyctl secrets set OMNIROUTE_WS_BRIDGE_SECRET=$(openssl rand -hex 32) -a omniroute
flyctl secrets set INITIAL_PASSWORD=你的强密码 -a omniroute
flyctl secrets list -a omniroute
页面没有显示你期待的变量,先检查:
是否和控制台应用一致
git pull flyctl deploy
flyctl secrets set KEY=value -a omniroute
的更新,推荐按下面流程执行。
git remote -v
,先添加:
git remote add upstream https://github.com/diegosouzapw/OmniRoute.git
git fetch upstream --tags
git describe --tags --always git show --no-patch --oneline v3.4.7
(current project version is / a versão atual do projeto é )。下文中的 仅为历史示例 (the references below are kept as historical examples only / as referências a abaixo são apenas exemplos históricos);实际发布时请使用 或当前版本标签 (e.g. ) (use or the current version tag — e.g. — for actual releases / use ou a tag da versão atual — p.ex. — em releases reais)。
,并强制保留 fork 当前的 ,可按下面流程执行:
git merge upstream/main git checkout HEAD~1 -- fly.toml git add -- fly.toml git commit -m "chore(deploy): keep fork fly.toml" git push origin main
,也可以先确认标签是否已经包含在 :
git merge-base --is-ancestor v3.4.7 upstream/main
已经包含该版本,直接合并 即可。
时使用的实际流程 (示例为历史版本,当前实际版本是 / example refers to a historical version; the current actual version is / o exemplo refere-se a uma versão histórica; a versão atual é )。
flyctl status -a omniroute
flyctl logs --no-tail -a omniroute
try {
(Invoke-WebRequest -Uri "https://omniroute.fly.dev" -MaximumRedirection 5 -UseBasicParsing).StatusCode
} catch {
if ($_.Exception.Response) {
$_.Exception.Response.StatusCode.value__
} else {
throw
}
}
说明站点已正常响应。
[bootstrap] Secrets persisted to: /data/server.env [DB] SQLite database ready: /data/storage.sqlite
,说明 没配对,需要立即修正。
flyctl apps create omniroute
- 是否设置为
。生产环境建议尽快修改后台密码。
- 、
、、
flyctl auth whoami flyctl status -a omniroute flyctl secrets list -a omniroute flyctl deploy flyctl logs --no-tail -a omniroute
flyctl deploy