Merge branch 'main' into tweak/prometheus-metrics-doc

This commit is contained in:
Zedifus
2025-11-24 13:09:49 +00:00
47 changed files with 2494 additions and 204 deletions

View File

@@ -30,10 +30,10 @@ pages:
mkdocs-monorepo-plugin
mkdocs-multirepo-plugin
mkdocs_pymdownx_material_extras
mkdocs-redirects
mkdocs-safe-text-plugin
mkdocs-simple-hooks
mkdocs-redirects
mkdocs-render-swagger-plugin
mkdocs-swagger-ui-tag
mkdocs-versioning
mkdocs-with-confluence
mkdocstrings

View File

@@ -25,9 +25,10 @@ RUN apk add gcc musl-dev python3-dev py3-regex py3-pynacl py3-ruamel.yaml && \
mkdocs-monorepo-plugin \
mkdocs-multirepo-plugin \
mkdocs_pymdownx_material_extras \
mkdocs-redirects \
mkdocs-safe-text-plugin \
mkdocs-simple-hooks \
mkdocs-redirects \
mkdocs-swagger-ui-tag \
mkdocs-render-swagger-plugin \
mkdocs-versioning \
mkdocs-with-confluence \

11
README.md Normal file
View File

@@ -0,0 +1,11 @@
# Crafty 4 Documentation
WIP
*Todo: Make pretty README.md*
#### DEV Env (Basic)
```
$ docker build -t craftydoc .
$ docker run --rm -p 8000:8000 -v "<path-to-repo-ie-pwd>:/src/" craftydoc
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 73 KiB

View File

@@ -15,7 +15,7 @@ hide:
<img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg" />
</a>
<a href="https://www.python.org" target="_blank">
<img alt="Supported Python Versions" src="https://shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20-blue">
<img alt="Supported Python Versions" src="https://shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20-blue">
</a>
<a href="https://gitlab.com/crafty-controller/crafty-4/-/releases" target="_blank">
<img alt="Crafty Version" src="https://img.shields.io/gitlab/v/tag/20430749?label=release" />

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +0,0 @@
!!! info "Please Note"
Developer Guide docs are largely incomplete.<br><br>
**Check Back Later!**
In the meantime please use the old docs: [API v2 Documentation Reference](https://wiki.craftycontrol.com/en/4/docs/API%20V2){:target="_blank"}

View File

@@ -1,5 +1,8 @@
!!! info "Please Note"
Developer Guide docs are largely incomplete.<br><br>
**Check Back Later!**
---
hide:
- toc
---
In the meantime please use the old docs: [API v2 Documentation Reference](https://wiki.craftycontrol.com/en/4/docs/API%20V2){:target="_blank"}
<swagger-ui src="openapi-spec.yml" />
If the interactive UI does not render, you can view the raw OpenAPI spec here: [openapi-spec.yml](openapi-spec.yml)

View File

@@ -9,6 +9,7 @@ The issue template will provide the following sections to structure your issue:
- **Quick Information:**
- **Operating System:** Windows / Linux / MacOS / UnRAID
- **Install Type:** Git Cloned (Manual) / Installer / WinPackage / Docker
- **Crafty Version:** v4.x.x
- **What Happened?**
*A brief description of what happened when you tried to perform an action.*

View File

@@ -15,9 +15,10 @@ While creating the issue, please include the following information:
- [ ] **High Priority/Severity:** Documentation issues that significantly impact understanding or usage, such as critical inaccuracies, misleading instructions, or missing essential information.
- [ ] **Medium Priority/Severity:** Documentation issues that affect usability or comprehension, but with less immediate impact, such as minor inaccuracies, unclear explanations, or inconsistent terminology.
- [ ] **Low Priority/Severity:** Documentation issues that are cosmetic or have minimal impact on understanding or usage, such as minor typos, formatting inconsistencies, or suggestions for minor improvements.
<center>
<div class="center-content" markdown>
{>>An issue template will be made soon<<} <!-- -TODO Make issue templates -->
</center>
</div>
By reporting documentation issues, you contribute to enhancing the overall experience for our community.

View File

@@ -1,5 +1,5 @@
# Contributing
<center>
<div class="center-content" markdown>
Welcome to Crafty's contributing community! 🚀
We greatly appreciate your involvement in improving Crafty and making it even better for everyone. There are several ways you can contribute and help us enhance the overall experience.
@@ -9,7 +9,7 @@ By actively participating in these areas, you contribute to the growth and impro
Thank you for your contributions and for being a part of our journey!
Together, we can make Crafty the best it can be! ✨
</center>
</div>
### Creating an issue

View File

@@ -18,7 +18,7 @@ Once you reach the Crafty webpage you will be greeted with a login screen.
The default `admin` credentials are generated and stored in `app/config/default-creds.txt`.<br>
* **On Linux** distros you must use the crafty system user to access this file.<br>
* **On Linux** <br>
Example: *assuming Crafty is installed in the default location*
```shell
sudo cat /var/opt/minecraft/crafty/crafty-4/app/config/default-creds.txt
@@ -46,7 +46,7 @@ Once you are logged in you will see this welcome screen. **This is your dashboar
-----
<center>
<div class="center-content" markdown>
So you ready to create some servers? I know I am, click the button below!
[Make your first Server :rocket:](../user-guide/server-creation/minecraft.md){ .md-button .md-button--primary }
</center>
</div>

View File

@@ -9,12 +9,16 @@
With Crafty a being Python-based application it is designed to be compatible with a wide range of systems, giving users the flexibility to run it on various platforms. However, to ensure optimal performance and reliability, we have tested it's functionality on a specific set of distributions and can only provide support for those systems.
!!! success "Minecraft Version Compatibility"
<center><bold>Crafty is currently tested on and works running MC Java versions 1.8 - latest<br>
Versions older than 1.8 are not supported - run them at your own risk.</bold></center>
<div class="center-content" markdown>
**Crafty is currently tested on and works running MC Java versions 1.8 - latest**<br>
**Versions older than 1.8 are not supported - run them at your own risk.**
</div>
!!! note ""
<center>**Please refer to the table below for a list of the distributions we have tested and confirmed compatibility with.**<br>
We will not provide direct support to users deploying in untested environments.</center>
<div class="center-content" markdown>
**Please refer to the table below for a list of the distributions we have tested and confirmed compatibility with.**<br>
We will not provide direct support to users deploying in untested environments.
</div>
## Compatibility Chart / Support Matrix
@@ -26,13 +30,14 @@ With Crafty a being Python-based application it is designed to be compatible wit
| Docker | Latest | :material-check: Arcadia Images Only |
| Fedora | 37, 38 | :material-check-all: Full |
| Manjaro | 21, 22 | :material-check-all: Full |
| Mint | 20, 20.2, 20.3, 21 | :material-check-all: Full |
| Mint | 21.2, 21.3, 22 | :material-check-all: Full |
| OSX | 11 (Big Sur), 12 (Monterey), 13 (Ventura) | :material-check-all: Full |
| PopOS | 22.04 | :material-check-all: Full |
| Raspberry Pi OS | 10, 11 | :material-check-all: Full |
| Rocky Linux | 9.2 | :material-check-all: Full |
| Windows | 10, 11 | :material-check-all: Full |
| Windows | 11 | :material-check-all: Full |
| Ubuntu | 22.04, 23.10 | :material-check-all: Full |
| Zorin | 17 | :material-check-all: Full |
| Unraid | Latest | :material-check: Arcadia Image based Template Only |
!!! example "Request a missing distro"

View File

@@ -23,25 +23,28 @@ This file is Crafty's system configuration file, it provides numerous settings w
| Key | Type | Default | Description |
| -------------------------------: | :-------: | :------ | :----------------------------------------------------------------------------------- |
| "allow_nsfw_profile_pictures" | bool | false | Whether or not to allow gravatar defined NSFW PFPs for your local users. |
| "base_url" | str | 127.0.0.1:8443 | The base URL used in things such as webhook notification file download links |
| "big_bucket_repo" | str | https://jars.arcadiatech.org | [Big Bucket](https://gitlab.com/crafty-controller/big-bucket) repo url for server creator |
| "cookie_expire" | int | 30 | How long cookies are valid (days) |
| "crafty_logs_delete_after_days" | int | 0 | How we should keep crafty logs for (days, 0 is never delete) |
| "delete_default_json" | bool | false | Whether to use [default.json](#defaultjson) when starting Crafty for the first time. |
| "delete_default_json" | bool | false | Whether to use [default.json](#what-is-defaultjson) when starting Crafty for the first time. |
| "dir_size_poll_freq_minutes" | int | 5 | How often we should poll directories for their size (minutes)<br>(The more this happens the performance intensive Crafty will be) |
| "disabled_language_files" | list[str] | [ ] | Which languages you would like disabled for users. |
| "disabled_language_files" | list[str] | [ ] | Which languages you would like disabled for users. |
| "enable_otp_skew" | bool | false | Permit the OTP / MFA system to accept one token before current & one token after. |
| "enable_user_self_delete" | bool | false | Can a user delete themselves. |
| "history_max_age" | int | 7 | How long we should hold onto stats in the database for. (days) |
| "http_port" | int | 8000 | Port for our http redirect server |
| "https_port" | int | 8443 | Port for Crafty's main secure webserver. |
| "keywords" | list[str] | [ <br>"help",<br>"chunk"<br> ] | Keywords that will be highlighted in the terminal and in the logs page. |
| "language" | str | "en_EN" | Default Crafty instance language.<br>(This is for login page and any public pages with translations enabled) |
| "max_audit_entries" | int | 300 | How many audit log entries we will keep in the DB. |
| "max_log_lines" | int | 700 | How many lines of logs we will keep on the logs page. |
| "max_login_attempts" | int | 3 | How many login attempts are permitted before cooldown triggers. |
| "monitored_mounts" | str | "C:\\" | Mount points that will appear under 'storage monitoring' on the dashboard. |
| "reset_secrets_on_next_boot" | bool | false | Should we reset the key secrets on the next boot? |
| "show_contribute_link" | bool | true | Show the link to contributors on the navigation of Crafty. |
| "show_errors" | bool | true | Should we show traceback errors on the page<br>(This helps us with debugging when you come in with issues. 👷‍♂️) |
| "stats_update_frequency_seconds" | int | 30 | How often we poll your server for stats. (seconds) |
| "superMFA" | bool | false | Enforces MFA to be configured for 'super users' if `true` |
| "virtual_terminal_lines" | int | 70 | How many lines we should save in your server's terminal buffer. |
## Changing the server storage location

View File

@@ -0,0 +1,50 @@
# Installing Crafty on CasaOS :material-cloud:
!!! abstract "Important note on App Stores"
Only the official app store version of Crafty Controller is supported. Alternate appstores may work but you will not be able to receive support for them.
## Installation
1. Ensure you are on the latest version of CasaOS. Go into the CasaOS settings and check that it says you are **"Currently, at the latest version."**
<figure markdown>
![CasaOS Settings Button](../../../img/page-assets/getting-started/installation/casaos/01.jpg)
<figcaption>CasaOS Settings Button</figcaption>
</figure>
2. Open the app store and press the 'Install' button for the Crafty app
<figure markdown>
![Installing Crafty](../../../img/page-assets/getting-started/installation/casaos/02.jpg)
<figcaption>Installing Crafty</figcaption>
</figure>
3. Get your randomly generated password from the files app at:<br>`DATA > AppData > crafty > config > default-creds.txt`
You should see the username of `admin` and a 64 character long randomly generated password.
!!! warning "Do not change your password here, this file does not control your password!"
<figure markdown>
![Crafty Password](../../../img/page-assets/getting-started/installation/casaos/03.jpg)
<figcaption>Crafty Password</figcaption>
</figure>
## Updating Crafty on CasaOS
1. Open the context menu for the Crafty app in CasaOS and go to the app settings.
<figure markdown>
![CasaOS App Settings](../../../img/page-assets/getting-started/installation/casaos/04.jpg)
<figcaption>CasaOS App Settings</figcaption>
</figure>
2. Set the app's tag to `latest` or your desired version of Crafty. Then restart the app.
<figure markdown>
![App Version Tag](../../../img/page-assets/getting-started/installation/casaos/05.jpg)
<figcaption>App Version Tag</figcaption>
</figure>
-----
## Post-Install
<div class="center-content" markdown>
Excellent, by this point you should have successfully stood up your crafty instance!<br>
Great work, You're ready to proceed to the next step 🎉<br>
[How to access the dashboard :material-application-import:](../access.md){ .md-button }
</div>

View File

@@ -139,26 +139,24 @@ The Crafty Docker images can be deployed in multiple ways:
=== "Pre-built image `docker-compose.yml`"
``` yaml linenums="1"
version: '3'
services:
crafty:
container_name: crafty_container
image: registry.gitlab.com/crafty-controller/crafty-4:latest
restart: always
environment:
- TZ=Etc/UTC
ports:
- "8443:8443" # HTTPS
- "8123:8123" # DYNMAP
- "19132:19132/udp" # BEDROCK
- "25500-25600:25500-25600" # MC SERV PORT RANGE
volumes:
- ./docker/backups:/crafty/backups
- ./docker/logs:/crafty/logs
- ./docker/servers:/crafty/servers
- ./docker/config:/crafty/app/config
- ./docker/import:/crafty/import
crafty:
container_name: crafty_container
image: registry.gitlab.com/crafty-controller/crafty-4:latest
restart: always
environment:
- TZ=Etc/UTC
ports:
- "8443:8443" # HTTPS
- "8123:8123" # DYNMAP
- "19132:19132/udp" # BEDROCK
- "25500-25600:25500-25600" # MC SERV PORT RANGE
volumes:
- ./docker/backups:/crafty/backups
- ./docker/logs:/crafty/logs
- ./docker/servers:/crafty/servers
- ./docker/config:/crafty/app/config
- ./docker/import:/crafty/import
```
``` shell
docker-compose up -d && docker-compose logs -f
@@ -166,26 +164,24 @@ The Crafty Docker images can be deployed in multiple ways:
=== "Portainer Stack :simple-portainer:"
``` yaml linenums="1"
version: '3'
services:
crafty:
container_name: crafty_container
image: registry.gitlab.com/crafty-controller/crafty-4:latest
restart: always
environment:
- TZ=Etc/UTC
ports:
- "8443:8443" # HTTPS
- "8123:8123" # DYNMAP
- "19132:19132/udp" # BEDROCK
- "25500-25600:25500-25600" # MC SERV PORT RANGE
volumes:
- /srv/docker/crafty-4/backups:/crafty/backups
- /srv/docker/crafty-4/logs:/crafty/logs
- /srv/docker/crafty-4/servers:/crafty/servers
- /srv/docker/crafty-4/config:/crafty/app/config
- /srv/docker/crafty-4/import:/crafty/import
crafty:
container_name: crafty_container
image: registry.gitlab.com/crafty-controller/crafty-4:latest
restart: always
environment:
- TZ=Etc/UTC
ports:
- "8443:8443" # HTTPS
- "8123:8123" # DYNMAP
- "19132:19132/udp" # BEDROCK
- "25500-25600:25500-25600" # MC SERV PORT RANGE
volumes:
- /srv/docker/crafty-4/backups:/crafty/backups
- /srv/docker/crafty-4/logs:/crafty/logs
- /srv/docker/crafty-4/servers:/crafty/servers
- /srv/docker/crafty-4/config:/crafty/app/config
- /srv/docker/crafty-4/import:/crafty/import
```
!!! note ""
Notice, we've chosen **absolute paths** instead of the other examples that use **relative**!
@@ -233,14 +229,14 @@ The following is a list of the ports that are required:
left most option(external) in the previous examples.
``` yaml
---Engine ---
# Engine
-p external:internal
---Compose---
# Compose
services:
crafty:
ports:
- "external:internal";
crafty:
ports:
- "external:internal";
```
You can as well bind host networking as another option, This is pretty overkill and This will discard any published ports, It is useful to optimize performance in situations where a large range of ports is required...<br>
@@ -311,11 +307,13 @@ Crafty does not have any built in backup/restore methods currently, This is some
-----
## Post-Install
<center>
Excellent, by this point you should have successfully stood up your crafty instance!<br>
Great work, You're ready to proceed to the next step 🎉<br>
<div class="center-content" markdown>
Excellent, by this point you should have successfully stood up your Crafty instance!
Great work, you're ready to proceed to the next step 🎉
[How to access the dashboard :material-application-import:](../access.md){ .md-button }
</center>
</div>
## Troubleshooting / FAQ

View File

@@ -157,23 +157,18 @@ If you get stuck or [Need help? Click here!](../../developer-guide/contributing/
=== "Update After Automated Install Script"
``` shell
cd /var/opt/minecraft/crafty
```
``` shell
sudo su crafty
```
``` shell
./update_crafty.sh
sudo -u crafty /var/opt/minecraft/crafty/update_crafty.sh
```
=== "Update After Manual Install"
``` shell
cd /var/opt/minecraft/crafty/crafty-4
sudo su crafty
```
``` shell
sudo su crafty
cd /var/opt/minecraft/crafty/crafty-4
```
``` shell
git fetch && git pull
@@ -194,8 +189,8 @@ If you get stuck or [Need help? Click here!](../../developer-guide/contributing/
-----
## Post-Install
<center>
<div class="center-content" markdown>
Excellent, by this point you should have successfully stood up your crafty instance!<br>
Great work, You're ready to proceed to the next step 🎉<br>
[How to access the dashboard :material-application-import:](../access.md){ .md-button }
</center>
</div>

View File

@@ -161,8 +161,8 @@ pip3 install -r requirements.txt --no-cache-dir
-----
### Post-Install
<center>
<div class="center-content" markdown>
Excellent, by this point you should have successfully stood up your crafty instance!<br>
Great work, You're ready to proceed to the next step 🎉<br>
[How to access the dashboard :material-application-import:](../access.md){ .md-button }
</center>
</div>

View File

@@ -47,8 +47,8 @@ The following is a list of the ports that are required:
-----
## Post-Install
<center>
<div class="center-content" markdown>
Excellent, by this point you should have successfully stood up your crafty instance!<br>
Great work, You're ready to proceed to the next step 🎉<br>
[How to access the dashboard :material-application-import:](../access.md){ .md-button }
</center>
</div>

View File

@@ -12,7 +12,7 @@
The Windows Portable build comes with an updater packaged with it, simple as launching the updater and following the prompts 🚀
## Crafty Windows Service :material-server: <sub><small>beta</small></sub>
> A .Net6 based Windows Service to run Crafty as a service on Windows
> A .Net based Windows Service to run Crafty as a service on Windows
### Contents of the package
| File | Description |
@@ -28,7 +28,10 @@ The Windows Portable build comes with an updater packaged with it, simple as lau
**Requirements:**
- Windows 10 or 11
- [.NET 6](https://dotnet.microsoft.com/download/dotnet/6.0){:target="_blank"} or Higher
- [.NET 8](https://dotnet.microsoft.com/download/dotnet/8.0){:target="_blank"} or Higher
- [Python3](https://www.python.org/downloads/windows){:target="_blank"}
- [Git](https://git-scm.com/downloads/win){:target="_blank"}
- [Rust Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html){:target="_blank"}
- Internet Connection to download Crafty Files
-----
@@ -44,8 +47,10 @@ The Windows Portable build comes with an updater packaged with it, simple as lau
7. The `PowerShell` console can be closed.
??? warning "What to do if a login failure appears?"
<center>During the installation if you recieve "Error 1069: The Service did not start due to login failure."
![Service login failure example](../../../img/page-assets/getting-started/installation/windows/Crafty_ServiceCantStart.png)</center>
<div class="center-content" markdown>
During the installation if you recieve "Error 1069: The Service did not start due to login failure."
![Service login failure example](../../../img/page-assets/getting-started/installation/windows/Crafty_ServiceCantStart.png)
</div>
1. Open the **Services Manager**.
2. Go to the Crafty Service properties.
@@ -72,7 +77,10 @@ The Windows Portable build comes with an updater packaged with it, simple as lau
**Requirements:**
- Windows 2016 or Higher
- [.NET 6](https://dotnet.microsoft.com/download/dotnet/6.0){:target="_blank"} or Higher
- [.NET 8](https://dotnet.microsoft.com/download/dotnet/8.0){:target="_blank"} or Higher
- [Python3](https://www.python.org/downloads/windows){:target="_blank"}
- [Git](https://git-scm.com/downloads/win){:target="_blank"}
- [Rust Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html){:target="_blank"}
- Internet Connection to download Crafty Files
-----
@@ -101,8 +109,10 @@ The Windows Portable build comes with an updater packaged with it, simple as lau
7. You need to add the Crafty User at the `Open a session as a service`
??? warning "What to do if a login failure appears?"
<center>During the installation if you recieve "Error 1069: The Service did not start due to login failure."
![Service login failure example](../../../img/page-assets/getting-started/installation/windows/Crafty_ServiceCantStart.png)</center>
<div class="center-content" markdown>
During the installation if you recieve "Error 1069: The Service did not start due to login failure."
![Service login failure example](../../../img/page-assets/getting-started/installation/windows/Crafty_ServiceCantStart.png)
</div>
1. Open the **Services Manager**.
2. Go to the Crafty Service properties.
@@ -181,9 +191,9 @@ The Windows Portable build comes with an updater packaged with it, simple as lau
-----
## Post-Install
<center>
<div class="center-content" markdown>
Excellent, by this point you should have successfully stood up your crafty instance!<br>
Great work, You're ready to proceed to the next step 🎉<br>
[How to access the dashboard :material-application-import:](../access.md){ .md-button }
</center>
</div>

View File

@@ -151,61 +151,58 @@ Reverse proxies are used to make hosted applications accessible to the internet,
```
``` yaml title="Monolithic docker-compose.yml"
version: "3"
services:
swag:
image: linuxserver/swag
container_name: swag
cap_add:
- NET_ADMIN
networks:
- swag
environment:
- PUID=${USER_ID}
- PGID=${GROUP_ID}
- TZ=${TZ}
- URL=${URL}
- SUBDOMAINS=${SUBDOMAINS}
- VALIDATION=http
- DNSPLUGIN=cloudflare #optional
- PROPAGATION= #optional
- DUCKDNSTOKEN= #optional
- EMAIL=${EMAIL} #optional
- ONLY_SUBDOMAINS=${ONLY_SUBDOMAINS} #optional
- EXTRA_DOMAINS= #optional
- STAGING=false #optional Set staging to true so you don't get rate limited by LetsEncrypt if you're having issues with cert gen
volumes:
- ./swag:/config
ports:
- 443:443
- 80:80 #optional
restart: unless-stopped
crafty:
container_name: crafty_container
image: registry.gitlab.com/crafty-controller/crafty-4:latest
restart: unless-stopped
depends_on:
- swag
environment:
- TZ=Etc/UTC
ports:
- "8000:8000" # HTTP
- "8443:8443" # HTTPS
- "8123:8123" # DYNMAP
- "19132:19132/udp" # BEDROCK
- "25500-25600:25500-25600" # MC SERV PORT RANGE
volumes:
- ./crafty/backups:/crafty/backups
- ./crafty/logs:/crafty/logs
- ./crafty/servers:/crafty/servers
- ./crafty/config:/crafty/app/config
- ./crafty/import:/crafty/import
networks:
- swag
swag:
image: linuxserver/swag
container_name: swag
cap_add:
- NET_ADMIN
networks:
- swag
environment:
- PUID=${USER_ID}
- PGID=${GROUP_ID}
- TZ=${TZ}
- URL=${URL}
- SUBDOMAINS=${SUBDOMAINS}
- VALIDATION=http
- DNSPLUGIN=cloudflare #optional
- PROPAGATION= #optional
- DUCKDNSTOKEN= #optional
- EMAIL=${EMAIL} #optional
- ONLY_SUBDOMAINS=${ONLY_SUBDOMAINS} #optional
- EXTRA_DOMAINS= #optional
- STAGING=false #optional Set staging to true so you don't get rate limited by LetsEncrypt if you're having issues with cert gen
volumes:
- ./swag:/config
ports:
- 443:443
- 80:80 #optional
restart: unless-stopped
crafty:
container_name: crafty_container
image: registry.gitlab.com/crafty-controller/crafty-4:latest
restart: unless-stopped
depends_on:
- swag
networks:
- swag
environment:
- TZ=Etc/UTC
ports:
- "8443:8443" # HTTPS
- "8123:8123" # DYNMAP
- "19132:19132/udp" # BEDROCK
- "25500-25600:25500-25600" # MC SERV PORT RANGE
volumes:
- ./crafty/backups:/crafty/backups
- ./crafty/logs:/crafty/logs
- ./crafty/servers:/crafty/servers
- ./crafty/config:/crafty/app/config
- ./crafty/import:/crafty/import
networks:
swag:
name: swag
swag:
name: swag
```
``` CONF title="./config/nginx/proxy-confs/crafty.subdomain.conf"

View File

@@ -8,9 +8,9 @@ This often overlooked feature provides transparency and real-time updates on whe
Additionally, the status page displays the current player count, offering insights into server activity.
<center>
<div class="center-content" markdown>
## Exempting Servers from the Status Page
If you'd prefer certain servers to not be displayed on the public status page, all you need to do is turn off the toggle on the servers configuration page.
![Public status exempt exxample](../../img/page-assets/getting-started/public-status-page/public-status-page-config.png)
</center>
</divr>

View File

@@ -1,18 +1,24 @@
# Using the Backup Manager :material-backup-restore:
This document provides an overview of Crafty's backup manager. The backup manager is a powerful tool that allows you to create and manage backups of your servers with ease. You can create multiple backup configurations with a number of configurable options per config including, but not limited to; the max number of backups to store, define whether the server should be shut down while backing up, and the backup location.
This document provides an overview of Crafty's backup manager.
The backup manager is a powerful tool that allows you to create and manage backups of your servers with ease.
You can create multiple backup configurations with a number of configurable options per config including, but not limited to; the max number of backups to store, define whether the server should be shut down while backing up, and the backup location.
Moreover, you can specify what data to backup, including files, folders, ensuring that your minecraft worlds always protected. The backup manager is an essential feature to help you safeguard your data and recover from unexpected events.
This document covers essential topics such as configuring backup settings, scheduling backups and restoring data from backups, to help you get started and make the most of this feature."
## Configuring the backup manager
![Backup Page Overview](../../img/page-assets/user-guide/backup-manager/backups-landing.png)
### Default Backup
This is the backup that will be run before any update is done for a particular server. This backup configuration cannot be deleted. The default backup cannot be reassigned to a different configuration
### Create new backup
Click this button to add additional backup configurations.
## Create new/edit backup configuration
![Backup Manager Overview](../../img/page-assets/user-guide/backup-manager/backup-manager-overview.png)
### Backup Name
@@ -41,19 +47,33 @@ It can be useful if you want to perform certain tasks before the server shuts do
### Backup Exclusions
Useful if you want to exclude large directories of non-essential data from your server backups, for example in Minecraft you may want to exclude your dynmap rendered tile data, As it can be huge!
<center>
![Backup Exclusions Example](../../img/page-assets/user-guide/backup-manager/backup-manager-exclusions.png)
<br>Click the "backup exclusions" button to open a menu where you select what paths to exclude in your backup.
<figure markdown="span">
![Backup Exclusions Example](../../img/page-assets/user-guide/backup-manager/backup-manager-exclusions.png)
<figcaption>
Click the "backup exclusions" button to open a menu where you select what paths to exclude in your backup.<br>
<small>Excluded paths will be listed below in the backup menu.</small>
</figcaption>
</figure>
<small>Excluded paths will be listed below in the backup menu.</small>
</center>
### Restore Options
Depending on your exclusions configuration, You may not want to reset the entire server directory on backup restore.
<div class="center-content" markdown>
![Backup Restore Example](../../img/page-assets/user-guide/backup-manager/backup-restore.png)
- For instance, if you manage your backup exclusions to disregard all files except world files, on restore you will be left with a server empty with only your world save.
To avoid this situation you would choose **"Restore backup files in place"**
- If you have a backup that covers all server files, And just want to ensure the server is inthe state it was in when it was backed up, You would go for: <br>**"Restore backup files and reset server directory"**<br>
All current server files will changed to backup state and will be unrecoverable.
</div>
### Schedule Backups
**Hey!** Remember you can schedule backups with the task scheduler,<br>
For more information you should head over to the [scheduler documentation :material-calendar-end:](task-scheduler.md)
-----
<center>
<div class="center-content" markdown>
### Backup Actions
![Backup Actions](../../img/page-assets/user-guide/backup-manager/backup-manager-actions.png)
@@ -64,7 +84,8 @@ For more information you should head over to the [scheduler documentation :mater
##### Delete Backup
<small>Hit the red delete button to delete a specific backup</small>
##### Restore Backup
<small>Hit the yellow restore button to restore a backup, you will be prompted to confirm as all current server files will changed to backup state and will be unrecoverable.</small>
<small>Hit the yellow restore button to restore a backup, you will be prompted with options on how you would like to restore.<br>
See [Restore Options](#restore-options) for more details!</small>
##### Saving your backup config
<small>It's something you may miss but after configuring the backup manager, dont forget to hit save!</small>
</center>
</div>

View File

@@ -6,9 +6,9 @@ Welcome to our Frequently Asked Questions (FAQ) page, where you'll find answers
Before reaching out for support, we recommend using the search feature on our documentation platform to find answers online. Take a moment to review this document, as it may already contain the solution you're looking for.
The FAQ page is regularly updated to provide the latest insights and solutions. It's a resource designed to help you quickly resolve your concerns without the need to contact support.
<center>
<div class="center-content" markdown>
**Happy troubleshooting!** 🥳
</center>
</div>
-----
!!! quote ""
@@ -16,7 +16,9 @@ Welcome to our Frequently Asked Questions (FAQ) page, where you'll find answers
-----
<center>**If your having trouble accessing Crafty after forgetting your password, all is not lost!**</center>
<div class="center-content" markdown>
**If your having trouble accessing Crafty after forgetting your password, all is not lost!**
</div>
By hitting `Forgot Password` on the login screen this will activate the anti lockout user for **1 hour**.
@@ -69,6 +71,51 @@ Welcome to our Frequently Asked Questions (FAQ) page, where you'll find answers
By following these steps, you should be able to set up your Minecraft Forge server successfully within Crafty. If you encounter any issues or need further assistance, don't hesitate to reach out to our support team. Happy crafting!
!!! quote ""
### Setting up Minecraft NeoForge Servers with Crafty
-----
Setting up NeoForge servers with Crafty can be a little tricky. Follow the steps below to ensure a smooth setup process:
1. **Prepare the NeoForge Server:**
- Download the NeoForge "Server Files".
- Run the NeoForge Installer. When the installer window opens make sure to choose the same directory the installer is in. If the installer is in a directory called `/neoforge` make sure to direct the install to `/neoforge`.
- Once extracted, compress the `/neoforge` directory into a zip file called `neoforge.zip`.
2. **Import the NeoForge Server into Crafty:**
- In Crafty's control panel, click on 'Create a Server'.
- Choose the option "upload zip for server import". Upload the `neoforge.zip`.
- Select the root dir. You're looking for the directory with the neoforge installer and a libraries folder in it.
- The server executable will be `libraries/net/neoforged/neoforge/[your-forge-version-do-not-copy]/neoforge-[your-forge-version-do-not-copy]-server.jar`
!!! success ""
To find the neoforge-version you can click on select root dir then expand `libraries/net/neoforged/neoforge`.
The folder inside of neoforge will be named the neoforge version. The installer file should also have this information.
- Fill out the remaining fields.
3. **Update the Server Execution Command:**
- Modify your Server Execution Command in Crafty by adapting the command structure from the import process:
- **For Windows**: Replace the existing command with the following:
```
java -Xms4000M -Xmx4000M @libraries\net\neoforged\neoforge\[your-neoforge-version-do-not-copy]\win_args.txt nogui
```
- **For Linux/MacOS**: Replace the existing command with the following:
```
java -Xms4000M -Xmx4000M @libraries/net/neoforged/neoforge/[your-neoforge-version-do-not-copy]/unix_args.txt nogui
```
- Ensure you are using the correct java version for the server. 1.21 + requires java 21.
4. **Start the NeoForge Server:**
- Save the changes in Crafty and start the server.
- Keep in mind that NeoForge servers may take some time to fully initialize, so please be patient as it loads the necessary resources and displays the information on the terminal.
> **Note:** Be cautious when modifying the Server Execution Command and ensure that you refer to the specific `.bat` or `.sh` file provided by the installer to extract the correct information.
By following these steps, you should be able to set up your Minecraft Forge server successfully within Crafty. If you encounter any issues or need further assistance, don't hesitate to reach out to our support team. Happy crafting!
!!! quote ""
### Setting up Modrinth modpacks with Crafty

View File

@@ -8,7 +8,7 @@ In this document, you will find step-by-step instructions and useful tips on uti
## Working with files
![File manager overview](../../img/page-assets/user-guide/file-manager/file-manager-overview.png)
<center>
<div class="center-content" markdown>
To expand a directory click on the name of the directory.
Opening a file in the editor is as simple as clicking on the file. The file editor can be expanded with the chevrons in the bottom right of the file editor, or toggle the large editor with the <br>`Toggle Editor Size` button.
@@ -19,11 +19,13 @@ The file icon at the bottom of the editor displays save status.<br>
Green with a check mark means saved. :fontawesome-solid-file-circle-check:<br>
Gray with no check mark means unsaved. :fontawesome-regular-file:<br>
<small>(This editor support ctrl + s for saving.)</small>
</center>
</div>
!!! quote ""
![File manager context menu](../../img/page-assets/user-guide/file-manager/file-manager-context.png){ align=left }
![File manager context menu](../../img/page-assets/user-guide/file-manager/file-manager-context.png){ align=left width="300" }
Right clicking on files (holding down on mobile) will open a context menu. It will give you different options depending upon the file type or directory.
Right clicking on files (holding down on mobile) will open a context menu.
It will give you different options depending upon the file type or directory.
## Uploading files
![Upload context example](../../img/page-assets/user-guide/file-manager/file-manager-upload-menu.png){ align=right }
@@ -36,6 +38,3 @@ You may either drag and drop your files into the upload window or you can select
Uploading directories is unfortunately not supported due to restrictions with html, ***BUT*** what you can do is zip up the directory upload the zip, right-click and unzip. The directory will be created with the same name as the zip. :)
![File upload progress example](../../img/page-assets/user-guide/file-manager/file-manager-upload-example.png)
!!! warning ""
<center>⚠️ NOTE: If you are using [Cloudflare Free/Pro](https://www.cloudflare.com/en-gb/plans/){:target="_blank"}, your `Client Max Upload Size` is restricted to `100MB`</center>

View File

@@ -4,5 +4,7 @@
- Server re-ordering is only supported on desktop.
To change the order of your server click on the name of the server and drag it in the desired direction. Once you're hovering over where you would like to place it. Release your mouse button.
![Re-order example](../../img/page-assets/user-guide/server-reordering.gif)
<center><small>Your server is saved in this position automatically</small></center>
<figure markdown="span">
![Re-order example](../../img/page-assets/user-guide/server-reordering.gif)
<figcaption>Your server is saved in this position automatically</figcaption>
</figure>

View File

@@ -11,17 +11,17 @@ Near the bottom you will designate your min/max ram and designate a port. You ca
Remember, with docker you will need to match the ports that you've made available to your container. If you are using the [provided examples](../../getting-started/installation/docker.md#installation), you should have 100 ports to play with.
![Server Builder Panel](../../../img/page-assets/user-guide/server-creation/minecraft/server-builder.png)
<center><small>*Big thank you to [ServerJars](https://serverjars.com){:target="_blank"} for providing the API that serves jar content to this panel.* 💖</small></center>
## Import a server
If you already have a Minecraft server that is already set up, you can import this into Crafty!
Just bare in mind...
Just bear in mind...
When you import a server, we copy the server data into **internal crafty managed directory**.<br> This means that you will need to have double the amount of storage available when importing servers. After the import, you can remove your old copy of your server or keep it as a backup.
=== "Directory Import <sub>Local Storage</sub>"
<center>This option is to import a server that already exists on your harddrive.</center>
<div class="center-content" markdown>
This option is to import a server that already exists on your harddrive.
</div>
!!! example ""
![Directory import example](../../../img/page-assets/user-guide/server-creation/minecraft/server-dir-import.png){ align=left }
@@ -30,7 +30,9 @@ When you import a server, we copy the server data into **internal crafty managed
- The name of the executable file in that server directory.
=== "Zip Import <sub>Local Storage</sub>"
<center>This option is to import a server that is packaged in a zip file on your harddrive.</center>
<div class="center-content" markdown>
This option is to import a server that is packaged in a zip file on your harddrive.
</div>
!!! example ""
Very similar to the directory import but we just need the path where the .zip file is located.
@@ -41,14 +43,14 @@ When you import a server, we copy the server data into **internal crafty managed
You will be directed to a selection screen. Here, you will select the directory you want as your root directory for your server. The root directory in this archive is the one base directory where all the server files are stored so Ill just keep “Files” checked off.
=== "Zip Import <sub>Panel Upload</sub>"
<center>This option is to upload a zip file containing the server files to the dashboard.</center>
<div class="center-content" markdown>
This option is to upload a zip file containing the server files to the dashboard.
</div>
!!! example ""
Very similar to the local zip import, instead we're uploading the zip to the dashboard.
Choose the zip containing your server files and click upload.
⚠️ NOTE: If you are using [Cloudflare Free/Pro](https://www.cloudflare.com/en-gb/plans/){:target="_blank"}, your `Client Max Upload Size` is restricted to `100MB`
Once uploaded, click on <sub><sub>![Root dir select example](../../../img/page-assets/user-guide/server-creation/minecraft/zip-import-root-dir-select.png)</sub></sub>
![root dir select example](../../../img/page-assets/user-guide/server-creation/minecraft/rood-dir-select-example.png)
@@ -73,19 +75,16 @@ When you import a server, we copy the server data into **internal crafty managed
You can start a server from the terminal by clicking the '**Start**' button or from the dashboard by clicking the :material-play: button.
If this is your first time starting the server you will be met with the dialogue, asking you to confirm you have read and agreed with [Minecraft's EULA](https://www.minecraft.net/en-us/eula){:target="_blank"}.
<center>
<div class="center-content" markdown>
![Minecraft EULA Prompt](../../../img/page-assets/user-guide/server-creation/minecraft/minecraft-eula-prompt.png)
<br><small>If you press "**yes**", we will agree to the EULA and start the server for you.</small>
</center>
<center>
![Connectivity reminder prompt](../../../img/page-assets/user-guide/server-creation/minecraft/server-connectivity-reminder.png)
<br><small>Crafty will give a quick reminder to make sure your ports are forwarded if you want to access it remotely.</small>
</center>
</div>
-----
<center>
<div class="center-content" markdown>
![Dashboard example with server running](../../../img/page-assets/user-guide/server-creation/minecraft/dashboard-server-running.png)
<br>**At this point, we have a running server! 🎉**
</center>
</div>

View File

@@ -0,0 +1,112 @@
# Time-based one-time password (MFA) :material-account-clock:
MFA adds a second factor of authentication, ensuring that only authorized users with both the correct password and a unique one-time code can access Crafty. In this guide, well walk you through enabling, configuring, and using MFA on your Crafty instance.
<div class="center-content" markdown>
<img src="../../../../img/page-assets/user-guide/user-authentication/totp-configuration/login-example.png" alt="crafty login example">
</div>
## Prerequisites <sub><small>[:octicons-tag-24: 4.4.8][MFA support]{:target="_blank"}</small></sub>
- Ensure Crafty Controller is at **version 4.4.8 or later**.
- Make sure your server has internet access or can handle time sync properly.
- An authenticator app (e.g. Google Authenticator, Authy, Microsoft Authenticator).
## Enabling MFA in Crafty
### Accessing MFA Settings
- Click your user profile in the top right corner (top left on mobile).
- Click "Account Settings".
- Click the "Multi Factor Auth" tab
<div class="center-content" markdown>
<img src="../../../../img/page-assets/user-guide/user-authentication/totp-configuration/where-to-find.png" alt="where to find mfa">
</div>
### Generating a MFA Secret
- In the MFA tab click the "Add New Multi Factor Auth" button in the top right corner
- Give the MFA token a friendly name
- Scan the QR code with your phone's camera to add it to your authenticator app.
<div class="center-content" markdown>
<img src="../../../../img/page-assets/user-guide/user-authentication/totp-configuration/create-example-1.png" alt="mfa create example">
</div>
!!! note "If your chosen authenticator app suports it, you can manually type in the secret."
### Verification Step
- Once in your authenticator app verify the rotating code by typing in the 6 digit code on your app into the Crafty input text box then press verify.
- **Make sure to save your backup codes! Better safe, than sorry!**
- Error handling if the code is incorrect or expired. ([Having issues? See Troubleshooting](#troubleshooting))
<div class="center-content" markdown>
<img src="../../../../img/page-assets/user-guide/user-authentication/totp-configuration/create-example-2.png" alt="mfa create verify success example">
</div>
## Using MFA at Login
- If you have MFA enabled please enter your **username**, **password**, and **6 digit MFA token** on the login screen.
- If you are using a backup code please be sure to change the dropdown from "authenticator app" to "backup code"
<div class="center-content" markdown>
<img src="../../../../img/page-assets/user-guide/user-authentication/totp-configuration/backup-code-login-example.png" alt="backup code login example">
</div>
## Requiring MFA for users
### Super Users
- You can require all Super Users to have MFA enabled.
- Select "Panel Settings ⚙️" on the left side navigation (hamburger menu on mobile)
- Select the "config.json" tab
- Use the security menu and set "Require superusers to enable MFA" to True.
<div class="center-content" markdown>
<img src="../../../../img/page-assets/user-guide/user-authentication/totp-configuration/opt-out-mfa.png" alt="mfa required option opt out example">
</div>
### Roles
- You can require all users with an assigned role to enable MFA
- Click on "Panel Settings ⚙️" on the left side navigation (hamburger menu on mobile)
- Scroll to the "roles" section and click the edit pencil to edit a role or click create role
- In the menu that appears you select "Require role users to enable MFA (Multi Factor Authentication)"
<div class="center-content" markdown>
<img src="../../../../img/page-assets/user-guide/user-authentication/totp-configuration/require-for-role.png" alt="mfa required for role example">
</div>
## Recovery and Backup Codes
- Optional but recommended for users who lose their MFA device.
- Backup codes are automatically generated when creating an MFA token.
- You can reroll **6 new backup codes** by navigating to the MFA settings then clicking "Renew Recovery Codes".
- As the `anti-lockout-user` (Recovery Account), you can reroll backup codes if a MFA device is lost.
<div class="center-content" markdown>
<img src="../../../../img/page-assets/user-guide/user-authentication/totp-configuration/backup-codes-example.png" alt="mfa backup codes example">
</div>
## Troubleshooting
- Common MFA errors: “Invalid code” “Code expired” could relate to time-sync issues.
- On Windows systems exact time is likely to not be in sync with your mobile device. You can enable "MFA Skew" in the `config.json` settings that will allow 1 previous code and 1 code in the future to be valid.
## MFA FAQs
- **“Can I use multiple devices for MFA?”**<br>
Yes!
- **“What if I lose my phone?”**<br>
You can reset your backup codes in the "anti-lockout-user" then login and create a new MFA token. If you are a lower priviledged user you can speak with the system administrator for help.
- **“Does MFA work offline?”**<br>
As long as the system time is correct MFA will work offline.
- **“Why am I getting an Invalid Token error?”**<br>
Your system time is likely not exactly in sync with your mobile device's time.
## Additional Resources
- [Wikipedia | Time-Based One-Time Password Algorithm](https://en.wikipedia.org/wiki/Time-based_one-time_password){:target="_blank"}
- [RFC-Editor | TOTP spec (RFC 6238)](https://www.rfc-editor.org/rfc/rfc6238){:target="_blank"}
### Links to Common Authenticator Apps
| App | URL |
| ----------------------- | ------------------------------ |
| Google Authenticator | **[Google Play :simple-android:](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2){:target="_blank"}** |
| | **[Apple App Store :material-apple: :material-apple-ios:](https://apps.apple.com/gb/app/google-authenticator/id388497605){:target="_blank"}** |
| Authy | **[Google Play :simple-android:](https://play.google.com/store/apps/details?id=com.authy.authy){:target="_blank"}** |
| | **[Apple App Store :material-apple: :material-apple-ios:](https://apps.apple.com/gb/app/twilio-authy/id494168017){:target="_blank"}** |
| Microsoft Authenticator | **[Google Play :simple-android:](https://play.google.com/store/apps/details?id=com.azure.authenticator){:target="_blank"}** |
| | **[Apple App Store :material-apple: :material-apple-ios:](https://apps.apple.com/gb/app/microsoft-authenticator/id983156458){:target="_blank"}** |
| Yubico Authenticator | **[Google Play :simple-android:](https://play.google.com/store/apps/details?id=com.yubico.yubioath){:target="_blank"}** |
| | **[Apple App Store :material-apple: :material-apple-ios:](https://apps.apple.com/gb/app/yubico-authenticator/id1476679808){:target="_blank"}** |
| | **[Microsoft Store :material-microsoft-windows:](https://apps.microsoft.com/detail/9nfng39387k0){:target="_blank"}** |
| KeePass / KeePassXC | **[Microsoft Store :material-microsoft-windows:](https://apps.microsoft.com/detail/xp8k2l36vp0qmb){:target="_blank"}** |
| BitWarden | **[Google Play :simple-android:](https://play.google.com/store/apps/details?id=com.x8bit.bitwarden){:target="_blank"}** |
| | **[Apple App Store :material-apple: :material-apple-ios:](https://apps.apple.com/gb/app/bitwarden-password-manager/id1137397744){:target="_blank"}** |
| | **[Microsoft Store :material-microsoft-windows:](https://apps.microsoft.com/detail/9pjsdv0vpk04){:target="_blank"}** |
[MFA support]: https://gitlab.com/crafty-controller/crafty-4/-/releases/v4.4.8

View File

@@ -4,13 +4,12 @@ The user management panel is a central component of Crafty, providing administra
This document serves as a guide to effectively navigate and utilize the user management panel, enabling you to effortlessly handle user creation, roles, and permissions.
## The User Management Panel
![Config cog arrow](../../img/page-assets/user-guide/settings-pointer.png){ align=right}
!!! abstract ""
Getting to the **User/Role Manager** is incredibly easy all you have to do it click the cogs in the top right next to your profile picture.
Getting to the **User/Role Manager** is incredibly easy all you have to do it click on Panel Settings in the navigation drawer.
![User/role manager overview](../../img/page-assets/user-guide/user-role-config/user-role-manager-overview.png)
Here we are able to Create new users and roles. Clicking the pencil icon :material-pencil: next to a user or role will allow you to edit their respective config settings.
## Adding a User
@@ -33,7 +32,7 @@ To change your user language select it from the dropdown. If the language is dis
These variables limit the amount of resources that the user can create.
![Crafty Permissions User config overview](../../img/page-assets/user-guide/user-role-config/user-role-manager-user-config-perms.png)
<center>
<div class="center-content" markdown>
Allow the user to create servers. <small>(If Quantity is -1 they can create an unlimited number of servers.)</small><br>
Allow the user to create a user account. <small>(If Quantity is -1 they can create an unlimited number of users.)</small><br>
Allow the user to create a role. <small>(If Quantity is -1 they can create an unlimited number of roles.)</small>
@@ -47,17 +46,18 @@ Allow the user to create a role. <small>(If Quantity is -1 they can create an un
-----
<small>The Super user option is only displayed if the user creating a new user account is a Super User.</small>
</center>
</div>
## Adding a Role
Roles allow you to segregate access to certain servers and related server management options.
To create a role, Click `Add New Role`. Adding a role gives you many options to fine tune access.
<center>
<div class="center-content" markdown>
![Role config overview](../../img/page-assets/user-guide/user-role-config/user-role-manager-role-config.png)
Give your role a name, and select who you want to be able to manage this role (*if any*)<br>
<small>If you only want superusers to be able to manage this role leave manager unselected.</small>
</center>
</div>
Now add the servers you want to attach to this role, check off options to allow this role to see different parts of the server specified. See the table below for descriptions of each area:

View File

@@ -38,7 +38,7 @@ Be sure to send a test notification to verify that your webhook is configured co
-----
<center>
<div class="center-content" markdown>
### Webhook Actions
@@ -56,6 +56,73 @@ Be sure to send a test notification to verify that your webhook is configured co
##### Delete Service 🗑️
<small>Remove an integration if it's no longer needed.</small>
</center>
</div>
### Jinja2 Dynamic Variables <sub><small>[:octicons-tag-24: 4.6.1][Jinja2 Webhooks Release]{:target="_blank"}</small></sub>
**Craftys webhook system supports full Jinja2 variable rendering**, allowing you to dynamically inject live server data, timestamps and event-specific information directly into your webhook payloads. This gives you far more flexibility when dispatching to external services.
!!! note "Base URL"
For variables that provide links such as `backup_link` you can adjust the base URL for these links and [Crafty's main configuration](../getting-started/config.md#craftys-config-file-configjson){:target="_blank"}
!!! info "Jinja2 Template Examples"
=== "Server Start/Stop Combined"
```jinja
{% if event_type == "start_server" %}
Server `{{ server_name }}` has started!
{% elif event_type == "stop_server" %}
Server `{{ server_name }}` has stopped.
{% else %}
Event: `{{ event_type }}` on server `{{ server_name }}`
{% endif %}
Iso: `{{ time_iso }}`
```
=== "Descriptive Backup"
```jinja
**{{ server_name }}** backup completed.
{% if backup_name.endswith('.zip') %}
**Backup Type** - Archive
{% else %}
**Backup Type** - Snapshot
{% endif %}
{% if backup_status == "✅" %}
Backup succeeded!
**File Name** - {{ backup_name }}
**Backup Size** - {{ backup_size }}
**Download Link** - {{ backup_link }}
{% else %}
Backup Failed! D:
**Reason** - {{ backup_error }}
{% endif %}
Iso: `{{ time_iso }}`
```
=== "Disco Time :simple-discord:"
Given discord allows you to do some fancy time stamping, which shows a time in the viewer's local time,
you have the ability inject these on the fly with Unix time, [Check here for alternative syntax!](https://hammertime.cyou/en-GB){:target="_blank"}
```jinja
Event: `{{ event_type }}` on server `{{ server_name }}`
Disco_unix 1: <t:{{ time_unix }}:T>
Disco_unix 2: <t:{{ time_unix }}:F>
Disco_unix 3: <t:{{ time_unix }}:R>
```
!!! example "Dynamic Variables Currently Supported in Webhook Templates"
| Description | <div style="width:16em">Variable</div> | Example |
|-------------|-----------------|---------|
| **General Variables** | | |
| Server Name | `{{ server_name }}` | My First Server |
| Server ID | `{{ server_id }}` | ef3fb2d1-a94c-4d9b-8c65-c4274be706cb |
| Event Type | `{{ event_type }}` | start_server |
| ISO 8601 | `{{ time_iso }}` | 2025-11-16T19:54:27.915915Z |
| UNIX timestamp (useful for Discord) | `{{ time_unix }}` | 1763322867 |
| Day/Month/Year in UTC | `{{ time_[day\|month\|year] }}` | 22 / 11 / 2025 |
| **Event Specific Variables** | | |
| Command sent (From Panel) | `{{ command }}` | say hello world |
| Backup file name | `{{ backup_name }}` | 2025-11-19_17-30-57.zip |
| Backup file download link | `{{ backup_link }}` | https://127.0.0.1:8443/api/v2/servers/50fb7273-9ee3-4407-aaed-f523c27daedb/backups/backup/0683f7fb-09a2-432f-9dd6-775019f75fae/download/2025-11-19_17-30-57.zip |
| Backup file size | `{{ backup_size }}` | 248.6MB |
| Backup Status | `{{ backup_status }}` | ✅ / ❌ |
| Backup Error | `{{ backup_error }}` | [Errno 2] No such file or directory: F:\Users\bill-gates\crafty-4\backups\50fb7273-9ee3-4407-aaed-f523c27daedb\0683f7fb-09a2-432f-9dd6-775019f75fae\2025-11-19_17-30-57.zip' |
[Webhooks Release]: https://gitlab.com/crafty-controller/crafty-4/-/releases/v4.2.0
[Jinja2 Webhooks Release]: https://gitlab.com/crafty-controller/crafty-4/-/releases/v4.6.1

View File

@@ -0,0 +1,3 @@
.center-content {
text-align: center;
}

View File

@@ -9,6 +9,7 @@ nav:
- Windows: pages/getting-started/installation/windows.md
- MacOS: pages/getting-started/installation/macos.md
- UnRAID: pages/getting-started/installation/unraid.md
- CasaOS: pages/getting-started/installation/casaos.md
- Uninstalling Crafty: pages/getting-started/installation/uninstalling.md
- First Steps:
- Access the Dashboard: pages/getting-started/access.md
@@ -18,6 +19,8 @@ nav:
- Progressive Web App: pages/getting-started/pwa.md
- User Guide:
- User/Role Configuration: pages/user-guide/user-role-config.md
- User Authentication:
- TOTP Configuration: pages/user-guide/user-authentication/totp-configuration.md
- Server Creation:
- Minecraft Server: pages/user-guide/server-creation/minecraft.md
# - SteamCMD Server(Beta): pages/user-guide/server-creation/steamcmd.md
@@ -32,10 +35,8 @@ nav:
- Server Re-ordering: pages/user-guide/reorder-servers.md
- Server Webhooks: pages/user-guide/webhooks.md
- Open-Metrics (Prometheus): pages/user-guide/open-metrics.md
- Troubleshooting (FAQ): pages/user-guide/faq.md
- Developer Guide:
- API Reference (v2): pages/developer-guide/api-reference/v2.md
- API Reference (v1): pages/developer-guide/api-reference/v1.md
- Contributing:
- pages/developer-guide/contributing/index.md
- Making repository changes: https://gitlab.com/crafty-controller/crafty-4/-/blob/master/CONTRIBUTING.md
@@ -43,10 +44,14 @@ nav:
- Reporting a docs issue: pages/developer-guide/contributing/doc-issue.md
- Requesting a change: pages/developer-guide/contributing/change-requests.md
- Asking a question: pages/developer-guide/contributing/ask-a-question.md
- Troubleshooting (FAQ): pages/user-guide/faq.md
- About:
- Credits: pages/about/credits.md
- Licence: pages/about/licence.md
extra_css:
- stylesheets/extra.css
# Project paths.
docs_dir: docs
site_dir: site
@@ -132,13 +137,14 @@ extra:
plugins:
- search:
separator: '[\s\-,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
- render_swagger
- swagger-ui-tag
#- external-markdown
markdown_extensions:
- admonition
- attr_list
- def_list
- meta
- md_in_html
- pymdownx.critic
- pymdownx.details