Skip to content

Commit 0a652fd

Browse files
committed
docs: add capability to load YAML config file along with a schema
1 parent 66653bc commit 0a652fd

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,10 @@ mode: users
4444
```
4545
4646
**We encourage you to version this file** such that re-deployment is easy (e.g., for test purposes, or in case of a catastrophic failure of the infra during the event).
47-
Nevertheless, please do not commit the admin credentials ! Use the corresponding environment variables and provide their value from a safe secret store.
47+
Nevertheless, please do not commit the admin credentials ! Use `from_env` objects instead (refer to [the YAML Schema](#schema) for more info).
4848

4949
For further configuration, please refer to the binary's specific API through `ctfd-setup --help`.
5050

51-
If you are using it as part of Infra as Code provisionning, you can map the values of this configuration file to environment variables (which could ease your job).
52-
5351
### GitHub Actions
5452

5553
To improve our own workflows and share knownledges and tooling, we built a GitHub Action: `ctfer-io/ctfd-setup`.
@@ -71,6 +69,8 @@ jobs:
7169
uses: 'ctfer-io/ctfd-setup@v1.4.4'
7270
with:
7371
url: ${{ secrets.CTFD_URL }}
72+
file: '.ctfd.yaml'
73+
# or directly attributes
7474
appearance_name: 'My CTF'
7575
appearance_description: 'My CTF description'
7676
admin_name: ${{ secrets.ADMIN_USERNAME }}
@@ -102,6 +102,8 @@ steps:
102102
settings:
103103
url:
104104
from_secret: CTFD_URL
105+
file: '.ctfd.yaml'
106+
# or directly attributes
105107
appearance_name: 'My CTF'
106108
appearance_description: 'My CTF description'
107109
admin_name:
@@ -113,6 +115,16 @@ steps:
113115
# ... and so on (non-mandatory attributes)
114116
```
115117

118+
## Schema
119+
120+
For ease of use, you can generate and use the `ctfd-setup` YAML schema using `ctfd-setup schema`.
121+
122+
In your `.ctfd.yaml` file you could then prepend `# yaml-language-server: $schema=file:///path/to/schema.json`.
123+
124+
<div align="center">
125+
<img src="res/schema.png">
126+
</div>
127+
116128
## Security
117129

118130
### Signature and Attestations

res/schema.png

20.7 KB
Loading

0 commit comments

Comments
 (0)