---
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
  postgres_ca_cert.erb: config/postgres_ca_cert
  postgres_client_cert.erb: config/postgres_client_cert
  postgres_client_key.erb: config/postgres_client_key
  vault_ca_cert.erb: config/vault_ca_cert
  vault_client_cert.erb: config/vault_client_cert
  vault_client_key.erb: config/vault_client_key

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. This will be
      auto-generated using the IP of each ATC VM if not specified, however
      this is only a reasonable default if you have a single instance.

      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.

  x_frame_options:
    description: |
        The value to set for X-Frame-Options.

        If omitted, the header is not set.
    default: ""

  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

  encryption_key:
    description: |
      The 16 or 32 byte AES key to use for encrypting sensitive information
      in the database.

      If specified, all existing data will be encrypted on start and any new
      data will be encrypted.

  old_encryption_key:
    description: |
      The key used previously to encrypt sensitive information in the database.

      To rotate your encryption key, set both old_encryption_key and
      encryption_key. This will result in the ATC re-encrypting all data on
      start.

      To disable encryption, specify old_encryption_key and do *not* set
      encryption_key. This will result in the ATC decrypting all data on start,
      restoring it to plaintext.

  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

  gc_interval:
    description: |
      The interval, in Go duration format (1m = 1 minute), on which to garbage
      collect containers, volumes, and other internal data.
    default: 30s

  build_tracker_interval:
    description: |
      The interval, in Go duration format (1m = 1 minute), on which to run
      build tracking to keep track of build status.
    default: 10s

  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.host:
    description: |
      IP address or DNS name of a PostgreSQL server to connect to.

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

  postgresql.port:
    description: |
      Port on which to connect to the server specified by `postgresql.host`.

      If `postgresql.host` is not specified, this will be autodiscovered via
      BOSH links, along with the host.
    default: 5432

  postgresql.address:
    description: |
      Deprecated. Shorthand for specifying `postgresql.host` and
      `postgresql.port`.

  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.

  postgresql.sslmode:
    description: |
      Whether or not to use SSL. Defaults to `verify-ca` when `postgresql.address`
      or `postgresql.host` is provided. Otherwise, defaults to `disable`.

  postgresql.ca_cert:
    type: certificate
    description: |
      CA certificate to verify the server against.

  postgresql.client_cert:
    type: certificate
    description: |
      Client certificate to use when connecting with the server.

  postgresql.connect_timeout:
    description: |
      Dialing timeout, in Go duration format (1m = 1 minute). 0 means wait indefinitely.
    default: 5m

  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

  influxdb.url:
    description: |
      If configured, detailed metrics will be emitted to the specified InfluxDB
      server.
  influxdb.database:
    description: |
      InfluxDB database to which metrics will be emitted.
    default: ""
  influxdb.username:
    description: |
      InfluxDB username for authorizing access.
    default: ""
  influxdb.password:
    description: |
      InfluxDB password for authorizing access.
    default: ""
  influxdb.insecure_skip_verify:
    description: |
      Skip SSL verification when emitting to InfluxDB.
    default: false

  vault.url:
    description: |
      Vault server URL to use for parameterizing credentials.
  vault.path_prefix:
    description: |
      Path under which to namespace team/pipeline credentials.
    default: /concourse
  vault.tls.ca_cert:
    type: certificate
    description: |
      A PEM-encoded CA cert to use to verify the Vault server SSL cert.
  vault.tls.server_name:
    description: |
      If set, is used to set the SNI host when connecting via TLS.
    default: ""
  vault.tls.insecure_skip_verify:
    description: |
      Enable insecure SSL verification.
    default: false
  vault.tls.client_cert:
    type: certificate
    description: |
      Client certificate for Vault TLS auth.
  vault.auth.client_token:
    description: |
      Client token to use for accessing your Vault server.
    default: ""
  vault.auth.backend:
    description: |
      Auth backend to use for logging in to Vault.
    default: ""
  vault.auth.params:
    description: |
      Key-value parameters to provide when logging in with the backend.
    default: {}
    example: {role_id: abc123, secret_id: def456}
