Skip to content

estvita/separator

Repository files navigation

Русский

Separator.biz: Bitrix24 Integration Hub

Description

One separator installation allows you to create and manage an unlimited number of local and mass-distributed Bitrix24 applications with OAuth 2.0 authorization.

Video Instructions on YouTube

https://www.youtube.com/playlist?list=PLeniNJl73vVmmsG1XzTlimbZJf969LIpS

Installation

Docker (Recommended)

  1. Clone the repository:

    git clone https://github.com/estvita/separator
    cd separator
  2. Configure environment:

    cp docs/example/env.example .env
    make generate-keys
    nano .env

    make generate-keys will automatically generate secure values for DJANGO_SECRET_KEY, SALT_KEY, and DJANGO_ADMIN_URL. Ensure ASTERX_SERVER=True is set if you need the AsterX service.

  3. Start with Docker Compose:

    docker compose up -d --build
  4. Create a superuser:

    docker compose run --rm web python manage.py createsuperuser

Migration Guide from Systemd to Docker

Data Encryption

Sensitive data (tokens, secrets, passwords) in the database is encrypted using SALT_KEY. If you are migrating an existing installation to use encryption, please follow the Encryption Migration Guide.

Manual Installation

git clone https://github.com/estvita/separator
cd separator


python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements/production.txt

cp docs/example/env.example .env
nano .env 

# Set SALT_KEY for encryption
# replace DJANGO_ALLOWED_HOSTS, CSRF_TRUSTED_ORIGINS with your values 
# Replace the value of DATABASE_URL with your own (the psql database must be created beforehand)

python manage.py migrate 
python manage.py collectstatic 
python manage.py createsuperuser

python manage.py runserver 0.0.0.0:8000 (for testing and debugging)


sudo cp docs/example/celery_worker.service /etc/systemd/system/celery_worker.service
sudo cp docs/example/celery_beat.service /etc/systemd/system/celery_beat.service

sudo systemctl daemon-reload
sudo systemctl enable celery_worker.service
sudo systemctl enable celery_beat.service
sudo systemctl start celery_worker.service
sudo systemctl start celery_beat.service

The default path to access the admin panel is /admin. To set your own path, change the DJANGO_ADMIN_URL variable in the .env file.

Celery Configuration (Docker only)

When running in Docker, you can configure the concurrency (number of worker processes) for each Celery queue using environment variables in your .env file. This is useful for optimizing resource usage based on your server's capabilities.

Default value is 3 for all queues.

To disable a specific worker, set its concurrency to 0.

Available variables:

  • CELERY_BITRIX_CONCURRENCY: Concurrency for Bitrix24 tasks.
  • CELERY_OLX_CONCURRENCY: Concurrency for OLX tasks.
  • CELERY_WAWEB_CONCURRENCY: Concurrency for WhatsApp Web tasks.
  • CELERY_WABA_CONCURRENCY: Concurrency for WhatsApp Business API tasks.
  • CELERY_BITBOT_CONCURRENCY: Concurrency for BitBot tasks.
  • CELERY_DEFAULT_CONCURRENCY: Concurrency for default tasks.

Example .env configuration:

CELERY_BITRIX_CONCURRENCY=5
CELERY_WAWEB_CONCURRENCY=2

Database

The DJ-Database-URL module allows connecting various databases. See the documentation via the link.

Update

cd separator
git pull
source .venv/bin/activate
python manage.py migrate
deactivate
sudo systemctl restart separator

Proxy Server

  • You can view the process of setting up Nginx and Gunicorn here
  • Example configuration files are available in the documentation

Integrations

User Service Pages

  • /portals/ - Bitrix24
  • /asterx/ - IP PBX Asterisk
  • /olx/accounts/ - OLX
  • /waba/ - waba
  • /waweb/ - whatsapp web
  • /bitbot/ - chat-bot connector