Spaces:
Runtime error
Runtime error
zankdthi commited on
Commit ·
d85549c
1
Parent(s): 03cdf80
Deploy Zone.ID Domain API 2025-12-07
Browse files- Dockerfile +6 -7
- lib/temp-email.js +3 -1
- src/routes/domains.js +2 -2
Dockerfile
CHANGED
|
@@ -26,25 +26,24 @@ RUN apt-get update && apt-get install -y \
|
|
| 26 |
--no-install-recommends \
|
| 27 |
&& rm -rf /var/lib/apt/lists/*
|
| 28 |
|
| 29 |
-
|
| 30 |
-
USER user
|
| 31 |
|
| 32 |
-
ENV HOME=/home/
|
| 33 |
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
| 34 |
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
|
| 35 |
ENV CHROMIUM_PATH=/usr/bin/chromium
|
| 36 |
|
| 37 |
-
WORKDIR /home/
|
| 38 |
|
| 39 |
-
COPY --chown=
|
| 40 |
|
| 41 |
RUN npm ci --only=production
|
| 42 |
|
| 43 |
-
COPY --chown=
|
| 44 |
|
| 45 |
RUN npx prisma generate
|
| 46 |
|
| 47 |
-
COPY --chown=
|
| 48 |
|
| 49 |
ENV PORT=7860
|
| 50 |
ENV HOST=0.0.0.0
|
|
|
|
| 26 |
--no-install-recommends \
|
| 27 |
&& rm -rf /var/lib/apt/lists/*
|
| 28 |
|
| 29 |
+
USER node
|
|
|
|
| 30 |
|
| 31 |
+
ENV HOME=/home/node
|
| 32 |
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
| 33 |
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
|
| 34 |
ENV CHROMIUM_PATH=/usr/bin/chromium
|
| 35 |
|
| 36 |
+
WORKDIR /home/node/app
|
| 37 |
|
| 38 |
+
COPY --chown=node package*.json ./
|
| 39 |
|
| 40 |
RUN npm ci --only=production
|
| 41 |
|
| 42 |
+
COPY --chown=node prisma ./prisma/
|
| 43 |
|
| 44 |
RUN npx prisma generate
|
| 45 |
|
| 46 |
+
COPY --chown=node . .
|
| 47 |
|
| 48 |
ENV PORT=7860
|
| 49 |
ENV HOST=0.0.0.0
|
lib/temp-email.js
CHANGED
|
@@ -42,7 +42,9 @@ async function waitForEmail(address, timeout = 120000, interval = 5000) {
|
|
| 42 |
const emails = await listEmails(address);
|
| 43 |
|
| 44 |
if (emails.length > 0) {
|
| 45 |
-
|
|
|
|
|
|
|
| 46 |
}
|
| 47 |
|
| 48 |
await new Promise(r => setTimeout(r, interval));
|
|
|
|
| 42 |
const emails = await listEmails(address);
|
| 43 |
|
| 44 |
if (emails.length > 0) {
|
| 45 |
+
// Fetch the full email content (list only returns metadata)
|
| 46 |
+
const fullEmail = await getEmail(emails[0].id);
|
| 47 |
+
return fullEmail;
|
| 48 |
}
|
| 49 |
|
| 50 |
await new Promise(r => setTimeout(r, interval));
|
src/routes/domains.js
CHANGED
|
@@ -60,7 +60,7 @@ async function domainRoutes(fastify, options) {
|
|
| 60 |
id: d.id,
|
| 61 |
subdomain: d.subdomain,
|
| 62 |
suffix: d.suffix,
|
| 63 |
-
fullDomain:
|
| 64 |
status: d.status,
|
| 65 |
accountId: d.accountId,
|
| 66 |
accountEmail: d.account.email,
|
|
@@ -225,7 +225,7 @@ async function domainRoutes(fastify, options) {
|
|
| 225 |
id: domain.id,
|
| 226 |
subdomain: domain.subdomain,
|
| 227 |
suffix: domain.suffix,
|
| 228 |
-
fullDomain:
|
| 229 |
status: domain.status,
|
| 230 |
usageType: domain.usageType,
|
| 231 |
usageDescription: domain.usageDescription,
|
|
|
|
| 60 |
id: d.id,
|
| 61 |
subdomain: d.subdomain,
|
| 62 |
suffix: d.suffix,
|
| 63 |
+
fullDomain: d.subdomain, // subdomain already includes suffix (e.g., "test.zone.id")
|
| 64 |
status: d.status,
|
| 65 |
accountId: d.accountId,
|
| 66 |
accountEmail: d.account.email,
|
|
|
|
| 225 |
id: domain.id,
|
| 226 |
subdomain: domain.subdomain,
|
| 227 |
suffix: domain.suffix,
|
| 228 |
+
fullDomain: domain.subdomain, // subdomain already includes suffix
|
| 229 |
status: domain.status,
|
| 230 |
usageType: domain.usageType,
|
| 231 |
usageDescription: domain.usageDescription,
|