From 27a1089e1f5d2c7f6a3cea4b1aa4750ed1f129a3 Mon Sep 17 00:00:00 2001 From: ponei Date: Thu, 7 May 2026 23:51:22 -0300 Subject: [PATCH 1/3] api/instagram: prefer graphql over embed for posts --- api/src/processing/services/instagram.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api/src/processing/services/instagram.js b/api/src/processing/services/instagram.js index 0fa25527..e20a3076 100644 --- a/api/src/processing/services/instagram.js +++ b/api/src/processing/services/instagram.js @@ -305,6 +305,8 @@ export default function instagram(obj) { if (sidecar) { const picker = sidecar.edges.filter(e => e.node?.display_url) .map((e, i) => { + // if extracted from HTML embed, the first GraphVideo node from a "multipost" post sometimes + // reports `is_video` without a `video_url`. this also breaks the official Instagram "multipost" embed. const type = e.node?.is_video && e.node?.video_url ? "video" : "photo"; let url; @@ -436,13 +438,13 @@ export default function instagram(obj) { if (media_id && !hasData(data)) data = await requestMobileApi(media_id); if (media_id && cookie && !hasData(data)) data = await requestMobileApi(media_id, { cookie }); - // html embed (no cookie, cookie) - if (!hasData(data)) data = await requestHTML(id); - if (!hasData(data) && cookie) data = await requestHTML(id, cookie); - // web app graphql api (no cookie, cookie) if (!hasData(data)) data = await requestGQL(id); if (!hasData(data) && cookie) data = await requestGQL(id, cookie); + + // html embed (no cookie, cookie) + if (!hasData(data)) data = await requestHTML(id); + if (!hasData(data) && cookie) data = await requestHTML(id, cookie); } catch {} if (!hasData(data)) { From 2073ad77d053219763117ae40479e5a89c67c7c3 Mon Sep 17 00:00:00 2001 From: "railway-app[bot]" <68434857+railway-app[bot]@users.noreply.github.com> Date: Sat, 11 Jul 2026 14:31:18 +0000 Subject: [PATCH 2/3] fix: add cacheKey prefix to pnpm cache mount id (#1) Co-authored-by: railway-app[bot] <68434857+railway-app[bot]@users.noreply.github.com> --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d9a55b6a..41d6b9f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ COPY . /app RUN corepack enable RUN apk add --no-cache python3 alpine-sdk -RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ +RUN --mount=type=cache,id=s/d8a550a4-8221-403e-9e69-a91d15b02317-/pnpm/store,target=/pnpm/store \ pnpm install --prod --frozen-lockfile RUN pnpm deploy --filter=@imput/cobalt-api --prod /prod/api From 4355a7a4fa7e9354f530230bd72861c0eccee960 Mon Sep 17 00:00:00 2001 From: jonatasismael1 Date: Sat, 11 Jul 2026 11:41:00 -0300 Subject: [PATCH 3/3] Update Dockerfile for build and API stages --- Dockerfile | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 41d6b9f3..57f3334d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,40 @@ FROM node:24-alpine AS base + ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" FROM base AS build + WORKDIR /app + COPY . /app RUN corepack enable RUN apk add --no-cache python3 alpine-sdk -RUN --mount=type=cache,id=s/d8a550a4-8221-403e-9e69-a91d15b02317-/pnpm/store,target=/pnpm/store \ - pnpm install --prod --frozen-lockfile +RUN pnpm install --prod --frozen-lockfile RUN pnpm deploy --filter=@imput/cobalt-api --prod /prod/api FROM base AS api + +ARG RAILWAY_GIT_COMMIT_SHA=unknown +ARG RAILWAY_GIT_BRANCH=fix-instagram +ARG RAILWAY_GIT_REPO_OWNER=unknown +ARG RAILWAY_GIT_REPO_NAME=cobalt + WORKDIR /app COPY --from=build --chown=node:node /prod/api /app -COPY --from=build --chown=node:node /app/.git /app/.git + +RUN mkdir -p /app/.git/logs /app/.git/refs/heads \ + && printf 'ref: refs/heads/%s\n' "$RAILWAY_GIT_BRANCH" > /app/.git/HEAD \ + && printf '0000000000000000000000000000000000000000 %s railway 0 +0000\tbuild\n' "$RAILWAY_GIT_COMMIT_SHA" > /app/.git/logs/HEAD \ + && printf '[remote "origin"]\n\turl = https://github.com/%s/%s.git\n' "$RAILWAY_GIT_REPO_OWNER" "$RAILWAY_GIT_REPO_NAME" > /app/.git/config \ + && chown -R node:node /app/.git USER node EXPOSE 9000 -CMD [ "node", "src/cobalt" ] + +CMD ["node", "src/cobalt"]