You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+17-9
Original file line number
Diff line number
Diff line change
@@ -147,11 +147,12 @@ The `arkana.yml` would typically contain 3 important sections:
147
147
- **Environment Secrets**: This is where you declare the keys which will be ultimately exposed to your app, like `apiKey`.
148
148
- **Global Secrets**: Here you'd declare keys which are the same across all environments.
149
149
150
-
## Environment File
150
+
## Dotenv File
151
151
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.
153
153
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.
155
156
156
157
### Sample
157
158
@@ -164,24 +165,27 @@ environments:
164
165
environment_secrets:
165
166
- apiKey
166
167
global_secrets:
167
-
- clientId
168
+
- clientID
168
169
```
169
170
170
-
Coupled with an env file:
171
+
Coupled with env vars (or a `.env` file):
171
172
172
173
```properties
173
174
apiKeyDebug = "your_debug_api_key"
174
175
apiKeyRelease = "your_release_api_key"
175
-
clientId = "your_client_id"
176
+
clientID = "your_client_id"
176
177
```
177
178
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
+
178
182
Would generate the following accessors:
179
183
180
184
```swift
181
185
// Swift
182
186
public extension ArkanaKeys {
183
187
struct Global: ArkanaKeysGlobalProtocol {
184
-
public letclientId: String = {<decrypted accessor>}
188
+
public letclientID: String = {<decrypted accessor>}
185
189
}
186
190
}
187
191
public extension ArkanaKeys {
@@ -196,7 +200,11 @@ public extension ArkanaKeys {
196
200
}
197
201
```
198
202
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 foryour keysin 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.
200
208
201
209
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 commandin your CI/CD scripts, _fastlane_, Xcode Build Phases, or something similar.
202
210
@@ -339,7 +347,7 @@ This means that, if you are working with a white-label project, you can have all
339
347
340
348
## Continuous Integration
341
349
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.
343
351
344
352
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:
0 commit comments