Sign inSign up

frozenmountain/liveswitch-gateway

By frozenmountain

•Updated about 2 months ago

LiveSwitch Gateway releases.

Image
3

100K+

frozenmountain/liveswitch-gateway repository overview

The LiveSwitch Gateway authorizes access to LiveSwitch and provides the central message brokering service on which other LiveSwitch services rely.

⁠Quick Start

Do the following:

  1. Create a network for your server cluster:
    sudo docker network create liveswitch
  1. Set up a Redis⁠ server. LiveSwitch uses Redis as its default storage engine. Starting a Redis docker⁠ image is a simple way to get started. Do the following:
    sudo docker run -d \
        --network liveswitch \
        --publish 6379:6379 \
        --restart always \
        --name redis \
        redis
  1. Start and configure Postgres:
    sudo docker run -d \
        --env POSTGRES_PASSWORD='password' \
        --network liveswitch \
        --publish 5432:5432 \
        --restart always \
        --name postgres \
        postgres
  1. If you plan on installing the Recording Management, Recording Muxer, and Recording Mover services, then start RabbitMQ and configure Recording Postgres:
    sudo docker run -d \
        --network liveswitch \
        --publish 5672:5672 \
        --publish 15672:15672 \
        --restart always \
        --name rabbitmq \
        rabbitmq:3-management

    sudo docker exec -it postgres \
        psql "postgresql://postgres:password@localhost" -c "CREATE DATABASE recording;"

    sudo docker exec -it postgres \
        psql "postgresql://postgres:password@localhost" -c "GRANT ALL PRIVILEGES ON DATABASE recording TO postgres;"
  1. Start your LiveSwitch Gateway docker image.
    • If you are you are not installing Recording Management, do the following:
        sudo docker run -d \
            --env CONNECTIONSTRINGS:DEFAULT='postgres://postgres:password@postgres:5432/postgres' \
            --env CONNECTIONSTRINGS:CACHE='redis://redis' \
            --network liveswitch \
            --publish 8080:8080 \
            --publish 9090:9090 \
            --publish 8443:8443 \
            --publish 9443:9443 \
            --restart always \
            --name liveswitch-gateway \
            frozenmountain/liveswitch-gateway
    
    • If you are installing Recording Management, do the following:
        sudo docker run -d \
            --env CONNECTIONSTRINGS:DEFAULT='postgres://postgres:password@postgres:5432/postgres' \
            --env CONNECTIONSTRINGS:CACHE='redis://redis' \
            --env Deployments:0:DeploymentId='Default' \
            --env Deployments:0:RecordingManagement:Enabled='true' \
            --env Deployments:0:RecordingManagement:AmqpUri='amqp://guest:guest@rabbitmq:5672' \
            --env Deployments:0:RecordingManagement:PostgresUri='postgres://postgres:password@postgres:5432/recording' \
            --network liveswitch \
            --publish 8080:8080 \
            --publish 9090:9090 \
            --publish 8443:8443 \
            --publish 9443:9443 \
            --restart always \
            --name liveswitch-gateway \
            frozenmountain/liveswitch-gateway
    

See below for more information about the CONNECTIONSTRINGS:DEFAULT and CONNECTIONSTRINGS:CACHE environment variables.

⁠Network

/sync on TCP port 8080 handles HTTP and WebSocket signalling traffic from client applications, LiveSwitch Media Servers, and LiveSwitch SIP Connectors. TCP port 8443 is optionally available for TLS termination (HTTPS) if a certificate is provided.

/admin on TCP port 9090 handles HTTP administration traffic from the console and REST API. TCP port 9443 is optionally available for TLS termination if a certificate is provided.

⁠Configuration

The LiveSwitch Gateway has two levels of configuration.

  • Instance Specific Configuration for settings specific to an individual Gateway is done via environment variables or a JSON configuration file.
  • Cluster Configuration for comprehensive configuration of a LiveSwitch cluster including Deployments, Applications, Channels, and API Keys. You can provide advanced configuration via the administration console, REST API, or using environment variables. This configuration is stored centrally in Redis and servers in your cluster pull from configuration entities as needed.

⁠Instance Specific Configuration

Environment variables are recommended for instance configuration. Note that this configuration is specific to the particular Gateway in the container.

If using a JSON file, it must be located at /app/FM.LiveSwitch.Gateway.Service.config.json, e.g.:

docker cp FM.LiveSwitch.Gateway.Service.config.json liveswitch-gateway:/app/FM.LiveSwitch.Gateway.Service.config.json

Example JSON file:

{
  "ConnectionStrings": {
    "Default": "postgres://postgres:password@postgres:5432/postgres",
    "Cache": "redis://redis"
  },
  "TrustedServerCertificateSha1Fingerprints": [],
  "Admin": {
    "IPAddresses": []
  },
  "Sync": {
    "IPAddresses": []
  }
}

Environment variable names map to the JSON property names using .NET Core conventions⁠.

⁠CONNECTIONSTRINGS:DEFAULT

A postgres connection URI that matches the documentation here⁠. If not provided, the server will fail to startup.

⁠CONNECTIONSTRINGS:CACHE

A redis connection string compatible with ServiceStack.Redis⁠. If not specified, it will default to 127.0.0.1.

⁠TRUSTEDSERVERCERTIFICATESHA1FINGERPRINTS

A list of SHA-1 fingerprints (hexadecimal, no colons, case insensitive) from trusted certificates used by the redis data access layer, i.e. when redis traffic is encrypted and the redis server is using a self-signed TLS certificate.

⁠ADMIN:IPADDRESSES

The IP address(es) or CIDR range(s) for the administration (default port 9090) service binding. If not specified, all network interfaces will be used.

⁠SYNC:IPADDRESSES

The IP address(es) or CIDR range(s) for the signalling (default port 8080) service binding. If not specified, all network interfaces will be used.

⁠Cluster Configuration

To learn how to configure your cluster, see Cluster Configuration⁠.

⁠Application Configuration

To learn how to configure your application, see Application Configuration⁠.

Tag summary

Content type

Image

Digest

sha256:b46d372f3…

Size

133.9 MB

Last updated

about 2 months ago

docker pull frozenmountain/liveswitch-gateway