Skip to content

Commit

Permalink
Merge tag 'v1.39.0' into feature/staging-rollout12-v1.39.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DenSmolonski committed May 16, 2024
2 parents f67d71e + ff1f629 commit b48797c
Show file tree
Hide file tree
Showing 439 changed files with 15,955 additions and 6,522 deletions.
32 changes: 31 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
# The cache TTL for a missing token price.
# (default is 259200 [72 hours])
# NOT_FOUND_PRICE_TTL_SECONDS=
# Token addresses whose prices should be refresed more often (with HIGH_REFRESH_RATE_TOKENS_TTL_SECONDS TTL).
# (default is [])
# HIGH_REFRESH_RATE_TOKENS=
# The cache TTL for high-refresh-rate token addresses.
# (default is 30)
# HIGH_REFRESH_RATE_TOKENS_TTL_SECONDS=
# The cache TTL for native coins.
# (default is 100)
# NATIVE_COINS_PRICES_TTL_SECONDS=

# Balances Provider - Zerion API
# Chain ids configured to use this provider. (comma-separated numbers)
Expand All @@ -23,7 +32,6 @@
#ZERION_API_KEY=

# Relay Provider
# FF_RELAY=
# The relay provider to be used.
# (default='https://api.gelato.digital')
# RELAY_PROVIDER_API_BASE_URI=
Expand Down Expand Up @@ -74,6 +82,9 @@
# Default if none is set: https://safe-config.safe.global
#SAFE_CONFIG_BASE_URI=https://safe-config.safe.global

# The base url for the Safe Locking Service
# Default if none is set: https://safe-locking.safe.global
#LOCKING_PROVIDER_API_BASE_URI=https://safe-locking.safe.global

# Redis
# The host name of where the Redis instance is running
Expand All @@ -95,10 +106,29 @@
# The cache expiration time in seconds for not found tokens errors (default=60)
#TOKEN_NOT_FOUND_EXPIRE_TIME_SECONDS

# RabbitMQ / AMQP Queue
# The AMQP server URL
#AMQP_URL=
# The AMQP Exchange name
#AMQP_EXCHANGE_NAME=
# The AMQP queue name
#AMQP_QUEUE=
# The AMQP Exchange mode
# (default=fanout)
#AMQP_EXCHANGE_MODE=
# The message prefetch amount (max non-acknowledged messages being processed)
# (default=100)
#AMQP_PREFETCH=

# Authorization token to use privileged endpoints.
# The AUTH_TOKEN should always be set
#AUTH_TOKEN=

# The issuer and secret used to sign and verify JWTs.
# The JWT_ISSUER and JWT_SECRET should always be set
#JWT_ISSUER=
#JWT_SECRET=

# Log level for the service.
#LOG_LEVEL=

Expand Down
28 changes: 0 additions & 28 deletions .eslintrc.js

This file was deleted.

43 changes: 26 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@ on:
release:
types: [released]

env:
DOCKER_IMAGE_REGISTRY: safeglobal
DOCKER_IMAGE_NAME: safe-client-gateway-nest
DOCKER_BUILD_IMAGE_TAG: buildcache

jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.11.x'
node-version: 'lts/iron'
cache: 'yarn'
- run: yarn install --immutable
- run: yarn run format-check
Expand All @@ -24,7 +29,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.11.x'
node-version: 'lts/iron'
cache: 'yarn'
- run: yarn install --immutable
- run: yarn run lint-check
Expand Down Expand Up @@ -65,11 +70,20 @@ jobs:
--health-retries 5
ports:
- 5433:5432
rabbitmq:
image: rabbitmq:alpine
ports:
- 5672:5672
options: >-
--health-cmd "rabbitmqctl await_startup"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.11.x'
node-version: 'lts/iron'
cache: 'yarn'
- run: yarn install --immutable
- run: yarn run build
Expand Down Expand Up @@ -115,27 +129,21 @@ jobs:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/build-push-action@v5
env:
DOCKER_IMAGE_TAG: safeglobal/safe-client-gateway-nest:staging
with:
platforms: linux/amd64,linux/arm64
push: true
build-args: |
BUILD_NUMBER=${{ env.BUILD_NUMBER }}
VERSION=${{ github.ref_name }}
tags: ${{ env.DOCKER_IMAGE_TAG }}
# Use inline cache storage https://docs.docker.com/build/cache/backends/inline/
cache-from: type=registry,ref=${{ env.DOCKER_IMAGE_TAG }}
cache-to: type=inline
tags: ${{ env.DOCKER_IMAGE_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:staging
# Use Registry cache backend https://docs.docker.com/build/cache/backends/registry/
cache-from: type=registry,ref=${{ env.DOCKER_IMAGE_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_BUILD_IMAGE_TAG }}
cache-to: type=registry,ref=${{ env.DOCKER_IMAGE_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_BUILD_IMAGE_TAG }},mode=max

docker-publish-release:
if: (github.event_name == 'release' && github.event.action == 'released')
needs: [prettier, es-lint, tests-finish]
runs-on: ubuntu-latest
env:
IMAGE_CACHE_SOURCE: staging
IMAGE_REGISTRY: safeglobal
IMAGE_NAME: safe-client-gateway-nest
steps:
- uses: actions/checkout@v4
- run: |
Expand All @@ -157,10 +165,11 @@ jobs:
BUILD_NUMBER=${{ env.BUILD_NUMBER }}
VERSION=${{ github.ref_name }}
tags: |
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
cache-from: type=registry,ref=${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_CACHE_SOURCE }}
cache-to: type=inline
${{ env.DOCKER_IMAGE_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ github.ref_name }}
${{ env.DOCKER_IMAGE_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:latest
# Use Registry cache backend https://docs.docker.com/build/cache/backends/registry/
cache-from: type=registry,ref=${{ env.DOCKER_IMAGE_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_BUILD_IMAGE_TAG }}
cache-to: type=registry,ref=${{ env.DOCKER_IMAGE_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_BUILD_IMAGE_TAG }},mode=max

autodeploy:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.11.1
lts/iron
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# BUILD CONTAINER
#
FROM node:20.11.1 as base
FROM node:lts-iron as base
ENV NODE_ENV production
ENV YARN_CACHE_FOLDER /root/.yarn
WORKDIR /app
Expand All @@ -20,14 +20,15 @@ RUN --mount=type=cache,target=/root/.yarn yarn run build \
#
# PRODUCTION CONTAINER
#
FROM node:20.11.1-alpine as production
FROM node:iron-alpine as production
USER node

ARG VERSION
ARG BUILD_NUMBER

ENV APPLICATION_VERSION=${VERSION} \
APPLICATION_BUILD_NUMBER=${BUILD_NUMBER}
APPLICATION_BUILD_NUMBER=${BUILD_NUMBER} \
NODE_ENV=production

COPY --chown=node:node --from=base /app/abis ./abis
COPY --chown=node:node --from=base /app/node_modules ./node_modules
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ It provides UI-oriented mappings and data structures for easier integration with

## Requirements

- Node 20.11.1https://nodejs.org/en/
- Node.js LTS (Iron) ([Node.js Release Schedule](https://nodejs.org/en/about/previous-releases))https://nodejs.org/en/
- Docker Compose – https://docs.docker.com/compose/

## Installation
Expand Down Expand Up @@ -78,7 +78,7 @@ docker compose up -d db-test
yarn run test

# e2e tests
yarn run test:e2e
docker-compose up -d redis rabbitmq && yarn run test:e2e

# test coverage
yarn run test:cov
Expand Down
15 changes: 14 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
redis:
image: redis/redis-stack:7.0.2-RC1
image: redis/redis-stack:7.2.0-v10
ports:
- ${REDIS_PORT-6379}:${REDIS_PORT-6379}
- 8001:8001
Expand Down Expand Up @@ -34,6 +34,17 @@ services:
-c ssl_key_file=/var/lib/postgresql/server.key
-c hba_file=/etc/pg_hba.conf
rabbitmq:
image: rabbitmq:alpine
ports:
- '5672:5672'
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 15s
timeout: 30s
retries: 3
start_period: 15s

web:
build: .
tty: true
Expand All @@ -52,6 +63,8 @@ services:
EMAIL_TEMPLATE_UNKNOWN_RECOVERY_TX: ${EMAIL_TEMPLATE_UNKNOWN_RECOVERY_TX-example_template_unknown_recovery_tx}
EMAIL_TEMPLATE_RECOVERY_TX: ${EMAIL_TEMPLATE_RECOVERY_TX-example_template_recovery_tx}
EMAIL_TEMPLATE_VERIFICATION_CODE: ${EMAIL_TEMPLATE_VERIFICATION_CODE-example_template_verification_code}
JWT_ISSUER: ${JWT_ISSUER-example_issuer}
JWT_TOKEN: ${JWT_TOKEN-example_token}
RELAY_PROVIDER_API_KEY_GNOSIS_CHAIN: ${RELAY_PROVIDER_API_KEY_GNOSIS_CHAIN-example_api_key}
RELAY_PROVIDER_API_KEY_SEPOLIA: ${RELAY_PROVIDER_API_KEY_SEPOLIA-example_api_key}
depends_on:
Expand Down
49 changes: 49 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import globals from 'globals';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
globals: {
...globals.node,
...globals.jest,
},
},
},
{
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/consistent-type-assertions': [
'warn',
{ assertionStyle: 'as' },
],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-floating-promises': 'warn',
// TODO: Address these rules: (added to update to ESLint 9)
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/unbound-method': 'off',
},
},
eslintConfigPrettier,
);
Loading

0 comments on commit b48797c

Please sign in to comment.