Skip to content

Configuration

Barnaby Keene edited this page Mar 16, 2019 · 3 revisions

Aside from pawn.json files, sampctl itself can be configured globally via a file or environment variables. In addition to environment variables, sampctl will also load key=value format variables from a file named .env relative to the directory it was executed from. This is useful in development but is discouraged in production for security reasons.

Inside the cache directory, sampctl will search for a config file which can be either JSON, YAML or TOML. As well this, any of the fields can also be overwritten with environment variables.

Configuration Fields

config indicates values that are read from the configuration file and env indicates an environment variable that can be used to override any value read from the configuration file.

  • (string) config: user_id

    An automatically set value by sampctl, it's an anonymous user ID for metrics

  • (bool) config: metrics, env: SAMPCTL_METRICS

    Whether or not to report telemetry metrics.

  • (string) config: default_user, env: SAMPCTL_DEFAULT_USER

    The default username for package init.

  • (string) config: github_token, env: SAMPCTL_GITHUB_TOKEN

    GitHub API token for extended API rate limit, you should set this if you are getting errors during package ensure from GitHub warning you that you have been temporarily blocked. See this page for how to get a token.

  • (string) config: git_username, env: SAMPCTL_GIT_USERNAME

    Git username for private repositories.

  • (string) config: git_password, env: SAMPCTL_GIT_PASSWORD

    Git password for private repositories.

Bool values can be any of: true, false, 1, 0.

Continuous Integration

sampctl will also detect if it's running inside a continuous integration server by checking if CI is set. This is a known environment variable on TravisCI and GitLab. Other CI services have not been tested, please file an issue if you use a CI server that does not behave this way and we can figure something out.

Clone this wiki locally