Skip to content
Merged
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
32 changes: 16 additions & 16 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'yarn'
cache: 'npm'

- name: Cache dependencies
uses: actions/cache@v3
id: node-modules-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-

- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install
run: npm ci

- name: Validate PR commits with commitlint
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
Expand All @@ -52,23 +52,23 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'yarn'
cache: 'npm'

- name: Cache dependencies
uses: actions/cache@v3
id: node-modules-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-

- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install
run: npm ci

- name: Build
run: yarn build
run: npm run build

lint:
name: Run lint
Expand All @@ -81,23 +81,23 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'yarn'
cache: 'npm'

- name: Cache dependencies
uses: actions/cache@v3
id: node-modules-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-

- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install
run: npm ci

- name: Lint
run: yarn lint
run: npm run lint

test:
name: Test
Expand All @@ -110,26 +110,26 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'yarn'
cache: 'npm'

- name: Cache dependencies
uses: actions/cache@v3
id: node-modules-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-modules-

- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: yarn install
run: npm ci

- name: Generate test SSL certificates
run: yarn generate-test-ssl
run: npm run generate-test-ssl

- name: Test
run: yarn test
run: npm test
env:
NODE_OPTIONS: '--max-old-space-size=4096'
MASTER_BITGO_EXPRESS_KEYPATH: ./test-ssl-key.pem
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ jobs:
lint-node-version: '22.x'
test-node-versions: '["22.x"]'
release-node-version: '22.x'
build-command: 'yarn build'
test-command: 'yarn test'
build-command: 'npm run build'
test-command: 'npm test'
allow-postinstall-scripts: false
18 changes: 9 additions & 9 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Commands

### Development
- `yarn start` - Start the application in development mode using nodemon for auto-reloading
- `yarn build` - Build the TypeScript code (creates /dist folder)
- `yarn lint` - Run ESLint to check for code issues
- `yarn lint:fix` - Run ESLint and automatically fix issues when possible
- `npm start` - Start the application in development mode using nodemon for auto-reloading
- `npm run build` - Build the TypeScript code (creates /dist folder)
- `npm run lint` - Run ESLint to check for code issues
- `npm run lint:fix` - Run ESLint and automatically fix issues when possible

### Testing
- `yarn test` - Run all tests
- `yarn test:watch` - Run tests in watch mode
- `yarn test:coverage` - Run tests with coverage report
- `yarn generate-test-ssl` - Generate self-signed SSL certificates for testing
- `npm test` - Run all tests
- `npm run test:watch` - Run tests in watch mode
- `npm run test:coverage` - Run tests with coverage report
- `npm run generate-test-ssl` - Generate self-signed SSL certificates for testing

### Container
- `yarn container:build` - Build the container image using Podman (optionally use --build-arg PORT=3080)
- `npm run container:build` - Build the container image using Podman (optionally use --build-arg PORT=3080)

## Architecture Overview

Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ RUN --mount=type=cache,target=/var/cache/apk \
linux-headers

# Copy dependency files
COPY package.json yarn.lock ./
COPY package.json package-lock.json ./

# Install dependencies with cache mount
RUN --mount=type=cache,target=/usr/src/app/.yarn-cache \
yarn install --frozen-lockfile --production=false --cache-folder /usr/src/app/.yarn-cache && \
yarn cache clean && \
rm -rf /usr/src/app/.yarn-cache/*
RUN --mount=type=cache,target=/usr/src/app/.npm-cache \
npm ci --cache /usr/src/app/.npm-cache && \
npm cache clean --force && \
rm -rf /usr/src/app/.npm-cache/*

# Copy source code
COPY . .

# Build TypeScript code with deterministic output
RUN yarn build
RUN npm run build

FROM node:22.1.0-alpine@sha256:487dc5d5122d578e13f2231aa4ac0f63068becd921099c4c677c850df93bede8 AS production

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ TLS_KEY_PATH=./server.key \
TLS_CERT_PATH=./server.crt \
MTLS_REQUEST_CERT=true \
ALLOW_SELF_SIGNED=true \
yarn start
npm run start
```

### 3. Start Master Express
Expand All @@ -117,7 +117,7 @@ ENCLAVED_EXPRESS_URL=https://localhost:3080 \
ENCLAVED_EXPRESS_CERT=./server.crt \
MTLS_REQUEST_CERT=false \
ALLOW_SELF_SIGNED=true \
yarn start
npm run start
```

### 4. Test the Connection
Expand Down Expand Up @@ -151,7 +151,7 @@ TLS_CERT_PATH=/secure/path/enclaved.crt \
MTLS_REQUEST_CERT=true \
ALLOW_SELF_SIGNED=false \
MTLS_ALLOWED_CLIENT_FINGERPRINTS=ABC123...,DEF456... \
yarn start
npm run start
```

#### Master Express (Production)
Expand All @@ -165,7 +165,7 @@ ENCLAVED_EXPRESS_URL=https://enclaved.internal.example.com:3080 \
ENCLAVED_EXPRESS_CERT=/secure/path/enclaved.crt \
MTLS_REQUEST_CERT=true \
ALLOW_SELF_SIGNED=false \
yarn start
npm run start
```

## Container Deployment with Podman
Expand All @@ -174,10 +174,10 @@ First, build the container image:

```bash
# For Master Express (default port 3081)
yarn container:build
npm run container:build

# For Enclaved Express (port 3080)
yarn container:build --build-arg PORT=3080
npm run container:build --build-arg PORT=3080
```

For local development, you'll need to run both the Enclaved Express and Master Express containers:
Expand Down Expand Up @@ -290,7 +290,7 @@ env | grep -E "(APP_MODE|KMS_URL|ENCLAVED_EXPRESS|TLS_)"
Enable debug logging for detailed troubleshooting:

```bash
DEBUG_NAMESPACE=enclaved:*,master:* yarn start
DEBUG_NAMESPACE=enclaved:*,master:* npm run start
```

## License
Expand Down
Loading