{"id":19866132,"url":"https://github.com/tlux/toml_config","last_synced_at":"2025-05-02T05:32:19.810Z","repository":{"id":62430466,"uuid":"206960069","full_name":"tlux/toml_config","owner":"tlux","description":"A config provider to read TOML configuration files that works with Elixir (1.9+) releases","archived":false,"fork":false,"pushed_at":"2019-09-19T14:47:41.000Z","size":24,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T23:08:44.955Z","etag":null,"topics":["config","elixir","hex-package","toml"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tlux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-07T11:44:10.000Z","updated_at":"2022-06-11T07:16:03.000Z","dependencies_parsed_at":"2022-11-01T20:18:31.989Z","dependency_job_id":null,"html_url":"https://github.com/tlux/toml_config","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlux%2Ftoml_config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlux%2Ftoml_config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlux%2Ftoml_config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlux%2Ftoml_config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tlux","download_url":"https://codeload.github.com/tlux/toml_config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251993002,"owners_count":21677022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["config","elixir","hex-package","toml"],"created_at":"2024-11-12T15:25:04.647Z","updated_at":"2025-05-02T05:32:14.801Z","avatar_url":"https://github.com/tlux.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TOML Config Provider\n\n[![Build Status](https://travis-ci.org/tlux/toml_config.svg?branch=master)](https://travis-ci.org/tlux/toml_config)\n[![Coverage Status](https://coveralls.io/repos/github/tlux/toml_config/badge.svg?branch=master)](https://coveralls.io/github/tlux/toml_config?branch=master)\n[![Hex.pm](https://img.shields.io/hexpm/v/toml_config.svg)](https://hex.pm/packages/toml_config)\n\nA config provider to read [TOML](https://github.com/toml-lang/toml)\nconfiguration files that works with Elixir (1.9+) releases.\n\nNote: If you are building releases with Distillery, you can use the config\nprovider from the [toml-elixir](https://github.com/bitwalker/toml-elixir)\nlibrary.\n\n## Prerequisites\n\n* Elixir \u003e= 1.9\n\n## Installation\n\nThe package can be installed by adding `toml_config` to your list of\ndependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:toml_config, \"~\u003e 0.1\", only: :prod}\n  ]\nend\n```\n\n## Usage\n\nUpdate the release configuration in your mix.exs file:\n\nYou can either give a fully qualified pathname to the config file.\n\n```elixir\nreleases: [\n  my_app: [\n    config_providers: [\n      {TomlConfigProvider, path: \"/absolute/path/to/my/config.toml\"}\n    ],\n    ...\n  ]\n]\n```\n\nOr you can read the config directory or path from a specified environment\nvariable. Booting the application fails if the specified environment variable is\nundefined.\n\n```elixir\nreleases: [\n  my_app: [\n    config_providers: [\n      {TomlConfigProvider,\n       path: {:system, \"RELEASE_CONFIG_DIR\", \"my_app.toml\"}}\n    ],\n    ...\n  ]\n]\n```\n\nOr:\n\n```elixir\nreleases: [\n  my_app: [\n    config_providers: [\n      {TomlConfigProvider, path: {:system, \"RELEASE_CONFIG_PATH\"}}\n    ],\n    ...\n  ]\n]\n```\n\nAll config provider options except `:path` are forwarded to `Toml.decode_file/2`\nfrom the [toml-elixir](https://github.com/bitwalker/toml-elixir) library. Thus,\nyou can also provide custom transforms.\n\n\n```elixir\nconfig_providers: [\n  {TomlConfigProvider,\n   path: \"path/to/my/config.toml\",\n   transforms: [UrlTransform, TupleTransform]}\n]\n```\n\n## Other Implementations\n\n### `toml` Config Provider\n\nThe [toml](https://hex.pm/packages/toml) package brings it's own config provider\nthat unfortunately only works with\n[distellery](https://github.com/bitwalker/distillery) releases at the moment.\n\n### `toml_config_provider`\n\nUnlike [toml_config_provider](https://hex.pm/packages/toml_config_provider),\nthis library allows specifying the location of the config file through\nenvironment variables. This is quite useful when you have multiple (slightly\ndifferent) instances of a release running on the same machine, such as staging\nand production environments. Additionally, we allow custom transform modules.\n\n## Docs\n\nDocumentation can be generated with\n[ExDoc](https://github.com/elixir-lang/ex_doc) and is published on\n[HexDocs](https://hexdocs.pm/toml_config).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlux%2Ftoml_config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftlux%2Ftoml_config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlux%2Ftoml_config/lists"}