Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
Initial implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham42 committed Apr 4, 2019
0 parents commit fbc2caa
Show file tree
Hide file tree
Showing 23 changed files with 35,861 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.git/
.gitignore
build/
README.md
Dockerfile*
*.log
**/*.swp
node_modules/
scan-results.json
coverage/
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
node_modules/
58 changes: 58 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
module.exports = {
env: {
node: true,
es6: true,
},
extends: ["eslint:recommended", "prettier"],
rules: {
"no-var": "error",
eqeqeq: ["error", "always"],
},

overrides: [
{
files: ["**/*.ts", "**/*.tsx"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
project: "./tsconfig.json",
},
plugins: ["@typescript-eslint"],
rules: {
// These ESLint rules are known to cause issues with typescript-eslint
// See https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/recommended.json
camelcase: "off",
indent: "off",
"no-array-constructor": "off",
"no-unused-vars": "off",

"@typescript-eslint/no-angle-bracket-type-assertion": "warn",
"@typescript-eslint/no-array-constructor": "warn",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-unused-vars": [
"warn",
{
args: "none",
ignoreRestSiblings: true,
},
],
"@typescript-eslint/camelcase": "warn",
"@typescript-eslint/no-use-before-define": "warn",
},
},
{
files: ["**/__tests__/**/*", "**/__mocks__/**/*"],
plugins: ["jest"],
env: {
// Bugged, see https://github.com/jest-community/eslint-plugin-jest/issues/128
// "jest/globals": true,
// This list isn't as complete but should work for now
jest: true,
},
rules: {
"no-console": "off",
},
},
],
};
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# we don't want to see generated files as part of diffs and code reviews
package-lock.json -diff
# This is a generated file for this project
src/types/smartcheck-api.d.ts -diff
87 changes: 87 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

build/

#rollup build cache
/.r*/

scan-results.json
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
# npm install does its' own formatting of the package.json and package-lock.json
# files
package*.json
build/
coverage/
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"package-lock.json": true,
"src/types/smartcheck-api.d.ts": true
},
"eslint.validate": [
"javascript",
"javascriptreact",
{ "language": "typescript", "autoFix": true }
],
"eslint.autoFixOnSave": true,
"cSpell.words": [
"deepsecurity",
"dssc",
"execa",
"microbundle",
"preregistry",
"smartcheck",
"userid"
]
}
56 changes: 56 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This target exists to enable targeted building for running tests
FROM node:10-alpine as builder
WORKDIR /code
# keep package.json separate so that we can cache the npm install step more often
COPY package*.json /code/
RUN npm install --quiet

COPY . /code/

RUN npm run build

################################################################################
FROM node:10-alpine as prod-install
WORKDIR /app/
COPY --from=builder /code/package*.json /app/
RUN npm install --production
COPY --from=builder /code/build/ /app/dist/

################################################################################
FROM node:10-alpine as docker-install

RUN apk update && \
apk add curl

WORKDIR /tmp

ENV VERSION "18.09.3"
RUN curl -L -o /tmp/docker-$VERSION.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VERSION.tgz \
&& tar -xz -f /tmp/docker-$VERSION.tgz \
&& mv docker/docker /usr/bin

################################################################################
FROM node:10-alpine

# See GitHub Action label docs
# https://developer.github.com/actions/creating-github-actions/creating-a-docker-container/#label
LABEL "com.github.actions.name"="Deep Security Smart Check Scan"
LABEL "com.github.actions.description"="Scan container images with Deep Security Smart Check."
LABEL "com.github.actions.icon"="shield"
LABEL "com.github.actions.color"="gray-dark"
LABEL "maintainer"="Trend Micro"
LABEL "repository"="https://github.com/deep-security/smartcheck-scan-action"
LABEL "homepage"="https://www.trendmicro.com/smartcheck"

RUN apk update && \
apk upgrade && \
rm -rf /var/cache/apk/*

COPY --from=prod-install /app/ /app/

COPY --from=docker-install /usr/bin/docker /usr/bin/docker

WORKDIR /app/

ENTRYPOINT ["node", "/app/dist/index.js"]

Loading

0 comments on commit fbc2caa

Please sign in to comment.