{"id":17129037,"url":"https://github.com/michaelhenry/envject","last_synced_at":"2025-04-06T03:13:31.597Z","repository":{"id":143442342,"uuid":"608160058","full_name":"michaelhenry/envject","owner":"michaelhenry","description":"A command-line tool for injecting environment variables or secrets to any file that has to be compiled. (like for example in iOS, with string obfuscation support).","archived":false,"fork":false,"pushed_at":"2023-03-26T13:21:09.000Z","size":2198,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-12T08:58:32.723Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/michaelhenry.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-01T12:54:41.000Z","updated_at":"2023-03-20T12:33:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"b93d9a69-e232-4ea9-b977-8edabf85cae2","html_url":"https://github.com/michaelhenry/envject","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelhenry%2Fenvject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelhenry%2Fenvject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelhenry%2Fenvject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelhenry%2Fenvject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelhenry","download_url":"https://codeload.github.com/michaelhenry/envject/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427012,"owners_count":20937214,"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-14T19:08:41.940Z","updated_at":"2025-04-06T03:13:31.580Z","avatar_url":"https://github.com/michaelhenry.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 💉envject\n\n[![codecov](https://codecov.io/gh/michaelhenry/envject/branch/main/graph/badge.svg?token=HT3OK2CB3R)](https://codecov.io/gh/michaelhenry/envject)\n\nA command-line tool for injecting environment variables or secrets to any file that has to be compiled especially in iOS.\n\nI have written a [short article](https://www.iamkel.net/posts/6-ios-secrets-handling) regarding this.\n\nAnd this is inspired by the functionality of [variable-injector](https://github.com/LucianoPAlmeida/variable-injector) but written in go and not dependent with the swift toolchain version.\n\n## Demo\n\n![envject](https://user-images.githubusercontent.com/717992/222741865-e8c51ba1-3660-4c07-a02f-8a630b5a577d.gif)\n\n\u003e This can allow us to prevent hard-coding production keys inside the project. So inside the CI, this can be executed during pre-compilation. And then after that, you can then do the obfuscation to guarantee that no strings are readable.\n\n## The Problem with default Xcode's configuration (`.xcconfig`)\n\nUsing an `xcconfig` file in Xcode to store sensitive information and then accessing that information from the `Info.plist` file can have some potential downsides:\n\n**Security risks**: Storing sensitive information in an xcconfig file can be a security risk. If you then use that information in the `Info.plist` file, it could be easier for an attacker to find and exploit that information.\n\n**Complexity**: Accessing sensitive information through an xcconfig file and the `Info.plist` file can add complexity to your project, making it more difficult to manage and maintain.\n\n**Increased chance of errors**: Using multiple files to manage your project's configuration settings increases the chance of errors, such as misconfigured settings or missing information.\n\n**Version control conflicts**: If multiple developers are working on the project and are using different xcconfig files or Info.plist files, it can create conflicts in version control systems like Git.\n\n**Debugging**: Debugging issues related to `.xcconfig` files and `Info.plist` files can be challenging, particularly if there are issues related to sensitive information.\n\n## Installation/How to use\n\n#### Use from source (must have a `go` installed on your machine)\n\n```shell\ngit clone https://github.com/michaelhenry/envject/\ncd envject\n\ngo run main.go --file sample.config.txt --debug true\n```\n\n#### Download the binary file from the release assets page.\n\n- https://github.com/michaelhenry/envject/releases\n\n```shell\n./envject --file sample.config.txt\n```\n\n#### Using Homebrew (Recommended)\n\n```shell\nbrew tap michaelhenry/envject\nbrew install envject\n```\n\n```shell\nenvject --file sample.config.txt\n```\n\nTo avoid brew from updating which usually taking some time:\n\n```\nexport HOMEBREW_NO_AUTO_UPDATE=1\n```\n\n\n## String obfuscation\n\n**envject** is also supporting string obfuscation using the `obfuscate-for` flag.\n\nFor example:\n\n### On Swift project\n\n```bash\nenvject --file Sources/Demo/Secrets.swift --obfuscate-for swift\n```\n![Swift-demo](Examples/swift/images/envject-swift-demo.gif)\n\n## LICENSE\n\nMIT\n\n\n## Other reference\n\n- [Secret Management on iOS](https://nshipster.com/secrets/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelhenry%2Fenvject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelhenry%2Fenvject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelhenry%2Fenvject/lists"}