Skip to content

Commit 4a81d68

Browse files
committed
add settings for the domain list
1 parent 048daa1 commit 4a81d68

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/aleph/vm/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ class Settings(BaseSettings):
189189
INIT_TIMEOUT: float = 20.0
190190

191191
CONNECTOR_URL: HttpUrl = HttpUrl("http://localhost:4021")
192+
# To fetch the list of domain mapping for the ipv4 domain features
193+
DOMAIN_SERVICE_URL: HttpUrl = HttpUrl("https://api.dns.public.aleph.sh/instances/list")
192194

193195
CACHE_ROOT: Path = Path("/var/cache/aleph/vm")
194196
MESSAGE_CACHE: Path | None = Field(

src/aleph/vm/haproxy.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
import aiohttp
2828

29+
from aleph.vm.conf import settings
30+
2931
# This should match the config in haproxy.cfg
3032
HAPROXY_BACKENDS = [
3133
{
@@ -283,7 +285,7 @@ def update_haproxy_backends(socket_path, backend_name, map_file_path, weight=1):
283285

284286
async def fetch_list() -> list[dict]:
285287
async with aiohttp.ClientSession() as client:
286-
resp = await client.get(url="https://api.dns.public.aleph.sh/instances/list")
288+
resp = await client.get(url=settings.DOMAIN_SERVICE_URL)
287289
resp.raise_for_status()
288290
instances = await resp.json()
289291
if len(instances) == 0:

0 commit comments

Comments
 (0)