Repository navigation
Version/2.3.9 #2819
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
Version/2.3.9 #2819
Changes from all commits
d4ddca0
191a797
3e7c00c
d171b3e
5c746b7
3ef459c
50af57c
78e3f4a
0eaa163
0aec264
9b6dcd7
7e572ce
da8004e
8bc8f9c
396629c
a2b82d1
45165f1
d614b0d
7a992f5
f7352bd
a7f272c
141fcf7
419c933
ec734af
c539c0f
56763fe
1989bac
f768a39
f329106
17d4997
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,34 @@ | ||
| { | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "type": "node", | ||
| "request": "launch", | ||
| "name": "Debug Evolution API (dev:server)", | ||
| "runtimeExecutable": "npm", | ||
| "runtimeArgs": ["run", "dev:server"], | ||
| "console": "integratedTerminal", | ||
| "cwd": "${workspaceFolder}", | ||
| "env": { | ||
| "NODE_OPTIONS": "--inspect" | ||
| }, | ||
| "skipFiles": ["<node_internals>/**"], | ||
| "resolveSourceMapLocations": [ | ||
| "${workspaceFolder}/**", | ||
| "!**/node_modules/**" | ||
| ] | ||
| }, | ||
| { | ||
| "type": "node", | ||
| "request": "attach", | ||
| "name": "Attach Evolution API (porta 9229)", | ||
| "port": 9229, | ||
| "restart": true, | ||
| "skipFiles": ["<node_internals>/**"], | ||
| "resolveSourceMapLocations": [ | ||
| "${workspaceFolder}/**", | ||
| "!**/node_modules/**" | ||
| ] | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,30 @@ | ||
| FROM node:24-alpine AS builder | ||
|
|
||
| # Instalar dependΓͺncias incluindo openssh | ||
| RUN apk update && \ | ||
| apk add --no-cache git ffmpeg wget curl bash openssl | ||
| apk add --no-cache git ffmpeg wget curl bash openssl openssh-client | ||
|
|
||
| LABEL version="2.3.1" description="Api to control whatsapp features through http requests." | ||
| LABEL maintainer="Davidson Gomes" git="https://github.com/DavidsonGomes" | ||
| LABEL contact="contato@evolution-api.com" | ||
|
|
||
| WORKDIR /evolution | ||
|
|
||
| # Configurar SSH para GitHub | ||
| RUN mkdir -p -m 0700 ~/.ssh && \ | ||
| ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
|
|
||
| # Montar a chave SSH durante o build (usando BuildKit) | ||
| RUN --mount=type=ssh,id=default \ | ||
| git config --global url."git@github.com:".insteadOf https://github.com/ | ||
|
|
||
| COPY ./package*.json ./ | ||
| COPY ./patches ./patches | ||
| COPY ./tsconfig.json ./ | ||
| COPY ./tsup.config.ts ./ | ||
| COPY ./patches ./patches | ||
|
|
||
| RUN npm ci --silent | ||
| RUN --mount=type=ssh,id=default npm ci | ||
|
Contributor
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 Β· Dependency scripts can use the forwarded SSH agent When a dependency lifecycle script executed by Install dependencies without exposing a broadly privileged agent to lifecycle scripts, or use a narrowly scoped, read-only build credential and restrict what installation scripts can execute. Prompt for AI agentsIn `Dockerfile` at line 27:
**Dependency scripts can use the forwarded SSH agent**
When a dependency lifecycle script executed by `npm ci` is malicious or compromised, `npm ci` runs dependency lifecycle scripts while the SSH agent socket is mounted, so a compromised dependency can use the builder's forwarded key to authenticate to repositories accessible to that key; the build exposes the key's privileges to dependency code.
Install dependencies without exposing a broadly privileged agent to lifecycle scripts, or use a narrowly scoped, read-only build credential and restrict what installation scripts can execute. |
||
|
|
||
| COPY ./src ./src | ||
| COPY ./public ./public | ||
|
|
@@ -58,4 +68,4 @@ ENV DOCKER_ENV=true | |
|
|
||
| EXPOSE 8080 | ||
|
|
||
| ENTRYPOINT ["/bin/bash", "-c", ". ./Docker/scripts/deploy_database.sh && npm run start:prod" ] | ||
| ENTRYPOINT ["/bin/bash", "-c", ". ./Docker/scripts/deploy_database.sh && npm run start:prod" ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| Para fazer o deploy | ||
|
|
||
| Deve fazer o login no ECR | ||
|
|
||
| # Dar permissΓ£o de execuΓ§Γ£o (sΓ³ precisa fazer uma vez) | ||
| chmod +x build.sh | ||
|
|
||
| # Build de teste | ||
| ./build.sh uno/evolution-test | ||
|
|
||
| # Build de produΓ§Γ£o | ||
| ./build.sh uno/evolution |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Script para build do Docker com SSH Agent | ||
| # chmod +x build.sh | ||
| # Uso: ./build.sh <nome-da-imagem> | ||
| # Exemplo: ./build.sh uno/evolution-test | ||
| # Exemplo: ./build.sh uno/evolution | ||
|
|
||
| set -e # Parar em caso de erro | ||
|
|
||
| # Verificar se foi passado o nome da imagem | ||
| if [ -z "$1" ]; then | ||
| echo "β Erro: VocΓͺ precisa especificar o nome da imagem!" | ||
| echo "" | ||
| echo "Uso: ./build.sh <nome-da-imagem>" | ||
| echo "" | ||
| echo "Exemplos:" | ||
| echo " ./build.sh uno/evolution-test" | ||
| echo " ./build.sh uno/evolution" | ||
| exit 1 | ||
| fi | ||
|
|
||
| IMAGE_NAME=$1 | ||
|
|
||
| echo "π Iniciando SSH Agent..." | ||
| eval $(ssh-agent -s) | ||
|
|
||
| echo "π Adicionando chave SSH (vocΓͺ precisarΓ‘ digitar a senha)..." | ||
| ssh-add ~/.ssh/id_ed25519 | ||
|
|
||
| echo "π³ Fazendo build da imagem: $IMAGE_NAME" | ||
| export DOCKER_BUILDKIT=1 | ||
| docker build --ssh default -t "$IMAGE_NAME" . | ||
|
|
||
| echo "β Build concluΓdo com sucesso!" | ||
| echo "" | ||
| echo "π§Ή Limpando SSH Agent..." | ||
| ssh-agent -k | ||
|
|
||
| echo "π Pronto! Imagem criada: $IMAGE_NAME" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,18 @@ | ||
| services: | ||
| api: | ||
| container_name: evolution_api | ||
| image: evolution/api:local | ||
| build: . | ||
| postgres: | ||
| image: postgres | ||
| restart: always | ||
| ports: | ||
| - 8080:8080 | ||
| volumes: | ||
| - evolution_instances:/evolution/instances | ||
| networks: | ||
| - evolution-net | ||
| env_file: | ||
| - .env | ||
| expose: | ||
| - 8080 | ||
|
|
||
| frontend: | ||
| container_name: evolution_frontend | ||
| image: evolution/manager:local | ||
| build: ./evolution-manager-v2 | ||
| - '5438:5432' | ||
| environment: | ||
| - POSTGRES_USER=postgres | ||
| - POSTGRES_PASSWORD=andand123 | ||
|
|
||
| redis: | ||
| image: redis:latest | ||
| restart: always | ||
| container_name: redis | ||
| command: > | ||
| redis-server --port 6379 --appendonly yes | ||
| ports: | ||
| - "3000:80" | ||
| networks: | ||
| - evolution-net | ||
|
|
||
| volumes: | ||
| evolution_instances: | ||
|
|
||
|
|
||
| networks: | ||
| evolution-net: | ||
| name: evolution-net | ||
| driver: bridge | ||
| - 6379:6379 |
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.
π High Β· Unverified GitHub key permits package substitution
When the build runs through a network where an attacker can intercept the GitHub host-key scan,
ssh-keyscantrusts whichever host key the network returns, so an on-path attacker can make the build trust an impersonated GitHub server and supply malicious dependency code duringnpm ci; the build then produces a compromised image.Pin GitHub's published SSH host keys and verify the scan result against those pins before trusting it.
Prompt for AI agents