I hate this
This commit is contained in:
parent
3007d9263a
commit
afdc3f890b
10 changed files with 22 additions and 14 deletions
7
.env
7
.env
|
|
@ -1,9 +1,8 @@
|
||||||
MINECRAFTD_PASSWORD="J526lGJOUZlppuMYQNJXQIvimiBZ1gViXD/lLQ==""
|
MINECRAFTD_PASSWORD="poteredellafiga12345678"
|
||||||
PID_FILE="/srv/retards-server/minecraftd/server.pid"
|
START_COMMAND="bash /srv/retards-server/server/start.sh"
|
||||||
START_COMMAND="bash /srv/retards-server/data/start.sh"
|
|
||||||
SERVER_HOST="localhost"
|
SERVER_HOST="localhost"
|
||||||
SERVER_PORT="25565"
|
SERVER_PORT="25565"
|
||||||
SERVER_RCON_PASSWORD="abcdc37ab1ae48056130338c"
|
SERVER_RCON_PASSWORD="abcdc37ab1ae48056130338c"
|
||||||
SERVER_RCON_PORT="25575"
|
SERVER_RCON_PORT="25575"
|
||||||
MAINTAINANCE_FILE="/srv/retards-server/minecraftd/maintainance.txt"
|
MAINTAINANCE_FILE="/srv/retards-server/minecraftd/maintainance.txt"
|
||||||
LOG_FILE="/srv/retards-server/data/logs/latest.log"
|
LOG_FILE="/srv/retards-server/server/logs/latest.log"
|
||||||
|
|
|
||||||
3
__main__.py
Normal file
3
__main__.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
import main
|
||||||
|
|
||||||
|
main.run()
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -8,8 +8,8 @@ from typing import Generator, Literal
|
||||||
from mcrcon import MCRcon
|
from mcrcon import MCRcon
|
||||||
from mcstatus import JavaServer
|
from mcstatus import JavaServer
|
||||||
|
|
||||||
from .classes import ProcessStatus, ServerStatus
|
from classes import ProcessStatus, ServerStatus
|
||||||
from .config import Config
|
from config import Config
|
||||||
|
|
||||||
|
|
||||||
class ProcessController:
|
class ProcessController:
|
||||||
|
|
|
||||||
16
main.py
16
main.py
|
|
@ -4,11 +4,13 @@ from typing import Annotated
|
||||||
from fastapi import FastAPI, Header
|
from fastapi import FastAPI, Header
|
||||||
from fastapi.responses import StreamingResponse
|
from fastapi.responses import StreamingResponse
|
||||||
|
|
||||||
from .classes import ProcessStatus
|
from classes import ProcessStatus
|
||||||
from .controllers import Controllers
|
from controllers import Controllers
|
||||||
from .models import Models
|
from models import Models
|
||||||
from .responses import Responses
|
from responses import Responses
|
||||||
from .util import check_password, stop_server
|
from util import check_password, stop_server
|
||||||
|
|
||||||
|
import uvicorn
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
|
|
@ -120,3 +122,7 @@ async def logs_tail(
|
||||||
) -> StreamingResponse:
|
) -> StreamingResponse:
|
||||||
check_password(authorization)
|
check_password(authorization)
|
||||||
return StreamingResponse(Controllers.logs.tail(data.back))
|
return StreamingResponse(Controllers.logs.tail(data.back))
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
uvicorn.run("main:app", host="0.0.0.0", port=42101)
|
||||||
|
|
|
||||||
6
util.py
6
util.py
|
|
@ -3,10 +3,10 @@ from typing import Callable
|
||||||
|
|
||||||
from fastapi import HTTPException
|
from fastapi import HTTPException
|
||||||
|
|
||||||
from minecraftd.classes import ProcessStatus
|
from classes import ProcessStatus
|
||||||
|
|
||||||
from .config import Config
|
from config import Config
|
||||||
from .controllers import Controllers
|
from controllers import Controllers
|
||||||
|
|
||||||
|
|
||||||
async def stop_server(
|
async def stop_server(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue