From f79d2b166a4ac773d04319b2d211c1b7a0172862 Mon Sep 17 00:00:00 2001 From: Redume Date: Wed, 5 Mar 2025 22:27:36 +0300 Subject: [PATCH] docs: Rename the file, replace the examples with a new config --- docs/astro.config.mjs | 4 +- .../{config-yaml.mdx => config-hjson.mdx} | 162 +++++++++++------- 2 files changed, 100 insertions(+), 66 deletions(-) rename docs/src/content/docs/docs/config/{config-yaml.mdx => config-hjson.mdx} (59%) diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index e310848..cf37752 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -51,8 +51,8 @@ export default defineConfig({ slug: 'docs/config/config-env' }, { - label: 'Configure config.yaml', - slug: 'docs/config/config-yaml' + label: 'Configure config.hjson', + slug: 'docs/config/config-hjson' }, { label: 'Configure Nginx', diff --git a/docs/src/content/docs/docs/config/config-yaml.mdx b/docs/src/content/docs/docs/config/config-hjson.mdx similarity index 59% rename from docs/src/content/docs/docs/config/config-yaml.mdx rename to docs/src/content/docs/docs/config/config-hjson.mdx index dcd0885..fe649ce 100644 --- a/docs/src/content/docs/docs/config/config-yaml.mdx +++ b/docs/src/content/docs/docs/config/config-hjson.mdx @@ -1,66 +1,93 @@ --- -title: Configure config.yaml +title: Configure config.hjson --- import { Aside } from '@astrojs/starlight/components'; -Kekkai can be configured using the `config.yaml` file in the working directory. -`config.example.yaml`. +Kekkai can be configured using the `config.hjson` file in the working directory. +`config.example.hjson`. -```yaml +```hjson # For more information, see the documentation # https://kekkai-docs.redume.su/ -database: - user: 'DATABASE_USERNAME' - password: 'DATABASE_PASSWORD' - host: 'DATABASE_HOST' - name: 'DATABASE_NAME' - port: 5432 -server: - host: '0.0.0.0' - ssl: - private_key: '/CertSSL/privkey.pem' - cert: '/CertSSL/fullchain.pem' - work: true - log: - print: true - level: 'info' -analytics: - plausible_api: 'https://plausible.io/api/event/' - plausible_domain: 'PLAUSIBLE_DOMAIN' - plausible_token: 'PLAUSIBLE_TOKEN' - work: false -currency: - chart: - save: false - collecting: +{ + database: + { + user: DATABASE_USERNAME + password: DATABASE_PASSWORD + host: localhost + name: kekkai + port: 5432 + } + server: + { + host: 0.0.0.0 + ssl: + { + private_key: /CertSSL/privkey.pem + cert: /CertSSL/fullchain.pem + enabled: false + } + log: + { + level: info + } + } + analytics: + { + plausible_domain: plausible.io + plausible_token: TOKEN + enabled: false + } + currency: + { + collecting: + { fiat: true - schedule: '30 8 * * *' - fiat: - - USD - - RUB - - EUR - - UAH - - TRY - - KZT + crypto: false + schedule: 30 8 * * * + crypto_apikey: TOKEN + } + fiat: + [ + USD + RUB + EUR + UAH + TRY + KZT + ] + crypto: + [ + ETH + TON + USDT + BTC + ] + } + } ``` ## Database Kekkai is used as a `PostgreSQL` database. @@ -96,7 +123,7 @@ analytics: plausible_api: 'https://plausible.io/api/event/' plausible_domain: 'PLAUSIBLE_DOMAIN' 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). - `plausible_token`: Api token for authorization and sending requests. You can create it [here](https://plausible.io/settings/api-keys). -- `work`: Enable or disable analytics. +- `enabled`: Enable or disable analytics. ## Currency `DuckDuckGo` (fiat currency collection) and `CoinMarketCap` (cryptocurrency collection) @@ -116,25 +143,32 @@ are used to collect currency rates. ```yaml ... -currency: - chart: - save: false # Enable or disable saving graphs to an image (Boolean) - collecting: - fiat: true # Turn off or turn on the collection of the fiat currency rate [Boolean] + currency: + { + collecting: + { + fiat: true crypto: false - schedule: '30 8 * * *' # Currency collection schedule in crontab format [String] - crypto_apikey: 'APIKEY' - fiat: # List of fiat currency to save the exchange rate [Array] - - USD - - RUB - - EUR - - UAH - - TRY - - KZT - crypto: - - ETH - - TON - - USDT + schedule: 30 8 * * * + crypto_apikey: TOKEN + } + fiat: + [ + USD + RUB + EUR + UAH + TRY + KZT + ] + crypto: + [ + ETH + TON + USDT + BTC + ] + } ``` - `currency.chart.save`: Enable or disable saving graphs.