Skip to content

Configuration Files

Pranav Prakash edited this page Aug 8, 2016 · 3 revisions

Octo-matic uses configuration files in YAML format. These files contain information about server IP addresses, ports, additional services, web properties accounts and pretty much everything you ever need to tame the beast. This is also a manual step wherein you must manually perform updates, changes and reviews to the details of the file. Hence, an understanding of the various options and details is necessary.

Environment Variables

In addition to the data in config files, octo-matic also uses environment variables for sensitive information. These could be your AWS, Mandrill or any other API key authentications or other details you would not want to be present in the config files. Not all config have environment variables. The ones which have are explicitly specified in the following document.

Config structure

config.yml

This is a simple yml file containing details about servers and other stuff. The comprehensive list goes below

cassandra

cassandra:
  host: cassandra
  port: 9042
  keyspace: octo_development
  max_retries: 3
  retry_delay: 1
  replication:
    class: SimpleStrategy
    replication_factor: 1

redis

redis:
  host: redis
  port: 6379

statsd

statsd:
  host: 127.0.0.1
  port: 8125

kafka

kafka:
  brokers:
    - 127.0.0.1:9092
  client_id: octomatic_development
  topic: events
  max_buffer_size: 20_000
  max_queue_size: 10_000
  delivery_interval: 1

logfile

logile: '/tmp/octo.log'

allowed events

allowed_events:
  - app.init
  - app.login
  - app.logout
  - page.view
  - productpage.view
  - update.push_token
  - update.profile
  - product.add
  - product.update
  - product.delete
  - funnel_update

kong

kong:
  url: 'http://127.0.0.1:8001'

APNS (Apple Push Notification Service)

apns:
  host: 'gateway.sandbox.push.apple.com'

aws

NOTE: Use environment variables to store confidential information like AWS keys.

aws:
  region: 'ap-southeast-1'
  secret_key: 'AWS_SECRET_KEY'
  access_key: 'AWS_ACCESS_KEY'
  bucket_name: 'octo-enterprise'

ISO Certificate

ioscertificate:
  filename: 'ioscertificate.pem'

search (Elasticsearch)

search:
  server: http://127.0.0.1:9200
  disk_threshold_low: 0.94
  disk_threshold_high: 0.98

mandrill api key

NOTE: Use environment variables to store sensitive information like mandrill api key

mandrill_api_key: 'xxxxxxxxxxx-generated-api-key-xxxxxxxxxxx'

Email Sender

email_sender:
  name: 'Octomatic'
  email: '[email protected]'

Email to

email_to:
  - name: 'Jon Doe'
    email: '[email protected]'

session length

session_length: 5

Push Notification Default Templates

push_templates:
  - name: trending
    text: "%{product_name} is trending right now. It's available for only INR %{product_price}. Check it out now."
  - name: recommended
    text: "We think you would love %{product1_name}, %{product2_name} and %{product3_name}. Check them out."
  - name: curated
    text: "We've handpicked %{product1_name} and %{product2_name} for you. You'd be really pleased."
  - name: similar
    text: "Are you looking for %{product1_name}, %{product2_name} and %{product3_name}? They're available at great offers. Check it out now."
  - name: custom1
    text: "You should customize this message before sending."
  - name: custom2

Intelligent Segments

NOTE: This is experimental and may evolve over time.

intelligent_segments:
  - name: Highly Engaged Users
    type: Octo::Segmentation::SegmentType::USER
    dimensions:
      - Octo::Segmentation::Dimensions::ENGAGEMENT
    operators:
      - Octo::Segmentation::Operators::EQUAL
    values:
      - Octo::UserPersona::HIGH_ENGAGED
  - name: Moderately Engaged Users
    type: Octo::Segmentation::SegmentType::USER
    dimensions:
      - Octo::Segmentation::Dimensions::ENGAGEMENT
    operators:
      - Octo::Segmentation::Operators::EQUAL
    values:
      - Octo::UserPersona::MEDIUM_ENGAGED
  - name: Low Engaged Users
    type: Octo::Segmentation::SegmentType::USER
    dimensions:
      - Octo::Segmentation::Dimensions::ENGAGEMENT
    operators:
      - Octo::Segmentation::Operators::EQUAL
    values:
      - Octo::UserPersona::LOW_ENGAGED
  - name: Slipping Out Users
    type: Octo::Segmentation::SegmentType::USER
    dimensions:
      - Octo::Segmentation::Dimensions::ENGAGEMENT
    operators:
      - Octo::Segmentation::Operators::EQUAL
    values:
      - Octo::UserPersona::DEAD

kong_config.yml

Kong specific configurations

Client/WebProperty Details

:clients:
  - :name: Jaobng
    :email: [email protected]
    :password: yothisisnotapassword
    :admin: false
    :rate-limiting:
      :day: 100000
      :minute: 100
      :second: 100
      :hour: 10000
      :month: 100000
      :year: 1000000000
  - :name: Octo
    :email: [email protected]
    :password: randompasswordhere
    :admin: true

APIs

:apis:
  - :name:  events
    :request_path: /events
    :upstream_url: http://192.168.99.100:9001/events
  - :name:  UpdatePushToken
    :request_path: /update_push_token
    :upstream_url: http://192.168.99.100:9001/update_push_token

Plugins

:plugins:
  :key-auth:
    :apis:
      - :events
      - :UpdatePushToken
    :clients: all
    :config:
      :key_names: apikey
  :cors:
    :apis:
      - :events
      - :UpdatePushToken
    :clients: all
    :config:
      :methods: 'GET,POST'
      :origin: '*'
  :rate-limiting:
    :apis:
      - :events
    :clients:
      - Jaobng

Kong

:kong: 127.0.0.1:8001

app specific config