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
+70Lines changed: 70 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -248,6 +248,76 @@ If you are using Cloudflare Access, ensure that you configure `CLOUDFLARE_TEAM_D
248
248
249
249
Else, if you are using a generic OIDC identity provider (such as Okta), then you should configure `SECRET_KEY` and `OIDC_CLIENT_SECRETS`. `CLOUDFLARE_TEAM_DOMAIN` and `CLOUDFLARE_APPLICATION_AUDIENCE` do not need to be set and can be removed from your env file. Make sure to also mount your `client-secrets.json` file to the container if you don't have it inline.
250
250
251
+
### Access application configuration
252
+
253
+
_All front-end and back-end configuration overrides are **optional**._
254
+
255
+
The default config for the application is at [`config/config.default.json`](config/config.default.json).
256
+
257
+
The file is structured with two keys, `FRONTEND` and `BACKEND`, which contain the configuration overrides for the
258
+
front-end and back-end respectively.
259
+
260
+
If you want to override either front-end or back-end values, create your own config file based on
261
+
[`config/config.default.json`](config/config.default.json). Any values that you don't override will fall back to
262
+
the values in the default config.
263
+
264
+
To use your custom config file, set the `ACCESS_CONFIG_FILE` environment variable to the name of your config
265
+
override file in the project-level `config` directory.
266
+
267
+
### Sample Usage
268
+
269
+
To override environment variables, create an override config file in the `config` directory. (You can name
270
+
this file whatever you want because the name of the file is specified by your `ACCESS_CONFIG_FILE` environment
271
+
variable.)
272
+
273
+
For example, if you want to set the default access time to 5 days in production, you might create a file named
274
+
`config.production.json` in the `config` directory:
275
+
276
+
```json
277
+
{
278
+
"FRONTEND": {
279
+
"DEFAULT_ACCESS_TIME": "432000"
280
+
}
281
+
}
282
+
```
283
+
284
+
Then, in your `.env.production` file, set the `ACCESS_CONFIG_FILE` environment variable to the name of your
285
+
config file:
286
+
287
+
```
288
+
ACCESS_CONFIG_FILE=config.production.json
289
+
```
290
+
291
+
This tells the application to use `config.production.json` for configuration overrides.
292
+
293
+
#### Frontend Configuration
294
+
295
+
To override values on the front-end, modify these key-value pairs inside the `FRONTEND` key in your custom config file.
|`ACCESS_TIME_LABELS`| Specifies the time access labels to use for dropdowns on the front end. Contains a JSON object of the format `{"NUM_SECONDS": "LABEL"}`. |`{"86400": "1 day", "604800": "1 week", "2592000": "1 month"}`|
300
+
|`DEFAULT_ACCESS_TIME`| Specifies the default time access label to use for dropdowns on the front end. Contains a string with a number of seconds corresponding to a key in the access time labels. |`"86400"`|
301
+
|`NAME_VALIDATION_PATTERN`| Specifies the regex pattern to use for validating role, group, and tag names. Should include preceding `^` and trailing `$` but is not a regex literal so omit `/` at beginning and end of the pattern |`"^[a-zA-Z0-9-]*$"`|
302
+
|`NAME_VALIDATION_ERROR`| Specifies the error message to display when a name does not match the validation pattern. |`"Name must contain only letters, numbers, and underscores."`|
303
+
304
+
The front-end config is loaded in [`craco.config.js`](craco.config.js). See
305
+
[`src/config/loadAccessConfig.js`](src/config/loadAccessConfig.js) for more details.
306
+
307
+
#### Backend Configuration
308
+
309
+
To override values on the back-end, modify these key-value pairs inside the `BACKEND` key in your custom config file.
|`NAME_VALIDATION_PATTERN`| PCRE regex used for validating role, group, and tag names. Should not explicitly declare pattern boundaries: depending on context, may be used with or without a preceding `^` and a trailing `$`. |`[A-Z][A-Za-z0-9-]*`|
314
+
|`NAME_VALIDATION_ERROR`| Error message to display when a name does not match the validation pattern. |`Name must start with a capital letter and contain only letters, numbers, and hypens.`|
315
+
316
+
The back-end config is loaded in [`api/access_config.py`](api/access_config.py).
317
+
318
+
See [`api/views/schemas/core_schemas.py`](api/views/schemas/core_schemas.py) for details about how the pattern override
319
+
supplied here will be used.
320
+
251
321
#### Database Setup
252
322
253
323
After `docker compose up --build`, you can run the following commands to setup the database:
0 commit comments