Skip to content
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

verification service #5

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 20 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
**/*.env
.git
.github
.husky
coverage
logs
# node_modules
.dockerignore
.editorconfig
.eslintrc.cjs
.gitignore
.lintstagedrc.json
.prettierignore
.prettierrc.js
compose-test.yaml
compose.yaml
compose-health-test.yaml
Dockerfile
README
.env.healthcheck.testing
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PORT=4009 # default port is 4009

# see the README for an explanation of logging
LOG_ALL_FILE=logs/all.log
ERROR_LOG_FILE=logs/error.log
CONSOLE_LOG_LEVEL=silly # default is silly, i.e. log everything - see the README for allowed levels
LOG_LEVEL=silly # default is silly
20 changes: 20 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
overrides: [
{
files: ['*.js'],
extends: [
"eslint:recommended",
"plugin:prettier/recommended"
],
env: {
node: true,
mocha: true,
es6: true
},
parserOptions: {
ecmaVersion: 2022,
sourceType: "module"
}
}
]
}
19 changes: 0 additions & 19 deletions .eslintrc.js

This file was deleted.

22 changes: 3 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -17,30 +17,14 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Run test with Node.js ${{ matrix.node-version }}
run: npm run test-node
run: npm run test
env:
CI: true
test-karma:
runs-on: ubuntu-latest
# needs: [lint]
timeout-minutes: 10
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Run karma tests
run: npm run test-karma
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
24 changes: 9 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ yarn-debug.log*
yarn-error.log*
lerna-debug.log*

package-lock.json
yarn.lock

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

Expand All @@ -26,8 +23,7 @@ coverage
*.lcov

# nyc test coverage
/.nyc_output
/coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
Expand All @@ -46,7 +42,7 @@ node_modules/
jspm_packages/

# TypeScript v1 declaration files
types/
typings/

# TypeScript cache
*.tsbuildinfo
Expand Down Expand Up @@ -84,6 +80,7 @@ types/

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
Expand All @@ -106,13 +103,10 @@ types/
# TernJS port file
.tern-port

# Editor files
*~
*.sw[nop]
/.vscode

# Output
dist
# vscode
.vscode

# MacOS
.DS_Store
compose-test.yaml
compose.yaml
compose-health-test.yaml
.env.healthcheck.testing
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
#npm test
20 changes: 20 additions & 0 deletions .knownDidRegistries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const knownDidRegistries = [
{
name: 'DCC Pilot Registry',
url: 'https://digitalcredentials.github.io/issuer-registry/registry.json'
},
{
name: 'DCC Sandbox Registry',
url: 'https://digitalcredentials.github.io/sandbox-registry/registry.json'
},
{
name: 'DCC Community Registry',
url: 'https://digitalcredentials.github.io/community-registry/registry.json'
},
{
name: 'DCC Registry',
url: 'https://digitalcredentials.github.io/dcc-registry/registry.json'
}
]

export default knownDidRegistries
6 changes: 6 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"*.js": [
"prettier --write",
"eslint"
]
}
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
trailingComma: 'none',
tabWidth: 2,
semi: false,
Expand Down
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# isomorphic-lib-template Changelog

## 1.0.0 - TBD
# verifier-service Changelog

## 0.1.0 - 2024-11-27
### Added
- first release

- Initial commit.
For previous history, see Git commits.
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:18 as builder
ADD . /app
ENV NODE_ENV=production
WORKDIR /app
RUN npm install

FROM gcr.io/distroless/nodejs18-debian11
COPY --from=builder /app/node_modules /app/node_modules
COPY --from=builder /app/server.js /app/server.js
COPY --from=builder /app/src /app/src
COPY --from=builder /app/package.json /app/package.json
COPY --from=builder /app/healthcheck.js /app/healthcheck.js
COPY --from=builder /app/.knownDidRegistries.js /app/.knownDidRegistries.js

# The healthcheck can be run from here, but also from the compose file
# HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD ["/nodejs/bin/node", "app/healthcheck.js"]

CMD ["app/server.js"]

EXPOSE 4009

6 changes: 6 additions & 0 deletions Dockerfile.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:20
WORKDIR /app
COPY . .
#RUN npm install
CMD ["node", "server.js"]
EXPOSE 4009
21 changes: 0 additions & 21 deletions LICENSE.md

This file was deleted.

Loading
Loading