{"id":16655546,"url":"https://github.com/aaronrenner/distillery_config_example","last_synced_at":"2025-03-12T18:42:16.585Z","repository":{"id":138357226,"uuid":"218347485","full_name":"aaronrenner/distillery_config_example","owner":"aaronrenner","description":null,"archived":false,"fork":false,"pushed_at":"2019-10-29T17:43:31.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-19T11:32:05.071Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aaronrenner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-29T17:43:17.000Z","updated_at":"2022-12-07T21:27:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"1b1cc0c6-c612-4197-9fde-d8fc709f942d","html_url":"https://github.com/aaronrenner/distillery_config_example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronrenner%2Fdistillery_config_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronrenner%2Fdistillery_config_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronrenner%2Fdistillery_config_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronrenner%2Fdistillery_config_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaronrenner","download_url":"https://codeload.github.com/aaronrenner/distillery_config_example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243276383,"owners_count":20265339,"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":[],"created_at":"2024-10-12T09:53:21.407Z","updated_at":"2025-03-12T18:42:16.571Z","avatar_url":"https://github.com/aaronrenner.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DistilleryConfigExample\n\nThis project shows how Distillery compiles application config into a\nmix release. It also illustrates how secrets that are available at\nbuild time are included in plain text into the release.\n\n## Setup\n\n1. Install the dependencies\n\n    ```\n    $ mix deps.get\n    ```\n\n2. Build the release and pass in an API key.\n\n    ```\n    $ MIX_ENV=prod API_KEY=supersecret mix release\n    ```\n\n3. Cd into the root of the build directory\n\n    ```\n    $ cd _build/prod/rel/distillery_config_example\n    ```\n\n    This is the folder that usually gets TARed up and shipped to\n    the production server.\n\n4. Look at the contents of `releases/\u003cversion_number\u003e/sys.config`\n\n    ```\n    $ cat releases/0.1.0/sys.config\n    %% coding: utf-8\n    %% RUNTIME_CONFIG=false\n    [{distillery_config_example,[{api_key,\u003c\u003c115,117,112,101,114,115,101,99,114,101,116\u003e\u003e}]}].\n    ```\n\n5. Paste the binary of the API key into iEX to see the raw value.\n\n    ```\n    $ iex\n    Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]\n\n    Interactive Elixir (1.9.1) - press Ctrl+C to exit (type h() ENTER for help)\n    iex(1)\u003e \u003c\u003c115,117,112,101,114,115,101,99,114,101,116\u003e\u003e\n    \"supersecret\"\n    ```\n\nThis shows that config values that are available at build time are compiled into the release and easily\nreadable if someone gets ahold of your build. Instead, secrets should be injected at runtime. Elixir\n1.9's `config/releases.exs` is a great place to start if you want to read in environment variables\nat runtime as you start your app.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronrenner%2Fdistillery_config_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaronrenner%2Fdistillery_config_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronrenner%2Fdistillery_config_example/lists"}