diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ffdff7a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.env +**/pycache +.venv \ No newline at end of file diff --git a/.version b/.version index f120bd5..3fd928f 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.0.1-dev1 \ No newline at end of file +0.0.1-dev2 \ No newline at end of file diff --git a/Containerfile b/Containerfile index 11ee7e1..0109a8f 100644 --- a/Containerfile +++ b/Containerfile @@ -14,4 +14,4 @@ RUN pip install --no-cache-dir -r requirements.txt EXPOSE 8000 # Serve the API -CMD ['fastapi', 'run', '--port', '8000', '/app/minecraft-plugin-proxy.py'] \ No newline at end of file +CMD ["fastapi", "run", "--port", "8000", "/app/minecraft-plugin-proxy.py"] \ No newline at end of file diff --git a/build.sh b/build.sh index 119dd0f..375fd7a 100644 --- a/build.sh +++ b/build.sh @@ -1,3 +1,6 @@ #!/bin/sh -podman build -t minecraft-plugin-proxy:latest -t minecraft-plugin-proxy:$(cat ./.version) . \ No newline at end of file +podman build \ + -t ghcr.io/epicshepich/minecraft-plugin-proxy:latest \ + -t ghcr.io/epicshepich/minecraft-plugin-proxy:$(cat ./.version) \ + . \ No newline at end of file diff --git a/minecraft-plugin-proxy.py b/minecraft-plugin-proxy.py index 9fa3edb..ab55bd0 100644 --- a/minecraft-plugin-proxy.py +++ b/minecraft-plugin-proxy.py @@ -11,6 +11,7 @@ from xml.etree import ElementTree as ET api = FastAPI() @api.get('/viabackwards/velocity') +@api.head('/viabackwards/velocity') async def viabackwards_velocity(): latest_release = requests.get( @@ -21,6 +22,7 @@ async def viabackwards_velocity(): ) @api.get('/luckperms/{server_type}') +@api.head('/luckperms/{server_type}') async def luckperms_velocity(server_type): luckperms_metadata = requests.get('https://metadata.luckperms.net/data/all').json() @@ -31,6 +33,7 @@ async def luckperms_velocity(server_type): @api.get('/tribufu-velocityrcon') +@api.head('/tribufu-velocityrcon') async def tribufu_velocityrcon(): velocityrcon_metadata = requests.get('https://mvn.tribufu.com/releases/com/tribufu/Tribufu-VelocityRcon/maven-metadata.xml').text diff --git a/push.sh b/push.sh index e69de29..5b4e257 100644 --- a/push.sh +++ b/push.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +. ./.env + +echo $GHCR_TOKEN | podman login ghcr.io -u USERNAME --password-stdin + +podman push ghcr.io/epicshepich/minecraft-plugin-proxy:latest +podman push ghcr.io/epicshepich/minecraft-plugin-proxy:$(cat ./.version) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 735558d..0ed69bc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ requests +fastapi fastapi[standard] \ No newline at end of file