Compare commits
No commits in common. "a3eb5ee70c2a5808cbc2843b000d25df19d1a8b1" and "fd4b98ccfd50e6c6f4da01f72095a123b70fb1dc" have entirely different histories.
a3eb5ee70c
...
fd4b98ccfd
27
.env.example
27
.env.example
@ -1,24 +1,5 @@
|
|||||||
#Config
|
|
||||||
WEB_PORT=3000
|
WEB_PORT=3000
|
||||||
IS_PROD=FALSE
|
IS_PROD=TRUE
|
||||||
|
DATABASE_HOST=host
|
||||||
#MariaDB
|
DATABASE_USER=username
|
||||||
DATABASE_HOST="host"
|
DATABASE_PASSWORD=Password
|
||||||
DATABASE_USER="username"
|
|
||||||
DATABASE_PASSWORD="Password"
|
|
||||||
DATABASE_NAME="database"
|
|
||||||
|
|
||||||
#Mojang API
|
|
||||||
SUPPORT_UUID_TO_NAME_HISTORY=TRUE
|
|
||||||
|
|
||||||
#Authlib-Injector
|
|
||||||
SUPPORT_AUTHLIB_INJECTOR=TRUE
|
|
||||||
SUPPORT_LEGACY_SKIN_API=TRUE #[legacy_skin_api]
|
|
||||||
SUPPORT_MOJANG_FALLBACK=FALSE #[no_mojang_namespace]
|
|
||||||
SUPPORT_MOJANG_TELEMETRY_BLOCKER=TRUE #[enable_mojang_anti_features]
|
|
||||||
SUPPORT_PROFILE_KEY=TRUE #[enable_profile_key]
|
|
||||||
SUPPORT_ONLY_DEFAULT_USERNAME=true #[username_check]
|
|
||||||
SUPPORT_REGISTER=TRUE
|
|
||||||
REGISTER_ENDPOINT="/register"
|
|
||||||
HOMEPAGE_URL=
|
|
||||||
SERVER_NAME="Yggdrasil"
|
|
||||||
@ -3,7 +3,7 @@ const globals = require("globals")
|
|||||||
|
|
||||||
module.exports = [
|
module.exports = [
|
||||||
{
|
{
|
||||||
ignores: ["node_modules", "data", "logs", "coverage", ".env", "*.log"],
|
ignores: ["node_modules", "logs", "coverage", ".env", "*.log"],
|
||||||
},
|
},
|
||||||
js.configs.recommended,
|
js.configs.recommended,
|
||||||
{
|
{
|
||||||
|
|||||||
@ -6,6 +6,8 @@ require("dotenv").config({
|
|||||||
quiet: true
|
quiet: true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
process.setMaxListeners(15)
|
||||||
|
|
||||||
function cleanup($stream) {
|
function cleanup($stream) {
|
||||||
if (!$stream.destroyed) {
|
if (!$stream.destroyed) {
|
||||||
$stream.end()
|
$stream.end()
|
||||||
|
|||||||
@ -1,17 +0,0 @@
|
|||||||
const express = require("express")
|
|
||||||
const router = express.Router()
|
|
||||||
const utils = require("../modules/utils")
|
|
||||||
const serverService = require("../services/serverService")
|
|
||||||
|
|
||||||
if (utils.isTrueFromDotEnv("SUPPORT_AUTHLIB_INJECTOR")) {
|
|
||||||
router.get("", (req, res) => {
|
|
||||||
const hostname = req.hostname
|
|
||||||
const metadata = serverService.getServerMetadata(hostname)
|
|
||||||
res.header("X-Authlib-Injector-Date", new Date().toISOString())
|
|
||||||
return res.status(200).json(metadata)
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
router.get("", (req, res, next) => next())
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = router
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
const certs = require("../modules/certificatesManager")
|
|
||||||
const utils = require("../modules/utils")
|
|
||||||
const package = require("../package.json")
|
|
||||||
|
|
||||||
function getServerMetadata(hostname) {
|
|
||||||
const keys = certs.getKeys()
|
|
||||||
const publicKeyPEM = keys.playerCertificateKeys.public
|
|
||||||
|
|
||||||
const serverMeta = {
|
|
||||||
meta: {
|
|
||||||
serverName: process.env.SERVER_NAME || "Yggdrasil Server",
|
|
||||||
implementationName: package.name,
|
|
||||||
implementationVersion: package.version,
|
|
||||||
|
|
||||||
"feature.legacy_skin_api": utils.isTrueFromDotEnv("SUPPORT_LEGACY_SKIN_API"),
|
|
||||||
"feature.no_mojang_namespace": utils.isTrueFromDotEnv("SUPPORT_MOJANG_FALLBACK"),
|
|
||||||
"feature.enable_mojang_anti_features": utils.isTrueFromDotEnv("SUPPORT_MOJANG_TELEMETRY_BLOCKER"),
|
|
||||||
"feature.enable_profile_key": utils.isTrueFromDotEnv("SUPPORT_PROFILE_KEY"),
|
|
||||||
"feature.username_check": utils.isTrueFromDotEnv("SUPPORT_ONLY_DEFAULT_USERNAME"),
|
|
||||||
|
|
||||||
links: {
|
|
||||||
homepage: process.env.HOMEPAGE_URL || `http://${hostname}`,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
skinDomains: [
|
|
||||||
hostname,
|
|
||||||
`.${hostname}`
|
|
||||||
],
|
|
||||||
signaturePublickey: publicKeyPEM
|
|
||||||
}
|
|
||||||
if (utils.isTrueFromDotEnv("SUPPORT_REGISTER")) {
|
|
||||||
serverMeta.meta.links.register = process.env.REGISTER_ENDPOINT || `http://${hostname}/register`
|
|
||||||
}
|
|
||||||
return serverMeta
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
getServerMetadata
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user