Difference between revisions of "Configuration Options"

From Telstar Wiki
Jump to navigation Jump to search
(Created page with "# Using Docker Compose __*** Please note TELSTAR as an application is still under development and subject to change. ***__ The following docker-compose yaml file can be used to manage the TELSTAR application and associated *mongo* database. version: "3.8" services: telstar-01: container_name: "telstar-server" image: "johnnewcombe/telstar" command: "server --port 6512 --install" # install to the primary database ports:...")
 
Line 1: Line 1:
# Using Docker Compose
# Configuration Options


__*** Please note TELSTAR as an application is still under development and subject to change. ***__
__*** Please note TELSTAR as an application is still under development and subject to change. ***__


The following docker-compose yaml file can be used to manage the TELSTAR application and associated *mongo* database.
## Container Types


The same Telstar image is used to host different container types, for example a the Telstar image can be used to create videotex server container and an API server container. The first argument passed to the container determines the specific configuration of the container. Currently the container supports the following values;


    version: "3.8"
    services:
      telstar-01:
        container_name: "telstar-server"
        image: "johnnewcombe/telstar"
        command: "server --port 6512 --install" # install to the primary database
        ports:
          - target: 6512
            published: 6512
        networks:
          - telstar-network
        volumes:
          - type: volume
          source: telstar-volume
          target: /opt/telstar/volume
        depends_on:
          - mongodb
        environment:
          - TELSTAR_SERVER=AUSTEN
      mongodb:
        container_name: "telstar-mongo"
        image: "mongo"
        ports:
          - target: 27017
            published: 27017
        networks:
          telstar-network:
        environment:
          - MONGO_INITDB_ROOT_USERNAME=mongoadmin
          - MONGO_INITDB_ROOT_PASSWORD=secret
    networks:
      telstar-network:
        name: telstar-network
    volumes:
      telstar-volume:
        name: telstar-volume


The following docker-compose file starts three TELSTAR servers all talking to the same database server, however the third TELSTAR server (telstar-server-03) uses the *secondary* database. This *secondary* database collection is typically used to test content before publishing it to the primary database collection. In addition the TELSTAR API is launced as a separate container.
    server         Creates the standard videotex server container
    api            Creates an API server allowing the videotex system to be managed using a restful API.


    version: "3.8"
For example the following Docker run command starts a videotex server listening on port 6502 (see TCP Port below) with an initial set of example system pages.
     services:
 
      telstar-01:
     docker run --rm -d --name telstar-server --network telstar-network -p 6512:6512 -v telstar-volume:/opt/telstar/volume johnnewcombe/telstar server --port=6502 --init
        container_name: "telstar-server-01"
   
        build: .
## TCP Port Number
        image: "johnnewcombe/telstar"
 
        command: "server --port 6512 --install" # install to the primary database
The _--port-- argument must be specified for the Telstar _server_ and Telstar _api_ containers. The _port_ parameter specifies the TCP port number that the server or api application should be listening on. This can be any suitable port.
        ports:
 
          - target: 6512
## Optional Arguments
            published: 6512
 
        networks:
The following is a list of optional arguments for both the Telstar _server_ and Telstar _api_ containers.
          - telstar-network
 
        volumes:
    --init                              This will create/recreate the basic telstar content.
          - type: volume
 
          source: telstar-volume
The _--init_ parameter, when starting a videotex server will create/recreate the standard telstar system pages along with some example gateway pages. If this parameter is used when starting an API server, it will create an API user using the userid __"2222222222"__ and password __"1234"__.
          target: /opt/telstar/volume
 
        depends_on:
 
          - mongodb
## Environment Variables
        environment:
 
          - TELSTAR_SERVER=AUSTEN
The full description of each of these can be found in the __telstar.yml__ configuration file.
      telstar-02:
 
        container_name: "telstar-server-02"
    Name                                  | Default
        image: "johnnewcombe/telstar"
    -----------------------------------------------------------------------------------------
        command: "server --port 6513"
    TELSTAR_API_HOST                      | 0.0.0.0
        ports:
    TELSTAR_PAD_HOST                      | 0.0.0.0
          - target: 6513
     TELSTAR_PAD_DLE                        | 0x10
            published: 6513
TELSTAR_SERVER_HOST                    | 0.0.0.0
        networks:
TELSTAR_SERVER_DISPLAY_NAME            | DUKE
          - telstar-network
TELSTAR_HIDE_PAGE_ID                  | FALSE
        volumes:
TELSTAR_HIDE_COST                      | FALSE
          - type: volume
TELSTAR_DISABLE_VERTICAL_ROLLOVER      | TRUE
            source: telstar-volume
TELSTAR_EDITTF_TITLE_ROWS              | 4
            target: /opt/telstar/volume
    TELSTAR_DBCON                          | mongodb://mongoadmin:secret@telstar-mongo:27017
        depends_on:
    TELSTAR_DBCOLLECTION                  | SECONDARY
          - mongodb
    TELSTAR_START_PAGE                    | 99
        environment:
    TELSTAR_LOGIN_PAGE                    | 990
          - TELSTAR_SERVER=ELIOT
    TELSTAR_MAIN_INDEX_PAGE                | 0
      telstar-03:
    TELSTAR_REQUIRES_AUTHENTICATION        | FALSE
        container_name: "telstar-server-03"
    TELSTAR_ROOT_USER_ID                  | 0
        image: "johnnewcombe/telstar"
     TELSTAR_PARITY                        | FALSE
        command: "server --port 6514 --install" # install to the secondary database
    TELSTAR_VOLUME_DIRECTORY              | /opt/telstar/volume/
        ports:
    TELSTAR_DEFAULT_NAV_MESSAGE            | [B][n][Y]Select item or[W]*page# : [_+]
          - target: 6514
    TELSTAR_DEFAULT_PAGE_NOT_FOUND_MESSAGE | [B][n][Y]Page not Found :[W]
            published: 6514
     TELSTAR_DEFAULT_HEADER_TEXT            | [G]T[R]E[C]L[B]S[W]T[M]A[Y]R
        networks:
 
          - telstar-network
The default connection string is: "mongodb://mongoadmin:secret@telstar-mongo:27017" and points to a mongo Docker container on the Docker telstar-network, see [Docker Compose](docker_compose.md). The default settings for many of the settings above are stored in the **telstar.yaml** configuration file which is stored in the **/opt/telstar** directory. It is recommended that Telstar is run in a Docker container in which case the above environment variables should be used to override the standard configuration file.
        volumes:
          - type: volume
            source: telstar-volume
            target: /opt/telstar/volume
        depends_on:
          - mongodb
        environment:
          - TELSTAR_SERVER=HARDY
          - TELSTAR_DBCOLLECTION=SECONDARY
      telstar-api:
        container_name: "telstar-api"
        image: "johnnewcombe/telstar"
        command: "api --port 8001 --init"
        ports:
          - target: 8001
            published: 8001
        networks:
          - telstar-network
        depends_on:
          - mongodb
     environment:
      - TELSTAR_API_USERID=0 # User 0 has access to all pages
      - TELSTAR_API_PASSWORD=telstarapisecret
      - TELSTAR_COOKIE_SECRET=<place yout secret here> # define this for yourself and keep it secret!
      mongodb:
        container_name: "telstar-mongo"
        image: "mongo"
        ports:
          - target: 27017
            published: 27017
        networks:
          telstar-network:
        environment:
          - MONGO_INITDB_ROOT_USERNAME=mongoadmin
          - MONGO_INITDB_ROOT_PASSWORD=secret
     networks:
      telstar-network:
        name: telstar-network
     volumes:
      telstar-volume:
        name: telstar-volume

Revision as of 12:49, 3 April 2022

  1. Configuration Options

__*** Please note TELSTAR as an application is still under development and subject to change. ***__

    1. Container Types

The same Telstar image is used to host different container types, for example a the Telstar image can be used to create videotex server container and an API server container. The first argument passed to the container determines the specific configuration of the container. Currently the container supports the following values;


   server          Creates the standard videotex server container
   api             Creates an API server allowing the videotex system to be managed using a restful API.

For example the following Docker run command starts a videotex server listening on port 6502 (see TCP Port below) with an initial set of example system pages.

   docker run --rm -d --name telstar-server --network telstar-network -p 6512:6512 -v telstar-volume:/opt/telstar/volume johnnewcombe/telstar server --port=6502 --init
   
    1. TCP Port Number

The _--port-- argument must be specified for the Telstar _server_ and Telstar _api_ containers. The _port_ parameter specifies the TCP port number that the server or api application should be listening on. This can be any suitable port.

    1. Optional Arguments

The following is a list of optional arguments for both the Telstar _server_ and Telstar _api_ containers.

   --init                              This will create/recreate the basic telstar content.

The _--init_ parameter, when starting a videotex server will create/recreate the standard telstar system pages along with some example gateway pages. If this parameter is used when starting an API server, it will create an API user using the userid __"2222222222"__ and password __"1234"__.


    1. Environment Variables

The full description of each of these can be found in the __telstar.yml__ configuration file.

   Name                                   | Default
   -----------------------------------------------------------------------------------------
   TELSTAR_API_HOST                       | 0.0.0.0
   TELSTAR_PAD_HOST                       | 0.0.0.0
   TELSTAR_PAD_DLE                        | 0x10

TELSTAR_SERVER_HOST | 0.0.0.0 TELSTAR_SERVER_DISPLAY_NAME | DUKE TELSTAR_HIDE_PAGE_ID | FALSE TELSTAR_HIDE_COST | FALSE TELSTAR_DISABLE_VERTICAL_ROLLOVER | TRUE TELSTAR_EDITTF_TITLE_ROWS | 4

   TELSTAR_DBCON                          | mongodb://mongoadmin:secret@telstar-mongo:27017
   TELSTAR_DBCOLLECTION                   | SECONDARY
   TELSTAR_START_PAGE                     | 99
   TELSTAR_LOGIN_PAGE                     | 990
   TELSTAR_MAIN_INDEX_PAGE                | 0
   TELSTAR_REQUIRES_AUTHENTICATION        | FALSE
   TELSTAR_ROOT_USER_ID                   | 0
   TELSTAR_PARITY                         | FALSE
   TELSTAR_VOLUME_DIRECTORY               | /opt/telstar/volume/
   TELSTAR_DEFAULT_NAV_MESSAGE            | [B][n][Y]Select item or[W]*page# : [_+]
   TELSTAR_DEFAULT_PAGE_NOT_FOUND_MESSAGE | [B][n][Y]Page not Found :[W]
   TELSTAR_DEFAULT_HEADER_TEXT            | [G]T[R]E[C]L[B]S[W]T[M]A[Y]R

The default connection string is: "mongodb://mongoadmin:secret@telstar-mongo:27017" and points to a mongo Docker container on the Docker telstar-network, see [Docker Compose](docker_compose.md). The default settings for many of the settings above are stored in the **telstar.yaml** configuration file which is stored in the **/opt/telstar** directory. It is recommended that Telstar is run in a Docker container in which case the above environment variables should be used to override the standard configuration file.