Skip to content

Commit

Permalink
fix(core): Fix Vercel deployment with HTTPS Mediatior and KERIA (#211)
Browse files Browse the repository at this point in the history
* fix(core): https mediator

* fix(core): dont launch agent for now

* fix(core): start agent again

* fix(core): dont start mediator

* fix: check if fetching mediator url works

* refactor(core): enable debug logs

* refactor(core): debug statements

* feat(core): https keria

* fix(core): add back in mediator

* fix(core): new invitation URL for https

* fix(core): revert debug changes and prettier

* refactor(core): remove debug logger
  • Loading branch information
iFergal authored Nov 15, 2023
1 parent bbf1c0d commit 2bdb076
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 6 deletions.
1 change: 1 addition & 0 deletions cloud-services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
At the moment, our wallet depends on a number of cloud services:
- KERIA (KERI Cloud Agent),
- AFJ Mediator
- Credential issuance server (from this repo)

This directory is incomplete for now - missing:
- Full Traefik config,
Expand Down
53 changes: 51 additions & 2 deletions cloud-services/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@ services:
- 3901:3901
- 3902:3902
- 3903:3903
labels:
- "traefik.enable=true"
- "traefik.http.routers.keria.rule=Host(`${KERIA_HOST:-keria}`)"
- "traefik.http.routers.keria.entrypoints=websecure"
- "traefik.http.routers.keria.tls.certresolver=myresolver"
- "traefik.http.routers.keria.service=keria"
- "traefik.http.services.keria.loadbalancer.server.port=3901"

- "traefik.http.routers.keria-ext.rule=Host(`${KERIA_EXT_HOST:-keria-ext}`)"
- "traefik.http.routers.keria-ext.entrypoints=websecure"
- "traefik.http.routers.keria-ext.tls.certresolver=myresolver"
- "traefik.http.routers.keria-ext.service=keria-ext"
- "traefik.http.services.keria-ext.loadbalancer.server.port=3902"

- "traefik.http.routers.keria-boot.rule=Host(`${KERIA_BOOT_HOST:-keria-boot}`)"
- "traefik.http.routers.keria-boot.entrypoints=websecure"
- "traefik.http.routers.keria-boot.tls.certresolver=myresolver"
- "traefik.http.routers.keria-boot.service=keria-boot"
- "traefik.http.services.keria-boot.loadbalancer.server.port=3903"

vlei:
container_name: vlei-server
restart: unless-stopped
Expand All @@ -42,6 +62,12 @@ services:
timeout: 3s
start_period: 10s
retries: 5
labels:
- "traefik.enable=true"
- "traefik.http.routers.mediator.rule=Host(`${MEDIATOR_HOST:-mediator-host}`)"
- "traefik.http.routers.mediator.entrypoints=websecure"
- "traefik.http.routers.mediator.tls.certresolver=myresolver"
- "traefik.http.services.mediator.loadbalancer.server.port=2015"

mediator:
container_name: mediator
Expand All @@ -52,8 +78,31 @@ services:
- mediator-wallet:/root/.indy_client
restart: unless-stopped
environment:
- AGENT_ENDPOINTS=http://dev.mediator.cf-keripy.metadata.dev.cf-deployments.org:2015,ws://dev.mediator.cf-keripy.metadata.dev.cf-deployments.org:2015
- AGENT_ENDPOINTS=https://dev.mediator.cf-keripy.metadata.dev.cf-deployments.org,wss://dev.mediator.cf-keripy.metadata.dev.cf-deployments.org

cred-issuance:
container_name: cred-issuance
build:
context: ../cf-identity-wallet/credential-issuance-server
dockerfile: ./Dockerfile
restart: unless-stopped
ports:
- 3010:3010
labels:
- "traefik.enable=true"
- "traefik.http.routers.credentials.rule=Host(`${CRED_HOST:-credentials}`)"
- "traefik.http.routers.credentials.entrypoints=websecure"
- "traefik.http.routers.credentials.tls.certresolver=myresolver"
- "traefik.http.services.credentials.loadbalancer.server.port=3010"
volumes:
- cred-issuance:/root/.afj

volumes:
keria-data:
mediator-wallet:
mediator-wallet:
cred-issuance:

networks:
default:
name: traefik
external: true
2 changes: 1 addition & 1 deletion src/core/agent/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const agentModules = {
signify: new SignifyModule(),
mediationRecipient: new MediationRecipientModule({
mediatorInvitationUrl:
"http://dev.mediator.cf-keripy.metadata.dev.cf-deployments.org:2015/invitation?oob=eyJAdHlwZSI6Imh0dHBzOi8vZGlkY29tbS5vcmcvb3V0LW9mLWJhbmQvMS4xL2ludml0YXRpb24iLCJAaWQiOiIzY2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DE2LTRhNWUtYTY0Yy1kNmI4M2Y4NGE1NTYiLCJsYWJlbCI6IkFyaWVzIEZyYW1ld29yayBKYXZhU2NyaXB0IE1lZGlhdG9yIiwiYWNjZXB0IjpbImRpZGNvbW0vYWlwMSIsImRpZGNvbW0vYWlwMjtlbnY9cmZjMTkiXSwiaGFuZHNoYWtlX3Byb3RvY29scyI6WyJodHRwczovL2RpZGNvbW0ub3JnL2RpZGV4Y2hhbmdlLzEuMCIsImh0dHBzOi8vZGlkY29tbS5vcmcvY29ubmVjdGlvbnMvMS4wIl0sInNlcnZpY2VzIjpbeyJpZCI6IiNpbmxpbmUtMCIsInNlcnZpY2VFbmRwb2ludCI6Imh0dHBzOi8vZGV2Lm1lZGlhdG9yLmNmLWtlcmlweS5tZXRhZGF0YS5kZXYuY2YtZGVwbG95bWVudHMub3JnIiwidHlwZSI6ImRpZC1jb21tdW5pY2F0aW9uIiwicmVjaXBpZW50S2V5cyI6WyJkaWQ6a2V5Ono2TWtobXRpVVBjVDJubmNmamZNV2p3ZlBVNEU1N0RaWUxBQ1ZWQzdWVnNmeGpjdiJdLCJyb3V0aW5nS2V5cyI6W119LHsiaWQiOiIjaW5saW5lLTEiLCJzZXJ2aWNlRW5kcG9pbnQiOiJ3c3M6Ly9kZXYubWVkaWF0b3IuY2Yta2VyaXB5Lm1ldGFkYXRhLmRldi5jZi1kZXBsb3ltZW50cy5vcmciLCJ0eXBlIjoiZGlkLWNvbW11bmljYXRpb24iLCJyZWNpcGllbnRLZXlzIjpbImRpZDprZXk6ejZNa2htdGlVUGNUMm5uY2ZqZk1XandmUFU0RTU3RFpZTEFDVlZDN1ZWc2Z4amN2Il0sInJvdXRpbmdLZXlzIjpbXX1dfQ",
mediatorPickupStrategy: MediatorPickupStrategy.Implicit,
}),
credentials: new CredentialsModule({
Expand Down
4 changes: 2 additions & 2 deletions src/core/agent/modules/signify/signifyApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { KeyStoreKeys, SecureStorage } from "../../../storage";

export class SignifyApi {
static readonly LOCAL_KERIA_ENDPOINT =
"http://dev.keria.cf-keripy.metadata.dev.cf-deployments.org:3901";
"https://dev.keria.cf-keripy.metadata.dev.cf-deployments.org";
static readonly LOCAL_KERIA_BOOT_ENDPOINT =
"http://dev.keria.cf-keripy.metadata.dev.cf-deployments.org:3903";
"https://dev.keria-boot.cf-keripy.metadata.dev.cf-deployments.org";
static readonly BACKER_AID = "BIe_q0F4EkYPEne6jUnSV1exxOYeGf_AMSMvegpF4XQP";
static readonly FAILED_TO_CREATE_IDENTIFIER =
"Failed to create new managed AID, operation not completing...";
Expand Down
1 change: 1 addition & 0 deletions src/core/agent/transports/httpOutboundTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class HttpOutboundTransport implements OutboundTransport {
this.agent = agent;
}

// eslint-disable-next-line @typescript-eslint/no-empty-function
async stop(): Promise<void> {}

async sendMessage(outboundPackage: OutboundPackage) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/storage/secureStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enum KeyStoreKeys {
CRYPTO_ENTROPY_PREFIX = "crypto-entropy-",
CRYPTO_ROOT_XPRV_KEY_PREFIX = "crypto-root-xprv-key-",
LIBP2P_PEER = "libp2p-peer",
SIGNIFY_BRAN = "signify-bran"
SIGNIFY_BRAN = "signify-bran",
}

class SecureStorage {
Expand Down

0 comments on commit 2bdb076

Please sign in to comment.