Тип сервиса
Сервис Slack Inviter
Сервис приложения для размещения страницы приглашений в публичные сообщества Slack, у которых уже есть рабочий устаревший API-токен администратора, с необязательной защитой Cloudflare Turnstile.
Нужен устаревший токен Slack
Нужен уже существующий устаревший API-токен администратора, совместимый со Slackin. Slack больше не выдаёт такие токены, а обычные токены приложений и ботов Slack не подходят. Запускайте развёртывание, только если у вас уже есть рабочий устаревший токен.
Этот сервис запускает ваш код: его образ собирается из Git-репозитория, а каждая сборка развёртывается в окружение.
В StackMaster
Как Slack Inviter работает в StackMaster
How the application is started
The image built by the service's Dockerfile starts the application with npm run start, from /usr/src/app. package.json must define a start script.
- The application must listen on port 3000, on all interfaces. That is the port of the service's HTTP endpoint. The service sets
NODE_PORTto that number; it does not setPORT. ReadNODE_PORT, or default to 3000. NODE_ENVisdevelopmentin environments of typedevandproductionin every other type.
Build
The service's Dockerfile only copies the build context to /usr/src/app. It does not run npm install. Dependencies, and any compiled output, must be produced by the pipeline before the image is built, for example with wodby ci run -- npm ci, so that node_modules is part of what is copied. An image built without node_modules cannot load the application's dependencies.
A pipeline that passes a Dockerfile from the repository (wodby ci build node -f Dockerfile) uses that file instead.
The service declares no volume of its own: files written inside the container are lost when it is replaced.
Linked services
Links to other services reach the application as environment variables. Nothing in the image reads them: the application reads them itself. Do not hardcode hosts or credentials.
| Link | Variables |
|---|---|
| Database (MariaDB, MySQL or PostgreSQL) | DB_HOST, DB_PORT, DB_NAME (also DB_DATABASE), DB_USERNAME, DB_PASSWORD, DB_DRIVER (also DB_CONNECTION) |
SMTP_HOST, SMTP_PORT | |
| Redis or Valkey | REDIS_HOST, REDIS_PORT, REDIS_PASSWORD |
| OpenTelemetry Collector | OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_PROTOCOL (http/protobuf), OTEL_EXPORTER_OTLP_HEADERS (the Collector's ingest token) |
All links are optional. A variable is present only while its link exists and the linked service is enabled. The mail link carries no credentials. The OpenTelemetry variables are the standard SDK settings: an application or agent that uses an OpenTelemetry SDK exports to the Collector without further configuration; set OTEL_SERVICE_NAME to name the application in traces.
Environment
WODBY_HOSTSis a JSON array of the environment's hosts, not a comma-separated string.WODBY_PRIMARY_HOSTandWODBY_PRIMARY_URLare the canonical ones for links generated outside a request.WODBY_APP_SERVICE_NAMEis this service's host name inside the environment. Other services reach the application at that name on port 3000.WODBY_ENV_TYPEtells a development environment from a production-like one.
In a development workspace
- The checkout is mounted at
/usr/src/appand served as it is on disk. - Workspace setup installs dependencies with
workspace-node prepare. The package manager is taken frompackageManagerinpackage.json, otherwise from the lockfile:pnpm-lock.yamlmeans pnpm,yarn.lockmeans Yarn, anything else npm. Installs follow the lockfile exactly (npm ci,--frozen-lockfile,--immutable), with development dependencies. Run it again after changing dependencies. - The application is started with the
devscript ofpackage.jsonwhen there is one, otherwise withstart.WORKSPACE_NODE_COMMANDon the service replaces that command. NODE_ENVis alwaysdevelopmenthere, whatever the environment type.PORTis set, toNODE_PORTunless given, andHOSTto0.0.0.0.- A saved file is picked up without a restart or a deployment. A
devscript is expected to watch the files itself. Astartscript runs the application once, so the checkout is watched for it: when a file changes, the application is stopped and started again in the same container, within a few seconds.node_modules,.git,.pnpm-store,.next,dist,buildandcoverageare not watched. A command set withWORKSPACE_NODE_COMMANDis run as it is, without that watcher;WORKSPACE_NODE_WATCH=0turns the watcher off. For scripts with their own watcher,CHOKIDAR_USEPOLLING,CHOKIDAR_INTERVALandWATCHPACK_POLLINGare set, because a checkout on network storage needs polling.WORKSPACE_POLL_INTERVALchanges the interval,WORKSPACE_POLLING=0turns this off. node_modules/and/.pnpm-store/are kept out of Git status without touching.gitignore.- A change to variables or linked services still needs a deployment of the environment.
Check the result
curl -s -o /dev/null -w '%{http_code}' "localhost:$NODE_PORT"from the container shows whether the application answers on the expected port.printenv | grep -E '^(DB|SMTP|REDIS)_' | cut -d= -f1lists the link variables that are present.
Slack Inviter on Wodby
What this service adds to the Node.js service it is based on. The application is the public wodby/slack-inviter project: an invitation page for a Slack community. It is configured entirely through environment variables; the source needs no edits.
Where each variable comes from
| Source | Variables |
|---|---|
| Set by the service | PUBLIC_URL (the environment's primary URL), TURNSTILE_EXPECTED_HOSTNAME (the primary host), TRUST_PROXY (true) |
| Service settings | SLACK_TEAM (required), COMMUNITY_NAME, COMMUNITY_HEADLINE, COMMUNITY_DESCRIPTION, COMMUNITY_WEBSITE_URL, COMMUNITY_LOGO_URL, COMMUNITY_SUPPORT_URL, COMMUNITY_PRIVACY_URL, SOCIAL_IMAGE_URL, RATE_LIMIT_IP_MAX, RATE_LIMIT_IP_WINDOW_SECONDS, RATE_LIMIT_EMAIL_MAX, RATE_LIMIT_EMAIL_WINDOW_SECONDS |
| Slack integration (required) | SLACK_TOKEN |
| Cloudflare Turnstile integration (optional) | TURNSTILE_SITE_KEY, TURNSTILE_SECRET_KEY |
Change the page's texts, links and limits through the service's settings, and the token and keys through the attached integrations. Do not put them in the repository or in a .env file.
What the application requires
- It refuses to start without
SLACK_TEAMandSLACK_TOKEN, and withoutPUBLIC_URLunlessNODE_ENVisdevelopmentortest. SLACK_TEAMis the workspace subdomain only, not a URL.PUBLIC_URLmust be an origin only: scheme and host, no path.- Turnstile verification is on when both Turnstile variables are present. Only one of them makes the application refuse to start.
COMMUNITY_LOGO_URLandSOCIAL_IMAGE_URLaccept an HTTPS URL or a root-relative path.- A failed start reports the offending variable by name in the container's log.
Running
- The application listens on
NODE_PORT, which the Node.js service sets to 3000. It has no dependencies to install. /healthzand/.healthzanswer the health check.- The rate limiter keeps its counters in the memory of one process. They are not shared between replicas and are reset by a restart.
- The service uses none of the database, mail or Redis variables of the Node.js service.
Обзор
Технический профиль Slack Inviter
Версии
Основан на
Репозиторий исходного кода
Публичный Helm-чарт
Стеки
Стеки, в которые входит Slack Inviter
CI/CD
Сборка Slack Inviter из Git-репозитория
Slack Inviter
Используйте его как есть или клонируйте в свой Git-аккаунт.
wodby/slack-inviterCI-провайдеры
StackMaster CI встроен в платформу: пайплайн описывается в файле .wodby/pipeline.yml в репозитории. Для подключённого репозитория те же шаги может выполнять внешний CI-провайдер с помощью StackMaster CLI.
Реестры контейнеров
Собранные образы по умолчанию попадают в StackMaster Registry или во внешний реестр, подключённый как интеграция.
Переменные окружения из интеграций
Интеграция с переменными один раз сохраняет учётные данные стороннего сервиса. Подключите её к Slack Inviter, и StackMaster передаст их в контейнер как переменные окружения во время работы, а не при сборке образа.
Конфигурация
Конфигурация сервиса Slack Inviter
Технические домены
Настройки
Связи сервиса
Каждая связь — это подключение Slack Inviter к другому сервису. На какой сервис указывает связь, задаёт стек. На карточках перечислены публичные сервисы, которые подходят для каждой связи.
db
Сервисы, которые подходят для этой связи
sendmail
Сервисы, которые подходят для этой связи
redis
Сервисы, которые подходят для этой связи
otel
Сервисы, которые подходят для этой связи