fork refine

This commit is contained in:
Stefan Pejcic
2024-02-05 10:23:04 +01:00
parent 3fffde9a8f
commit 8496a83edb
3634 changed files with 715528 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
{
"label": "Advanced",
"position": 99,
"link": {
"type": "generated-index"
}
}

View File

@@ -0,0 +1,116 @@
---
sidebar_position: 9
---
# API
## Basic Authentication
OpenPanel API uses JWT tokens for authentication.
### Generate access token
Send POST request to /api with your username and password:
```bash
curl -X POST -H "Content-Type: application/json" -d '{"username":"USERNAME_HERE", "password":"PASSWORD_HERE"}' https://OPENPANEL:2087/api
```
Example response:
```json
{
"name": "string"
}
```
### Check if token is valid
```bash
curl -H "Authorization: Bearer JWT_TOKEN" https://OPENPANEL:2087/api/whoami
```
Example response:
```json
{
"logged_in_as": "user"
}
```
## Users
### List All Users
```bash
curl -H "Authorization: Bearer JWT_TOKEN" https://OPENPANEL:2087/api/users
```
Example response:
```json
{
{
"users": [
[
12,
"SUSPENDED_20240103122300_jasta",
"pbkdf2:sha256:260000$G26Nw1zBQ6yywbiG$6a0d321490842b58068ad44e6e21b96e89f42cb6daecebe3afc06ad447ef3785",
"jasta",
"1,2,3,4,5,6,7,8,9,10,11,12",
"",
0,
null,
null,
"Tue, 02 Jan 2024 19:44:25 GMT",
2,
"cloud_4_nginx"
],
[
13,
"example_user",
"pbkdf2:sha256:260000$EIkp3AkT9OBPDtr1$956594ccc6aaa2c24c528f98eacadee7ac35193578b32dc415b2402fa9a22595",
"user@example.com",
"1,2,3,4,5,6,7,8,9,10,11,12",
"",
0,
null,
null,
"Tue, 09 Jan 2024 14:18:56 GMT",
2,
"cloud_4_apache"
]
]
}
}
```
### List Single User
```bash
curl -H "Authorization: Bearer JWT_TOKEN" https://OPENPANEL:2087/api/users/stefan
```
Example response:
```json
{
{
"users": [
[
15,
"stefan",
"pbkdf2:sha256:260000$EIkp3AkT9OBPDtr1$956594ccc6aaa2c24c528f98eacadee7ac35193578b32dc415b2402fa9a22595",
"user@example.com",
"1,2,3,4,5,6,7,8,9,10,11,12",
"",
0,
null,
null,
"Tue, 09 Jan 2024 14:18:56 GMT",
2,
"cloud_4_apache"
]
]
}
}
```
### Create User

View File

@@ -0,0 +1,49 @@
---
sidebar_position: 9
---
# Localization
OpenPanel is localization ready and can easily be translated into any language.
## Available Locales
OpenPanel is shipped with the following locales:
- English (EN)
## How to translate
To translate OpenPanel to another language, for example Serbian:
1. Navigate to the OpenPanel directory using the "cd" command:
```bash
cd /usr/local/panel
```
2. Initialize a new translations directory for your locale:
```bash
pybabel init -i messages.pot -d translations -l sr
```
3. Enter the newly created locale directory and edit the messages.po file. For each `msgid` write the translation in the `msgtr` tag, for example:
```bash title="/usr/local/panel/translations/sr/LC_MESSAGES/messages.po"
#: templates/base.html:237
msgid "Websites"
msgstr "Sajtovi"
```
4. After you are finished translating, you need to compile the edited `.po` file to `.mo` in order to be used by the panel:
```bash
pybabel compile -d translations
```
Thats it, your new locale is added and ready to be used.
:::info
If you would like to share your translation with the OpenPanel community, please email the content of your locale folder `/usr/local/panel/translations/<LOCALE-HERE>/LC_MESSAGES/` to support@openpanel.co
:::

View File

@@ -0,0 +1,11 @@
---
sidebar_position: 5
---
# Troubleshooting
## Logging
multitail /var/log/nginx/access.log -I /var/log/nginx/error.log