Skip to content

Commit

Permalink
fix(security): address sonar vulnerabilities (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
louisgrasset authored Oct 20, 2023
1 parent 09a0e34 commit 9d235c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
FROM node:lts

RUN groupadd --system bot \
&& useradd --system bot -g bot

WORKDIR /app

COPY src/ /app/src
COPY package.json package-lock.json tsconfig.json .eslintrc.json /app/

RUN npm ci && npm run build
RUN npm ci --ignore-scripts && npm run build

RUN echo "" > .env

USER bot

CMD node /app/dist/index.js $ENV_FILE
2 changes: 1 addition & 1 deletion src/helpers/tweet/get-tweet-id-from-permalink.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const getTweetIdFromPermalink = (url: string): string => url.match(/\d+$/)?.[0] || '';
export const getTweetIdFromPermalink = (url: string): string => url.match(/\d{19}$/)?.[0] || '';

0 comments on commit 9d235c0

Please sign in to comment.