Merge branch 'dev' into lang/additional-lang-for-4.4.0

This commit is contained in:
Zedifus 2024-05-24 00:33:05 +01:00
commit 94707be975
20 changed files with 63 additions and 19 deletions

View File

@ -1,7 +1,18 @@
# Changelog # Changelog
## --- [4.4.0] - 2024/05/10 ## --- [4.4.1] - 2024/TBD
### New features
TBD
### Bug fixes
TBD
### Tweaks
TBD
### Lang
TBD
<br><br>
## --- [4.4.0] - 2024/05/11
### Refactor ### Refactor
- Refactor API keys "super user" to "full access" ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/731)) - Refactor API keys "super user" to "full access" ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/731) | [Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/759))
- Refactor SBuilder to use Big Bucket Svc ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/755)) - Refactor SBuilder to use Big Bucket Svc ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/755))
### Bug fixes ### Bug fixes
- Reset query arguments on login if `?next` is not available ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/750)) - Reset query arguments on login if `?next` is not available ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/750))

View File

@ -1,5 +1,5 @@
[![Crafty Logo](app/frontend/static/assets/images/logo_long.svg)](https://craftycontrol.com) [![Crafty Logo](app/frontend/static/assets/images/logo_long.svg)](https://craftycontrol.com)
# Crafty Controller 4.4.0 # Crafty Controller 4.4.1
> Python based Control Panel for your Minecraft Server > Python based Control Panel for your Minecraft Server
## What is Crafty Controller? ## What is Crafty Controller?

View File

@ -26,6 +26,7 @@ class ApiAnnounceIndexHandler(BaseApiHandler):
_, _,
_, _,
_user, _user,
_,
) = auth_data ) = auth_data
data = self.helper.get_announcements() data = self.helper.get_announcements()
@ -72,6 +73,7 @@ class ApiAnnounceIndexHandler(BaseApiHandler):
_, _,
_, _,
_user, _user,
_,
) = auth_data ) = auth_data
try: try:
data = json.loads(self.request.body) data = json.loads(self.request.body)

View File

@ -14,6 +14,7 @@ class ApiCraftyLogIndexHandler(BaseApiHandler):
_, _,
superuser, superuser,
_, _,
_,
) = auth_data ) = auth_data
if not superuser: if not superuser:

View File

@ -68,6 +68,7 @@ class ApiCraftyConfigIndexHandler(BaseApiHandler):
_, _,
superuser, superuser,
_, _,
_,
) = auth_data ) = auth_data
# GET /api/v2/roles?ids=true # GET /api/v2/roles?ids=true
@ -94,13 +95,7 @@ class ApiCraftyConfigIndexHandler(BaseApiHandler):
auth_data = self.authenticate_user() auth_data = self.authenticate_user()
if not auth_data: if not auth_data:
return return
( (_, _, _, superuser, user, _) = auth_data
_,
_,
_,
superuser,
user,
) = auth_data
if not superuser: if not superuser:
return self.finish_json(400, {"status": "error", "error": "NOT_AUTHORIZED"}) return self.finish_json(400, {"status": "error", "error": "NOT_AUTHORIZED"})
@ -150,6 +145,7 @@ class ApiCraftyCustomizeIndexHandler(BaseApiHandler):
_, _,
superuser, superuser,
_, _,
_,
) = auth_data ) = auth_data
# GET /api/v2/roles?ids=true # GET /api/v2/roles?ids=true
@ -182,6 +178,7 @@ class ApiCraftyCustomizeIndexHandler(BaseApiHandler):
_, _,
superuser, superuser,
user, user,
_,
) = auth_data ) = auth_data
if not superuser: if not superuser:
return self.finish_json(400, {"status": "error", "error": "NOT_AUTHORIZED"}) return self.finish_json(400, {"status": "error", "error": "NOT_AUTHORIZED"})

View File

@ -24,6 +24,7 @@ class ApiCraftyConfigServerDirHandler(BaseApiHandler):
_, _,
superuser, superuser,
_, _,
_,
) = auth_data ) = auth_data
# GET /api/v2/roles?ids=true # GET /api/v2/roles?ids=true
@ -56,6 +57,7 @@ class ApiCraftyConfigServerDirHandler(BaseApiHandler):
_, _,
_, _,
_, _,
_,
) = auth_data ) = auth_data
if not auth_data: if not auth_data:

View File

@ -12,6 +12,7 @@ class ApiCraftyJarCacheIndexHandler(BaseApiHandler):
_, _,
_, _,
_, _,
_,
) = auth_data ) = auth_data
if not auth_data[4]["superuser"]: if not auth_data[4]["superuser"]:

View File

@ -75,6 +75,7 @@ class ApiRolesIndexHandler(BaseApiHandler):
_, _,
superuser, superuser,
_, _,
_,
) = auth_data ) = auth_data
# GET /api/v2/roles?ids=true # GET /api/v2/roles?ids=true
@ -107,6 +108,7 @@ class ApiRolesIndexHandler(BaseApiHandler):
_, _,
superuser, superuser,
user, user,
_,
) = auth_data ) = auth_data
if not superuser: if not superuser:

View File

@ -74,6 +74,7 @@ class ApiRolesRoleIndexHandler(BaseApiHandler):
_, _,
superuser, superuser,
_, _,
_,
) = auth_data ) = auth_data
if not superuser: if not superuser:
@ -97,6 +98,7 @@ class ApiRolesRoleIndexHandler(BaseApiHandler):
_, _,
superuser, superuser,
user, user,
_,
) = auth_data ) = auth_data
if not superuser: if not superuser:
@ -126,10 +128,19 @@ class ApiRolesRoleIndexHandler(BaseApiHandler):
_, _,
superuser, superuser,
user, user,
_,
) = auth_data ) = auth_data
if not superuser: role = self.controller.roles.get_role(role_id)
return self.finish_json(400, {"status": "error", "error": "NOT_AUTHORIZED"}) if not superuser and user["user_id"] != role["manager"]:
return self.finish_json(
400,
{
"status": "error",
"error": "NOT_AUTHORIZED",
"error_data": "Not Authorized",
},
)
try: try:
data = orjson.loads(self.request.body) data = orjson.loads(self.request.body)

View File

@ -13,6 +13,7 @@ class ApiRolesRoleServersHandler(BaseApiHandler):
_, _,
superuser, superuser,
_, _,
_,
) = auth_data ) = auth_data
# GET /api/v2/roles/role/servers?ids=true # GET /api/v2/roles/role/servers?ids=true

View File

@ -12,6 +12,7 @@ class ApiRolesRoleUsersHandler(BaseApiHandler):
_, _,
superuser, superuser,
_, _,
_,
) = auth_data ) = auth_data
if not superuser: if not superuser:

View File

@ -685,6 +685,7 @@ class ApiServersIndexHandler(BaseApiHandler):
_, _,
_superuser, _superuser,
user, user,
_,
) = auth_data ) = auth_data
if EnumPermissionsCrafty.SERVER_CREATION not in exec_user_crafty_permissions: if EnumPermissionsCrafty.SERVER_CREATION not in exec_user_crafty_permissions:

View File

@ -21,6 +21,7 @@ class ApiUsersIndexHandler(BaseApiHandler):
_, _,
_, _,
user, user,
_,
) = auth_data ) = auth_data
# GET /api/v2/users?ids=true # GET /api/v2/users?ids=true
@ -70,6 +71,7 @@ class ApiUsersIndexHandler(BaseApiHandler):
_, _,
superuser, superuser,
user, user,
_,
) = auth_data ) = auth_data
if EnumPermissionsCrafty.USER_CONFIG not in exec_user_crafty_permissions: if EnumPermissionsCrafty.USER_CONFIG not in exec_user_crafty_permissions:
@ -149,11 +151,12 @@ class ApiUsersIndexHandler(BaseApiHandler):
400, {"status": "error", "error": "INVALID_SUPERUSER_CREATE"} 400, {"status": "error", "error": "INVALID_SUPERUSER_CREATE"}
) )
if len(roles) != 0 and not superuser: for role in roles:
# HACK: This should check if the user has the roles or something role = self.controller.roles.get_role(role)
return self.finish_json( if int(role["manager"]) != int(auth_data[4]["user_id"]) and not superuser:
400, {"status": "error", "error": "INVALID_ROLES_CREATE"} return self.finish_json(
) 400, {"status": "error", "error": "INVALID_ROLES_CREATE"}
)
# TODO: do this in the most efficient way # TODO: do this in the most efficient way
user_id = self.controller.users.add_user( user_id = self.controller.users.add_user(

View File

@ -113,6 +113,7 @@ class ApiUsersUserKeyHandler(BaseApiHandler):
_, _,
_superuser, _superuser,
user, user,
_,
) = auth_data ) = auth_data
try: try:
@ -188,6 +189,7 @@ class ApiUsersUserKeyHandler(BaseApiHandler):
_, _,
_, _,
_user, _user,
_,
) = auth_data ) = auth_data
if key_id: if key_id:
key = self.controller.users.get_user_api_key(key_id) key = self.controller.users.get_user_api_key(key_id)

View File

@ -24,6 +24,7 @@ class ApiUsersUserIndexHandler(BaseApiHandler):
_, _,
_, _,
user, user,
_,
) = auth_data ) = auth_data
if user_id in ["@me", user["user_id"]]: if user_id in ["@me", user["user_id"]]:
@ -72,6 +73,7 @@ class ApiUsersUserIndexHandler(BaseApiHandler):
_, _,
_, _,
user, user,
_,
) = auth_data ) = auth_data
if (user_id in ["@me", user["user_id"]]) and self.helper.get_setting( if (user_id in ["@me", user["user_id"]]) and self.helper.get_setting(
@ -121,6 +123,7 @@ class ApiUsersUserIndexHandler(BaseApiHandler):
_, _,
superuser, superuser,
user, user,
_,
) = auth_data ) = auth_data
try: try:

View File

@ -27,6 +27,7 @@ class ApiUsersUserPermissionsHandler(BaseApiHandler):
_, _,
_, _,
user, user,
_,
) = auth_data ) = auth_data
if user_id in ["@me", user["user_id"]]: if user_id in ["@me", user["user_id"]]:

View File

@ -17,6 +17,7 @@ class ApiUsersUserPublicHandler(BaseApiHandler):
_, _,
_, _,
user, user,
_,
) = auth_data ) = auth_data
if user_id == "@me": if user_id == "@me":

View File

@ -1,5 +1,5 @@
{ {
"major": 4, "major": 4,
"minor": 4, "minor": 4,
"sub": 0 "sub": 1
} }

View File

@ -184,6 +184,8 @@
"error": { "error": {
"agree": "Aceptar", "agree": "Aceptar",
"bedrockError": "Descargas de Bedrock no disponibles. por favor, compruebe", "bedrockError": "Descargas de Bedrock no disponibles. por favor, compruebe",
"bigBucket1": "La verificación de estado de Big Bucket ha fallado. Por favor, verifica",
"bigBucket2": "para obtener la información más actualizada.",
"cancel": "Cancelar", "cancel": "Cancelar",
"contact": "Contacta el soporte de Crafty Control desde Discord", "contact": "Contacta el soporte de Crafty Control desde Discord",
"craftyStatus": "Página de estados de Crafty", "craftyStatus": "Página de estados de Crafty",
@ -206,6 +208,7 @@
"portReminder": "Detectamos que es la primera vez que se inicia {}. Asegúrese de configurar el puerto {} a través de su router/firewall para hacer el servidor accesible por Internet.", "portReminder": "Detectamos que es la primera vez que se inicia {}. Asegúrese de configurar el puerto {} a través de su router/firewall para hacer el servidor accesible por Internet.",
"privMsg": "y el ", "privMsg": "y el ",
"return": "Volver al panel de control", "return": "Volver al panel de control",
"selfHost": "Si estás autoalojando este repositorio, revisa tu dirección o consulta nuestra guía de solución de problemas.",
"serverJars1": "API de Servidor JAR no disponible. por favor, compruebe", "serverJars1": "API de Servidor JAR no disponible. por favor, compruebe",
"serverJars2": "para la información más actualizada.", "serverJars2": "para la información más actualizada.",
"start-error": "Servidor {} fallo al iniciar con código de error: {}", "start-error": "Servidor {} fallo al iniciar con código de error: {}",
@ -603,6 +606,7 @@
}, },
"startup": { "startup": {
"almost": "Terminando. Espera un momento...", "almost": "Terminando. Espera un momento...",
"cache": "Actualizando el archivo de caché de Big Bucket",
"internals": "Configurando e inicializando los componentes internos de Crafty", "internals": "Configurando e inicializando los componentes internos de Crafty",
"internet": "Verificando conexion a internet", "internet": "Verificando conexion a internet",
"server": "Inicializando ", "server": "Inicializando ",

View File

@ -3,7 +3,7 @@ sonar.organization=crafty-controller
# This is the name and version displayed in the SonarCloud UI. # This is the name and version displayed in the SonarCloud UI.
sonar.projectName=Crafty 4 sonar.projectName=Crafty 4
sonar.projectVersion=4.4.0 sonar.projectVersion=4.4.1
sonar.python.version=3.9, 3.10, 3.11 sonar.python.version=3.9, 3.10, 3.11
sonar.exclusions=app/migrations/**, app/frontend/static/assets/vendors/** sonar.exclusions=app/migrations/**, app/frontend/static/assets/vendors/**