Merge "media-api" into "beep"
Squashed commit of the following:
commit d0e3e13babd856ddd2ea9ee0fd39b7e6cc6fa703
Author: Jae Lo Presti (DN0) <me@jae.fi>
Date: Fri Aug 19 08:07:57 2022 +0300
README: add new endpoints to the working
commit 0f3deb34d1d338128b3b0456b1fce296597b70b5
Author: Jae Lo Presti (DN0) <me@jae.fi>
Date: Fri Aug 19 08:05:36 2022 +0300
Media: add handling of skin from URL upload
Additions:
- /minecraft/profile/skins skin from URL upload
Fixes:
- /minecraft/profile/skins use lowercase for "skin" in temp folder
commit b9c82efb3bfb241dd1ee8cb7e86a1180b784ac5d
Author: Jae Lo Presti (DN0) <me@jae.fi>
Date: Fri Aug 19 07:58:01 2022 +0300
Requirements: add new dependency (requests)
commit c8d3fbedd308fafd31384ddbd979838d41063d93
Author: Jae Lo Presti (DN0) <me@jae.fi>
Date: Fri Aug 19 07:55:28 2022 +0300
Media: upload skin endpoint
Fixes:
- upload_file() get UUID from player username
Additions:
- is_file_allowed() returns if an uploaded file is allowed on the
server
- check_temp_folder() creates all the temp dirs
- /minecraft/profile/skins skin upload endpoint
commit f184b9d61c9ca5b9870f847aa29a0d9e2540de8b
Author: Jae Lo Presti (DN0) <me@jae.fi>
Date: Fri Aug 19 07:38:08 2022 +0300
Media: add delete skin method & endpoint
Additions:
- delete_file() method to delete files from storage pool
- remove_skin_from_player() method to delete reset player skin
- /minecraft/profile/skins/active endpoint to reset player skin
commit d446632c81c9dfa0f39eb2fcd7e4359a8ebb46ec
Author: Jae Lo Presti (DN0) <me@jae.fi>
Date: Fri Aug 19 07:28:01 2022 +0300
MediaAPI: add cape profile endpoint
Additions:
- /minecraft/profile/capes/active endpoint
commit 6149513f5055ecde59e85a368bafa26750f5f9b5
Author: Jae Lo Presti (DN0) <me@jae.fi>
Date: Fri Aug 19 01:43:20 2022 +0300
Media: cache values for hashes
commit b680adb58b5a04d078731d8fcc02f00d4119b6d4
Author: Jae Lo Presti (DN0) <me@jae.fi>
Date: Fri Aug 19 01:40:04 2022 +0300
Media: add cape handling
Additions:
- get_player_cape() method to retreive cape hash
- generate_user_profile() now uses the selected user cape
Fixes:
- upload_file() now uses the cape or skin path depending on type
commit 978a477c146bca12c5b1bc7a23aaa5434a7e6e2e
Author: Jae Lo Presti (DN0) <me@jae.fi>
Date: Fri Aug 19 01:32:08 2022 +0300
API: add mediaapi & related methods
Additions:
- Base media API file
- get_player_skin() method that returns the file hash
- generate_user_profile() now uses the real player skin
commit 8367b86be3194ffdcb7e815baf5a2f9dfae4722b
Author: Jae Lo Presti (DN0) <me@jae.fi>
Date: Fri Aug 19 01:17:31 2022 +0300
Mediautil: add method & remove temp file
Additions:
- download_file() method that downloads to tmp location
Fixes:
- Remove temp file on upload_file() call
commit 0bcbe7cc9497b5ac794807a259e5b5f70f939883
Author: Jae Lo Presti (DN0) <me@jae.fi>
Date: Fri Aug 19 01:11:29 2022 +0300
Utils: add basic mediautil file
Additions:
- get_hash() -> Generates sha-1 hash from file
- upload_file() -> Uploads the file to the s3 bucket with {hash}.png
commit 49e82db8dc4b6eec7865d560eb8efec9afcdcfd3
Author: Jae Lo Presti (DN0) <me@jae.fi>
Date: Fri Aug 19 00:59:48 2022 +0300
Requirements: add storage API requirement (boto3)
commit 35411a63c581f58f0b4ad6f40e53058de8ea8041
Author: Jae Lo Presti (DN0) <me@jae.fi>
Date: Fri Aug 19 00:54:34 2022 +0300
DB: add media class to ORM file
commit efa69b8154741bcf3f141f5c1ca61a0d25c30450
Author: Jae Lo Presti (DN0) <me@jae.fi>
Date: Fri Aug 19 00:53:00 2022 +0300
Migrations: add new migations for the media table
README: add current status of what's working and TODOs
Meta: cleanup (remove prints of sensitive info)
API: fully functioning login & refresh sequence
Added:
- Refresh endpoint so launchers can refresh the session (/refresh)
Fixed:
- Moved the main response generators to their own files (playerutil.py)
Minor:
- Added a test cape URI in the profile response
API: Full functional login sequence
Fixes:
- Abandon base64 for simplicy's sake
Additions:
- Profile endpoint that returns skins and capes (/minecraft/profile)
TODO:
- Correct skin server
API: Working login / register
Fixes:
- Patch bug in the password hash storage that would store the function
instead of the the actual hash
Additions:
- Login endpoint (/authenticate)
API: add working way of registering for an account
New endpoint: /api/v1/register [POST]
Migrations: update base schema to include auto increment
Requirements: add hashing dep (bcrypt)
DBUtils: cache data to avoid DB load
Utils: add Redis utils (get and store values)
Requirements: add Redis (caching)
StatsAPI: add util + fill API on some stats (number of users registered
all/24h)
API: create basic userapi (username -> uuid) and serve it
Gitignore: fix typo in gitignore
DB: add object get method + basic DB utils (get uuid from username)
Gitignore: ignore init files (mainly for yoyo)
Migrations: add migration script & migrations folder
Gitignore: ignore sqlite databases