diff --git a/.dockerignore b/.dockerignore index 9e60b672897..f857a5a7438 100644 --- a/.dockerignore +++ b/.dockerignore @@ -12,7 +12,6 @@ node_modules/ **/test-results **/*.tsbuildinfo **/.DS_Store -*.env *.log .idea .vscode diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml new file mode 100644 index 00000000000..629da2fcf0b --- /dev/null +++ b/.github/workflows/CD.yml @@ -0,0 +1,47 @@ +name: Build Docker Image + +on: + push: + branches: + - staging + - frick + - frack + - production + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Set Heroku app name based on branch + id: set-heroku-app-name + run: | + BRANCH_NAME=${GITHUB_REF##*/} + case $BRANCH_NAME in + frick) + APP_NAME="commonwealth-frick" + ;; + frack) + APP_NAME="commonwealth-frack" + ;; + staging) + APP_NAME="commonwealth-beta" + ;; + demo) + APP_NAME="commonwealth-demo" + ;; + production) + APP_NAME="commonwealthapp" + ;; + *) + echo "Branch $BRANCH_NAME is not configured for deployment." + exit 1 + ;; + esac + echo "HEROKU_APP_NAME=$APP_NAME" >> $GITHUB_ENV + + - uses: actions/checkout@v2 + + - name: Deploy to Heroku + run: | + chmod +x ./scripts/deploy-to-heroku.sh + ./scripts/deploy-to-heroku.sh "${{ secrets.HEROKU_EMAIL }}" "${{ secrets.HEROKU_API_TOKEN }}" "${{ env.HEROKU_APP_NAME }}" \ No newline at end of file diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d06f0ae37a1..dde453d9125 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -188,7 +188,7 @@ jobs: - name: Run serial e2e tests run: | pnpm -F commonwealth bootstrap-test-db && - (cd packages/commonwealth && NODE_OPTIONS=--max-old-space-size=$(../../scripts/get-max-old-space-size.sh) node --import=extensionless/register --enable-source-maps ./build/server.js) & + (cd packages/commonwealth && node --import=extensionless/register --enable-source-maps ./build/server.js) & (pnpm -F commonwealth wait-server && pnpm -F commonwealth test-e2e-serial --forbid-only) - name: Archive code coverage results diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 3bc1d6a876c..00000000000 --- a/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM node:20-slim AS base -ENV PNPM_HOME="/pnpm" -ENV PATH="$PNPM_HOME:$PATH" -RUN corepack enable - -FROM base AS build -## needed for node-gyp to build -RUN apt-get update && \ - apt-get install -y python3 make gcc g++ -COPY . /usr/src/app -WORKDIR /usr/src/app -RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile -RUN pnpm run build -RUN pnpm deploy --filter=commonwealth --prod /prod/commonwealth -RUN mv /usr/src/app/packages/commonwealth/build /prod/commonwealth/build - -FROM base AS commonwealth -COPY --from=build /prod/commonwealth /prod/commonwealth -WORKDIR /prod/commonwealth -EXPOSE 8080 -CMD ["node", "--import=extensionless/register", "--enable-source-maps", "./build/server.js"] - -# If we plan on moving more applications to docker: -# 1. Add a line in the Dockerfile build stage to deploy that package -# 2. Write a new separate stage with an alias we can use to reference that specific application \ No newline at end of file diff --git a/Dockerfile.commonwealth_base b/Dockerfile.commonwealth_base new file mode 100644 index 00000000000..de286328844 --- /dev/null +++ b/Dockerfile.commonwealth_base @@ -0,0 +1,48 @@ +FROM datadog-base AS base +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" +RUN corepack enable + +FROM base AS build +## needed for node-gyp to build +RUN apt-get update && \ + apt-get install -y python3 make gcc g++ +COPY . /usr/src/app +WORKDIR /usr/src/app +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile +RUN pnpm run build + +RUN pnpm -F discord-bot run build +RUN pnpm deploy -F discord-bot --prod /prod/discord-bot +RUN mv /usr/src/app/packages/discord-bot/build /prod/discord-bot/build + +RUN pnpm -F snapshot-listener run build +RUN pnpm deploy -F snapshot-listener --prod /prod/snapshot-listener +RUN mv /usr/src/app/packages/snapshot-listener/build /prod/snapshot-listener/build + +RUN pnpm deploy -F commonwealth --prod /prod/commonwealth +RUN mv /usr/src/app/packages/commonwealth/build /prod/commonwealth/build + +FROM base AS commonwealth +ENV NODE_ENV=production +COPY --from=build /prod/commonwealth /prod/commonwealth +WORKDIR /prod/commonwealth +COPY ./scripts/datadog-entrypoint.sh /prod/commonwealth +RUN chmod +x /prod/commonwealth/datadog-entrypoint.sh +ENV PORT=$PORT + +FROM base AS snapshot-listener +ENV NODE_ENV=production +COPY --from=build /prod/snapshot-listener /prod/snapshot-listener +WORKDIR /prod/snapshot-listener +COPY ./scripts/datadog-entrypoint.sh /prod/snapshot-listener +RUN chmod +x /prod/snapshot-listener/datadog-entrypoint.sh +ENV PORT=$PORT + +FROM base AS discord-bot +ENV NODE_ENV=production +COPY --from=build /prod/discord-bot /prod/discord-bot +WORKDIR /prod/discord-bot +COPY ./scripts/datadog-entrypoint.sh /prod/discord-bot +RUN chmod +x /prod/discord-bot/datadog-entrypoint.sh +ENV PORT=$PORT \ No newline at end of file diff --git a/Dockerfile.datadog b/Dockerfile.datadog new file mode 100644 index 00000000000..1563a60318b --- /dev/null +++ b/Dockerfile.datadog @@ -0,0 +1,28 @@ +FROM node:20-slim AS datadog-base + +# Install Datadog dependencies +RUN apt-get update && apt-get install -y gnupg apt-transport-https gpg-agent curl ca-certificates + +# Add Datadog repository and signing keys +ENV DATADOG_APT_KEYRING="/usr/share/keyrings/datadog-archive-keyring.gpg" +ENV DATADOG_APT_KEYS_URL="https://keys.datadoghq.com" +RUN sh -c "echo 'deb [signed-by=${DATADOG_APT_KEYRING}] https://apt.datadoghq.com/ stable 7' > /etc/apt/sources.list.d/datadog.list" +RUN touch ${DATADOG_APT_KEYRING} +RUN curl -o /tmp/DATADOG_APT_KEY_CURRENT.public "${DATADOG_APT_KEYS_URL}/DATADOG_APT_KEY_CURRENT.public" && \ + gpg --ignore-time-conflict --no-default-keyring --keyring ${DATADOG_APT_KEYRING} --import /tmp/DATADOG_APT_KEY_CURRENT.public +RUN curl -o /tmp/DATADOG_APT_KEY_06462314.public "${DATADOG_APT_KEYS_URL}/DATADOG_APT_KEY_06462314.public" && \ + gpg --ignore-time-conflict --no-default-keyring --keyring ${DATADOG_APT_KEYRING} --import /tmp/DATADOG_APT_KEY_06462314.public +RUN curl -o /tmp/DATADOG_APT_KEY_C0962C7D.public "${DATADOG_APT_KEYS_URL}/DATADOG_APT_KEY_C0962C7D.public" && \ + gpg --ignore-time-conflict --no-default-keyring --keyring ${DATADOG_APT_KEYRING} --import /tmp/DATADOG_APT_KEY_C0962C7D.public +RUN curl -o /tmp/DATADOG_APT_KEY_F14F620E.public "${DATADOG_APT_KEYS_URL}/DATADOG_APT_KEY_F14F620E.public" && \ + gpg --ignore-time-conflict --no-default-keyring --keyring ${DATADOG_APT_KEYRING} --import /tmp/DATADOG_APT_KEY_F14F620E.public +RUN curl -o /tmp/DATADOG_APT_KEY_382E94DE.public "${DATADOG_APT_KEYS_URL}/DATADOG_APT_KEY_382E94DE.public" && \ + gpg --ignore-time-conflict --no-default-keyring --keyring ${DATADOG_APT_KEYRING} --import /tmp/DATADOG_APT_KEY_382E94DE.public + +# Install Datadog Agent +RUN apt-get update && apt-get -y install --reinstall datadog-agent + +# Expose DogStatsD and trace-agent ports +EXPOSE 8125/udp 8126/tcp + +COPY datadog-config/ /etc/datadog-agent/ \ No newline at end of file diff --git a/common_knowledge/Deployment.md b/common_knowledge/Deployment.md new file mode 100644 index 00000000000..7c254750e84 --- /dev/null +++ b/common_knowledge/Deployment.md @@ -0,0 +1,31 @@ +# Deployment Flow +In order to perform a deployment, we need to push to a branch that corresponds with a heroku application. The branches +are frick, frack, beta. This then runs a github action that takes care of the deployment. + +# Deployment Details +We use Heroku for deploying our applications. The deployment process is automated via GitHub Actions using a Continuous Deployment (CD) pipeline. Every time we push changes to a branch associated with a specific app (e.g., frick, frack, beta, etc.), the CD.yml GitHub action is triggered, which initiates the deployment process. + +## Deployment Workflow Overview +### Base Container Build: + +First, our base container image is built using the following command: +bash +```shell +docker build -f Dockerfile.commonwealth_base -t commonwealth_base . +``` +This image contains the core setup required by all of our apps, ensuring consistency and reducing redundancy across different services. +### Individual Process Builds: + +After building the base container, the individual process-specific Dockerfiles (e.g., Dockerfile.web, Dockerfile.evm_ce) are built and pushed to Heroku using the following command: +bash +```shell +heroku container:push --recursive -a ${heroku_app_name} +``` +The --recursive flag ensures that all defined processes (web, consumer, evm_ce, etc.) are built and pushed to the appropriate Heroku app. +### Release on Heroku: + +After the container images are successfully pushed, the next step is to release these images to Heroku: +```shell +heroku container:release web evm_ce consumer message_relayer knock -a ${heroku_app_name} +``` +This command releases the defined processes to their respective dynos on Heroku, making the application live. \ No newline at end of file diff --git a/common_knowledge/Package-Scripts.md b/common_knowledge/Package-Scripts.md index f1b1443fb12..ecdb4fb9396 100644 --- a/common_knowledge/Package-Scripts.md +++ b/common_knowledge/Package-Scripts.md @@ -415,7 +415,7 @@ Description: It creates new `tsx` file and modifies `componentsList.ts` file in ### send-cosmos-notifs -Definition: `node --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) build/server/workers/cosmosGovNotifications/generateCosmosGovNotifications.js` +Definition: `node build/server/workers/cosmosGovNotifications/generateCosmosGovNotifications.js` Description: Generates Cosmos v1 and v1beta1 governance notifications by polling relevant Cosmos chains. diff --git a/datadog-config/datadog.yaml b/datadog-config/datadog.yaml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/docker-compose.yml b/docker-compose.yml index d62087c1c63..9fc643d0e34 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,8 +51,8 @@ services: - with-app container_name: commonwealth build: - context: . # Assuming Dockerfile is in the same directory as this docker-compose.yml - dockerfile: Dockerfile # Name of the Dockerfile + context: . + dockerfile: ./Dockerfile.web ports: - '8080:8080' environment: diff --git a/libs/model/src/database.ts b/libs/model/src/database.ts index 41b366ffe4e..791c3e3da8e 100644 --- a/libs/model/src/database.ts +++ b/libs/model/src/database.ts @@ -13,9 +13,9 @@ export const sequelize = new Sequelize(config.DB.URI, { config.NODE_ENV !== 'production' || config.DB.NO_SSL ? { requestTimeout: 40000 } : config.DB.URI === - 'postgresql://commonwealth:edgeware@localhost/commonwealth' - ? { requestTimeout: 40000, ssl: false } - : { requestTimeout: 40000, ssl: { rejectUnauthorized: false } }, + 'postgresql://commonwealth:edgeware@localhost/commonwealth' + ? { requestTimeout: 40000, ssl: false } + : { requestTimeout: 40000, ssl: { rejectUnauthorized: false } }, pool: { max: 10, min: 0, diff --git a/libs/shared/package.json b/libs/shared/package.json index f6aa005e06e..22c7a18d479 100644 --- a/libs/shared/package.json +++ b/libs/shared/package.json @@ -30,8 +30,10 @@ "@canvas-js/gossiplog": "^0.10.10", "@canvas-js/interfaces": "^0.10.10", "@canvas-js/signatures": "^0.10.10", + "@cosmjs/encoding": "0.32.3", "@ipld/dag-json": "^10.2.0", "@libp2p/peer-id-factory": "^4.2.4", + "@polkadot/util": "12.6.2", "moment": "^2.23.0", "safe-stable-stringify": "^2.4.2" }, diff --git a/libs/shared/src/canvas/runtime/node.ts b/libs/shared/src/canvas/runtime/node.ts index c87a3ff1762..1c8f5108bf6 100644 --- a/libs/shared/src/canvas/runtime/node.ts +++ b/libs/shared/src/canvas/runtime/node.ts @@ -3,6 +3,7 @@ import { createEd25519PeerId, createFromProtobuf, } from '@libp2p/peer-id-factory'; +import { ConnectionConfig } from 'pg'; import { getSessionSigners } from '../signers'; import { contract, contractTopic } from './contract'; @@ -20,6 +21,28 @@ export const startCanvasNode = async (config: { PEER_ID?: string }) => { const listen = process.env.FEDERATION_LISTEN_ADDRESS ?? '/ip4/127.0.0.1/tcp/8090/ws'; + let pgConnectionConfig: ConnectionConfig = {}; + + if (path) { + const url = new URL(path); + + pgConnectionConfig = { + user: url.username, + host: url.hostname, + database: url.pathname.slice(1), // remove the leading '/' + password: url.password, + port: url.port ? parseInt(url.port) : 5432, + ssl: false, + }; + } + + if (process.env.NODE_ENV === 'production') { + pgConnectionConfig.ssl = { + rejectUnauthorized: false, + }; + console.log('===SSL configured with rejectUnauthorized: false'); + } + const peerId = config.PEER_ID ? await createFromProtobuf(Buffer.from(config.PEER_ID, 'base64')) : await createEd25519PeerId(); @@ -27,7 +50,7 @@ export const startCanvasNode = async (config: { PEER_ID?: string }) => { const app = await Canvas.initialize({ peerId, topic: contractTopic, - path, + path: pgConnectionConfig, contract, signers: getSessionSigners(), bootstrapList: [], diff --git a/package.json b/package.json index 12339e7e9bb..c2638114a2a 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "packageManager": "pnpm@9.10.0", "scripts": { "build": "chmod u+x scripts/build.sh && ./scripts/build.sh", - "docker-build-commonwealth": "docker build . --target commonwealth --tag commonwealth:latest", + "docker-build-commonwealth": "docker build -f Dockerfile.commonwealth_base --tag commonwealth:latest .", "chromatic": "chromatic --exit-zero-on-changes", "clean": "chmod u+x scripts/clean-modules.sh && ./scripts/clean-modules.sh", "db-all": "pnpm -F commonwealth db-all", @@ -125,7 +125,6 @@ "prettier-plugin-organize-imports": "^4.0.0", "process": "^0.11.10", "readline-sync": "^1.4.10", - "sequelize-cli": "^6.2.0", "sharp": "^0.31.2", "sinon": "^15.0.4", "source-map-support": "^0.5.21", diff --git a/packages/commonwealth/Procfile b/packages/commonwealth/Procfile deleted file mode 100644 index 8ab74703ffe..00000000000 --- a/packages/commonwealth/Procfile +++ /dev/null @@ -1,6 +0,0 @@ -web: cd packages/commonwealth && NODE_ENV=production NODE_OPTIONS=--max-old-space-size=$(../../scripts/get-max-old-space-size.sh) node --import=extensionless/register --enable-source-maps ./build/server.js -consumer: cd packages/commonwealth && node --import=extensionless/register --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) build/server/workers/commonwealthConsumer/commonwealthConsumer.js -evm-ce: cd packages/commonwealth && node --import=extensionless/register --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) build/server/workers/evmChainEvents/startEvmPolling.js -knock: cd packages/commonwealth && node --import=extensionless/register --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) build/server/workers/knock/knockWorker.js -message-relayer: cd packages/commonwealth && node --import=extensionless/register --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) build/server/workers/messageRelayer/messageRelayer.js -release: cd packages/commonwealth && node --import=extensionless/register --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) build/server/scripts/releasePhaseEnvCheck.js && npx sequelize-cli db:migrate --config server/sequelize.json && node --import=extensionless/register build/server/scripts/purgeCloudflareCache.js diff --git a/packages/commonwealth/deploy/dockerfiles/Dockerfile.consumer b/packages/commonwealth/deploy/dockerfiles/Dockerfile.consumer new file mode 100644 index 00000000000..41bb1bf29ad --- /dev/null +++ b/packages/commonwealth/deploy/dockerfiles/Dockerfile.consumer @@ -0,0 +1,2 @@ +FROM commonwealth +CMD NODE_ENV=production ./datadog-entrypoint.sh node --import=extensionless/register build/server/workers/commonwealthConsumer/commonwealthConsumer.js \ No newline at end of file diff --git a/packages/commonwealth/deploy/dockerfiles/Dockerfile.evm_ce b/packages/commonwealth/deploy/dockerfiles/Dockerfile.evm_ce new file mode 100644 index 00000000000..e5f1aec14db --- /dev/null +++ b/packages/commonwealth/deploy/dockerfiles/Dockerfile.evm_ce @@ -0,0 +1,2 @@ +FROM commonwealth +CMD NODE_ENV=production ./datadog-entrypoint.sh node --import=extensionless/register build/server/workers/evmChainEvents/startEvmPolling.js \ No newline at end of file diff --git a/packages/commonwealth/deploy/dockerfiles/Dockerfile.knock b/packages/commonwealth/deploy/dockerfiles/Dockerfile.knock new file mode 100644 index 00000000000..0519bd87230 --- /dev/null +++ b/packages/commonwealth/deploy/dockerfiles/Dockerfile.knock @@ -0,0 +1,2 @@ +FROM commonwealth +CMD NODE_ENV=production ./datadog-entrypoint.sh node --import=extensionless/register build/server/workers/knock/knockWorker.js \ No newline at end of file diff --git a/packages/commonwealth/deploy/dockerfiles/Dockerfile.message_relayer b/packages/commonwealth/deploy/dockerfiles/Dockerfile.message_relayer new file mode 100644 index 00000000000..9aa1d9a7767 --- /dev/null +++ b/packages/commonwealth/deploy/dockerfiles/Dockerfile.message_relayer @@ -0,0 +1,2 @@ +FROM commonwealth +CMD NODE_ENV=production ./datadog-entrypoint.sh node --import=extensionless/register build/server/workers/messageRelayer/messageRelayer.js \ No newline at end of file diff --git a/packages/commonwealth/deploy/dockerfiles/Dockerfile.release b/packages/commonwealth/deploy/dockerfiles/Dockerfile.release new file mode 100644 index 00000000000..b44204b35fc --- /dev/null +++ b/packages/commonwealth/deploy/dockerfiles/Dockerfile.release @@ -0,0 +1,5 @@ +FROM commonwealth +RUN apt-get update && apt-get install -y curl # Needed for heroku +CMD node --import=extensionless/register build/server/scripts/releasePhaseEnvCheck.js && \ + npx sequelize-cli db:migrate --config server/sequelize.json && \ + node --import=extensionless/register build/server/scripts/purgeCloudflareCache.js \ No newline at end of file diff --git a/packages/commonwealth/deploy/dockerfiles/Dockerfile.web b/packages/commonwealth/deploy/dockerfiles/Dockerfile.web new file mode 100644 index 00000000000..4662d2fd2b6 --- /dev/null +++ b/packages/commonwealth/deploy/dockerfiles/Dockerfile.web @@ -0,0 +1,2 @@ +FROM commonwealth +CMD NODE_ENV=production ./datadog-entrypoint.sh node --import=extensionless/register --enable-source-maps ./build/server.js \ No newline at end of file diff --git a/packages/commonwealth/deploy/environments/.env.public.commonwealth-beta b/packages/commonwealth/deploy/environments/.env.public.commonwealth-beta new file mode 100644 index 00000000000..85438b2d049 --- /dev/null +++ b/packages/commonwealth/deploy/environments/.env.public.commonwealth-beta @@ -0,0 +1,10 @@ +UNLEASH_FRONTEND_SERVER_URL=https://flag.commonwealth.im/api/frontend +UNLEASH_FRONTEND_API_TOKEN=*:development.309ede2a4ac83b15b51c0cd6b55acdc9f4edefeda5b6325e2414f9b0 +HEROKU_APP_NAME=commonwealth-beta +APP_ENV=beta +NODE_ENV=production +KNOCK_PUBLIC_API_KEY=pk_RLg22EIJ6jsuci6c7VvBU59gDQJZeFoeBKlOkgJLWvA +KNOCK_IN_APP_FEED_ID=fc6e68e5-b7b9-49c1-8fab-6dd7e3510ffb +SERVER_URL=https://qa.commonwealth.im +MIXPANEL_DEV_TOKEN=312b6c5fadb9a88d98dc1fb38de5d900 +MAGIC_PUBLISHABLE_KEY=pk_live_B0604AA1B8EEFDB4 diff --git a/packages/commonwealth/deploy/environments/.env.public.commonwealth-demo b/packages/commonwealth/deploy/environments/.env.public.commonwealth-demo new file mode 100644 index 00000000000..0b2985a64df --- /dev/null +++ b/packages/commonwealth/deploy/environments/.env.public.commonwealth-demo @@ -0,0 +1,7 @@ +UNLEASH_FRONTEND_SERVER_URL=https://flag.commonwealth.im/api/frontend +UNLEASH_FRONTEND_API_TOKEN=*:development.309ede2a4ac83b15b51c0cd6b55acdc9f4edefeda5b6325e2414f9b0 +HEROKU_APP_NAME=commonwealth-demo +APP_ENV=demo +NODE_ENV=production +MIXPANEL_DEV_TOKEN=312b6c5fadb9a88d98dc1fb38de5d900 +MAGIC_PUBLISHABLE_KEY=pk_live_EF89AABAFB87D6F4 diff --git a/packages/commonwealth/deploy/environments/.env.public.commonwealth-frack b/packages/commonwealth/deploy/environments/.env.public.commonwealth-frack new file mode 100644 index 00000000000..254a4b6c9fd --- /dev/null +++ b/packages/commonwealth/deploy/environments/.env.public.commonwealth-frack @@ -0,0 +1,10 @@ +UNLEASH_FRONTEND_SERVER_URL=https://flag.commonwealth.im/api/frontend +UNLEASH_FRONTEND_API_TOKEN=*:development.309ede2a4ac83b15b51c0cd6b55acdc9f4edefeda5b6325e2414f9b0 +HEROKU_APP_NAME=commonwealth-frack +APP_ENV=frack +NODE_ENV=production +SERVER_URL=https://commonwealth-frack.herokuapp.com +KNOCK_PUBLIC_API_KEY=pk_EkjqgrIByZo85tIqdBkCmihVBtTB_ixY_37oTG_Au1Y +KNOCK_IN_APP_FEED_ID=fc6e68e5-b7b9-49c1-8fab-6dd7e3510ffb +MIXPANEL_DEV_TOKEN=312b6c5fadb9a88d98dc1fb38de5d900 +MAGIC_PUBLISHABLE_KEY=pk_live_B0604AA1B8EEFDB4 diff --git a/packages/commonwealth/deploy/environments/.env.public.commonwealth-frick b/packages/commonwealth/deploy/environments/.env.public.commonwealth-frick new file mode 100644 index 00000000000..8ac8e396d45 --- /dev/null +++ b/packages/commonwealth/deploy/environments/.env.public.commonwealth-frick @@ -0,0 +1,8 @@ +UNLEASH_FRONTEND_SERVER_URL=https://flag.commonwealth.im/api/frontend +UNLEASH_FRONTEND_API_TOKEN=*:development.309ede2a4ac83b15b51c0cd6b55acdc9f4edefeda5b6325e2414f9b0 +HEROKU_APP_NAME=commonwealth-frick +APP_ENV=frick +NODE_ENV=production +SERVER_URL=https://commonwealth-frick.herokuapp.com +MIXPANEL_DEV_TOKEN=312b6c5fadb9a88d98dc1fb38de5d900 +MAGIC_PUBLISHABLE_KEY=pk_live_EF89AABAFB87D6F4 diff --git a/packages/commonwealth/deploy/environments/.env.public.commonwealthapp b/packages/commonwealth/deploy/environments/.env.public.commonwealthapp new file mode 100644 index 00000000000..979cd0ece77 --- /dev/null +++ b/packages/commonwealth/deploy/environments/.env.public.commonwealthapp @@ -0,0 +1,9 @@ +UNLEASH_FRONTEND_SERVER_URL=https://flag.commonwealth.im/api/frontend +UNLEASH_FRONTEND_API_TOKEN=*:production.b966a7bcb033f291f1151de9e144129eda0c99553b5e8e781ecc72a0 +HEROKU_APP_NAME=commonwealthapp +APP_ENV=production +KNOCK_PUBLIC_API_KEY=pk_ynCCqD_rlxXTO0TvBCYUKYV5BSG5-vHoy451WGDHW5w +KNOCK_IN_APP_FEED_ID=fc6e68e5-b7b9-49c1-8fab-6dd7e3510ffb +NODE_ENV=production +SERVER_URL=https://commonwealth.im +MAGIC_PUBLISHABLE_KEY=pk_live_B0604AA1B8EEFDB4 diff --git a/packages/commonwealth/package.json b/packages/commonwealth/package.json index 00fcbf644f7..88bd5f1ca81 100644 --- a/packages/commonwealth/package.json +++ b/packages/commonwealth/package.json @@ -12,7 +12,7 @@ "async-migrate-comment-version-history": "tsx ./scripts/async-migrate-comment-version-history.ts", "async-migrate-thread-version-history": "tsx ./scripts/async-migrate-thread-version-history.ts", "add-component-showcase": "tsx ./scripts/add-component-showcase.ts", - "archive-outbox": "node --import=extensionless/register --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) build/scripts/archive-outbox.js", + "archive-outbox": "node --import=extensionless/register build/scripts/archive-outbox.js", "build": "tsc -b ./tsconfig.build.json && tsc-alias -p ./tsconfig.build.json", "build-contracts": "npx hardhat compile", "bundle": "vite -c ./client/vite.config.ts build", diff --git a/packages/commonwealth/server/scripts/releasePhaseEnvCheck.ts b/packages/commonwealth/server/scripts/releasePhaseEnvCheck.js similarity index 78% rename from packages/commonwealth/server/scripts/releasePhaseEnvCheck.ts rename to packages/commonwealth/server/scripts/releasePhaseEnvCheck.js index b64561a8ff3..d17a3a96158 100644 --- a/packages/commonwealth/server/scripts/releasePhaseEnvCheck.ts +++ b/packages/commonwealth/server/scripts/releasePhaseEnvCheck.js @@ -8,12 +8,10 @@ if (import.meta.url.endsWith(process.argv[1])) { // TODO: Add checks for unused env var // TODO: Add warning for manually set client FLAGs when APP_ENV !== 'local'/'CI' log.info('Environment variables are properly configured'); - // eslint-disable-next-line @typescript-eslint/no-floating-promises dispose()('EXIT', true); }) .catch((err) => { log.fatal('Environment variables not properly configured!', err); - // eslint-disable-next-line @typescript-eslint/no-floating-promises dispose()('ERROR', true); }); } diff --git a/packages/discord-bot/Procfile b/packages/discord-bot/Procfile deleted file mode 100644 index dabdf02e54b..00000000000 --- a/packages/discord-bot/Procfile +++ /dev/null @@ -1,3 +0,0 @@ -listener: node --import=extensionless/register --max_old_space_size=$(./scripts/get-max-old-space-size.sh) packages/discord-bot/build/discord-listener/discordListener.js -consumer: node --import=extensionless/register --max_old_space_size=$(./scripts/get-max-old-space-size.sh) packages/discord-bot/build/discord-consumer/discordConsumer.js -release: node --import=extensionless/register --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) packages/discord-bot/build/scripts/releasePhaseEnvCheck.js diff --git a/packages/discord-bot/deploy/dockerfiles/Dockerfile.consumer b/packages/discord-bot/deploy/dockerfiles/Dockerfile.consumer new file mode 100644 index 00000000000..4ee0e2bcd48 --- /dev/null +++ b/packages/discord-bot/deploy/dockerfiles/Dockerfile.consumer @@ -0,0 +1,2 @@ +FROM discord-bot +CMD NODE_ENV=production ./datadog-entrypoint.sh node --import=extensionless/register ./build/src/discord-consumer/discordConsumer.js \ No newline at end of file diff --git a/packages/discord-bot/deploy/dockerfiles/Dockerfile.listener b/packages/discord-bot/deploy/dockerfiles/Dockerfile.listener new file mode 100644 index 00000000000..57863972957 --- /dev/null +++ b/packages/discord-bot/deploy/dockerfiles/Dockerfile.listener @@ -0,0 +1,2 @@ +FROM discord-bot +CMD NODE_ENV=production ./datadog-entrypoint.sh node --import=extensionless/register ./build/src/discord-listener/discordListener.js \ No newline at end of file diff --git a/packages/discord-bot/deploy/dockerfiles/Dockerfile.release b/packages/discord-bot/deploy/dockerfiles/Dockerfile.release new file mode 100644 index 00000000000..424b333db79 --- /dev/null +++ b/packages/discord-bot/deploy/dockerfiles/Dockerfile.release @@ -0,0 +1,3 @@ +FROM discord-bot +RUN apt-get update && apt-get install -y curl +CMD node --import=extensionless/register ./build/scripts/releasePhaseEnvCheck.js \ No newline at end of file diff --git a/packages/discord-bot/package.json b/packages/discord-bot/package.json index 440ee9bd91f..1157df41aed 100644 --- a/packages/discord-bot/package.json +++ b/packages/discord-bot/package.json @@ -23,8 +23,10 @@ "@hicommonwealth/core": "workspace:*", "@hicommonwealth/model": "workspace:*", "@hicommonwealth/shared": "workspace:*", + "@polkadot/util-crypto": "12.6.2", "axios": "^1.3.4", "discord.js": "^14.16.2", + "extensionless": "^1.9.9", "moment": "^2.23.0", "pg": "^8.11.3", "sequelize": "^6.32.1", diff --git a/packages/snapshot-listener/Procfile b/packages/snapshot-listener/Procfile deleted file mode 100644 index f7cea8e0016..00000000000 --- a/packages/snapshot-listener/Procfile +++ /dev/null @@ -1,2 +0,0 @@ -web: cd packages/snapshot-listener && node --import=extensionless/register --max_old_space_size=$(../../scripts/get-max-old-space-size.sh) ./build/src/index.js -release: cd packages/snapshot-listener && node --import=extensionless/register --max-old-space-size=$(../../scripts/get-max-old-space-size.sh) ./build/scripts/releasePhaseEnvCheck.js diff --git a/packages/snapshot-listener/deploy/dockerfiles/Dockerfile.release b/packages/snapshot-listener/deploy/dockerfiles/Dockerfile.release new file mode 100644 index 00000000000..d1c159446d1 --- /dev/null +++ b/packages/snapshot-listener/deploy/dockerfiles/Dockerfile.release @@ -0,0 +1,3 @@ +FROM snapshot-listener +RUN apt-get update && apt-get install +CMD node --import=extensionless/register ./build/scripts/releasePhaseEnvCheck.js \ No newline at end of file diff --git a/packages/snapshot-listener/deploy/dockerfiles/Dockerfile.web b/packages/snapshot-listener/deploy/dockerfiles/Dockerfile.web new file mode 100644 index 00000000000..6800fd74d1a --- /dev/null +++ b/packages/snapshot-listener/deploy/dockerfiles/Dockerfile.web @@ -0,0 +1,2 @@ +FROM snapshot-listener +CMD NODE_ENV=production ./datadog-entrypoint.sh node --import=extensionless/register --enable-source-maps ./build/src/index.js \ No newline at end of file diff --git a/packages/snapshot-listener/package.json b/packages/snapshot-listener/package.json index f82e83db9fc..1f6f606c2eb 100644 --- a/packages/snapshot-listener/package.json +++ b/packages/snapshot-listener/package.json @@ -22,8 +22,10 @@ "@hicommonwealth/core": "workspace:*", "@hicommonwealth/model": "workspace:*", "@hicommonwealth/shared": "workspace:*", + "@polkadot/util-crypto": "12.6.2", "body-parser": "^1.20.1", "express": "^4.18.2", + "extensionless": "^1.9.9", "moment": "^2.23.0", "node-fetch": "2", "sequelize": "^6.32.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7f1f7f1f40f..8a079a17fae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -258,9 +258,6 @@ importers: readline-sync: specifier: ^1.4.10 version: 1.4.10 - sequelize-cli: - specifier: ^6.2.0 - version: 6.6.2 sharp: specifier: ^0.31.2 version: 0.31.3 @@ -817,12 +814,18 @@ importers: '@canvas-js/signatures': specifier: ^0.10.10 version: 0.10.10 + '@cosmjs/encoding': + specifier: 0.32.3 + version: 0.32.3 '@ipld/dag-json': specifier: ^10.2.0 version: 10.2.0 '@libp2p/peer-id-factory': specifier: ^4.2.4 version: 4.2.4 + '@polkadot/util': + specifier: 12.6.2 + version: 12.6.2 moment: specifier: ^2.23.0 version: 2.30.1 @@ -1488,12 +1491,18 @@ importers: '@hicommonwealth/shared': specifier: workspace:* version: link:../../libs/shared + '@polkadot/util-crypto': + specifier: 12.6.2 + version: 12.6.2(@polkadot/util@12.6.2) axios: specifier: ^1.3.4 version: 1.6.8 discord.js: specifier: ^14.16.2 version: 14.16.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) + extensionless: + specifier: ^1.9.9 + version: 1.9.9 moment: specifier: ^2.23.0 version: 2.30.1 @@ -1558,12 +1567,18 @@ importers: '@hicommonwealth/shared': specifier: workspace:* version: link:../../libs/shared + '@polkadot/util-crypto': + specifier: 12.6.2 + version: 12.6.2(@polkadot/util@12.6.2) body-parser: specifier: ^1.20.1 version: 1.20.2 express: specifier: ^4.18.2 version: 4.19.2 + extensionless: + specifier: ^1.9.9 + version: 1.9.9 moment: specifier: ^2.23.0 version: 2.30.1 @@ -9363,6 +9378,9 @@ packages: extensionless@1.9.6: resolution: {integrity: sha512-40F6zThJu1MxaT1A1pJ/2SHlU1BPYYnQNHt0j2ZlPuxxm2ddMcNc1D7uS/LGc4K3VwMEMaZLkCdHWaKk0LnQXA==} + extensionless@1.9.9: + resolution: {integrity: sha512-fz0cWfLA4pgc2nwmg6lc2UH+g+NlFuD63VWqp8n1wGAZSSbPNoARkA54BxXRjYCYW9LvhBnA3NyJaGS2KudkWw==} + extsprintf@1.3.0: resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==} engines: {'0': node >=0.6.0} @@ -15688,7 +15706,7 @@ snapshots: '@aws-sdk/client-sso-oidc': 3.577.0(@aws-sdk/client-sts@3.577.0) '@aws-sdk/client-sts': 3.577.0 '@aws-sdk/core': 3.576.0 - '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))(@aws-sdk/client-sts@3.577.0) + '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0) '@aws-sdk/middleware-bucket-endpoint': 3.577.0 '@aws-sdk/middleware-expect-continue': 3.577.0 '@aws-sdk/middleware-flexible-checksums': 3.577.0 @@ -15749,7 +15767,7 @@ snapshots: '@aws-crypto/sha256-js': 3.0.0 '@aws-sdk/client-sts': 3.577.0 '@aws-sdk/core': 3.576.0 - '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))(@aws-sdk/client-sts@3.577.0) + '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0) '@aws-sdk/middleware-host-header': 3.577.0 '@aws-sdk/middleware-logger': 3.577.0 '@aws-sdk/middleware-recursion-detection': 3.577.0 @@ -15784,7 +15802,7 @@ snapshots: '@smithy/util-middleware': 3.0.0 '@smithy/util-retry': 3.0.0 '@smithy/util-utf8': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 transitivePeerDependencies: - '@aws-sdk/client-sts' - aws-crt @@ -15838,7 +15856,7 @@ snapshots: '@aws-crypto/sha256-js': 3.0.0 '@aws-sdk/client-sso-oidc': 3.577.0(@aws-sdk/client-sts@3.577.0) '@aws-sdk/core': 3.576.0 - '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))(@aws-sdk/client-sts@3.577.0) + '@aws-sdk/credential-provider-node': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0) '@aws-sdk/middleware-host-header': 3.577.0 '@aws-sdk/middleware-logger': 3.577.0 '@aws-sdk/middleware-recursion-detection': 3.577.0 @@ -15873,7 +15891,7 @@ snapshots: '@smithy/util-middleware': 3.0.0 '@smithy/util-retry': 3.0.0 '@smithy/util-utf8': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 transitivePeerDependencies: - aws-crt @@ -15885,14 +15903,14 @@ snapshots: '@smithy/smithy-client': 3.0.1 '@smithy/types': 3.0.0 fast-xml-parser: 4.2.5 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/credential-provider-env@3.577.0': dependencies: '@aws-sdk/types': 3.577.0 '@smithy/property-provider': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/credential-provider-http@3.577.0': dependencies: @@ -15904,39 +15922,39 @@ snapshots: '@smithy/smithy-client': 3.0.1 '@smithy/types': 3.0.0 '@smithy/util-stream': 3.0.1 - tslib: 2.6.2 + tslib: 2.7.0 - '@aws-sdk/credential-provider-ini@3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))(@aws-sdk/client-sts@3.577.0)': + '@aws-sdk/credential-provider-ini@3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0)': dependencies: '@aws-sdk/client-sts': 3.577.0 '@aws-sdk/credential-provider-env': 3.577.0 '@aws-sdk/credential-provider-process': 3.577.0 - '@aws-sdk/credential-provider-sso': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0)) + '@aws-sdk/credential-provider-sso': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0) '@aws-sdk/credential-provider-web-identity': 3.577.0(@aws-sdk/client-sts@3.577.0) '@aws-sdk/types': 3.577.0 '@smithy/credential-provider-imds': 3.0.0 '@smithy/property-provider': 3.0.0 '@smithy/shared-ini-file-loader': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 transitivePeerDependencies: - '@aws-sdk/client-sso-oidc' - aws-crt - '@aws-sdk/credential-provider-node@3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))(@aws-sdk/client-sts@3.577.0)': + '@aws-sdk/credential-provider-node@3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0)': dependencies: '@aws-sdk/credential-provider-env': 3.577.0 '@aws-sdk/credential-provider-http': 3.577.0 - '@aws-sdk/credential-provider-ini': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))(@aws-sdk/client-sts@3.577.0) + '@aws-sdk/credential-provider-ini': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0)(@aws-sdk/client-sts@3.577.0) '@aws-sdk/credential-provider-process': 3.577.0 - '@aws-sdk/credential-provider-sso': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0)) + '@aws-sdk/credential-provider-sso': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0) '@aws-sdk/credential-provider-web-identity': 3.577.0(@aws-sdk/client-sts@3.577.0) '@aws-sdk/types': 3.577.0 '@smithy/credential-provider-imds': 3.0.0 '@smithy/property-provider': 3.0.0 '@smithy/shared-ini-file-loader': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 transitivePeerDependencies: - '@aws-sdk/client-sso-oidc' - '@aws-sdk/client-sts' @@ -15948,17 +15966,17 @@ snapshots: '@smithy/property-provider': 3.0.0 '@smithy/shared-ini-file-loader': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 - '@aws-sdk/credential-provider-sso@3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))': + '@aws-sdk/credential-provider-sso@3.577.0(@aws-sdk/client-sso-oidc@3.577.0)': dependencies: '@aws-sdk/client-sso': 3.577.0 - '@aws-sdk/token-providers': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0)) + '@aws-sdk/token-providers': 3.577.0(@aws-sdk/client-sso-oidc@3.577.0) '@aws-sdk/types': 3.577.0 '@smithy/property-provider': 3.0.0 '@smithy/shared-ini-file-loader': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 transitivePeerDependencies: - '@aws-sdk/client-sso-oidc' - aws-crt @@ -15969,7 +15987,7 @@ snapshots: '@aws-sdk/types': 3.577.0 '@smithy/property-provider': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/lib-storage@3.578.0(@aws-sdk/client-s3@3.577.0)': dependencies: @@ -15990,14 +16008,14 @@ snapshots: '@smithy/protocol-http': 4.0.0 '@smithy/types': 3.0.0 '@smithy/util-config-provider': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/middleware-expect-continue@3.577.0': dependencies: '@aws-sdk/types': 3.577.0 '@smithy/protocol-http': 4.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/middleware-flexible-checksums@3.577.0': dependencies: @@ -16008,33 +16026,33 @@ snapshots: '@smithy/protocol-http': 4.0.0 '@smithy/types': 3.0.0 '@smithy/util-utf8': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/middleware-host-header@3.577.0': dependencies: '@aws-sdk/types': 3.577.0 '@smithy/protocol-http': 4.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/middleware-location-constraint@3.577.0': dependencies: '@aws-sdk/types': 3.577.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/middleware-logger@3.577.0': dependencies: '@aws-sdk/types': 3.577.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/middleware-recursion-detection@3.577.0': dependencies: '@aws-sdk/types': 3.577.0 '@smithy/protocol-http': 4.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/middleware-sdk-s3@3.577.0': dependencies: @@ -16046,7 +16064,7 @@ snapshots: '@smithy/smithy-client': 3.0.1 '@smithy/types': 3.0.0 '@smithy/util-config-provider': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/middleware-signing@3.577.0': dependencies: @@ -16056,13 +16074,13 @@ snapshots: '@smithy/signature-v4': 3.0.0 '@smithy/types': 3.0.0 '@smithy/util-middleware': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/middleware-ssec@3.577.0': dependencies: '@aws-sdk/types': 3.577.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/middleware-user-agent@3.577.0': dependencies: @@ -16070,7 +16088,7 @@ snapshots: '@aws-sdk/util-endpoints': 3.577.0 '@smithy/protocol-http': 4.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/region-config-resolver@3.577.0': dependencies: @@ -16079,7 +16097,7 @@ snapshots: '@smithy/types': 3.0.0 '@smithy/util-config-provider': 3.0.0 '@smithy/util-middleware': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/s3-request-presigner@3.577.0': dependencies: @@ -16099,9 +16117,9 @@ snapshots: '@smithy/protocol-http': 4.0.0 '@smithy/signature-v4': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 - '@aws-sdk/token-providers@3.577.0(@aws-sdk/client-sso-oidc@3.577.0(@aws-sdk/client-sts@3.577.0))': + '@aws-sdk/token-providers@3.577.0(@aws-sdk/client-sso-oidc@3.577.0)': dependencies: '@aws-sdk/client-sso-oidc': 3.577.0(@aws-sdk/client-sts@3.577.0) '@aws-sdk/types': 3.577.0 @@ -16113,52 +16131,52 @@ snapshots: '@aws-sdk/types@3.577.0': dependencies: '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/util-arn-parser@3.568.0': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/util-endpoints@3.577.0': dependencies: '@aws-sdk/types': 3.577.0 '@smithy/types': 3.0.0 '@smithy/util-endpoints': 2.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/util-format-url@3.577.0': dependencies: '@aws-sdk/types': 3.577.0 '@smithy/querystring-builder': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/util-locate-window@3.568.0': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/util-user-agent-browser@3.577.0': dependencies: '@aws-sdk/types': 3.577.0 '@smithy/types': 3.0.0 bowser: 2.11.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/util-user-agent-node@3.577.0': dependencies: '@aws-sdk/types': 3.577.0 '@smithy/node-config-provider': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/util-utf8-browser@3.259.0': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@aws-sdk/xml-builder@3.575.0': dependencies: '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@babel/code-frame@7.24.2': dependencies: @@ -18681,7 +18699,7 @@ snapshots: '@firebase/component@0.6.7': dependencies: '@firebase/util': 1.9.6 - tslib: 2.6.2 + tslib: 2.7.0 '@firebase/database-compat@1.0.5': dependencies: @@ -18786,7 +18804,7 @@ snapshots: '@firebase/logger@0.4.2': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@firebase/messaging-compat@0.2.9(@firebase/app-compat@0.2.35)(@firebase/app@0.10.5)': dependencies: @@ -20564,7 +20582,7 @@ snapshots: '@polkadot/util': 12.6.2 '@polkadot/util-crypto': 12.6.2(@polkadot/util@12.6.2) '@polkadot/x-global': 12.6.2 - tslib: 2.6.2 + tslib: 2.7.0 transitivePeerDependencies: - bufferutil - supports-color @@ -20588,7 +20606,7 @@ snapshots: dependencies: '@polkadot/util': 12.6.2 '@polkadot/util-crypto': 12.6.2(@polkadot/util@12.6.2) - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/keyring@7.9.2(@polkadot/util-crypto@7.9.2(@polkadot/util@7.9.2))(@polkadot/util@7.9.2)': dependencies: @@ -20600,7 +20618,7 @@ snapshots: dependencies: '@polkadot/util': 12.6.2 '@substrate/ss58-registry': 1.47.0 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/networks@7.9.2': dependencies: @@ -20630,7 +20648,7 @@ snapshots: eventemitter3: 5.0.1 mock-socket: 9.3.1 nock: 13.5.4 - tslib: 2.6.2 + tslib: 2.7.0 optionalDependencies: '@substrate/connect': 0.8.8(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: @@ -20651,7 +20669,7 @@ snapshots: eventemitter3: 5.0.1 mock-socket: 9.3.1 nock: 13.5.4 - tslib: 2.6.2 + tslib: 2.7.0 optionalDependencies: '@substrate/connect': 0.8.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: @@ -20685,7 +20703,7 @@ snapshots: '@polkadot/types': 11.0.3 '@polkadot/types-codec': 11.0.3 '@polkadot/util': 12.6.2 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/types-codec@10.13.1': dependencies: @@ -20697,7 +20715,7 @@ snapshots: dependencies: '@polkadot/util': 12.6.2 '@polkadot/x-bigint': 12.6.2 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/types-create@10.13.1': dependencies: @@ -20709,7 +20727,7 @@ snapshots: dependencies: '@polkadot/types-codec': 11.0.3 '@polkadot/util': 12.6.2 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/types-known@6.0.5': dependencies: @@ -20726,7 +20744,7 @@ snapshots: '@polkadot/types-support@11.0.3': dependencies: '@polkadot/util': 12.6.2 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/types@10.13.1': dependencies: @@ -20737,7 +20755,7 @@ snapshots: '@polkadot/util': 12.6.2 '@polkadot/util-crypto': 12.6.2(@polkadot/util@12.6.2) rxjs: 7.8.1 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/types@11.0.3': dependencies: @@ -20748,7 +20766,7 @@ snapshots: '@polkadot/util': 12.6.2 '@polkadot/util-crypto': 12.6.2(@polkadot/util@12.6.2) rxjs: 7.8.1 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/types@6.0.5': dependencies: @@ -20759,7 +20777,7 @@ snapshots: '@polkadot/util-crypto@12.6.2(@polkadot/util@12.6.2)': dependencies: - '@noble/curves': 1.4.0 + '@noble/curves': 1.5.0 '@noble/hashes': 1.4.0 '@polkadot/networks': 12.6.2 '@polkadot/util': 12.6.2 @@ -20768,7 +20786,7 @@ snapshots: '@polkadot/x-bigint': 12.6.2 '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@12.6.2)) '@scure/base': 1.1.6 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/util-crypto@7.9.2(@polkadot/util@7.9.2)': dependencies: @@ -20797,7 +20815,7 @@ snapshots: '@polkadot/x-textencoder': 12.6.2 '@types/bn.js': 5.1.5 bn.js: 5.2.1 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/util@7.9.2': dependencies: @@ -20814,7 +20832,7 @@ snapshots: '@polkadot/util': 12.6.2 '@polkadot/wasm-util': 7.3.2(@polkadot/util@12.6.2) '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@12.6.2)) - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/wasm-crypto-asmjs@4.6.1(@polkadot/util@7.9.2)': dependencies: @@ -20824,7 +20842,7 @@ snapshots: '@polkadot/wasm-crypto-asmjs@7.3.2(@polkadot/util@12.6.2)': dependencies: '@polkadot/util': 12.6.2 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/wasm-crypto-init@7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@12.6.2)))': dependencies: @@ -20834,7 +20852,7 @@ snapshots: '@polkadot/wasm-crypto-wasm': 7.3.2(@polkadot/util@12.6.2) '@polkadot/wasm-util': 7.3.2(@polkadot/util@12.6.2) '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@12.6.2)) - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/wasm-crypto-wasm@4.6.1(@polkadot/util@7.9.2)': dependencies: @@ -20845,7 +20863,7 @@ snapshots: dependencies: '@polkadot/util': 12.6.2 '@polkadot/wasm-util': 7.3.2(@polkadot/util@12.6.2) - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/wasm-crypto@4.6.1(@polkadot/util@7.9.2)(@polkadot/x-randomvalues@7.9.2)': dependencies: @@ -20864,23 +20882,23 @@ snapshots: '@polkadot/wasm-crypto-wasm': 7.3.2(@polkadot/util@12.6.2) '@polkadot/wasm-util': 7.3.2(@polkadot/util@12.6.2) '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@12.6.2)) - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/wasm-util@7.3.2(@polkadot/util@12.6.2)': dependencies: '@polkadot/util': 12.6.2 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/x-bigint@12.6.2': dependencies: '@polkadot/x-global': 12.6.2 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/x-fetch@12.6.2': dependencies: '@polkadot/x-global': 12.6.2 node-fetch: 3.3.2 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/x-fetch@7.9.2': dependencies: @@ -20893,7 +20911,7 @@ snapshots: '@polkadot/x-global@12.6.2': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/x-global@7.9.2': dependencies: @@ -20904,7 +20922,7 @@ snapshots: '@polkadot/util': 12.6.2 '@polkadot/wasm-util': 7.3.2(@polkadot/util@12.6.2) '@polkadot/x-global': 12.6.2 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/x-randomvalues@7.9.2': dependencies: @@ -20914,7 +20932,7 @@ snapshots: '@polkadot/x-textdecoder@12.6.2': dependencies: '@polkadot/x-global': 12.6.2 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/x-textdecoder@7.9.2': dependencies: @@ -20924,7 +20942,7 @@ snapshots: '@polkadot/x-textencoder@12.6.2': dependencies: '@polkadot/x-global': 12.6.2 - tslib: 2.6.2 + tslib: 2.7.0 '@polkadot/x-textencoder@7.9.2': dependencies: @@ -22459,16 +22477,16 @@ snapshots: '@smithy/abort-controller@3.0.0': dependencies: '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/chunked-blob-reader-native@3.0.0': dependencies: '@smithy/util-base64': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/chunked-blob-reader@3.0.0': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/config-resolver@3.0.0': dependencies: @@ -22476,7 +22494,7 @@ snapshots: '@smithy/types': 3.0.0 '@smithy/util-config-provider': 3.0.0 '@smithy/util-middleware': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/core@2.0.1': dependencies: @@ -22487,7 +22505,7 @@ snapshots: '@smithy/smithy-client': 3.0.1 '@smithy/types': 3.0.0 '@smithy/util-middleware': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/credential-provider-imds@3.0.0': dependencies: @@ -22495,7 +22513,7 @@ snapshots: '@smithy/property-provider': 3.0.0 '@smithy/types': 3.0.0 '@smithy/url-parser': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/eventstream-codec@3.0.0': dependencies: @@ -22508,24 +22526,24 @@ snapshots: dependencies: '@smithy/eventstream-serde-universal': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/eventstream-serde-config-resolver@3.0.0': dependencies: '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/eventstream-serde-node@3.0.0': dependencies: '@smithy/eventstream-serde-universal': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/eventstream-serde-universal@3.0.0': dependencies: '@smithy/eventstream-codec': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/fetch-http-handler@3.0.1': dependencies: @@ -22533,48 +22551,48 @@ snapshots: '@smithy/querystring-builder': 3.0.0 '@smithy/types': 3.0.0 '@smithy/util-base64': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/hash-blob-browser@3.0.0': dependencies: '@smithy/chunked-blob-reader': 3.0.0 '@smithy/chunked-blob-reader-native': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/hash-node@3.0.0': dependencies: '@smithy/types': 3.0.0 '@smithy/util-buffer-from': 3.0.0 '@smithy/util-utf8': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/hash-stream-node@3.0.0': dependencies: '@smithy/types': 3.0.0 '@smithy/util-utf8': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/invalid-dependency@3.0.0': dependencies: '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/is-array-buffer@3.0.0': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/md5-js@3.0.0': dependencies: '@smithy/types': 3.0.0 '@smithy/util-utf8': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/middleware-content-length@3.0.0': dependencies: '@smithy/protocol-http': 4.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/middleware-endpoint@3.0.0': dependencies: @@ -22584,7 +22602,7 @@ snapshots: '@smithy/types': 3.0.0 '@smithy/url-parser': 3.0.0 '@smithy/util-middleware': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/middleware-retry@3.0.1': dependencies: @@ -22595,25 +22613,25 @@ snapshots: '@smithy/types': 3.0.0 '@smithy/util-middleware': 3.0.0 '@smithy/util-retry': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 uuid: 9.0.1 '@smithy/middleware-serde@3.0.0': dependencies: '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/middleware-stack@3.0.0': dependencies: '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/node-config-provider@3.0.0': dependencies: '@smithy/property-provider': 3.0.0 '@smithy/shared-ini-file-loader': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/node-http-handler@3.0.0': dependencies: @@ -22621,28 +22639,28 @@ snapshots: '@smithy/protocol-http': 4.0.0 '@smithy/querystring-builder': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/property-provider@3.0.0': dependencies: '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/protocol-http@4.0.0': dependencies: '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/querystring-builder@3.0.0': dependencies: '@smithy/types': 3.0.0 '@smithy/util-uri-escape': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/querystring-parser@3.0.0': dependencies: '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/service-error-classification@3.0.0': dependencies: @@ -22651,7 +22669,7 @@ snapshots: '@smithy/shared-ini-file-loader@3.0.0': dependencies: '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/signature-v4@3.0.0': dependencies: @@ -22661,7 +22679,7 @@ snapshots: '@smithy/util-middleware': 3.0.0 '@smithy/util-uri-escape': 3.0.0 '@smithy/util-utf8': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/smithy-client@3.0.1': dependencies: @@ -22670,40 +22688,40 @@ snapshots: '@smithy/protocol-http': 4.0.0 '@smithy/types': 3.0.0 '@smithy/util-stream': 3.0.1 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/types@3.0.0': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/url-parser@3.0.0': dependencies: '@smithy/querystring-parser': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/util-base64@3.0.0': dependencies: '@smithy/util-buffer-from': 3.0.0 '@smithy/util-utf8': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/util-body-length-browser@3.0.0': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/util-body-length-node@3.0.0': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/util-buffer-from@3.0.0': dependencies: '@smithy/is-array-buffer': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/util-config-provider@3.0.0': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/util-defaults-mode-browser@3.0.1': dependencies: @@ -22711,7 +22729,7 @@ snapshots: '@smithy/smithy-client': 3.0.1 '@smithy/types': 3.0.0 bowser: 2.11.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/util-defaults-mode-node@3.0.1': dependencies: @@ -22721,28 +22739,28 @@ snapshots: '@smithy/property-provider': 3.0.0 '@smithy/smithy-client': 3.0.1 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/util-endpoints@2.0.0': dependencies: '@smithy/node-config-provider': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/util-hex-encoding@3.0.0': dependencies: - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/util-middleware@3.0.0': dependencies: '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/util-retry@3.0.0': dependencies: '@smithy/service-error-classification': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/util-stream@3.0.1': dependencies: @@ -22753,7 +22771,7 @@ snapshots: '@smithy/util-buffer-from': 3.0.0 '@smithy/util-hex-encoding': 3.0.0 '@smithy/util-utf8': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/util-uri-escape@3.0.0': dependencies: @@ -22762,13 +22780,13 @@ snapshots: '@smithy/util-utf8@3.0.0': dependencies: '@smithy/util-buffer-from': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@smithy/util-waiter@3.0.0': dependencies: '@smithy/abort-controller': 3.0.0 '@smithy/types': 3.0.0 - tslib: 2.6.2 + tslib: 2.7.0 '@snapshot-labs/snapshot.js@0.4.110(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: @@ -25675,7 +25693,7 @@ snapshots: camel-case@4.1.2: dependencies: pascal-case: 3.1.2 - tslib: 2.6.2 + tslib: 2.7.0 camelcase-keys@6.2.2: dependencies: @@ -27697,6 +27715,8 @@ snapshots: extensionless@1.9.6: {} + extensionless@1.9.9: {} + extsprintf@1.3.0: {} eyes@0.1.8: {} @@ -27796,7 +27816,7 @@ snapshots: file-selector@0.6.0: dependencies: - tslib: 2.6.2 + tslib: 2.7.0 file-uri-to-path@1.0.0: {} @@ -31181,7 +31201,7 @@ snapshots: param-case@3.0.4: dependencies: dot-case: 3.0.4 - tslib: 2.6.2 + tslib: 2.7.0 parchment@1.1.4: {} diff --git a/scripts/datadog-entrypoint.sh b/scripts/datadog-entrypoint.sh new file mode 100644 index 00000000000..4891e4c9e27 --- /dev/null +++ b/scripts/datadog-entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +datadog-agent run & +/opt/datadog-agent/embedded/bin/trace-agent --config=/etc/datadog-agent/datadog.yaml & +/opt/datadog-agent/embedded/bin/process-agent --config=/etc/datadog-agent/datadog.yaml & + +# Check if a command is provided +if [ -z "$1" ]; then + echo "Error: No command provided to run. Usage: $0 " + exit 1 +fi + +exec "$@" \ No newline at end of file diff --git a/scripts/deploy-to-heroku.sh b/scripts/deploy-to-heroku.sh new file mode 100755 index 00000000000..6a74415501c --- /dev/null +++ b/scripts/deploy-to-heroku.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +## Note must be run from root directory due to relative paths (How github CI runs it) + +set -e + +if [ "$#" -ne 3 ]; then + echo "Usage: $0 " + exit 1 +fi + +email=$1 +api_key=$2 +app_name=$3 + +cat >~/.netrc <