From 8739ab20eb57788d6ce1d5422cdc5b21dbe4cfbb Mon Sep 17 00:00:00 2001 From: aloftus23 Date: Thu, 2 May 2024 09:39:14 -0400 Subject: [PATCH] Merge more unrelated files from develop --- backend/.dockerignore | 2 +- backend/.eslintrc.yml | 42 ++++++++++++++++--------------- backend/.npmrc | 2 +- backend/.snyk | 4 +-- backend/Dockerfile | 2 +- backend/Dockerfile.pe | 6 ++--- backend/Dockerfile.worker | 2 +- backend/db-init/create-test-db.sh | 4 +-- 8 files changed, 33 insertions(+), 31 deletions(-) diff --git a/backend/.dockerignore b/backend/.dockerignore index 510052ca..fa207aab 100644 --- a/backend/.dockerignore +++ b/backend/.dockerignore @@ -4,4 +4,4 @@ node_modules dist Dockerfile* nvd-dump -coverage \ No newline at end of file +coverage diff --git a/backend/.eslintrc.yml b/backend/.eslintrc.yml index b3bbd73e..843e1470 100644 --- a/backend/.eslintrc.yml +++ b/backend/.eslintrc.yml @@ -1,21 +1,23 @@ --- -{ - "env": { "es6": true, "node": true }, - "parser": "@typescript-eslint/parser", - "ignorePatterns": ["dist/**"], - "extends": - [ - "plugin:prettier/recommended", - "plugin:@typescript-eslint/eslint-recommended", - ], - "plugins": ["prettier", "@typescript-eslint"], - "parserOptions": { "ecmaVersion": 2018, "sourceType": "module" }, - "rules": - { - "prettier/prettier": "error", - "react/prop-types": 0, - "react/display-name": 0, - }, - "settings": { "react": { "version": "detect" } }, - "globals": { "Atomics": "readonly", "SharedArrayBuffer": "readonly" }, -} +env: + es6: true + node: true +parser: '@typescript-eslint/parser' +ignorePatterns: [dist/**] +extends: + - plugin:prettier/recommended + - plugin:@typescript-eslint/eslint-recommended +plugins: [prettier, '@typescript-eslint'] +parserOptions: + ecmaVersion: '2018' + sourceType: module +rules: + prettier/prettier: error + react/prop-types: 0 + react/display-name: 0 +settings: + react: + version: detect +globals: + Atomics: readonly + SharedArrayBuffer: readonly diff --git a/backend/.npmrc b/backend/.npmrc index 4fd02195..b6f27f13 100644 --- a/backend/.npmrc +++ b/backend/.npmrc @@ -1 +1 @@ -engine-strict=true \ No newline at end of file +engine-strict=true diff --git a/backend/.snyk b/backend/.snyk index 540e11d0..59c21139 100644 --- a/backend/.snyk +++ b/backend/.snyk @@ -4,9 +4,9 @@ version: v1.22.1 # ignores vulnerabilities until expiry date; change duration by modifying expiry date -ignore: +ignore: # ignore scrapy 2.x.x for 6 months. - SNYK-PYTHON-SCRAPY-40690: + SNYK-PYTHON-SCRAPY-40690: - '*': reason: No fix available up to version 2.11.0 expires: 2024-06-01T00:00:00.000Z diff --git a/backend/Dockerfile b/backend/Dockerfile index a45d7240..24b89bee 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,7 +1,7 @@ FROM node:18-alpine3.17 USER root -RUN apk update && apk upgrade +RUN apk update && apk upgrade && apk add g++ make py3-pip WORKDIR /app COPY ./package* ./ diff --git a/backend/Dockerfile.pe b/backend/Dockerfile.pe index eb0fa4b1..eef90641 100644 --- a/backend/Dockerfile.pe +++ b/backend/Dockerfile.pe @@ -33,9 +33,9 @@ RUN git clone -b AL-staging-SQS https://github.com/cisagov/pe-reports.git && \ RUN python -m spacy download en_core_web_lg -# Create database.ini -RUN echo "[database]" > database.ini \ - && echo "user=$(cat db_user.txt)" >> database.ini \ +# Create database.ini +RUN echo "[database]" > database.ini \ + && echo "user=$(cat db_user.txt)" >> database.ini \ && echo "password=$(cat db_password.txt)" >> database.ini COPY worker worker diff --git a/backend/Dockerfile.worker b/backend/Dockerfile.worker index 3f0a270c..a37e4cfe 100644 --- a/backend/Dockerfile.worker +++ b/backend/Dockerfile.worker @@ -26,7 +26,7 @@ WORKDIR /app RUN apk add --no-cache curl unzip musl-dev -RUN curl -4LO http://github.com/Findomain/Findomain/releases/latest/download/findomain-linux.zip +RUN curl -4LO http://github.com/Findomain/Findomain/releases/latest/download/findomain-linux.zip RUN unzip findomain-linux.zip && chmod +x findomain && cp findomain /usr/bin/findomain RUN go mod init crossfeed-worker diff --git a/backend/db-init/create-test-db.sh b/backend/db-init/create-test-db.sh index 77190622..6d766685 100755 --- a/backend/db-init/create-test-db.sh +++ b/backend/db-init/create-test-db.sh @@ -3,7 +3,7 @@ set -e set -u -psql -v ON_ERROR_STOP=1 --username "$DB_USERNAME" <<-EOSQL +psql -v ON_ERROR_STOP=1 --username "$DB_USERNAME" <<- EOSQL CREATE DATABASE crossfeed_test; GRANT ALL PRIVILEGES ON DATABASE crossfeed_test TO $DB_USERNAME; -EOSQL \ No newline at end of file +EOSQL