diff --git a/README.md b/README.md index 5cd1b7c..7c88d13 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ but likely needed for production and test deployments. | AGENT_ENDPOINT | Public endpoint where agent DIDComm endpoints will be accessible (including protocol and port) | ws://localhost:3001 | | AGENT_ENDPOINTS | List of endpoints where agent DIDComm endpoints will be accessible (including protocol and port), comma separated | ws://localhost:3001 | | AGENT_INVITATION_IMAGE_URL | Public URL for image to be shown in invitations | none | -| AGENT_INVITATION_BASE_URL | Public URL for fallback when no DIDComm agent is found | https://2060.io/i | +| AGENT_INVITATION_BASE_URL | Public URL for fallback when no DIDComm agent is found | https://hologram.zone/ | +| REDIRECT_DEFAULT_URL_TO_INVITATION_URL | Default redirect to AGENT_INVITATION_BASE_URL | https://hologram.zone/ | | AGENT_PUBLIC_DID | Agent's public DID (in did:web format) | none | | AGENT_PORT | Port where DIDComm agent will be running | 3001 | | AGENT_LOG_LEVEL | Aries Agent Log level | 4 (warn) | diff --git a/doc/service-agent-api.md b/doc/service-agent-api.md index b1562a2..6558af5 100644 --- a/doc/service-agent-api.md +++ b/doc/service-agent-api.md @@ -756,7 +756,7 @@ Response from Service Agent is a JSON object containing an URL-encoded invitatio Note that the following Service Agent configuration environment variables are used when creating invitations: -- AGENT_INVITATION_BASE_URL: Base URL for invitations (e.g. https://2060.io/i) +- AGENT_INVITATION_BASE_URL: Base URL for invitations (e.g. https://hologram.zone/) - AGENT_INVITATION_IMAGE_URL: An optional image URL to display along the connection invitation - AGENT_LABEL: An optional label to show along the connection invitation @@ -799,7 +799,7 @@ Response will include the invitation code in both short and long form URL format Note that the following Service Agent configuration environment variables are used when creating presentation request invitations: -- AGENT_INVITATION_BASE_URL: Base URL for long-form invitations (e.g. https://2060.io/i) +- AGENT_INVITATION_BASE_URL: Base URL for long-form invitations (e.g. https://hologram.zone/) - AGENT_INVITATION_IMAGE_URL: An optional image URL to display along the connection invitation - AGENT_LABEL: An optional label to show along the connection invitation - PUBLIC_API_BASE_URL: Base URL for short URL creation (resulting something like https://myHost.com/s?id=) @@ -851,7 +851,7 @@ Response will include the invitation code in both short and long form URL format Note that the following Service Agent configuration environment variables are used when creating credential offer invitations: -- AGENT_INVITATION_BASE_URL: Base URL for long-form invitations (e.g. https://2060.io/i) +- AGENT_INVITATION_BASE_URL: Base URL for long-form invitations (e.g. https://hologram.zone/) - AGENT_INVITATION_IMAGE_URL: An optional image URL to display along the connection invitation - AGENT_LABEL: An optional label to show along the connection invitation - PUBLIC_API_BASE_URL: Base URL for short URL creation (resulting something like https://myHost.com/s?id=) diff --git a/examples/demo-dts/docker-compose.yml b/examples/demo-dts/docker-compose.yml index 6c516c8..497856e 100644 --- a/examples/demo-dts/docker-compose.yml +++ b/examples/demo-dts/docker-compose.yml @@ -23,7 +23,7 @@ services: - POSTGRES_USER=gaia - POSTGRES_PASSWORD=2060demo - AGENT_WALLET_KEY_DERIVATION_METHOD=ARGON2I_INT - - AGENT_INVITATION_BASE_URL=https://hologram.zone/ + - REDIRECT_DEFAULT_URL_TO_INVITATION_URL=true - REDIS_HOST=redis volumes: - ./afj:/root/.afj diff --git a/packages/main/src/controllers/vcauthn/VCAuthNController.ts b/packages/main/src/controllers/vcauthn/VCAuthNController.ts index 63df80c..f70838d 100644 --- a/packages/main/src/controllers/vcauthn/VCAuthNController.ts +++ b/packages/main/src/controllers/vcauthn/VCAuthNController.ts @@ -89,7 +89,7 @@ export class VCAuthNController { invitation: invitation.outOfBandInvitation.toJSON(), invi_msg_id: invitation.outOfBandInvitation.id, invitation_url: invitation.outOfBandInvitation.toUrl({ - domain: process.env.AGENT_INVITATION_BASE_URL ?? 'https://2060.io/i', + domain: process.env.AGENT_INVITATION_BASE_URL ?? 'https://hologram.zone/', }), oob_id: invitation.id, state: invitation.state, diff --git a/packages/main/src/invitationRoutes.ts b/packages/main/src/invitationRoutes.ts index 77aaa3c..9d64c9a 100644 --- a/packages/main/src/invitationRoutes.ts +++ b/packages/main/src/invitationRoutes.ts @@ -39,7 +39,8 @@ export const addInvitationRoutes = async (app: express.Express, agent: ServiceAg // Generate a regular invitation app.get('/invitation', async (req, res) => { const { url: invitationUrl } = await createInvitation(agent) - res.send(invitationUrl) + if (process.env.REDIRECT_DEFAULT_URL_TO_INVITATION_URL === 'true') res.redirect(invitationUrl) + else res.send(invitationUrl) }) // Generate a regular invitation and render it to a QR code diff --git a/packages/main/src/utils/agent.ts b/packages/main/src/utils/agent.ts index 2c39554..3db83d8 100644 --- a/packages/main/src/utils/agent.ts +++ b/packages/main/src/utils/agent.ts @@ -21,6 +21,8 @@ export async function createInvitation(agent: ServiceAgent, messages?: AgentMess }) ).outOfBandInvitation return { - url: outOfBandInvitation.toUrl({ domain: process.env.AGENT_INVITATION_BASE_URL ?? 'https://2060.io/i' }), + url: outOfBandInvitation.toUrl({ + domain: process.env.AGENT_INVITATION_BASE_URL ?? 'https://hologram.zone/', + }), } }