Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion keepercommander/command_categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
# Service Mode REST API
'Service Mode REST API': {
'service-create', 'service-add-config', 'service-start', 'service-stop', 'service-status',
'service-config-add', 'service-docker-setup', 'slack-app-setup', 'teams-app-setup'
'service-config-add', 'service-docker-setup', 'slack-app-setup', 'teams-app-setup',
'gchat-app-setup'
},

# Email Configuration Commands
Expand Down
10 changes: 8 additions & 2 deletions keepercommander/commands/start_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
from ..service.commands.config_operation import AddConfigService
from ..service.commands.handle_service import StartService, StopService, ServiceStatus
from ..service.commands.service_docker_setup import ServiceDockerSetupCommand
from ..service.commands.integrations import SlackAppSetupCommand, TeamsAppSetupCommand
from ..service.commands.integrations import (
GChatAppSetupCommand,
SlackAppSetupCommand,
TeamsAppSetupCommand,
)

def register_commands(commands):
commands['service-create'] = CreateService()
Expand All @@ -24,6 +28,7 @@ def register_commands(commands):
commands['service-docker-setup'] = ServiceDockerSetupCommand()
commands['slack-app-setup'] = SlackAppSetupCommand()
commands['teams-app-setup'] = TeamsAppSetupCommand()
commands['gchat-app-setup'] = GChatAppSetupCommand()

def register_command_info(aliases, command_info):
service_classes = [
Expand All @@ -34,7 +39,8 @@ def register_command_info(aliases, command_info):
ServiceStatus,
ServiceDockerSetupCommand,
SlackAppSetupCommand,
TeamsAppSetupCommand
TeamsAppSetupCommand,
GChatAppSetupCommand,
]

for service_class in service_classes:
Expand Down
56 changes: 56 additions & 0 deletions keepercommander/service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ The Service Mode module for Keeper Commander enables REST API integration by pro
| `service-config-add` | Add new API configuration and command access settings |
| `service-docker-setup` | Automated Docker service mode setup with KSM configuration |
| `slack-app-setup` | Automated Slack App integration setup with Commander Service Mode |
| `teams-app-setup` | Automated Teams App integration setup with Commander Service Mode |
| `gchat-app-setup` | Automated Google Chat App integration setup with Commander Service Mode |

### Security Features
- API key authentication
Expand Down Expand Up @@ -500,6 +502,60 @@ This automates the complete setup for Slack App integration:

The command generates a complete `docker-compose.yml` with both Commander service and Slack App service configured.

### Google Chat App Integration Setup

For integrating Commander Service Mode with Google Chat, use the `gchat-app-setup` command:

```bash
My Vault> gchat-app-setup
```

This automates the complete setup for Google Chat App integration:
- **Phase 1**: Runs Docker setup (same as `service-docker-setup`)
- **Phase 2**: Configures Google Chat App integration
- Collects service account JSON (Pub/Sub + Chat API worker credentials)
- Collects Google Project ID (defaults from the service account JSON when omitted)
- Collects Pub/Sub Topic ID, Subscription ID, Approvals Space ID, and slash command IDs
- Creates Google Chat configuration record
- Updates `docker-compose.yml` with Google Chat App service
- Supports optional EPM and Device Approval integrations

**Configuration Options:**
- Port selection (default: 8900)
- Ngrok/Cloudflare tunneling for public URL exposure
- Google Chat service account / Pub/Sub / space credentials
- Optional EPM integration
- Optional SSO Cloud Device Approval

The command generates a complete `docker-compose.yml` with both Commander service and Google Chat App service configured.

**Vault config record fields** (read by the Google Chat app via KSM / `GCHAT_RECORD`):

| Field label | Type | Description |
|-------------|------|-------------|
| `google_service_account_json` | secret | Full GCP service account JSON (Pub/Sub + Chat API) |
| `google_project_id` | text | GCP project ID |
| `google_topic_id` | text | Pub/Sub topic ID (short form) |
| `google_subscription_id` | text | Pub/Sub subscription ID (short form) |
| `chat_approvals_space_id` | text | Google Chat space ID (`spaces/...`) |
| `chat_command_request_record_id` | text | Slash command ID for `/keeper-request-record` |
| `chat_command_request_folder_id` | text | Slash command ID for `/keeper-request-folder` |
| `chat_command_one_time_share_id` | text | Slash command ID for `/keeper-one-time-share` |
| `pedm_enabled` | text | `true` / `false` |
| `pedm_polling_interval` | text | Seconds |
| `device_approval_enabled` | text | `true` / `false` |
| `device_approval_polling_interval` | text | Seconds |

**Generated compose environment for the Google Chat service:**

| Env var | Value |
|---------|-------|
| `KSM_CONFIG` | Base64 KSM config |
| `COMMANDER_RECORD` | Commander Docker config record UID |
| `GCHAT_RECORD` | Google Chat config record UID |

Image name used in compose: `keeper/gchat-app:latest`.

---

### Manual Authentication Methods (Alternative)
Expand Down
2 changes: 2 additions & 0 deletions keepercommander/service/commands/integrations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@

"""Integration setup commands."""

from .gchat_app_setup import GChatAppSetupCommand
from .integration_setup_base import IntegrationSetupCommand
from .slack_app_setup import SlackAppSetupCommand
from .teams_app_setup import TeamsAppSetupCommand

__all__ = [
'IntegrationSetupCommand',
'GChatAppSetupCommand',
'SlackAppSetupCommand',
'TeamsAppSetupCommand',
]
Loading