Commit f6ea0cb8 authored by nanahira's avatar nanahira

add warp

parent 22956a53
......@@ -269,10 +269,14 @@ class InventoryBuilder {
const redirectAvailableGateways = Object.values(this.gateways[host.name]).filter(gateway => !gateway.hidden);
const gostConfig: GostConfig = {
Routes: redirectAvailableGateways.map(gateway => ({
Routes: redirectAvailableGateways.map(gateway => {
const useWarp = host.arch !== 'arm' && gateway.warp;
return {
ServeNodes: [`red://${host.address}:${gateway.redirectServerPort}`],
Mark: gateway.selectionMark as number,
}))
Mark: useWarp ? 0 : gateway.selectionMark as number,
ChainNodes: useWarp ? [`http://localhost:${gateway.redirectServerPort - 2000}`] : undefined
}
})
};
const allRedirectServerPorts = redirectAvailableGateways.map(gateway => gateway.redirectServerPort).join(',');
......@@ -287,6 +291,18 @@ class InventoryBuilder {
volumes: ['./gost.json:/etc/gost/gost.json:ro'],
command: '-C /etc/gost/gost.json'
};
if (host.arch !== 'arm') {
for (const gateway of redirectAvailableGateways.filter(gw => gw.warp)) {
host.dockerServices[`warp-${gateway.isp}`] = {
restart: 'always',
image: 'git-registry.mycard.moe/nanahira/warp-proxy',
ports: [`127.0.0.1:${gateway.redirectServerPort - 2000}:8080`],
environment: {
FORWARD_PROXY_PORT: 8080
}
}
}
}
}
host.frpcRestarts = [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment