mirror of
https://github.com/Redume/Kekkai.git
synced 2025-03-12 19:44:39 +03:00
docs: Wrote pages for the configs
This commit is contained in:
parent
102790613f
commit
8e1e9fe3c7
4 changed files with 228 additions and 0 deletions
|
@ -43,6 +43,23 @@ export default defineConfig({
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Config',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
label: 'Configure .env',
|
||||||
|
slug: 'docs/config/config-env'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Configure config.yaml',
|
||||||
|
slug: 'docs/config/config-yaml'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Configure Nginx',
|
||||||
|
slug: 'docs/config/config-nginx'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|
31
docs/src/content/docs/docs/config/config-env.mdx
Normal file
31
docs/src/content/docs/docs/config/config-env.mdx
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
---
|
||||||
|
title: Configure .env
|
||||||
|
---
|
||||||
|
|
||||||
|
import { Aside, Code } from '@astrojs/starlight/components';
|
||||||
|
|
||||||
|
Kekkai can be configured using the `.env` file in the working directory. `.env.example`.
|
||||||
|
|
||||||
|
`.env` config is used to configure PosgreSQL running in Docker Compose.
|
||||||
|
|
||||||
|
<Aside>
|
||||||
|
If you are not using Docker Compose, you do not need to edit this config
|
||||||
|
</Aside>
|
||||||
|
|
||||||
|
<Code code=
|
||||||
|
'
|
||||||
|
# Connection secret for postgres. You should change it to a random password
|
||||||
|
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
|
||||||
|
|
||||||
|
POSTGRES_PASSWORD=my_password
|
||||||
|
|
||||||
|
# If you do not know what you are doing, then you should not edit the values below
|
||||||
|
###################################################################################
|
||||||
|
POSTGRES_DB=kekkai
|
||||||
|
DB_HOST=postgres
|
||||||
|
POSTGRES_USER=postgres
|
||||||
|
' title='.env.example'/>
|
||||||
|
|
||||||
|
This config only edits the password for PosgreSQL.
|
||||||
|
|
||||||
|
Please use only the characters `A-Za-z0-9`, without special characters or spaces
|
32
docs/src/content/docs/docs/config/config-nginx.mdx
Normal file
32
docs/src/content/docs/docs/config/config-nginx.mdx
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
---
|
||||||
|
title: Nginx configuration
|
||||||
|
---
|
||||||
|
|
||||||
|
import { Code } from '@astrojs/starlight/components';
|
||||||
|
|
||||||
|
Kekkai is used by `Nginx` to redirect to the correct microservice.
|
||||||
|
|
||||||
|
## Change domain
|
||||||
|
|
||||||
|
Change localhost to your `domain` or `ipv4` based on your needs.
|
||||||
|
If you need to use Kekkai locally, you don't need to change anything,
|
||||||
|
|
||||||
|
<Code code='
|
||||||
|
...
|
||||||
|
server_name localhost; # Your domain
|
||||||
|
...
|
||||||
|
'title='nginx.conf'/>
|
||||||
|
|
||||||
|
|
||||||
|
## Change name for SSL
|
||||||
|
This is where the name of the SSL files changes. This needs to be edited if you have a different one
|
||||||
|
|
||||||
|
Change `privkey.pem` and `fullchain.pem` to the names of the files you have.
|
||||||
|
|
||||||
|
<Code code=
|
||||||
|
'
|
||||||
|
...
|
||||||
|
ssl_certificate /etc/nginx/ssl/fullchain.pem;
|
||||||
|
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
|
||||||
|
...
|
||||||
|
' title='nginx.conf'/>
|
148
docs/src/content/docs/docs/config/config-yaml.mdx
Normal file
148
docs/src/content/docs/docs/config/config-yaml.mdx
Normal file
|
@ -0,0 +1,148 @@
|
||||||
|
---
|
||||||
|
title: Configure config.yaml
|
||||||
|
---
|
||||||
|
|
||||||
|
import { Aside } from '@astrojs/starlight/components';
|
||||||
|
|
||||||
|
Kekkai can be configured using the `config.yaml` file in the working directory.
|
||||||
|
`config.example.yaml`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# 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:
|
||||||
|
fiat: true
|
||||||
|
schedule: '30 8 * * *'
|
||||||
|
fiat:
|
||||||
|
- USD
|
||||||
|
- RUB
|
||||||
|
- EUR
|
||||||
|
- UAH
|
||||||
|
- TRY
|
||||||
|
- KZT
|
||||||
|
```
|
||||||
|
|
||||||
|
## Database
|
||||||
|
Kekkai is used as a `PostgreSQL` database.
|
||||||
|
|
||||||
|
<Aside>
|
||||||
|
If you installed Kekkai via Docker Compose,
|
||||||
|
then install it in the `database.host` value of `postgres`.
|
||||||
|
The rest of the data does not have to be filled in.
|
||||||
|
They need to be filled in `.env`.
|
||||||
|
|
||||||
|
What should it look like:
|
||||||
|
```yaml
|
||||||
|
database:
|
||||||
|
...
|
||||||
|
host: 'postgres'
|
||||||
|
...
|
||||||
|
...
|
||||||
|
```
|
||||||
|
</Aside>
|
||||||
|
|
||||||
|
## Server
|
||||||
|
<Aside>
|
||||||
|
If you installed Kekkai via Docker Compose, then changing `server.host`, `
|
||||||
|
server.ssl` is not recommended.
|
||||||
|
</Aside>
|
||||||
|
|
||||||
|
### SSL
|
||||||
|
Create a folder CertSSL to store your certificates
|
||||||
|
```shell
|
||||||
|
mkdir CertSSL
|
||||||
|
```
|
||||||
|
|
||||||
|
Copy your certificates to the CertSSL folder.
|
||||||
|
|
||||||
|
It is recommended to rename the certificates to `privkey.pem` and `fullchain.pem`.
|
||||||
|
If this is not possible,
|
||||||
|
you need to change the SSL name in `nginx.conf` (if using Docker Compose)
|
||||||
|
|
||||||
|
## Analytics
|
||||||
|
Kekkai uses [`Plausbile`](https://plausible.io/) as an analyst.
|
||||||
|
Minimal data is transferred for anilithics.
|
||||||
|
Such as: browser, OS, status code, url, where the user came from.
|
||||||
|
Most of the data is built on User Agent.
|
||||||
|
It is possible to disable analytics in Kekkai.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
...
|
||||||
|
analytics:
|
||||||
|
plausible_api: 'https://plausible.io/api/event/'
|
||||||
|
plausible_domain: 'PLAUSIBLE_DOMAIN'
|
||||||
|
plausible_token: 'PLAUSIBLE_TOKEN'
|
||||||
|
work: true
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
- `plausible_api`: This is where the Plausible instance is specified.
|
||||||
|
The official instance is specified by default.
|
||||||
|
- `plausible_domain`: Kekkai Instance Domain.
|
||||||
|
It should be added to Plausible first, and then to the config.
|
||||||
|
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.
|
||||||
|
|
||||||
|
## Currency
|
||||||
|
`DuckDuckGo` (fiat currency collection) and `CoinMarketCap` (cryptocurrency collection)
|
||||||
|
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]
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|
||||||
|
- `currency.chart.save`: Enable or disable saving graphs.
|
||||||
|
- `currency.collecting`: Enable or disable cryptocurrency
|
||||||
|
or fiat currency exchange rate collection.
|
||||||
|
- `currency.schedule`: Currency collection interval (Configurable via cron.
|
||||||
|
It is recommended to use [crontab.guru](https://crontab.guru),
|
||||||
|
not supported in `Non-standard format`, like `@daily`).
|
||||||
|
- `crypto.crypto_apiKey`: API-key from CoinMarketCap service
|
||||||
|
- `currency.fiat`: A list of fiat currencies that will be saved to the database.
|
||||||
|
- `currency.crypto`: A list of crypto currencies that will be saved to the database.
|
Loading…
Add table
Add a link
Reference in a new issue