# GRR Server configuration file
# This is the template used in deployment of GRR. It contains the basic
# elements and test configurations to run the system.

AdminUI.bind: "::"

AdminUI.webauth_manager: BasicWebAuthManager

AdminUI.use_precompiled_js: True

API.DefaultRouter: ApiCallRouterWithoutChecks

Client.company_name: GRR Project

Client.description: "%(name) %(platform) %(arch)"

Client.name: GRR

Client.proxy_servers:

Logging.engines: "stderr,file"

Logging.verbose: False

# These must be in the domain specified above as Logging.domain.
# Monitoring.emergency_access_email: grr-emergency-access@example.com
# Monitoring.alert_email: grr-monitoring@example.com

AdminUI Context:
  Logging.filename: "%(Logging.path)/grr-ui.log"

# The client's reported architecture string depends on the Arch context
Arch:amd64:
  Client.arch: amd64

Arch:i386:
  Client.arch: i386

# When GRR is installed globally, we use the following global location for the
# configuration writeback. Otherwise the writeback is written into the
# virtualenv.
Global Install Context:
  Config.directory: /etc/grr/

Client Context:
  Client.foreman_check_frequency: 1800

Target:Darwin:
  # The build system generates a build.yaml file with information about the
  # build. It is placed right next to this file.
  Config.includes:
    - build.yaml

  Client.install_path: |
    /usr/local/lib/%(Client.name)/%(ClientRepacker.output_basename)

  Client.unprivileged_user: nobody
  Client.unprivileged_group: nobody
  Client.use_filesystem_sandboxing: True

  ClientBuilder.build_dest: "%(Client.name)-build"

  ClientBuilder.build_root_dir: /Users/%(USER|env)/mac-build

  ClientBuilder.install_dir: "/usr/local/lib/%(Client.name)/%(ClientBuilder.output_basename)"

  ClientBuilder.output_extension: .pkg

  ClientBuilder.package_maker_organization: com.google.code

  ClientBuilder.template_extension: .xar.zip

  ClientBuilder.fleetspeak_plist_path: /Library/LaunchDaemons/com.google.code.fleetspeak.plist
  ClientBuilder.fleetspeak_service_dir: /etc/fleetspeak-client/textservices

  Logging.path: /var/log

  PyInstaller.distpath: |
    /Users/%(USER|env)/mac-dist

  Config.writeback: /etc/%(Client.name).local.yaml

  # This indicates that we are building a client for debugging. It needs to
  # be nested deeper than the Client context so it always takes precedence
  # when both contexts apply.
  DebugClientBuild Context:
    Logging.verbose: True
    ClientBuilder.console: True
    Client.foreman_check_frequency: 30
    Client.prefix: dbg_

Target:Linux:
  Config.includes:
    - build.yaml

  Client.binary_name: grrd

  Client.install_path: |
    /usr/lib/%(Client.name)/%(ClientRepacker.output_basename)

  Config.writeback: /etc/%(Client.name).local.yaml

  Client.name: grr

  ClientBuilder.output_extension: .deb

  ClientBuilder.target_dir: |
    /usr/lib/%(Client.name)/%(ClientRepacker.output_basename)

  ClientBuilder.template_extension: .deb.zip

  Logging.engines: stderr

  Logging.path: /var/log

  ClientBuilder.build_root_dir: /tmp/grr-build

  PyInstaller.distpath: |
    %(PyInstaller.dpkg_root)/debian/

  Client.unprivileged_user: _%(Client.name)
  Client.unprivileged_group: _%(Client.name)
  Client.use_filesystem_sandboxing: True
  Client.use_memory_sandboxing: True

  Target:LinuxRpm:
    ClientBuilder.output_extension: .rpm

    ClientBuilder.target_dir: |
      /usr/lib64/%(Client.name)/%(ClientRepacker.output_basename)

    ClientBuilder.template_extension: .rpm.zip

    Client.install_path: |
      /usr/lib64/%(Client.name)/%(ClientRepacker.output_basename)

    ClientBuilder.fleetspeak_service_dir: |
      /etc/fleetspeak-client/textservices

    Client.fleetspeak_service_name: fleetspeak-client

  # This indicates that we are building a client for debugging. It needs to
  # be nested deeper than the Client context so it always takes precedence
  # when both contexts apply.
  DebugClientBuild Context:
    Logging.verbose: True
    ClientBuilder.console: True
    Client.foreman_check_frequency: 30
    Client.prefix: dbg_

Target:Windows:
  Config.includes:
    - build.yaml

  ClientBuilder.build_root_dir: C:\\grr-build-root

  PyInstaller.distpath: |
    C:\\grr-distpath

  ClientBuilder.output_extension: .exe

  ClientBuilder.template_extension: .exe.zip

  Client.use_filesystem_sandboxing: True
  Client.use_memory_sandboxing: True

  Target:WindowsMsi:
    ClientBuilder.output_extension: .msi

    ClientBuilder.template_extension: .msi.zip

  # This indicates that we are building a client for debugging. It needs to
  # be nested deeper than the Client context so it always takes precedence
  # when both contexts apply.
  DebugClientBuild Context:
    Logging.verbose: True
    ClientBuilder.console: True
    Client.foreman_check_frequency: 30
    Client.prefix: dbg_

ConfigUpdater Context:
  ConfigUpdater.old_config: /etc/grr/grr-server.conf

HTTPServer Context:
  Logging.filename: "%(Logging.path)/grr-http-server.log"

Platform:Darwin:
  Client.name: grr

  Client.platform: darwin

  Client Context:
    Logging.engines: stderr,file,syslog

    Logging.syslog_path: /var/run/syslog

    Logging.filename: "%(Logging.path)/%(Client.name).log"

Platform:Linux:
  Client.binary_name: grrd

  Client.platform: linux

  Client Context:

    Logging.engines: stderr,file,syslog

    Logging.syslog_path: /dev/log

    Logging.filename: "%(Logging.path)/%(Client.name).log"

    Commandline Context:
      Logging.engines: stderr

      Logging.verbose: False


Platform:Windows:
  Client.binary_name: |
      %(Client.name).exe

  Client.install_path: |
    %(SystemRoot|env)\\System32\\%(Client.name)\\%(Source.version_string)

  Client.platform: windows

  # Windows services has an insecure temp directory so we use our installation
  # path.
  Client.tempdir_roots:
    - "%(install_path)"
  Client.grr_tempdir: "Temp"

  Arch:amd64:
    ClientBuilder.vs_arch: x64

    ClientBuilder.vs_env_script: "%(vs_dir)\\VC\\bin\\amd64\\vcvars64.bat"

  # For windows 32 bit clients.
  Arch:i386:
    ClientBuilder.vs_arch: Win32

    ClientBuilder.vs_env_script: "%(vs_dir)\\VC\\bin\\vcvars32.bat"

  Client Context:
    Logging.engines: file,stderr,event_log

    Logging.filename: |
      %(path)\\%(Client.name).log

    Logging.path: |
      %(WINDIR|env)\\System32\\logfiles\\

    # This is where the client will write back volatile configuration data. On
    # windows we write configuration into the registry.
    Config.writeback: reg://%(Client.config_hive)/%(Client.config_key)


Worker Context:
  Cron.active: True
  Logging.filename: "%(Logging.path)/grr-worker.log"

FleetspeakFrontend Context:
  Logging.filename: "%(Logging.path)/grr-fleetspeak-frontend.log"

# For Test Context, see test_data/grr_test.yaml in the grr-response-test
# package.
