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

promote dev to master #83

Merged
merged 25 commits into from
Apr 20, 2024
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
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules
.trunk
.eslintrc.js
.prettierrc.js
37 changes: 21 additions & 16 deletions .github/workflows/audit_and_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,56 @@ on:
pull_request:
branches: [main, dev]

concurrency:
group:
'${{ github.workflow }} @ ${{ github.event.pull_request.head.label ||
github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
audit:
# run only on main/dev branch and pull requests
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.event_name == 'pull_request'
runs-on: ubuntu-latest

container:
image: synthetixio/docker-sec-tools:18.13-alpine
image: synthetixio/docker-sec-tools:20.12-alpine

steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Audit dependencies
run: audit-ci --critical --report-type full

- name: Lockfile lint
run: lockfile-lint -p yarn.lock --type yarn --allowed-hosts yarn --empty-hostname false --validate-package-names --validate-https

build:
needs: audit
# run only on audit success or audit skipped
if: always() && (needs.audit.result == 'success' || needs.audit.result == 'skipped')
runs-on: ubuntu-latest

container:
image: synthetixio/docker-node:18.13-alpine
image: synthetixio/docker-node:20.12-alpine

steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Set yarn cache directory
run: yarn config set cache-folder .yarn-cache
- name: Set pnpm cache directory
run: pnpm config set store-dir .pnpm-store
continue-on-error: true

- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
- name: Setup cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # pin@v2
with:
path: |
.yarn-cache
.pnpm-store
node_modules
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-pnpm-v1-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-v1-
${{ runner.os }}-pnpm-v1-
continue-on-error: true

- name: Install dependencies
run: yarn --frozen-lockfile --prefer-offline --no-audit
run: pnpm install --frozen-lockfile --prefer-offline

- name: Lint
run: pnpm lint
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Initialize CodeQL
uses: github/codeql-action/init@04df1262e6247151b5ac09cd2c303ac36ad3f62b
uses: github/codeql-action/init@99c9897648dded3fe63d6f328c46089dd57735ca
with:
queries: security-and-quality
languages: javascript

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@04df1262e6247151b5ac09cd2c303ac36ad3f62b
uses: github/codeql-action/analyze@99c9897648dded3fe63d6f328c46089dd57735ca
47 changes: 0 additions & 47 deletions .github/workflows/trunk.yml

This file was deleted.

1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules
.trunk
.eslintrc.js
.prettierrc.js
7 changes: 0 additions & 7 deletions .trunk/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions .trunk/configs/.hadolint.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions .trunk/configs/.markdownlint.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions .trunk/configs/.shellcheckrc

This file was deleted.

36 changes: 0 additions & 36 deletions .trunk/trunk.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# syntax=docker/dockerfile:1
FROM synthetixio/docker-node:18.13-alpine as builder
FROM synthetixio/docker-node:20.12-alpine as builder

RUN mkdir /app
WORKDIR /app

COPY package.json ./
COPY yarn.lock ./
COPY pnpm-lock.yaml ./

RUN yarn --frozen-lockfile --prefer-offline --no-audit
RUN pnpm install --frozen-lockfile --prefer-offline
COPY . .

FROM builder as api
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# syntax=docker/dockerfile:1
FROM synthetixio/docker-node:18.13-alpine as builder
FROM synthetixio/docker-node:20.12-alpine as builder

RUN mkdir /app
WORKDIR /app

COPY package.json ./
COPY yarn.lock ./
COPY pnpm-lock.yaml ./

RUN yarn --frozen-lockfile --prefer-offline --no-audit
RUN pnpm install --frozen-lockfile --prefer-offline
COPY . .

FROM builder as api
USER node
ENV CACHE_TIME 1
EXPOSE 3000
CMD ["yarn", "docker:dev"]
CMD ["pnpm", "docker:dev"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Docker with latest docker compose is mandatory.

## Development (auto-reload included)

- `yarn dev`
- `pnpm dev`

## Production

- `yarn start`
- `pnpm start`
7 changes: 7 additions & 0 deletions api.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
REDIS_PASSWORD=password1
CACHE_TIME=300 # 5 minutes

# postgres
PG_USER=
PG_HOST=
PG_NAME=
PG_PASSWORD=
PG_PORT=

# api
API_HOST=0.0.0.0
API_PORT=3000
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ services:

proxy:
container_name: proxy
image: synthetixio/nginx-debug:41158a4bf17aca53222e6b101633ddfa5af7724c-base
image: synthetixio/nginx-debug:d294126f4b4f41d99538217ce68f2e8e9bfcc6fd-base
restart: unless-stopped
volumes:
- ./nginx/templates:/etc/nginx/templates
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ services:

proxy:
container_name: proxy
image: synthetixio/nginx:41158a4bf17aca53222e6b101633ddfa5af7724c-base
image: synthetixio/nginx:d294126f4b4f41d99538217ce68f2e8e9bfcc6fd-base
restart: unless-stopped
volumes:
- ./nginx/templates:/etc/nginx/templates
Expand Down
1 change: 1 addition & 0 deletions nginx/scripts/setup-whitelist.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# whitelist domains
printf '"~*(?:\\b)synthetix\.io(?:\\b)" 0;\n' >>/etc/nginx/bots.d/whitelist-domains.conf
printf '"~*(?:\\b)synthetix\.eth\.limo(?:\\b)" 0;\n' >>/etc/nginx/bots.d/whitelist-domains.conf
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@
"dev": "./scripts/start-dev-local.sh",
"docker:start": "node src/server.js",
"docker:dev": "DEBUG=api:* nodemon src/server.js",
"lint": "trunk check .",
"format": "trunk fmt .",
"update:deps": "ncu -u && yarn"
"lint": "eslint . --ext js && prettier --check src/**",
"format": "eslint --fix src/** && prettier --write src/**",
"update:deps": "ncu -u && pnpm install"
},
"dependencies": {
"@aws-sdk/client-cloudwatch-logs": "3.327.0",
"@synthetixio/contracts-interface": "2.77.2",
"@aws-sdk/client-cloudwatch-logs": "3.556.0",
"@synthetixio/contracts-interface": "2.77.5",
"basic-auth": "2.0.1",
"bignumber.js": "9.1.1",
"bignumber.js": "9.1.2",
"cookie-parser": "1.4.6",
"debug": "4.3.4",
"ethers": "5.7.2",
"express": "4.18.2",
"express": "4.19.2",
"express-basic-auth": "1.2.1",
"morgan": "1.10.0",
"redis": "4.6.6",
"pg": "8.11.5",
"redis": "4.6.13",
"serve-favicon": "2.5.0",
"swagger-jsdoc": "6.2.8",
"swagger-ui-express": "4.6.3",
"winston": "3.8.2"
"swagger-ui-express": "5.0.0",
"winston": "3.13.0"
},
"devDependencies": {
"@trunkio/launcher": "1.2.4",
"eslint": "8.39.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-prettier": "4.2.1",
"nodemon": "2.0.22",
"npm-check-updates": "16.10.9",
"nodemon": "3.1.0",
"npm-check-updates": "16.14.18",
"prettier": "2.8.8"
}
}
Loading