---
name: atc

description: |
  The ATC (Air Traffic Controller) provides UI and API access. It is
  responsible for scheduling builds and detecting versions of your resources.

templates:
  atc_ctl.erb: bin/atc_ctl
  tls_cert.erb: config/tls_cert
  tls_key.erb: config/tls_key
  cf_ca_cert.erb: config/cf_ca_cert

packages:
  - pid_utils
  - atc
  - fly
  - generated_signing_key

consumes:
- name: db
  type: postgresql
  optional: true

provides:
- name: atc
  type: atc
  properties:
  - bind_port
  - tls_bind_port

properties:
  bind_ip:
    description: |
      IP address on which the ATC should listen for HTTP traffic.
    default: 0.0.0.0

  bind_port:
    description: |
      Port on which the ATC should listen for HTTP traffic.
    default: 8080

  tls_bind_port:
    description: |
      Port on which the ATC should listen for HTTPS traffic.
    default: 4443

  tls_cert:
    description: |
      SSL cert to use for HTTPS.

      If not specified, only HTTP will be enabled.

  tls_key:
    description: |
      SSL private key to use for encrypting HTTPS traffic.

      If not specified, only HTTP will be enabled.

  external_url:
    description: |
      Externally reachable URL of the ATCs. Required for OAuth.

      Typically this is the URL that you as a user would use to reach your CI.
      For multiple ATCs it would go to some sort of load balancer.
    example: https://ci.concourse.ci

  peer_url:
    description: |
      Address used internally to reach the ATC. This will be auto-generated
      using the IP of each ATC VM if not specified.

      Note that this refers to an *individual ATC*, not the whole cluster. This
      property is only useful if you're deploying in a way that cannot
      autodetect its own IP, e.g. a `bosh-init` deployment.

      You should otherwise leave this value blank.

  allow_self_signed_certificates:
    description: |
      Allow self-signed certificates.
    default: false

  log_level:
    description: |
      The log level for the ATC. When set to debug, you'll see a lot more
      information about scheduling, resource scanning, etc., but it'll be quite
      chatty.
    default: info

  log_db_queries:
    description: |
      Log database queries. Log level is debug, so you'll need to set the
      log_level property as well. This is mainly useful for Concourse
      developers to analyze query counts.
    default: false

  no_really_i_dont_want_any_auth:
    description: |
      A safeguard to prevent accidentally forgetting to configure auth. Set
      this to true if you really don't want auth configured. This will leave
      your Concourse wide open and writable.
    default: false

  basic_auth_username:
    description: |
      Username for HTTP basic auth.
    default: ""

  basic_auth_password:
    description: |
      Password for HTTP basic auth, in plaintext.
    default: ""

  auth_duration:
    description: |
      Length of time for which tokens are valid. Afterwards, users will have to log back in.
      Use Go duration format (48h = 48 hours).
    default: 24h

  github_auth.client_id:
    description: |
      GitHub client ID to use for OAuth.

      The application must be configured with its callback URL as
      `{external_url}/auth/github/callback` (replacing `{external_url}`
      with the actual value).
    default: ""

  github_auth.client_secret:
    description: |
      GitHub client secret to use for OAuth.

      The application must be configured with its callback URL as
      `{external_url}/auth/github/callback` (replacing `{external_url}`
      with the actual value).
    default: ""

  github_auth.auth_url:
    description: |
      Override default OAuth endpoint for Github Enterprise.
    example: "https://github.example.com/login/oauth/authorize"

  github_auth.token_url:
    description: |
      Override default access token endpoint for Github Enterprise.
    example: "https://github.example.com/login/oauth/access_token"

  github_auth.api_url:
    description: |
      Override default API endpoint URL for Github Enterprise. Must end in a
      trailing slash.
    example: "https://github.example.com/api/v3/"

  github_auth.authorize:
    default: []
    description: |
      An array of different criteria to check for when authorizing a GitHub
      user. If empty, GitHub authorization is effectively disabled.
    example:
    - organization: org1
      teams: all
    - organization: org2
      teams: [Team 1, Team 2]
    - user: user1
    - user: user2

  uaa_auth.client_id:
    description: UAA client ID to use for OAuth.
    default: ""

  uaa_auth.client_secret:
    description: UAA client secret to use for OAuth.
    default: ""

  uaa_auth.auth_url:
    description: UAA authorization endpoint url to use for OAuth.
    default: ""

  uaa_auth.token_url:
    description: UAA token endpoint url to use for OAuth.
    default: ""

  uaa_auth.cf_spaces:
    description: |
      List of space GUIDs for Cloud Foundry spaces whose developers
      will have access.
    default: []

  uaa_auth.cf_api_url:
    description: Cloud Foundry api endpoint url.
    default: ""

  uaa_auth.cf_ca_cert:
    description: Cloud Foundry CA Certificate.
    default: ""

  generic_oauth.client_id:
    description: Application client ID for enabling generic OAuth.
    default: ""

  generic_oauth.client_secret:
    description: Application client secret for enabling generic OAuth.
    default: ""

  generic_oauth.auth_url:
    description: Generic OAuth provider authorization endpoint url.
    default: ""

  generic_oauth.auth_url_params:
    description: |
      List Parameter to pass to the authentication server authorization url.
    example:
      param1: value1
      param2: value2
    default: {}

  generic_oauth.scope:
    description: OAuth scope required for users who will have access.
    default: ""

  generic_oauth.token_url:
    description: Generic OAuth provider token endpoint URL.
    default: ""

  generic_oauth.display_name:
    description: Name of the authentication method to be displayed on the Web UI
    default: ""

  default_check_interval:
    description: |
      The interval, in Go duration format (1m = 1 minute), on which to check
      for new versions of resources.

      This can also be specified on a per-resource basis by specifying
      `check_every` on the resource config.
    default: 1m

  resource_cache_cleanup_interval:
    description: |
      The interval, in Go duration format (1m = 1 minute), on which to check
      for and release old caches of resource versions.
    default: 30s

  old_resource_grace_period:
    description: |
      How long to cache the result of a get step after a newer version of the
      resource is found. Use Go duration format (1m = 1 minute).
    default: 5m

  postgresql_database:
    description: |
      Name of the database to use from the `postgresql` link.

  postgresql.address:
    description: |
      Address of a PostgreSQL server to connect to, in `HOST:PORT` format.

      If not specified, one will be autodiscovered via BOSH links.

  postgresql.database:
    description: |
      Name of the database to use.
    default: atc

  postgresql.role.name:
    description: |
      Name of role to connect with.
    default: atc

  postgresql.role.password:
    description: |
      Password to use when connecting.

  yeller.api_key:
    description: |
      If configured, errors emitted to the logs will also be emitted to Yeller.
      This is only really useful for Concourse developers.
    default: ""

  yeller.environment_name:
    description: |
      Environment name to specify for errors emitted to Yeller.
    default: ""

  riemann.host:
    description: |
      If configured, detailed metrics will be emitted to the specified Riemann
      server.
    default: ""

  riemann.port:
    description: |
      Port of the Riemann server to emit events to.
    default: 5555

  riemann.service_prefix:
    description: |
      An optional prefix for emitted Riemann services
    default: ""

  riemann.tags:
    description: |
      An optional map of tags in key: value format
    default: {}
    example:
      env: dev
      foo: bar
