Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
npm-debug.log
.git
.gitignore
.env
*.md
data/*.db
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Application settings
PORT=2019

# Database settings
SQLITE_DB_PATH=data/items.db

# Redis settings (legacy)
# REDIS_HOST=localhost
# REDIS_PORT=6379
# REDIS_PASSWORD=
13 changes: 12 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI
name: Node.js CI with Trivy

on:
push:
Expand Down Expand Up @@ -29,3 +29,14 @@ jobs:
- run: npm ci
- run: npm run build --if-present
- run: npm test

trivy-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Trivy
run: curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh
- name: Scan Docker Image
run: trivy image simple-application:sqlite
- name: Scan Kubernetes Manifests
run: trivy k8s --report all --file simple-app/templates/deployment.yaml
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.env
node_modules
node_modules
simple-app/values.yaml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This is a simple application that uses SQLite3 as the main database.
- Docker
- Minikube
- Kubernetes CLI (`kubectl`)
- Helm
- Helm

### Installation

Expand Down
Binary file modified data/items.db
Binary file not shown.
17 changes: 8 additions & 9 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// jest.config.js
module.exports = {
testEnvironment: 'node',
testMatch: ['**/tests/**/*.test.js'],
testPathIgnorePatterns: ['/node_modules/', '/src/routes/'],
moduleDirectories: ['node_modules', 'src'],
verbose: true,
testTimeout: 10000,
setupFiles: ['dotenv/config']
};

testEnvironment: 'node',
testMatch: ['**/tests/**/*.test.js'],
testPathIgnorePatterns: ['/node_modules/', '/src/routes/', '/data/*.db-journal'],
moduleDirectories: ['node_modules', 'src'],
verbose: true,
testTimeout: 10000,
setupFiles: ['dotenv/config']
};
Loading