mirror of
https://github.com/shiroyashik/sculptor.git
synced 2025-12-06 04:51:13 +03:00
🎉Release v0.3.0!🎉
This commit is contained in:
parent
dabe176e0e
commit
494de2ba0c
9 changed files with 60 additions and 19 deletions
15
.github/release-body.md
vendored
15
.github/release-body.md
vendored
|
|
@ -1,5 +1,14 @@
|
|||
## Bug fix
|
||||
## Release ☆ ~('▽^人)
|
||||
|
||||
Fixed error (failed to verify) when authenticating via Mojang
|
||||
> [!CAUTION]
|
||||
> **Update your Config.toml according to the example in the repository!**
|
||||
|
||||
**Full Changelog**: https://github.com/shiroyashik/sculptor/compare/v0.2.2...v0.2.3
|
||||
What's added:
|
||||
- Ability to change authentication providers;
|
||||
- Display information about Sculptor in MOTD;
|
||||
- Checking updates for Sculptor (displayed in CLI at startup) and for Figura (reported in mod UI);
|
||||
- Saving log files in a separate directory;
|
||||
- User bans and Minecraft blacklist parser;
|
||||
- Implemented a special API for backend manipulation by third-party software.
|
||||
|
||||
**Full Changelog**: https://github.com/shiroyashik/sculptor/compare/v0.2.3...v0.3.0
|
||||
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -1502,7 +1502,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|||
|
||||
[[package]]
|
||||
name = "sculptor"
|
||||
version = "0.3.0-dev"
|
||||
version = "0.3.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"axum",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "sculptor"
|
||||
authors = ["Shiroyashik <shiroyashik@shsr.ru>"]
|
||||
version = "0.3.0-dev"
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
|
|
|
|||
|
|
@ -70,10 +70,10 @@ special = [0,0,0,1,0,0] # 6
|
|||
pride = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # 25
|
||||
|
||||
## With advancedUsers you can set additional parameters
|
||||
# [advancedUsers.your uuid here]
|
||||
# [advancedUsers.your-uuid-here]
|
||||
# username = "Your_username_here"
|
||||
# banned = true
|
||||
# special = [0,1,0,0,0,0] # and set badges what you want! :D
|
||||
# pride = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||
# special = [0,1,0,0,0,0] # Set badges what you want! :D
|
||||
# pride = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] # Check out note.txt for reference
|
||||
|
||||
## you can create an unlimited number of "advancedUsers" for any users.
|
||||
## you can create an unlimited number of "advancedUsers" for any players.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
FROM rust:1.78.0-alpine3.20 as builder
|
||||
FROM rust:1.80.1-alpine3.20 as builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ services:
|
|||
- ./Config.toml:/app/Config.toml:ro
|
||||
- ./avatars:/app/avatars
|
||||
- ./logs:/app/logs
|
||||
# You can specify the path to the server folder
|
||||
# for Sculptor to use the ban list from it
|
||||
# - ./minecraft-server:/app/mc
|
||||
environment:
|
||||
- RUST_LOG=info
|
||||
## Recommended for use with reverse proxy.
|
||||
|
|
|
|||
14
note.txt
14
note.txt
|
|
@ -1,4 +1,4 @@
|
|||
Коды ошибок WebSocket из Figura
|
||||
WebSocket close codes from Figura
|
||||
1000 Normal Closure
|
||||
1001 Going Away
|
||||
1002 Protocol Error
|
||||
|
|
@ -20,12 +20,12 @@
|
|||
4002 Too Many Connections
|
||||
|
||||
Special badges
|
||||
1 Разработчик
|
||||
2 Член персонала официального сервера
|
||||
3 Победитель контеста
|
||||
4 Спасибо за поддержку
|
||||
5 Переводчик
|
||||
6 Художник текстур мода
|
||||
1 Разработчик | Figura Developer!
|
||||
2 Член персонала официального сервера | Official Figura Discord Staff!
|
||||
3 Победитель контеста | Figura contest winner! GG!
|
||||
4 Спасибо за поддержку | Thank you for supporting the Figura mod!
|
||||
5 Переводчик | Figura mod Translator!
|
||||
6 Художник текстур мода | Figura mod Texture Artist!
|
||||
|
||||
Pride badges
|
||||
1 Агендерный
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ pub fn router() -> Router<AppState> {
|
|||
.route("/raw", post(http2ws::raw))
|
||||
.route("/sub/raw", post(http2ws::sub_raw))
|
||||
.route("/user/create", post(users::create_user))
|
||||
.route("/user/:uuid/ban", post(users::ban))
|
||||
.route("/user/:uuid/unban", post(users::unban))
|
||||
.route("/avatar/:uuid", put(avatars::upload_avatar).layer(DefaultBodyLimit::disable()))
|
||||
.route("/avatar/:uuid", delete(avatars::delete_avatar))
|
||||
}
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
use axum::{
|
||||
extract::State,
|
||||
extract::{Path, State},
|
||||
Json
|
||||
};
|
||||
use tracing::debug;
|
||||
use tracing::{debug, info};
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::{auth::{Token, Userinfo}, ApiResult, AppState};
|
||||
|
||||
|
|
@ -17,4 +18,30 @@ pub(super) async fn create_user(
|
|||
|
||||
state.user_manager.insert_user(json.uuid, json);
|
||||
Ok("ok")
|
||||
}
|
||||
|
||||
pub(super) async fn ban(
|
||||
Token(token): Token,
|
||||
State(state): State<AppState>,
|
||||
Path(uuid): Path<Uuid>
|
||||
) -> ApiResult<&'static str> {
|
||||
state.config.read().await.clone().verify_token(&token)?;
|
||||
|
||||
info!("Trying ban user: {uuid}");
|
||||
|
||||
state.user_manager.ban(&Userinfo { uuid: uuid, banned: true, ..Default::default() });
|
||||
Ok("ok")
|
||||
}
|
||||
|
||||
pub(super) async fn unban(
|
||||
Token(token): Token,
|
||||
State(state): State<AppState>,
|
||||
Path(uuid): Path<Uuid>
|
||||
) -> ApiResult<&'static str> {
|
||||
state.config.read().await.clone().verify_token(&token)?;
|
||||
|
||||
info!("Trying unban user: {uuid}");
|
||||
|
||||
state.user_manager.unban(&uuid);
|
||||
Ok("ok")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue