<?xml version="1.0"?>
<config>

  <!-- bootstrap config for OpenSRF apps -->
  <opensrf>

    <routers>

      <!-- define the list of routers our services will register with -->

      <router>

        <!-- This is the public router.  On this router, we only register applications
             which should be accessible to everyone on the opensrf network -->
        <name>router</name>
        <domain>public.localhost</domain>
        <services>
            <service>opensrf.math</service>
            <service>opensrf.simple-text</service>
        </services>
      </router>

      <router>
        <!-- This is the private router.  All applications must register with
            this router, so no explicit <services> section is required -->
        <name>router</name>
        <domain>private.localhost</domain>
      </router>
    </routers>


    <!-- Jabber login settings
        Our domain should match that of the private router -->
    <domain>private.localhost</domain>
    <username>opensrf</username>
    <passwd>privosrf</passwd>
    <port>5222</port>
    <!-- name of the router used on our private domain.
        this should match one of the <name> of the private router above -->
    <router_name>router</router_name>

    <!-- log file settings ======================================  -->
    <!-- log to a local file -->
    <logfile>/openils/var/log/osrfsys.log</logfile>

    <!-- Log to syslog. You can use this same layout for
        defining the logging of all services in this file -->
    <!--
    <logfile>syslog</logfile>
    <syslog>local2</syslog>
    <actlog>local1</actlog>
    -->

    <!-- 0 None, 1 Error, 2 Warning, 3 Info, 4 debug, 5 Internal (Nasty) -->
    <loglevel>3</loglevel>

    <!-- config file for the services -->
    <settings_config>/openils/conf/opensrf.xml</settings_config>

  </opensrf>

  <!-- The section between <gateway>...</gateway> is a standard OpenSRF C stack config file -->
  <gateway>

    <!--
    we consider ourselves to be the "originating" client for requests,
    which means we define the log XID string for log traces
    -->
    <client>true</client>

    <!--  the routers's name on the network -->
    <router_name>router</router_name>

    <!-- jabber login info -->
    <!-- The gateway connects to the public domain -->
    <domain>public.localhost</domain>
    <username>opensrf</username>
    <passwd>pubosrf</passwd>
    <port>5222</port>
    <logfile>/openils/var/log/gateway.log</logfile>
    <loglevel>3</loglevel>

  </gateway>

  <!-- ======================================================================================== -->

    <routers>
        <router> <!-- public router -->
            <trusted_domains>
                <!-- allow private services to register with this router
                     and public clients to send requests to this router. -->
                <server>private.localhost</server>
                <!-- also allow private clients to send to the router so it can receive error messages -->
                <client>private.localhost</client>
                <client>public.localhost</client>
            </trusted_domains>
            <transport>
                <server>public.localhost</server>
                <port>5222</port>
                <unixpath>/openils/var/sock/unix_sock</unixpath>
                <username>router</username>
                <password>pubrout</password>
                <resource>router</resource>
                <connect_timeout>10</connect_timeout>
                <max_reconnect_attempts>5</max_reconnect_attempts>
            </transport>
            <logfile>/openils/var/log/router.log</logfile>
            <!--
            <logfile>syslog</logfile>
            <syslog>local2</syslog>
            -->
            <loglevel>3</loglevel>
        </router>
        <router> <!-- private router -->
            <trusted_domains>
                <server>private.localhost</server>
                <!-- only clients on the private domain can send requests to this router -->
                <client>private.localhost</client>
            </trusted_domains>
            <transport>
                <server>private.localhost</server>
                <port>5222</port>
                <username>router</username>
                <password>privrout</password>
                <resource>router</resource>
                <connect_timeout>10</connect_timeout>
                <max_reconnect_attempts>5</max_reconnect_attempts>
            </transport>
            <logfile>/openils/var/log/router.log</logfile>
            <!--
            <logfile>syslog</logfile>
            <syslog>local2</syslog>
            -->
            <loglevel>3</loglevel>
        </router>
    </routers>

  <!-- ======================================================================================== -->

</config>
