diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..d0bff0d --- /dev/null +++ b/.env.example @@ -0,0 +1,34 @@ +# ========================================== +# WEB SERVER CONFIGURATIE +# ========================================== +PORT=3000 +NODE_ENV=development + +SESSION_SECRET=very_long_very_strong_very_secret_secret + +# ========================================== +# MINECRAFT & RCON +# ========================================== +MC_HOST=mc.example.com +MC_RCON_PORT=25575 +MC_RCON_PASSWORD=your_rcon_password + +MC_LOG_PATH=/data/logs/latest.log + +# ========================================== +# OAUTH2 CONFIGURATION +# ========================================== +OAUTH_CLIENT_ID=jouw_authentik_client_id +OAUTH_CLIENT_SECRET=jouw_authentik_client_secret + +OAUTH_REDIRECT_URI=http://localhost:3000/auth/callback +OAUTH_ISSUER_URL=https://authentik.jouwdomein.nl/application/o/minecraft-panel/ + +OAUTH_AUTHORIZATION_URL=https://authentik.jouwdomein.nl/application/o/authorize/ +OAUTH_TOKEN_URL=https://authentik.jouwdomein.nl/application/o/token/ +OAUTH_USERINFO_URL=https://authentik.jouwdomein.nl/application/o/userinfo/ + +# ========================================== +# DOCKER API +# ========================================== +DOCKER_SOCK=/var/run/docker.sock \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..30da4b8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +package-lock.json +node_modules/ +.env \ No newline at end of file diff --git a/main.js b/main.js new file mode 100644 index 0000000..a7816ed --- /dev/null +++ b/main.js @@ -0,0 +1,35 @@ +/* +Imports +*/ + + + + + +/* +Constant declaration +*/ + + + + + +/* +Socket.io socket function +*/ + + +/* +Passport.js OAuth2/OICD handler +*/ + + +/* +Express Routes +*/ + + + +/* +Run Express +*/ \ No newline at end of file diff --git a/minecraft.js b/minecraft.js new file mode 100644 index 0000000..6888ae2 --- /dev/null +++ b/minecraft.js @@ -0,0 +1,13 @@ +/* +Imports +*/ + + +/* +helper functions (eg, getOnlinePlayers()) +*/ + + +/* +module.exports all those functions +*/ \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..869a496 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "dependencies": { + "dockerode": "^5.0.0", + "dotenv": "^17.4.2", + "express": "^5.2.1", + "express-session": "^1.19.0", + "helmet": "^8.1.0", + "minecraft-server-util": "^5.4.4", + "passport": "^0.7.0", + "passport-oauth2": "^1.8.0", + "rcon-client": "^4.2.5", + "socket.io": "^4.8.3", + "tail": "^2.2.6" + } +}