-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: handle undefined author in plugins and remove deprecated Projects API #1777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
27d1cfe
8e305d9
beee10d
5b3e924
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Base image | ||
| FROM node:20-bookworm-slim | ||
|
|
||
| # Copy repository | ||
| COPY . /metrics | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 HIGH - Docker cache invalidation: COPY all files before dependency install Category: quality Description: Suggestion: Why this matters: Any file change invalidates cached npm install layer. Confidence: 95% |
||
| WORKDIR /metrics | ||
|
|
||
| # Setup | ||
| RUN chmod +x /metrics/source/app/action/index.mjs \ | ||
| # Install latest chrome dev package, fonts to support major charsets and skip chromium download on puppeteer install | ||
| # Based on https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker | ||
| && apt-get update \ | ||
| && apt-get install -y wget gnupg ca-certificates libgconf-2-4 \ | ||
| && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ | ||
| && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ | ||
| && apt-get update \ | ||
| && apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 libx11-xcb1 libxtst6 lsb-release --no-install-recommends \ | ||
| # Install deno for miscellaneous scripts | ||
| && apt-get install -y curl unzip \ | ||
| && curl -fsSL https://deno.land/x/install/install.sh | DENO_INSTALL=/usr/local sh \ | ||
| # Install ruby to support github licensed gem | ||
| && apt-get install -y ruby-full git g++ cmake pkg-config libssl-dev \ | ||
| && gem install licensed \ | ||
| # Install python for node-gyp | ||
| && apt-get install -y python3 \ | ||
| # Clean apt/lists | ||
| && rm -rf /var/lib/apt/lists/* \ | ||
| # Install node modules and rebuild indexes | ||
| && npm ci \ | ||
| && npm run build | ||
|
Comment on lines
+5
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 MEDIUM - Copying entire project directory into production image Category: security Description: Suggestion: Why this matters: Smaller images pull faster, have fewer vulnerabilities, and reduce secrets exposure. Confidence: 80% |
||
|
|
||
| # Environment variables | ||
| ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true | ||
| ENV PUPPETEER_BROWSER_PATH="google-chrome-stable" | ||
| ENV NODE_ENV=production | ||
|
|
||
| # Run web server | ||
| CMD ["npm", "start"] | ||
|
Comment on lines
+37
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 HIGH - Missing HEALTHCHECK in Docker container Category: bug Description: Suggestion: Why this matters: Missing healthcheck prevents automatic recovery from application failures. Confidence: 85%
Comment on lines
+1
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 HIGH - Container runs as root user Category: security Description: Suggestion: Why this matters: Root in container may have elevated privileges on host depending on configuration. Confidence: 95%
Comment on lines
+1
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 HIGH - Single-stage Docker build leaves build tools in production Category: security Description: Suggestion: Why this matters: Security issues can lead to data breaches. Confidence: 90% |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| web: npm start |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| build: | ||
| docker: | ||
| web: Dockerfile.web |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ export default async function({log = true, sandbox = false, community = {}, extr | |
| authenticated: null, | ||
| templates: {}, | ||
| queries: {}, | ||
| settings: {port: 3000}, | ||
| settings: {port: Number(process.env.PORT) || 3000}, | ||
| metadata: {}, | ||
| paths: { | ||
| statics: __statics, | ||
|
|
@@ -63,6 +63,12 @@ export default async function({log = true, sandbox = false, community = {}, extr | |
| } | ||
| } | ||
|
|
||
| //Environment variables override (for Heroku/Docker deployment) | ||
| if (process.env.METRICS_TOKEN) | ||
| conf.settings.token = process.env.METRICS_TOKEN | ||
| if (process.env.PORT) | ||
| conf.settings.port = Number(process.env.PORT) | ||
|
|
||
| if (!conf.settings.templates) | ||
| conf.settings.templates = {default: "classic", enabled: []} | ||
| if (!conf.settings.plugins) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 CRITICAL - JSON.parse without try-catch for package.json Category: bug Description: Suggestion: Why this matters: Unhandled errors crash the application or hide bugs. Confidence: 92% |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 MEDIUM - Node.js base image uses floating patch version
Agent: microservices
Category: quality
Description:
Node.js base image uses 'node:20-bookworm-slim' which is a floating tag that resolves to the latest patch version of Node 20. This can lead to non-deterministic builds.
Suggestion:
Use a specific patch version like 'node:20.11.1-bookworm-slim' instead of 'node:20-bookworm-slim' to ensure consistent, reproducible builds.
Why this matters: Improves code reliability.
Confidence: 75%
Rule:
docker_pin_specific_patch_versions_for_node_jsReview ID:
8aeb9742-af0a-4aae-8c5e-a98c17691accRate it 👍 or 👎 to improve future reviews | Powered by diffray