docs: Rename the file, replace the examples with a new config

This commit is contained in:
Данил 2025-03-05 22:27:36 +03:00
parent dd73f73869
commit f79d2b166a
2 changed files with 100 additions and 66 deletions

View file

@ -51,8 +51,8 @@ export default defineConfig({
slug: 'docs/config/config-env' slug: 'docs/config/config-env'
}, },
{ {
label: 'Configure config.yaml', label: 'Configure config.hjson',
slug: 'docs/config/config-yaml' slug: 'docs/config/config-hjson'
}, },
{ {
label: 'Configure Nginx', label: 'Configure Nginx',

View file

@ -1,66 +1,93 @@
--- ---
title: Configure config.yaml title: Configure config.hjson
--- ---
import { Aside } from '@astrojs/starlight/components'; import { Aside } from '@astrojs/starlight/components';
Kekkai can be configured using the `config.yaml` file in the working directory. Kekkai can be configured using the `config.hjson` file in the working directory.
`config.example.yaml`. `config.example.hjson`.
```yaml ```hjson
# For more information, see the documentation # For more information, see the documentation
# https://kekkai-docs.redume.su/ # https://kekkai-docs.redume.su/
database: {
user: 'DATABASE_USERNAME' database:
password: 'DATABASE_PASSWORD' {
host: 'DATABASE_HOST' user: DATABASE_USERNAME
name: 'DATABASE_NAME' password: DATABASE_PASSWORD
port: 5432 host: localhost
server: name: kekkai
host: '0.0.0.0' port: 5432
ssl: }
private_key: '/CertSSL/privkey.pem' server:
cert: '/CertSSL/fullchain.pem' {
work: true host: 0.0.0.0
log: ssl:
print: true {
level: 'info' private_key: /CertSSL/privkey.pem
analytics: cert: /CertSSL/fullchain.pem
plausible_api: 'https://plausible.io/api/event/' enabled: false
plausible_domain: 'PLAUSIBLE_DOMAIN' }
plausible_token: 'PLAUSIBLE_TOKEN' log:
work: false {
currency: level: info
chart: }
save: false }
collecting: analytics:
{
plausible_domain: plausible.io
plausible_token: TOKEN
enabled: false
}
currency:
{
collecting:
{
fiat: true fiat: true
schedule: '30 8 * * *' crypto: false
fiat: schedule: 30 8 * * *
- USD crypto_apikey: TOKEN
- RUB }
- EUR fiat:
- UAH [
- TRY USD
- KZT RUB
EUR
UAH
TRY
KZT
]
crypto:
[
ETH
TON
USDT
BTC
]
}
}
``` ```
## Database ## Database
Kekkai is used as a `PostgreSQL` database. Kekkai is used as a `PostgreSQL` database.
<Aside> <Aside>
If you installed Kekkai via Docker Compose, If you installed Kekkai via `Docker Compose`,
then install it in the `database.host` value of `postgres`. set it to `database.host` for postgres.
The rest of the data does not have to be filled in. The password (database.password) should be the same as in `.env`,
They need to be filled in `.env`. the rest of the data doesn't need to be filled in,
it should be in `.env`
What should it look like: What should it look like:
```yaml ```hjson
database: database:
... {
host: 'postgres' ...
... password: PASSWORD_FROM_ENV
host: postgres
...
}
... ...
``` ```
</Aside> </Aside>
@ -96,7 +123,7 @@ analytics:
plausible_api: 'https://plausible.io/api/event/' plausible_api: 'https://plausible.io/api/event/'
plausible_domain: 'PLAUSIBLE_DOMAIN' plausible_domain: 'PLAUSIBLE_DOMAIN'
plausible_token: 'PLAUSIBLE_TOKEN' plausible_token: 'PLAUSIBLE_TOKEN'
work: true enabled: true
... ...
``` ```
@ -107,7 +134,7 @@ analytics:
You can add the domain [here](https://plausible.io/sites/new?flow=provisioning). You can add the domain [here](https://plausible.io/sites/new?flow=provisioning).
- `plausible_token`: Api token for authorization and sending requests. - `plausible_token`: Api token for authorization and sending requests.
You can create it [here](https://plausible.io/settings/api-keys). You can create it [here](https://plausible.io/settings/api-keys).
- `work`: Enable or disable analytics. - `enabled`: Enable or disable analytics.
## Currency ## Currency
`DuckDuckGo` (fiat currency collection) and `CoinMarketCap` (cryptocurrency collection) `DuckDuckGo` (fiat currency collection) and `CoinMarketCap` (cryptocurrency collection)
@ -116,25 +143,32 @@ are used to collect currency rates.
```yaml ```yaml
... ...
currency: currency:
chart: {
save: false # Enable or disable saving graphs to an image (Boolean) collecting:
collecting: {
fiat: true # Turn off or turn on the collection of the fiat currency rate [Boolean] fiat: true
crypto: false crypto: false
schedule: '30 8 * * *' # Currency collection schedule in crontab format [String] schedule: 30 8 * * *
crypto_apikey: 'APIKEY' crypto_apikey: TOKEN
fiat: # List of fiat currency to save the exchange rate [Array] }
- USD fiat:
- RUB [
- EUR USD
- UAH RUB
- TRY EUR
- KZT UAH
crypto: TRY
- ETH KZT
- TON ]
- USDT crypto:
[
ETH
TON
USDT
BTC
]
}
``` ```
- `currency.chart.save`: Enable or disable saving graphs. - `currency.chart.save`: Enable or disable saving graphs.