Skip to content

Commit 1d14d49

Browse files
committed
Improve usage documentation.
1 parent c4131c0 commit 1d14d49

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

README.md

+17-9
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,12 @@ The `arkana.yml` would typically contain 3 important sections:
147147
- **Environment Secrets**: This is where you declare the keys which will be ultimately exposed to your app, like `apiKey`.
148148
- **Global Secrets**: Here you'd declare keys which are the same across all environments.
149149
150-
## Environment File
150+
## Dotenv File
151151
152-
The environment (`.env`) file contains the actual secrets for each environment. While config file declares the keys, they are assigned encrypted values from this file.
152+
The dotenv (`.env`) file is an optional but quite handy way to modify and test with your keys during development. It contains the actual secrets for each environment. While config file declares the keys, they are assigned encrypted values from this file.
153153
154-
This file is optional, but quite handy in local development. `.env` files shouldn't be committed as they contain your secrets. Instead, they should be stored in a secure location, like your CI/CD server as environment variables (all CI/CD servers have a way to store secrets securely). See [Continuous Integration](#continuous-integration) for more information.
154+
> [!CAUTION]
155+
> `.env` files shouldn't be committed to git as they contain your secrets. Instead, its values should be stored in a secure location, like your CI/CD server as environment variables (all CI/CD services have a way to store secrets securely). See [Continuous Integration](#continuous-integration) for more information.
155156
156157
### Sample
157158
@@ -164,24 +165,27 @@ environments:
164165
environment_secrets:
165166
- apiKey
166167
global_secrets:
167-
- clientId
168+
- clientID
168169
```
169170
170-
Coupled with an env file:
171+
Coupled with env vars (or a `.env` file):
171172
172173
```properties
173174
apiKeyDebug = "your_debug_api_key"
174175
apiKeyRelease = "your_release_api_key"
175-
clientId = "your_client_id"
176+
clientID = "your_client_id"
176177
```
177178
179+
> [!IMPORTANT]
180+
> Notice how arkana needs you to name your env var keys by appending the environment name to the environment secrets, e.g. `apiKey` environment secret requires `apiKeyDebug` and `apiKeyRelease` env vars.
181+
178182
Would generate the following accessors:
179183
180184
```swift
181185
// Swift
182186
public extension ArkanaKeys {
183187
struct Global: ArkanaKeysGlobalProtocol {
184-
public let clientId: String = {<decrypted accessor>}
188+
public let clientID: String = {<decrypted accessor>}
185189
}
186190
}
187191
public extension ArkanaKeys {
@@ -196,7 +200,11 @@ public extension ArkanaKeys {
196200
}
197201
```
198202
199-
Note that you have to prepend `bundle exec` before `arkana` if you manage your dependencies via bundler, as recommended.
203+
> [!NOTE]
204+
> You can use PascalCase for your keys in the config file and env var keys, however, Arkana will automatically convert them to camelCase when generating the code. For instance, `MySecretAPIKey` will be converted to `mySecretAPIKey` (just the first letter of the first word will be lowercased).
205+
206+
> [!NOTE]
207+
> You have to prepend `bundle exec` before `arkana` if you manage your dependencies via bundler, as recommended.
200208
201209
Arkana only has one command, which parses your config file and env vars, generating all the code needed. Arkana should always be run before attempting to build your project, to make sure the files exist _and_ are up-to-date (according to the current config file). This means you might need to add the Arkana run command in your CI/CD scripts, _fastlane_, Xcode Build Phases, or something similar.
202210
@@ -339,7 +347,7 @@ This means that, if you are working with a white-label project, you can have all
339347
340348
## Continuous Integration
341349
342-
We advise you not to commit your `.env` files, because of security concerns. They should live in secure Environment Variables in your build (CI/CD) server instead.
350+
We advise you not to commit your `.env` files, because they contain your secrets and secrets should generally never be committed to your code repository. They should live in secure Environment Variables in your build (CI/CD) server instead.
343351
344352
Following the [template.yml](template.yml) example file, these would be the variables that would need to be added to your build server env vars:
345353

0 commit comments

Comments
 (0)