diff --git a/.github/workflows/deploy-billboard.yml b/.github/workflows/deploy-billboard.yml index 73fd3719a..af8ae27b1 100644 --- a/.github/workflows/deploy-billboard.yml +++ b/.github/workflows/deploy-billboard.yml @@ -3,9 +3,9 @@ on: push jobs: messenger-demo-deploy: + environment: devconnect2023 runs-on: ubuntu-latest # if: ${{ contains( github.ref, vars.STAGING_BRANCH) }} - environment: staging-billboard steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v3 @@ -29,14 +29,14 @@ jobs: env: TARGET_HOST: ${{ secrets.STAGING_HOST }} run: | - echo "REACT_APP_ADDR_ENS_SUBDOMAIN=.bb-addr.dm3.eth" >> ./.env.react + echo "REACT_APP_ADDR_ENS_SUBDOMAIN=.addr.devconnect.dm3.eth" >> ./.env.react echo "REACT_APP_BACKEND=http://${{ secrets.STAGING_HOST }}/api" >> ./.env.react - echo "REACT_APP_DEFAULT_DELIVERY_SERVICE=beta-ds.dm3.eth" >> ./.env.react + echo "REACT_APP_DEFAULT_DELIVERY_SERVICE=bb-ds.devconnect.dm3.eth" >> ./.env.react echo "REACT_APP_DEFAULT_SERVICE=http://${{ secrets.STAGING_HOST }}/api" >> ./.env.react echo "REACT_APP_ETHEREUM_PROVIDER=${{ secrets.REACT_APP_ETHEREUM_PROVIDER }}" >> ./.env.react echo "REACT_APP_PROFILE_BASE_URL=http://${{ secrets.STAGING_HOST }}/api" >> ./.env.react echo "REACT_APP_RESOLVER_BACKEND=http://${{ secrets.STAGING_HOST }}/resolver-handler" >> ./.env.react - echo "REACT_APP_USER_ENS_SUBDOMAIN=.beta-user.dm3.eth" >> ./.env.react + echo "REACT_APP_USER_ENS_SUBDOMAIN=.user.devconnect.dm3.eth" >> ./.env.react echo "REACT_APP_WALLET_CONNECT_PROJECT_ID=${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID }}" >> ./.env.react echo "REACT_APP_COMMIT_HASH=${{ env.sha_short }}" >> ./.env.react echo "REACT_APP_BRANCH=${{ env.branch }}" >> ./.env.react diff --git a/docker/billboard/docker-compose.yml b/docker/billboard/docker-compose.yml index 24bfb91e5..f08e3557d 100644 --- a/docker/billboard/docker-compose.yml +++ b/docker/billboard/docker-compose.yml @@ -103,7 +103,7 @@ services: LOG_LEVEL: debug CONFIG: | { - "0x26139b2349282de5ee2bd9c7a53171a28d6a6c84": { + "0xc9bf092673b3a066df088a2a911e23e9b69b82f2": { "type": "signing", "handlerUrl": "http://offchain-resolver:8082" } diff --git a/packages/backend/src/rpc/methods/handleSubmitMessage.ts b/packages/backend/src/rpc/methods/handleSubmitMessage.ts index f0edcd138..e7f737bff 100644 --- a/packages/backend/src/rpc/methods/handleSubmitMessage.ts +++ b/packages/backend/src/rpc/methods/handleSubmitMessage.ts @@ -62,7 +62,7 @@ export async function handleSubmitMessage( } catch (error) { global.logger.warn({ method: 'RPC SUBMIT MESSAGE', - error, + error: JSON.stringify(error), }); logError({ text: '[handleSubmitMessage]', diff --git a/packages/lib/delivery/src/Messages.ts b/packages/lib/delivery/src/Messages.ts index 6a9edb108..cce392eb9 100644 --- a/packages/lib/delivery/src/Messages.ts +++ b/packages/lib/delivery/src/Messages.ts @@ -138,12 +138,18 @@ export async function incomingMessage( if (!tokenIsValid) { //Token is invalid + logDebug({ + text: 'incomingMessage token invalid', + }); throw Error('Token check failed'); } //Retrives the session of the receiver const receiverSession = await getSession(deliveryInformation.to); if (!receiverSession) { + logDebug({ + text: 'incomingMessage unknown session', + }); throw Error('unknown session'); } logDebug({ @@ -155,6 +161,9 @@ export async function incomingMessage( //Checkes if the message is spam if (await isSpam(provider, receiverSession, deliveryInformation)) { + logDebug({ + text: 'incomingMessage is spam', + }); throw Error('Message does not match spam criteria'); } diff --git a/packages/lib/delivery/src/Session.ts b/packages/lib/delivery/src/Session.ts index 427687456..fec298b0b 100644 --- a/packages/lib/delivery/src/Session.ts +++ b/packages/lib/delivery/src/Session.ts @@ -1,5 +1,6 @@ import { ethers } from 'ethers'; import { ProfileExtension, SignedUserProfile } from 'dm3-lib-profile'; +import { logDebug } from 'dm3-lib-shared'; //1Year const TTL = 31536000000; @@ -23,17 +24,26 @@ export async function checkToken( ensName: string, token: string, ): Promise { + logDebug({ + text: 'checkToken', + }); const address = await provider.resolveName(ensName); if (!address) { // Couln't resolve ENS name + logDebug({ + text: `checkToken - Couln't resolve ENS name`, + }); return false; } const session = await getSession(ensName.toLocaleLowerCase()); - //There is now account for the requesting accoung + //There is no account for the requesting accoung if (!session) { + logDebug({ + text: `checkToken - There is no account for the requesting accoung`, + }); return false; } @@ -41,12 +51,18 @@ export async function checkToken( //The account has a session but the token is wrong if (!tokenIsValid) { + logDebug({ + text: `checkToken - The account has a session but the token is wrong`, + }); return false; } const isTokenExpired = session.createdAt + TTL < new Date().getTime(); //The token is exceeded if (isTokenExpired) { + logDebug({ + text: `checkToken - The token is exceeded`, + }); return false; } diff --git a/packages/offchain-resolver/src/http/profile.ts b/packages/offchain-resolver/src/http/profile.ts index f2f8a23bd..85643b61b 100644 --- a/packages/offchain-resolver/src/http/profile.ts +++ b/packages/offchain-resolver/src/http/profile.ts @@ -87,17 +87,17 @@ export function profile(web3Provider: ethers.providers.BaseProvider) { } global.logger.debug({ message: 'nameP setAlias', - hotAddr: hotAddr + '.bb-addr.dm3.eth', - alias: `${address}.bb-user.dm3.eth`, + hotAddr: hotAddr + '.addr.devconnect.dm3.eth', + alias: `${address}.user.devconnect.dm3.eth`, }); await req.app.locals.db.removeAlias( - `${address}.bb-user.dm3.eth`, + `${address}.user.devconnect.dm3.eth`, ); await req.app.locals.db.setAlias( - hotAddr + '.bb-addr.dm3.eth', - `${address}.bb-user.dm3.eth`, + hotAddr + '.addr.devconnect.dm3.eth', + `${address}.user.devconnect.dm3.eth`, ); return res.sendStatus(200);