Skip to content

Latest commit

 

History

History
258 lines (207 loc) · 8.05 KB

README.md

File metadata and controls

258 lines (207 loc) · 8.05 KB

Features

  • Can use always own skin-system
  • Possibility to redirect a nickname in the Ely.by system
  • Automatic signature of skins
  • Distribution of rights by tokens
  • Beautiful smiley in /debug :-)

Installation

Note

After installation, remember to configure docker-compose.yml if needed.

Docker

Arch
sudo pacman -Syu git docker docker-compose
sudo systemctl enable docker
git clone https://github.com/steepboy/skin-system --recursive
cd skin-system
docker-compose up -d  --build
Ubuntu/Debian
sudo apt update && sudo apt upgrade
sudo apt-get install git docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable docker
git clone https://github.com/steepboy/skin-system --recursive
cd skin-system
docker-compose up -d  --build
Windows

Just install this: Docker Desktop for Windows

Manually

mkdir skin-system
cd skin-system
git clone https://github.com/steepboy/skin-system --recursive
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 run



How to use

Request routers in the skin system are practically the same as in Ely.by, but there are some features

Token system

In `tokens.json` you can create and prioritize your access key.

For example:

{
  "valid_tokens": {
    "token1": {"priority": 0},
    "token2": {"priority": 1},
    "token3": {"priority": 2}
  }
}

Here we see that tokens one two and three are access keys, and {“priority”: {*} its priority.

In the skin system only priorities 0 and 1 are used so far, where 0 is a user who can just request access, and 1 is an administrator who can work with the database to add and remove users.

Example request: http://example.com/skin/yiski/?token=token1

Tip

If you don't need the token system, just turn it off in docker-compose.yml by changing TOKEN_SYSTEM = 1 to 0 or on bash export TOKEN_SYSTEM=0.

Routers

/skin/{username}

Return skin image

Has a variable: No
Type: GET
Min token priority: 0
Working through: Ely.by (as soon own system too)
Example request: http://example.com/skin/yiski/?token=test

/render/{username}

Renders the character in 2D

Has a variable: scale= (default: 8) type= (body or head) layer (1 or 0) # second layer of skin on or off
Type: GET
Min token priority: 0
Working through: Ely.by (as soon own system too)
Example request: http://example.com/render/yiski?token=test&scale=20&type=body&layer=1

/perspective/{username}

WARNING!!! Render in perspective does not show the second layer on the skin

render the character in perspective
Has a variable: scale= (default: 8) z= (up or down) y= (front or back)
Type: GET
Min token priority: 0
Working through: Ely.by (as soon own system too)
Example request: http://example.com/perspective/yiski?token=test&scale=40&z=up&y=front

/signature-verification-key(.der or .pem)

This endpoint returns a public key that can be used to verify a texture’s signature

Has a variable: No
Type: GET
Min token priority: 0
Working through: Ely.by future only
Example request: http://example.com/signature-verification-key.pem?token=test

/textures/{username}

Returns url for skin png

Has a variable: No
Type: GET
Min token priority: 0
Working through: Ely.by (as soon own system too)
Example request: http://example.com/textures/yiski?token=test

/textures/signed/{username}

Passes nickname, signature key and skin and information in base64

Has a variable: proxy= (true or false) # When true, the skin is not in the skin system, it will be retransmitted from Ely.by or Mojang.API
Type: GET
Min token priority: 0
Working through: skin-system and Ely.by
Example request: http://example.com/textures/signed/yiski?token=test&proxy=true

/profile/{username}

Passes nickname, signature key and skin and information in base64

Has a variable: unsigned= (true or false) # if true, does not show the signature key. More info: here
Type: GET
Min token priority: 0
Working through: Ely.by future only
Example request: http://example.com/profile/yiski?token=test&unsigned=false

Skin system management

/sys/search/{args}

If you enter a nickname or skin id, it will display what is stored in the DB skin system, but if you enter <all>, it will display the whole DB

Has a variable: table= (user_data or skin_data) # Which table should be searched**
Type: GET
Min token priority: 1
Working through: skin-system future only
Example request: http://example.com/sys/search/yiski?token=test1&table=user_data

/sys/remove/skin/{id}

Deletes the skin and all its data in the DB

Has a variable: No
Type: GET
Min token priority: 1
Working through: skin-system future only
Example request: http://example.com/sys/remove/skin/Ihdnwj12h?token=test1

/sys/add/user

Signs the skin and adds it to the DB

Type: POST
Min token priority: 1
Working through: skin-system future only
Example request:

curl -X POST http://example.com/sys/add/user \
  -F 'file=@/path/to/your/skin.png' \
  -F 'nickname=yiski'
  -F 'redirect=0' #Immediately set the redirect value, if 0, it will show the skin system data, if 1 Ely.by (diffault is 0)
  -F 'token=token'
/sys/toggle/redirect/{username}

Enables or disables nick redirect from Ely.by

Has a variable: toggle= (0 or 1)
Type: GET
Min token priority: 1
Working through: skin-system future only
Example request: http://example.com/sys/toggle/redirect/yiski?token=test1&toggle=0

/ely/set/{username}

Deletes the skin and all its data in the DB

Has a variable: redirect= (nickname or <del>) # Ely.by nickname skin of which will be forwarded. if <del> deletes the redirection nickname, if it has been
Type: GET
Min token priority: 1
Working through: skin-system future only
Example request: http://example.com/ely/set/yiski?token=test1&redirect=pablo

/temp

Temporarily saves the skin and gives a link to download it (Idk why I did this)

Type: POST
Min token priority: 1
Working through: skin-system future only
Example request:

curl -X POST http://example.com/temp \
  -F 'file=@/path/to/your/skin.png' \
  -F 'token=token' \
  -F 'time=60' #Time in seconds to delete. Max 300 seconds
/debug

just a debugi with a smiley face

Example request: http://example.com/debug

Special thanks

  • Ely.by - for the excellent documentation
  • My Mom - for me

Issues or questions

If you have an issue, or a question, please open an issue or DM me on discord: yiskiii