<?xml version="1.0" encoding="ISO-8859-1" ?>
<adagio>

   <!-- Normal profile. See in conf_samples for a simpler example and for
         the full options available. -->

   <!-- General considerations 
         All time values can be specified with their unit following.
         Allowed units are: d, h, m, s, ms. 
         Omiting the units will be interpreted as seconds. 
         Don't leave spaces between the quantities and their units.

         Sizes use b for bit, B for byte,
         k for 1024 bytes, m for 1024*1024 bytes, g for 1024*1024*1024 bytes.
         k, m and g are case insensitive.
         Quantities in bits are rounded towards bytes.

         Speeds are a size plus "/s", which is the only unit allowed.
         A special speed is "unlimited".

         Times can contain decimal part (dot is separator).

         Sizes/speeds can't have decimal part.

         Paths should be specified with forward slashes "/" in 
         both windows and unix.
         
         All elements/attributes names are case sensitive! 
   -->

   <!-- GLOBALS 
        This section contains global application parameters -->
   <globals>
      <!-- Data directory for all persistent information across runs -->
      <DataFolder path="data" />
   </globals>

   <!-- GUI 
         Adagio hasn't a GUI. Instead, it provides a SOAP interface to
         acquire/provide data. That interface could allow the building
         of a stand-alone GUI application. -->
   <gui>
      <!-- We can specify if the SOAP interface is running -->
      <active>yes</active>
      <!-- In which interface we must listen. 0.0.0.0 means any and
            127.0.0.1 localhost. Please set an username and password if you're
            listening outside 127.0.0.1 -->
      <address>127.0.0.1</address>
      <!-- Port for the Web/SOAP interfaces -->
      <port>24444</port>

      <!-- This user/password combination would allow access from remote
            computers -->
      <user>name</user>
      <pass>word</pass>
   </gui>

   <!-- LIBRARY. -->
   <library>
      <!-- Allow browsing of our shared files -->
      <AllowBrowse>yes</AllowBrowse>

      <!-- Max cpu usage while hashing/adding folders -->
      <HashingCPUusage units="%">85</HashingCPUusage>

      <!-- Hashing speed.
            fast   : files will be hashed at top speed, without throttling,
               but also they can't be moved or renamed while are being read.
            normal : files will be hashed at good speed, but without pre-
               venting renaming/moving/editing (that will trigger rehash of
               the affected files).
            slow   : cpu throttling is on and hashing will be slower. -->
      <HashSpeed>slow</HashSpeed>

      <!-- Shared folders. This element can be specified as many times as
            folders we want to share. All subfolders of a given shared folder
            will also be shared. 
            Folders will be re-scanned for changes as specified. Rescan
            periods can be not less than 5m. All folders are re-scanned on
            startup regardeless of this period. -->
      <shared path="c:/movies"  RescanPeriod="24h" />
      <shared path="c:/music"   RescanPeriod="6h" />
      <!-- Unshared folders can be used to disallow sharing of specific 
            subfolders. This facilitates specifying entire branchs for sharing
            and removing only selected, unshared folders under them. -->
      <unshared path="c:/music/own/unfinished" />
   </library>

   <!-- USER PROFILE.
         The user profile is specified via the conformant schema of Shareaza.
         The following subtree must be that XML profile. -->
   <gProfile xmlns="http://www.shareaza.com/schemas/GProfile.xsd">
      <gnutella/> <!-- This element is necessary. Don't remove it -->
      <identity>
         <!-- Replace Anonymous with your nickname here -->
         <handle primary="Anonymous"/>
      </identity>
   </gProfile>

   <!-- UPLOAD SUBSYSTEM -->
   <uploads>
      <!-- Maximum simultaneous uploads allowed per client -->
      <!-- Uploads will be queued in every matching queue that many times.
            There is no problem if a request matches two queues' criteria. 
            RATIONALE: since you can't know in which queue you'll arrive to
            head sooner, Adagio takes the safest approach: clients wait in
            every queue as many times as total uploads they are allowed. That
            means that if there are 3 queues and 2 uploads per client, one can
            be queued in 6 slots. However, each time a client reaches a head,
            their active uploads are checked. If a client is uploading the 
            maximum allowed, their queued slots will be dropped. That ensures
            respecting the maximum uploads per client and at the same time 
            prevents that clients don't get a file which belongs to a queue 
            because they're queued in another, slower, one. 
            Similarly, when a request reaches a head, it is removed from any
            other queue. -->
      <MaxPerClient>2</MaxPerClient>
      <!-- Maximum allowed bandwidth for all uploads. -->
      <bandwidth>16kB/s</bandwidth>
      <!-- Clients are remembered by Adagio between runs or drops. The next
            parameter indicates for how many time a client can come back and
            continue at his former queue position. 
            If you make this period longer, your queues will get filled
            more quickly. Never missing clients will defer ready ones.
            -->
      <RememberClientPeriod>1h</RememberClientPeriod>

      <!-- Queues. We can have as many of these as we want. -->
      <!-- The queue name must be unique. It's employed for queue data saving,
            so it must be a valid OS filename. -->
      <!-- The queue name also prioritizes a queue over another, if
            several are free when a new client arrives and it's valid for
            more than one. You may want to name them with some numbering 
            or alphabetical order. -->
      <queue name="example queue">
         <!-- Inactive queues will not be used on next run. -->
         <active>no</active>
         <!-- Maximum length of the queue. It's convenient to make these
               as long as possible given your resources. -->
         <length>256</length>
         <!-- Priority. It acts as a ratio. All queues' priorities will be
               added up. This priority divided by the total gives the upload
               bandwidth ratio guaranteed for this queue. Note that wasted 
               bandwidth in empty queues or slower clients will be reallocated
               proportionally to other queues if bandwidth sharing is enabled.
               Total doesn't need to sum 100. -->
         <priority>30</priority>
         <!-- Number of slots with actively uploading clients -->
         <ActiveClients>2</ActiveClients>
         <!-- Minimum average bandwidth a client must consume to not be
               dropped. It is calculated over the period specified later.
               Take care to not set contradictory values given the queue
               priority, active clients and total upload capacity. -->
         <MinimumClientSpeed>1kB/s</MinimumClientSpeed>
         <!-- Period used to average the client speed. Don't be too res-
               trictive here or short periods of starvation can cause the
               drop of valid connections -->
         <AveragePeriod>30s</AveragePeriod>
         <!-- Entry criteria for the queue.
               Existing ones:
                  Greater_than            Size greater OR EQUAL than 
                  Smaller_than            Size smaller than 
                  Is_in                   File is in a certain folder branch.
                           Paths must be specified between '|'
                           Must be absolute paths.
                           Any path starting like this will match (subfolders)
                           I.e: "Is_in |c:/shared files/release/|"
                  Extension_is            Extension comparison (with dot)
                           I.e: "Extension_is .mp3"
                  Additionally we have: 'and' 'or' 'true' 'false'
                     evaluated always left to righ

                  Examples:
                  Smaller_than 1024kB or Is_in c:/test or Extension_is .mp3
                  Greater_than 1024kB and Smaller_than 10240kB -->
         <criteria is="true"/> <!-- Queue for everybody -->
         <!-- Rotating queues. You can enable here preemption after some
               time of upload or bytes transferred. At least one of these
               two conditions must be provided if enabled. Both can be 
               supplied and the first to occur will cause the preemption.  -->
         <preemption active="yes" time="15m" size="10mB"/>
         <!-- Queues can be "fifo" or "rated". In rating-based queues, 
               each client rating is computed when another client is done.
               The higher the rating, the near to head of the queue.
               For two clients with same rating, FIFO policy is applied.
               The expression doesn't apply for fifo queues but it's in
               this example for documentation purposes.
               Rating expressions can use the following operators:
                  sin, cos, tan, log, ln, exp, cot, sqrt, !, 
                  trigonometric hyperbolic (same with trailing h), 
                  trigonometric inverse (same with leading arc)
                  + - * / ^ ( ) with usual precedence. They act on numerals
               and the following predefined variables:
                  Uploads   : number of started uploads of the requested file.
                  Bytes_sent: number of bytes sent to some uploader. 
                  File_size : size in bytes of the requested file.
                  Waited    : seconds elapsed since arrival (starts at 1.0) 
               These variables are of course persistent across sessions. -->
         <type expression="waited">rated</type> <!-- FIFO emulation -->
      </queue>

      <!-- MORE EXAMPLE QUEUES ARE IN THE FULL CONFIGURATION EXAMPLE -->

      <!-- DEFAULT QUEUES -->
      <!-- These are the default queues supplied with this installation.
            You can change the queuing system at will. -->

      <queue name="smaller first">
         <active>yes</active>
         <length>512</length>
         <priority>10</priority>
         <ActiveClients>1</ActiveClients>
         <MinimumClientSpeed>1kB/s</MinimumClientSpeed>
         <AveragePeriod>30s</AveragePeriod>
         <criteria is="true"/>
         <preemption active="yes" time="10m" size="10mB"/>
         <type expression="-File_size">rated</type>
      </queue>

      <queue name="rare first">
         <active>yes</active>
         <length>512</length>
         <priority>10</priority>
         <ActiveClients>1</ActiveClients>
         <MinimumClientSpeed>1kB/s</MinimumClientSpeed>
         <AveragePeriod>30s</AveragePeriod>
         <criteria is="true"/>
         <preemption active="yes" time="10m" size="10mB"/>
         <type expression="-Uploads">rated</type>
      </queue>

      <queue name="small files">
         <active>yes</active>
         <length>512</length>
         <priority>10</priority>
         <ActiveClients>1</ActiveClients>
         <MinimumClientSpeed>1kB/s</MinimumClientSpeed>
         <AveragePeriod>30s</AveragePeriod>
         <criteria is="Smaller_than 1mB"/>
         <preemption active="no" />
         <type expression="-Bytes_sent">rated</type>
      </queue>

      <queue name="fifo">
         <active>yes</active>
         <length>512</length>
         <priority>10</priority>
         <ActiveClients>1</ActiveClients>
         <MinimumClientSpeed>1kB/s</MinimumClientSpeed>
         <AveragePeriod>30s</AveragePeriod>
         <criteria is="true"/>
         <preemption active="yes" time="10m" size="10mB"/>
         <type>fifo</type>
      </queue>
      <!-- End of default queues -->
   </uploads>

   <!-- NETWORKS.
         At current only G2 is supported, and GWebCache2 for discovery.
         There are global setting and network specific settings.  

         proxy: If you use a proxy for HTTP, specify it here. The format is  
            [user[:pass]@]host:port 
         InternetRoute: direct/NAT/none. 
            Use direct if you have a public IP.
            Use NAT if you are behing a transparent NAT router. 
            Use none if you're stuck in a LAN without direct external access.
         ValidAddresses: public/private/all
            Use public to discard private addresses.
            Use private if you want a LAN network.
            Use all if you are in a mixed environment.
            Note that for local testing you must allow private addresses.
      -->
   <network
      proxy=""
      InternetRoute="direct"
      ValidAddresses="public">

      <!-- Gnutella2 -->
      <Gnutella2>
         <!-- Listening TCP/UDP port. -->
         <port>24610</port>

         <!-- Servers to remember in our cache -->
         <CachedServers>1000</CachedServers>

         <!-- Number of servers we want to be simultaneously connected -->
         <ActiveServers>2</ActiveServers>

         <!-- Number of servers we want to try until full connectivity -->
         <TryServers>30</TryServers>

         <!-- Maximum bandwidth usage in server links. -->
         <LinkBandwidth>4kB/s</LinkBandwidth>

         <!-- Attempt compressed connections to servers? -->
         <CompressedLink>yes</CompressedLink>

         <!-- Root servers. Use a rating of 0 to not use them.
               Higher ratings mean higher preference to use them.
               These servers are never dropped so you can specify here
               static IP servers you know and prefer.
               For comparison, new servers are rated like that:
               * From GWebCache2: 300
               * From /KHL/NH:    250
               * From /KHL/CH:    200 -->
         <root address="127.0.0.1:36765" rating="0"/>
      </Gnutella2>

      <!-- GWCache2 -->
      <GWebCache2>
         <!-- Some root (non discardable) GWCaches -->
         <root url="http://www.gwc2.ip3.com/cgi-bin/gwc2/gcache.cgi"/>
         <root url="http://gwc.isuldor.com/g2only/cache.asp"/>
         <root url="http://gwebcache2.jonatkins.com/cgi-bin/gwebcache.cgi"/>
         <root url="http://g2cache.theg2.net/gwcache/lynnx.asp"/>
         <root url="http://cache.shareaza.com/cache.aspx"/>
         <root url="http://g2.instantnetworks.net/g2/bazooka.php"/>
         <root url="http://bazooka1.servehttp.com/g2/bazooka.php"/>
      </GWebCache2>
   </network>

   <!-- SECURITY
         Host banning. That's made through additional xml files conforming
         to Shareaza schema for security rules. 
         There is no limit in the number of files you can specify here.  -->
   <security>
      <!-- Default banning policy. If you set it to "no", no connections
            will be allowed except to selected countries (see below). -->
      <policy allow="yes"/>

      <!-- File with security rules. They can be disabled if desired.
            Only "address" type rules will be processed. -->
      <file path="./security 2.5.xml" active="yes" />
      <file path="./security 2.6.xml" active="yes" />
      <file path="./security 2.7.xml" active="yes" />
      <file path="./security 2.7.5.xml" active="yes" />
      <file path="./security pg 1.0.xml" active="yes" />

      <!-- Specific User-Agent bannings are specified here (multiple allowed).
            Two kind of banning strings are allowed (both case-insensitive):
               * substring: any user agent containing this substring
                  will be banned
               * regexp: file-like regular expressions.
                  Must match the whole user agent
                     -->
      <ban client="bearshare" type="substring" active="no" />
      <ban client="bear*4.2.3*" type="regexp" active="no" />

      <!-- Country bannings. You can ban countries or allow them against the
            general policy. Note that the country detection can't be 100%
            accurate, use it at your own risk! 
           Use the code "??" to refer to unknown locations. 
           Private addresses will not be checked.  -->
      <country code="es" allow="yes"/>
      <!-- Example of hypotetical banned country: -->
      <country code="zz" allow="no"/>
   </security>

   <!-- CHAT -->
   <chat logfile="log/chat.log" log="yes">
      <!-- Enable or disable it here -->
      <!-- Currently only chat for G2 is implemented -->
      <enabled>yes</enabled>
      <!-- Answering machine. You can select one of these:
            Away   : the standard away message below will be sent.
            Eliza  : a classic Eliza bot will chat with the requester.
            Random : one of the previous will be chosen randomly. -->
      <answer>Away</answer>
      <AwayMessage>Hello. This is an away bot, nobody here. My master is using Adagio server, you can check it at http://agio.sourceforge.net</AwayMessage>
   </chat>

   <!-- DEBUG.
         active: enabled or not
         logfile: file to keep the log. Unbounded size.
         netlogfile: file to keep network related log.
         loglevel: Level of tracing: debug, informative, warning, error.
            Below warning level, messages are not relevant to the developer.
         ConsoleEcho: echoes traces in console. 
            NOTE: You need a console-based platform (i.e. linux). In windows
               that will cause undefined (probably faultly) behavior.
         DebugStatistics: shows statistics about internal status.
         PurgeOnStartup: logfiles will be deleted in each run.
         MemoryPeriod: lap between memory usage counting
         CrawlerAllowed: Adagio will answer to crawler requests (this reveals
            your IP but not your Gnutella GUID).
   -->
   <debug 
      active="yes"
      logfile="log/adagio.log" 
      netlogfile="log/adagio.log"
      loglevel="informative"
      ConsoleEcho="no"
      DebugStatistics="no"
      PurgeOnStartup="yes"
      heartbeat="1s"
      MemoryPeriod="1m"
      CrawlerAllowed="yes"
   />
</adagio>