fix: Add dig to Docker, fix admin sync endpoints
- Added dnsutils (dig) to backend Dockerfile for DNS zone transfers - Fixed admin zone sync endpoints with correct imports - AsyncSessionLocal instead of async_session_maker
This commit is contained in:
@ -12,8 +12,10 @@ RUN groupadd -r pounce && useradd -r -g pounce pounce
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
# dnsutils provides 'dig' for DNS zone transfers (AXFR)
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
dnsutils \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python dependencies
|
||||
|
||||
@ -1743,11 +1743,12 @@ async def trigger_switch_sync(
|
||||
from app.services.zone_file import ZoneFileService
|
||||
|
||||
async def run_sync():
|
||||
from app.database import AsyncSessionLocal
|
||||
async with AsyncSessionLocal() as session:
|
||||
zf = ZoneFileService()
|
||||
from app.database import async_session_maker
|
||||
async with async_session_maker() as session:
|
||||
result = await zf.sync_all_zones(session)
|
||||
return result
|
||||
for tld in ["ch", "li"]:
|
||||
await zf.run_daily_sync(session, tld)
|
||||
return {"status": "complete"}
|
||||
|
||||
background_tasks.add_task(run_sync)
|
||||
|
||||
@ -1770,9 +1771,9 @@ async def trigger_czds_sync(
|
||||
from app.services.czds_client import CZDSClient
|
||||
|
||||
async def run_sync():
|
||||
from app.database import AsyncSessionLocal
|
||||
async with AsyncSessionLocal() as session:
|
||||
client = CZDSClient()
|
||||
from app.database import async_session_maker
|
||||
async with async_session_maker() as session:
|
||||
result = await client.sync_all_zones(session)
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user