Commit 34c1774
committed
Support Docker bridge networking and Kubo URL env
Add detection of the container's own bridge IP for proxy targets and environment-driven Kubo API address handling.
blox/kubo_proxy.go: add a new detection step that iterates local interfaces (skipping lo, docker*, br-*, veth) to find the container's bridge IPv4 and return it as the proxy target; keep existing docker0/br-* detection and fallback to 127.0.0.1. Adds an informational log when a container bridge IP is detected.
cmd/blox/main.go: read KUBO_API_URL (default http://127.0.0.1:5001), parse host:port, resolve host via DNS to an IP (to support Docker DNS names like "kubo"), construct the IP-based multiaddr, and pass the kubo address into the blox options via WithKuboAPIAddr. Also adds a strings import. These changes enable running go-fula inside bridge-networked containers and using docker-compose service names for the Kubo API.1 parent 7d178ab commit 34c1774
2 files changed
+44
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
91 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
92 | 115 | | |
93 | 116 | | |
94 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
1089 | 1090 | | |
1090 | 1091 | | |
1091 | 1092 | | |
1092 | | - | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
1093 | 1110 | | |
1094 | 1111 | | |
1095 | 1112 | | |
| |||
1136 | 1153 | | |
1137 | 1154 | | |
1138 | 1155 | | |
| 1156 | + | |
1139 | 1157 | | |
1140 | 1158 | | |
1141 | 1159 | | |
| |||
0 commit comments