package datakit-ci

  1. Overview
  2. Docs

Web Configuration

type config

The type for web configuration.

val config : ?name:string -> ?state_repo:Uri.t -> ?metrics_token:[ `SHA256 of string ] -> ?listen_addr:[ `HTTP of int | `HTTPS of int ] -> ?github_scopes_needed:Github_t.scope list -> can_read:ACL.t -> can_build:ACL.t -> unit -> config

config ~name ~state_repo ~can_read ~can_build () is a web configuration. If name is given, it is used as the main heading, and also as the name of the session cookie (useful if you run multiple CIs on the same host, on different ports). If state_repo is given, it is used to construct links to the state repository on GitHub. If metrics_token is Some (`SHA256 expected) given then doing an HTTP GET on /metrics with an Authorization header containing "Bearer TTT" will return Prometheus-format metrics if sha256(TTT) = expected. There is no rate limiting, so pick a long token. github_scopes_needed should be `Read_org; `Public_repo to check whether users can access a public repository, or `Read_org, `Repo to check access to private repos. Unfortunately, the GitHub API requires us to ask for far more permissions than we need.