{"id":14955926,"url":"https://github.com/freeletics/creds","last_synced_at":"2025-10-24T09:30:25.075Z","repository":{"id":45221210,"uuid":"127416829","full_name":"freeletics/creds","owner":"freeletics","description":"Encrypted \u0026 plain text credentials for multiple environments","archived":false,"fork":false,"pushed_at":"2023-03-17T02:35:18.000Z","size":36,"stargazers_count":37,"open_issues_count":3,"forks_count":2,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-01-29T09:11:19.953Z","etag":null,"topics":["credentials","rails","ruby","ruby-gem"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/freeletics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-03-30T10:43:38.000Z","updated_at":"2023-07-21T08:10:44.000Z","dependencies_parsed_at":"2024-09-22T00:01:19.986Z","dependency_job_id":null,"html_url":"https://github.com/freeletics/creds","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":"0.050000000000000044","last_synced_commit":"ea184d9538f72b15ce873b8e7ecff78d6fc564ab"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freeletics%2Fcreds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freeletics%2Fcreds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freeletics%2Fcreds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freeletics%2Fcreds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freeletics","download_url":"https://codeload.github.com/freeletics/creds/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237944039,"owners_count":19391588,"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":["credentials","rails","ruby","ruby-gem"],"created_at":"2024-09-24T13:12:01.518Z","updated_at":"2025-10-24T09:30:24.614Z","avatar_url":"https://github.com/freeletics.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Creds\n\nManage encrypted credentials (added in Rails 5.2.0) with multiple environments.\n\n## Installation\n\nAvailable as a gem [`creds`](https://rubygems.org/gems/creds)\n\n## Usage\n\nUsing Rails command, generate new encrypted file by\n```\nbin/rails encrypted:edit config/credentials/production.yml.enc --key config/credentials/production.key\n```\n\nadd some content in opened editor (note there is no environment root key, ie no `production`):\n```yaml\naws_access_key_id: my-access-key-id\n```\n\nIf `config/credentials/production.key` doesn't exist yet, run `bin/rails generate master_key` and adjust naming to match desired one.\nContent of file can be displayed by\n```\nbin/rails encrypted:show config/credentials/production.yml.enc --key config/credentials/production.key\n```\n\nAdd to `config/environments/production.rb` (or any other env)\n```ruby\nconfig.creds = Creds.new(\"config/credentials/production.yml.enc\")\n```\n\nIf wants to use key from custom path - by default it checks `RAILS_MASTER_KEY` env key and `config/master.key` file:\n```ruby\nconfig.creds = Creds.new(\"config/credentials/production.yml.enc\", key_path: \"config/credentials/production.key\")\n```\n\nIn the code:\n```ruby\nRails.configuration.creds.aws_access_key_id\n```\n\nTo ease working in development/test environments with the same API, add `config/credentials/plain.yml` with key/value pairs\nnested under environment name, like:\n```yml\ndevelopment:\n  aws_access_key_id: \"aws-key-id\"\n```\n\nThen add to `config/environments/development.rb`\n```ruby\nconfig.creds = Creds.new(\"config/credentials/plain.yml\", env: \"development\")\n```\n\n### Rails 6.0\n\nIn Rails 6.0 it is possible to edit files by `rails credentials:edit --environment production` which will look for\n`config/credentials/production.yml.enc` encrypted by `ENV[\"RAILS_MASTER_KEY\"]` or `config/credentials/production.key`\n\n### Additions\n\n* To raise error in case of missing key you can add bang to the name, like `Rails.configuration.creds.database_url!`\n* To list all defined key/value pairs call `config`, like `Rails.configuration.creds.config`\n* Plain text file can embed Ruby (`\u003c%= %\u003e`), but not encrypted one\n* If `secret_key_base` is specified in credentials file, it will be assigned to `Rails.configuration.secret_key_base`, as it is required by Rails\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/freeletics/creds\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreeletics%2Fcreds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreeletics%2Fcreds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreeletics%2Fcreds/lists"}