Menú de la documentación

Slack y Teams: alojamiento propio

Ivy’s hosted service comes with its own Slack app and Teams bot. A self-hosted Ivy registers its own, once per installation, and passes their credentials to the API and the worker. Until it does, Settings → Integrations lists Slack and Teams as unavailable. After that, organisation admins install the apps as described in Install the Slack app and Install the Teams app.

The app definitions are in the repository’s deploy/integrations/ directory: a Slack app manifest and the Teams app template that Ivy fills in for the package admins download.

Before you start

Slack and Microsoft deliver messages to Ivy over HTTPS, so these addresses must be reachable from the internet, at your app host (APP_ORIGIN):

{APP_ORIGIN}/api/v1/integrations/slack/events
{APP_ORIGIN}/api/v1/integrations/slack/interactions
{APP_ORIGIN}/api/v1/integrations/teams/messages

They carry no Ivy session: Ivy checks Slack’s request signature or the Bot Framework token on every request. Don’t put a sign-in in front of /api/v1/integrations/, and if a web application firewall inspects request bodies, let these through, because people’s messages may contain code. Ivy doesn’t support Slack’s Socket Mode, so an installation without public HTTPS can’t use Slack or Teams.

Outbound, on port 443, the API calls slack.com, login.microsoftonline.com, login.botframework.com and graph.microsoft.com; the worker also calls files.slack.com and the Bot Framework service URLs (smba.trafficmanager.net and *.botframework.com). The chart’s default network policies allow HTTPS to the internet; see the chart README if you’ve restricted them.

Slack

  1. Copy deploy/integrations/slack/manifest.yaml and replace every {{APP_ORIGIN}} with your app origin, for example https://ivy.acme.example.
  2. At api.slack.com/apps, select Create New App → From a manifest, choose a development workspace, paste the manifest and create the app.
  3. Under Basic Information, copy the Client ID, Client Secret and Signing Secret.
  4. Under Manage Distribution, turn on public distribution if you want to install the app in more than the workspace you created it in.

Don’t install the app from Slack’s pages. Organisation admins install it from Ivy, which ties each Slack workspace to their organisation. If Event Subscriptions shows the request URL as unverified, open it again after Ivy is running with the signing secret: Slack re-checks it.

The manifest asks for exactly the permissions Ivy uses and no channels:history; see what the app can do.

Microsoft Teams

Teams talks to Ivy through an Azure Bot. Microsoft no longer creates new multi-tenant bots, so register it as single tenant in your own Microsoft Entra tenant. Its tokens come from your tenant either way. By default only your tenant can then connect Ivy; to let other organisations connect theirs too, see Other organisations’ tenants.

  1. In the Azure portal, create an Azure Bot resource. Choose Single Tenant as the type of app and Create new Microsoft App ID.

  2. In the bot’s Configuration, set the Messaging endpoint to {APP_ORIGIN}/api/v1/integrations/teams/messages, and note the Microsoft App ID and the App Tenant ID.

  3. Under Channels, add Microsoft Teams and accept its terms.

  4. Open the app registration (Manage Password next to the App ID). Under Certificates & secrets, create a client secret and copy its value. It expires: put a reminder in your calendar to rotate it.

  5. Under Authentication, add a Web platform with these redirect URIs, which Ivy uses for admin consent and for people linking their accounts:

    {APP_ORIGIN}/api/v1/integrations/teams/install/callback
    {APP_ORIGIN}/api/v1/integrations/teams/link/callback
  6. Under API permissions, keep Microsoft Graph User.Read and add the delegated openid, profile, AppCatalog.ReadWrite.All and AppCatalog.Submit permissions. The last two let Connect add Ivy’s app to the tenant’s Teams app catalog as the admin who connects it. You can grant admin consent here, or later from Ivy.

  7. Under Manifest, set "groupMembershipClaims": "DirectoryRole". ID tokens then carry the wids claim, which Ivy checks to make sure the person connecting the tenant is an administrator who can grant consent for it.

This Entra app is separate from any app you registered for connected drives or single sign-on, so your admins can consent to each on its own.

Other organisations’ tenants

Optional. By default (multiTenant: false) Ivy signs admins and people in through your own tenant (login.microsoftonline.com/<tenantId>), and the app registration can stay on Accounts in this organizational directory only. To let other organisations connect their Microsoft 365 tenants as well:

  1. In the app registration, under Authentication, set the supported account types to Multiple Entra ID tenants and choose Allow all tenants.
  2. Set integrations.teams.multiTenant: true (TEAMS_APP_MULTI_TENANT=true). Consent and sign-in then go through login.microsoftonline.com/organizations; the bot’s tokens still come from your tenant.

Either way, Ivy connects a tenant only for an admin who signs in from it with a role that can grant tenant-wide consent, refuses personal Microsoft accounts, and lets one Ivy organisation hold each tenant.

Configure Ivy

With the Helm chart, put the secrets in a Kubernetes Secret and set the IDs in your values:

kubectl -n ivy create secret generic ivy-integrations \
  --from-literal=SLACK_CLIENT_SECRET=… \
  --from-literal=SLACK_SIGNING_SECRET=… \
  --from-literal=TEAMS_APP_PASSWORD=…
integrations:
  existingSecret: ivy-integrations
  slack:
    clientId: "1234567890.0987654321"
  teams:
    appId: 00000000-0000-0000-0000-000000000000 # Microsoft App ID
    tenantId: 00000000-0000-0000-0000-000000000000 # App Tenant ID
    multiTenant: false # optional: let other organisations' tenants connect

A platform is offered once its ID is set; leave one out to offer only the other. The chart refuses to render IDs without existingSecret. Outside Kubernetes, set the same environment variables:

Variable Service Value
INTEGRATIONS API, jobs slack,teams or one of them; empty = every configured one
SLACK_CLIENT_ID API the Slack app’s Client ID
SLACK_CLIENT_SECRET API its Client Secret
SLACK_SIGNING_SECRET API its Signing Secret
TEAMS_APP_ID API, jobs the bot’s Microsoft App ID
TEAMS_APP_PASSWORD API, jobs the client secret
TEAMS_APP_TENANT_ID API, jobs the App Tenant ID of your single-tenant bot
TEAMS_APP_MULTI_TENANT API, jobs optional: true lets other organisations’ tenants connect
INTEGRATIONS_STREAM_INTERVAL_MS jobs optional: shortest interval between edits of a reply (1500)

The worker needs no Slack secret: each Slack workspace’s bot token is stored encrypted with your data encryption key when an admin installs the app.

Check it works

  1. In Ivy, Settings → Integrations now lists Slack and Teams as available.
  2. Install the Slack app from there, invite @Ivy to a channel and write @Ivy connect: Ivy should answer privately within a few seconds.
  3. Connect the tenant from there, add Ivy in Teams from Apps → Built for your org and send it a one-to-one message.

If Ivy doesn’t answer, check that the three addresses above are reachable from the internet and that the API logs show no signature or token errors. For development without Slack or Microsoft, INTEGRATIONS=fake with ALLOW_FAKE_INTEGRATIONS=true runs both against a local stand-in.