Skip to content

Commit

Permalink
chore: remove mvval.sh locally and fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Cnily03 committed Sep 17, 2024
1 parent e75f6fd commit f8d3a0a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 540 deletions.
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
ENV NODE_ENV=production
RUN NODE_OPTIONS="--max_old_space_size=2048" pnpm build

FROM base AS fetch
RUN apt update && apt install -y curl
RUN curl https://gist.githubusercontent.com/Cnily03/4d4a8a1f2ba63328a9543c82b73a677c/raw/dfbc1f5ca355858fd19e28d6078e62f102679cd5/mvval.sh -o /usr/local/bin/mvval.sh

FROM oven/bun:1.1.20-slim

ENV FLAG="flag{test_flag}"
Expand All @@ -32,13 +36,13 @@ COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/public/dist /app/public/dist
RUN rm -rf public-src content.js webpack.config.js pnpm-lock.yaml package-lock.json

RUN mv /app/mvval.sh /usr/local/bin/mvval.sh
COPY --from=fetch /usr/local/bin/mvval.sh /usr/local/bin/mvval.sh
RUN chmod +x /usr/local/bin/mvval.sh

# Use mvval.sh to switch user
USER root

EXPOSE 3000
ENV NODE_ENV=production
ENTRYPOINT [ "/usr/local/bin/mvval.sh", "--type=env", "--name=ICQ_FLAG:FLAG", "--user=ctf", "--", "/usr/local/bin/docker-entrypoint.sh" ]
CMD [ "bun", "start" ]

EXPOSE 3000
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The challenge doesn't provide source code to participants.

## Deployment

> [!IMPORTANT]
> [!NOTE]
> The FLAG is initially given by the environment variable `ICQ_FLAG`.
Docker is provided. You can run the following command to start the environment quickly:
Expand Down
Loading

0 comments on commit f8d3a0a

Please sign in to comment.