aido-onyx/smb-connector/docker-compose.standalone.yml
Naeem Dosh 26d3262cfb SMB connector: per-connector group access + standalone Docker mode
1. Optional Onyx group per connector. Set SMB_SOURCE_<N>_GROUPS (or
   "groups" in SMB_SOURCES JSON, or SMB_DEFAULT_GROUP_IDS as a fallback)
   to a list of Onyx user-group ids. The connector is then created
   PRIVATE and restricted to those groups; empty stays PUBLIC. Applied
   only at connector creation, as requested. Needs the Business licence.

2. Standalone deployment. New docker-compose.standalone.yml runs the
   connector as its own Compose project next to Onyx (no -f injection),
   joining Onyx's network (onyx_default, override via ONYX_NETWORK) to
   reach the API by service name. Suits Compose management tools that
   cannot handle multiple injected compose files. The legacy injected
   compose still works.

Verified: group-id parsing across all three source styles, the
private+groups vs public payload, standalone compose config, and the
full index/sync simulation (still green).
2026-09-24 14:20:39 +05:00

60 lines
2.1 KiB
YAML

# Standalone SMB connector — its own Compose project, next to Onyx.
#
# Run it on its own (no `-f` injection into the Onyx compose):
#
# cd smb-connector
# docker compose -f docker-compose.standalone.yml up -d --build
#
# It reaches Onyx over Onyx's existing Docker network. Onyx's compose has
# `name: onyx` and no custom network, so its network is `onyx_default`. If your
# Onyx project uses a different name, set ONYX_NETWORK to <project>_default.
# The connector talks to the API by service name (http://api_server:8080).
#
# In-container CIFS mounting works the same as before: give the share +
# credentials via env (see .env.example). The two capabilities and the
# unconfined apparmor profile below are required for mount.cifs in a container.
name: aido-smb-connector
services:
smb_connector:
build: .
image: livtec/aido-smb-connector:local
container_name: aido-smb-connector
restart: unless-stopped
environment:
# Reach the Onyx API over the shared network (override if needed).
- ONYX_API_URL=${ONYX_API_URL:-http://api_server:8080}
env_file:
- path: .env
required: false
networks:
- onyx_net
# --- required to mount SMB/CIFS shares inside the container ---------------
cap_add:
- SYS_ADMIN
- DAC_READ_SEARCH
security_opt:
- apparmor:unconfined
# If your host's Docker still refuses the mount, use privileged mode instead
# of the two cap_add lines above:
# privileged: true
volumes:
# Persist the sync manifest + cached api-key/cc_pair (survives restarts).
- ./state:/app/state
# Legacy host-mount mode still works: bind-mount a share here and OMIT the
# SMB_SOURCE_*_SERVER/_UNC env for that source, e.g.
# - /mnt/smb/finance:/mnt/smb/finance:ro
logging:
driver: json-file
options:
max-size: "50m"
max-file: "6"
# Onyx's network, created by the Onyx compose project. Joined as external so
# this stays a separate Compose project. Override the name with ONYX_NETWORK.
networks:
onyx_net:
external: true
name: ${ONYX_NETWORK:-onyx_default}