Skip to content

Commit 82610e0

Browse files
committed
SWITCH TO NODE
1 parent 0018da6 commit 82610e0

34 files changed

+8145
-0
lines changed

.dockerignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.github
2+
.nyc_output
3+
.dockerignore
4+
.git*
5+
Dockerfile
6+
node_modules
7+
8+
config.local.json
9+
node_modules/
10+
coverage/
11+
.nyc_output/
12+
.idea/
13+
npm-debug.log
14+
newrelic_agent.log
15+
16+
test/screenshots/test
17+
test/screenshots/reference
18+
test/screenshots/compare.json
19+
20+
public/style/build/*
21+
public/js/build/*
22+
23+
local.log
24+
test.log
25+
.npmrc
26+
.DS_Store
27+
28+
logfile
29+
30+
selenium-debug.log
31+
tests_output/

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
- [ ] Tests written and linted [ℹ︎](https://github.com/snyk/general/wiki/Tests)
2+
- [ ] Documentation written [ℹ︎](https://github.com/snyk/general/wiki/Documentation)
3+
- [ ] Commit history is tidy [ℹ︎](https://github.com/snyk/general/wiki/Git)
4+
5+
### What this does
6+
7+
_Explain why this PR exists_
8+
9+
### Notes for the reviewer
10+
11+
_Instructions on how to run this locally, background context, what to review, questions…_
12+
13+
### More information
14+
15+
- [Jira ticket SC-0000](https://snyksec.atlassian.net/browse/SC-0000)
16+
- [Link to documentation](https://github.com/Snyk/registry/wiki/)
17+
18+
### Screenshots
19+
20+
_Visuals that may help the reviewer_

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# build output
2+
dist
3+
4+
# Logs
5+
logs
6+
*.log
7+
npm-debug.log*
8+
9+
# Runtime data
10+
pids
11+
*.pid
12+
*.seed
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# node-waf configuration
27+
.lock-wscript
28+
29+
# Compiled binary addons (http://nodejs.org/api/addons.html)
30+
build/Release
31+
32+
# Dependency directories
33+
node_modules
34+
jspm_packages
35+
36+
# Optional npm cache directory
37+
.npm
38+
39+
# Optional REPL history
40+
.node_repl_history

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
10

.snyk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
2+
version: v1.13.1
3+
ignore: {}
4+
patch: {}

.travis.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
sudo: false
2+
dist: xenial
3+
language: node_js
4+
cache:
5+
directories:
6+
- node_modules
7+
notifications:
8+
email: false
9+
slack:
10+
on_failure: always
11+
on_success: never
12+
on_pull_requests: false
13+
rooms:
14+
secure: mWzYwXXkaPJ/t24kG9gz6hYyRGoGX+zsjKDa+IzjhY4NeMJyzgHyN3x1vWwSXhfG1jQuBTFyT5RTWN8Jfo2Za/XDKYfMXXP5gCMtNkeWdflYWaUC7sAZepRANUB3gzkCTvkc/DOY/FI07xCcLMJoZ7jGiADNakTaWvzdExJUBs6NuhGdIUmOT+chbip02yN7mSPeqyU7/vFqpCxxEoPeNzaNshLufbZUEWgmLm0bm5Uxdo7Yi5rL0/nA7oqXUzzWTtgQEu0mOG4Oqu7oXAki2rLISw8enZwt5/fUbxGgK1J3UB86vgnDrxbTAhuNUuddaSxUuDsg1+3xyRzU74cyKUWnWqL10Tyy9KgDR0A+48w2v8DH/pOvnvfXA+FL0zLtDJ9jPuSK0dFbceRYmolEGMDF53Q/s2W+waC13Bi3nHRQJKYmT+bOnoLABLpfm5fbV/2br4LVTQwiP80HJ+19Vy4lriF55zu1yjESUBzdvvX1Dhp5E3AXZZv6xB0v4gyZZeOoIv6BxqinLauZiS3nM7O9vu1QnFvbo4HH0Df651fyy1kOU5UAAD+CNRgpZ8GMc+EegvnLbS3nzbNOPlkACmhxMNcpEvD6MomcB4UV2dPWAYIQSfrRV5h+iZlNSqCkA2pl3p6TTZhLMvoSxziRzUZZx7GQe/cnUGN6GbzyyRk=
15+
node_js:
16+
- '10'
17+
before_install:
18+
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
19+
install:
20+
- npm install
21+
jobs:
22+
include:
23+
# test stage
24+
- stage: Test
25+
script: npm run test
26+
# release and deploy stage
27+
- stage: Release and deploy
28+
if: branch IN (master, develop) AND type != pull_request
29+
script:
30+
- npx semantic-release
31+
- ./scripts/travis_after_success.sh
32+
branches:
33+
only:
34+
- master
35+
- develop

.vscode/launch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch Program",
11+
"program": "${workspaceFolder}/dist/index.js",
12+
"preLaunchTask": "tsc: build - tsconfig.json",
13+
"outFiles": [
14+
"${workspaceFolder}/dist/**/*.js"
15+
]
16+
}
17+
]
18+
}

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM nodesource/nsolid:dubnium-latest
2+
3+
MAINTAINER Snyk Ltd
4+
5+
ENV NODE_ENV production
6+
7+
RUN mkdir -p /srv/app
8+
WORKDIR /srv/app
9+
10+
RUN useradd --home-dir /srv/app -s /bin/bash snyk
11+
RUN chown -R snyk:snyk /srv/app
12+
USER snyk
13+
14+
# Add manifest files and install before adding anything else to take advantage of layer caching
15+
ADD --chown=snyk:snyk package.json package-lock.json .snyk ./
16+
17+
ARG NPMJS_TOKEN
18+
RUN echo //registry.npmjs.org/:_authToken=$NPMJS_TOKEN >> ~/.npmrc && \
19+
npm install && \
20+
rm ~/.npmrc
21+
22+
# add the rest of the app files
23+
ADD --chown=snyk:snyk . .
24+
25+
# Complete any `prepare` tasks (e.g. typescript), as this step ran automatically prior to app being copied
26+
RUN npm run prepare
27+
28+
ENTRYPOINT ["./docker-entrypoint.sh"]
29+
30+
EXPOSE 1212
31+
CMD ["bin/start"]

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# snyk/kubernetes-monitor #
2+
3+
## Summary ##
4+
Docker container to monitor Kubernetes clusters' security
5+
6+
## Running Locally ##
7+
https://kubernetes.io/docs/tasks/tools/install-minikube/
8+
9+
kubectl run snyk-k8s-monitor --image-pull-policy=Never --image=snyk-k8s-monitor:latest
10+
11+

bin/start

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#! /bin/sh
2+
3+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
4+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
5+
6+
exec node --inspect=5444 $NODE_OPTIONS "$PROJECT_ROOT" "$@"

0 commit comments

Comments
 (0)