%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 et
[
 %% Riak CS configuration
 {riak_cs, [
              %% == Basic Configuration ==

              %% Riak CS http/https port and IP address to listen at
              %% for object storage activity
              {cs_ip, "10.33.32.130"},
              {cs_port, 8084 } ,

              %% Riak node to which Riak CS accesses
              {riak_ip, "10.33.32.130"},
              {riak_pb_port, 8087 } ,

              %% Configuration for access to request
              %% serialization service
              {stanchion_ip, "127.0.0.1"},
              {stanchion_port, 8085 },
              {stanchion_ssl, false },

              %% Enable this to allow the creation of an admin user
              %% when setting up a system. It is recommended to only
              %% enable this temporarily unless your use-case
              %% specifically dictates letting anonymous users to
              %% create accounts.
              {anonymous_user_creation, false},

              %% Admin user credentials. Admin access like
              %% /riak-cs/stats requires this entry to be set
              %% properly. The credentials specified here must match
              %% the admin credentials specified in the stanchion
              %% app.config for the system to function properly.
              {admin_key, "BQS93ZEJBVW7TRQROUFL"},
              {admin_secret, "1gI7mdcrOuZkZ1hQgrhMSdw10Tn-c7rviB3ytA=="},

              %% Port and IP address to listen on for system
              %% administration tasks. Uncomment the following lines
              %% to use a separate IP and port for administrative
              %% API calls.
              %%{admin_ip, "127.0.0.1"},
              %%{admin_port, 8000 } ,

              %% If SSL needed, un-comment. Without SSL
              %% section, CS will be accessible via http.
              %% {ssl, [
              %%        {certfile, "./etc/cert.pem"},
              %%        {keyfile, "./etc/key.pem"}
              %%       ]},

              %% Root host name which Riak CS accepts.
              %% Your CS bucket at s3.example.com will be accessible
              %% via URL like http://bucket.s3.example.com/object/name
              {cs_root_host, "s3.amazonaws.com"},

              %% Connection pools
              %% Each pool is specified as a nested
              %% tuple of {Name, {FixedSize, OverflowSize}}
              {connection_pools,
               [
                {request_pool, {128, 0} },
                {bucket_list_pool, {5, 0} }
               ]},

              %% == Rolling upgrade support ==

              %% Riak CS version number. This is used to selectively
              %% enable new features for the current version to better
              %% support rolling upgrades. New installs should not
              %% need to modify this. If peforming a rolling upgrade
              %% then set this value to 0 until all nodes have been
              %% upgraded and then set back to the original value.
              {cs_version, 10300 },

              %% == Usage recording ==

              %% How often to flush the access log; integer factor of
              %% access_archive_period (1 == once per period; 2 ==
              %% twice per period, etc.)
              {access_log_flush_factor, 1},

              %% Additional access log flush trigger - flush after
              %% this many accesses are recorded, even if the flush
              %% interval has not expired; integer number of accesses
              {access_log_flush_size, 1000000},

              %% How large each access archive object is. Should be a
              %% multiple of access_log_flush_interval; integer number
              %% of seconds (3600 == 1 hour)
              {access_archive_period, 3600},

              %% How many access logs are allowed to pile up in the
              %% archiver's queue before it starts skipping to catch
              %% up; integer number of logs
              {access_archiver_max_backlog, 2},

              %% When to automatically start storage calculation
              %% batches; list of "HHMM" UTC times
              %% ([] == do not automatically calculation;
              %%  ["0600"] == automatically calculate at 6am UTC every day;
              %%  ["0600","1945"] == automatically calculate at 6am and
              %%                     again at 7:45pm every day)
              {storage_schedule, []},

              %% How large each storage archive object is. Should be
              %% chosen such that each storage_schedule entry falls in
              %% a different period; integer number of seconds
              %% (86400 == 1 day)
              {storage_archive_period, 86400},

              %% How many archive periods a user can request in one
              %% usage read, applied independently to access and
              %% storage; integer number of intervals (744 == 1 month
              %% @ 1 hour intervals)
              {usage_request_limit, 744},

              %% == Garbage Collection ==

              %% The number of seconds to retain the block
              %% for an object after it has been deleted.
              %% This leeway time is set to give the delete
              %% indication time to propogate to all replicas.
              %% 86400 is 24-hours.
              {leeway_seconds, 86400},

              %% How often the garbage collection daemon
              %% waits in-between gc batches.
              %% 900 is 15-minutes.
              {gc_interval, 900},

              %% How long a move to the garbage
              %% collection to do list can remain
              %% failed, before we retry it.
              %% 21600 is 6-hours.
              {gc_retry_interval, 21600},

              %% == DTrace ==

              %% If your Erlang virtual machine supports DTrace (or
              %% user-space SystemTap), set dtrace_support to true.
              {dtrace_support, false}

             ]},

 {webmachine, [
               %% custom server name at http response header "Server: Riak CS"
               {server_name, "Riak CS"},

               %% The webmachine_log_handler entry can be
               %% commented-out or removed to disable access
               %% logging. Do not remove the
               %% riak_cs_access_log_handler entry.
               {log_handlers, [
                               {webmachine_log_handler, ["./log"]},
                               {riak_cs_access_log_handler, []}
                              ]}
              ]},

 {lager, [
          %% What handlers to install with what arguments
          %% The defaults for the logfiles are to rotate the files when
          %% they reach 10Mb or at midnight, whichever comes first, and keep
          %% the last 5 rotations. See the lager README for a description of
          %% the time rotation format:
          %% https://github.com/basho/lager/blob/master/README.org
          %%
          %% If you wish to disable rotation, you can either set the size to 0
          %% and the rotation time to "", or instead specify a 2-tuple that only
          %% consists of {Logfile, Level}.
          {handlers, [
                      {lager_console_backend, info},
                      {lager_file_backend, [
                                            {"./log/error.log", error, 10485760, "$D0", 5},
                                            {"./log/console.log", info, 10485760, "$D0", 5}
                                           ]}
                     ]},

          %% Whether to write a crash log, and where.
          %% Commented/omitted/undefined means no crash logger.
          {crash_log, "./log/crash.log"},

          %% Maximum size in bytes of events in the crash log - defaults to 65536
          {crash_log_msg_size, 65536},

          %% Maximum size of the crash log in bytes, before its rotated, set
          %% to 0 to disable rotation - default is 0
          {crash_log_size, 10485760},

          %% What time to rotate the crash log - default is no time
          %% rotation. See the lager README for a description of this format:
          %% https://github.com/basho/lager/blob/master/README.org
          {crash_log_date, "$D0"},

          %% Number of rotated crash logs to keep, 0 means keep only the
          %% current one - default is 0
          {crash_log_count, 5},

          %% Whether to redirect error_logger messages into lager - defaults to true
          {error_logger_redirect, true}
         ]},

 %% SASL config
 {sasl, [
         {sasl_error_logger, false}
        ]}
].
