From b7885d20cf02f80f924410994a4e1b922d885aba Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 1 Sep 2025 19:44:18 +0200 Subject: [PATCH] ajout admin panel --- mangosd.conf | 56 -------------------------------------------- php/Dockerfile | 22 ------------------ php/composer.json | 15 ------------ php/index.php | 58 ---------------------------------------------- php/srp6.php | 50 --------------------------------------- soap.php | 59 ----------------------------------------------- 6 files changed, 260 deletions(-) delete mode 100644 mangosd.conf delete mode 100644 php/Dockerfile delete mode 100644 php/composer.json delete mode 100644 php/index.php delete mode 100644 php/srp6.php delete mode 100644 soap.php diff --git a/mangosd.conf b/mangosd.conf deleted file mode 100644 index 9b4647e..0000000 --- a/mangosd.conf +++ /dev/null @@ -1,56 +0,0 @@ - -################################################################################################################### -# -# GameType -# Server realm style -# 0 = NORMAL; 1 = PVP; 4 = NORMAL; 6 = RP; 8 = RPPVP -# also custom type: 16 FFA_PVP (free for all pvp mode like arena PvP in all zones except rest -# activated places and sanctuaries) -# -# RealmZone -# Server realm zone (set allowed alphabet in character names/etc). See also Strict*Names options. -# -# 1 Development - any language (Default) -# 2 United States - extended-Latin -# 3 Oceanic - extended-Latin -# 4 Latin America - extended-Latin -# 5 Tournament - basic-Latin at create, any at login -# 6 Korea - East-Asian -# 7 Tournament - basic-Latin at create, any at login -# 8 English - extended-Latin -# 9 German - extended-Latin -# 10 French - extended-Latin -# 11 Spanish - extended-Latin -# 12 Russian - Cyrillic -# 13 Tournament - basic-Latin at create, any at login -# 14 Taiwan - East-Asian -# 15 Tournament - basic-Latin at create, any at login -# 16 China - East-Asian -# 17 CN1 - basic-Latin at create, any at login -# 18 CN2 - basic-Latin at create, any at login -# 19 CN3 - basic-Latin at create, any at login -# 20 CN4 - basic-Latin at create, any at login -# 21 CN5 - basic-Latin at create, any at login -# 22 CN6 - basic-Latin at create, any at login -# 23 CN7 - basic-Latin at create, any at login -# 24 CN8 - basic-Latin at create, any at login -# 25 Tournament - basic-Latin at create, any at login -# 26 Test Server - any language -# 27 Tournament - basic-Latin at create, any at login -# 28 QA Server - any language -# 29 CN9 - basic-Latin at create, any at login -# -# RabbitDay -# Set to Rabbit Day (date in unix time), only the day and month are considered, the year is not important -# Default: 0 (off) -# Suggested: 954547200 (April 1st, 2000) -# -# Motd -# Message of the Day. Displayed at worldlogin for every user ('@' for a newline). -# -#################################################################################################################### - -GameType = 0 -RealmZone = 8 -RabbitDay = 954547200 -Motd = "Bienvenue en Azeroth!" diff --git a/php/Dockerfile b/php/Dockerfile deleted file mode 100644 index 3bd9db1..0000000 --- a/php/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -FROM php:8.2-apache - -# Installer les dépendances nécessaires pour compiler les extensions PHP -RUN apt-get update && apt-get install -y \ - unzip \ - git \ - libgmp-dev \ - libzip-dev \ - libxml2-dev \ - default-mysql-client \ - && docker-php-ext-install mysqli gmp soap \ - && rm -rf /var/lib/apt/lists/* - -# Installer composer -COPY --from=composer:2 /usr/bin/composer /usr/bin/composer - -# Copier l'application -WORKDIR /var/www/html -COPY ./index.php ./srp6.php ./composer.json ./ - -# Installer les dépendances PHP -RUN composer install --no-dev --optimize-autoloader diff --git a/php/composer.json b/php/composer.json deleted file mode 100644 index 50d1e0d..0000000 --- a/php/composer.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "wow/account-web", - "description": "Web panel to create WoW accounts with SRP6 and OIDC authentication", - "require": { - "php": ">=8.0", - "jumbojett/openid-connect-php": "^0.9.6", - "ext-gmp": "*", - "ext-mysqli": "*" - }, - "autoload": { - "files": [ - "srp6.php" - ] - } -} \ No newline at end of file diff --git a/php/index.php b/php/index.php deleted file mode 100644 index a9767e4..0000000 --- a/php/index.php +++ /dev/null @@ -1,58 +0,0 @@ -authenticate(); -// $_SESSION['user'] = $oidc->getVerifiedClaims(); -// } - -// --- Formulaire pour créer un compte --- -if ($_SERVER['REQUEST_METHOD'] === 'POST') { - $user = $_POST['username']; - $pass = $_POST['password']; - - $soapUser = 'SOAPUSER'; - $soapPass = 'SOAPPASS'; - $host = getenv('SOAP_HOST'); - $port = getenv('SOAP_PORT'); - - $command = "account create $user $pass"; - $command = "account list"; - - $client = new SoapClient(NULL, [ - "location" => "http://mangosd:7878/", - "uri" => "urn:MaNGOS", - "style" => SOAP_RPC, - 'login' => $soapUser, - 'password' => $soapPass - ]); - - try { - // NOTE : ne pas mettre de préfixe ns1: - $result = $client->__soapCall('executeCommand', [new SoapParam($command, 'command')]); - echo "✅ Command executed:\n"; - echo $result; - var_dump($result); - } catch (Exception $e) { - echo "❌ Command failed:\n"; - echo $e->getMessage(); - } -} -?> - -
- - - -
diff --git a/php/srp6.php b/php/srp6.php deleted file mode 100644 index 0bcdc18..0000000 --- a/php/srp6.php +++ /dev/null @@ -1,50 +0,0 @@ - 64 hex) - $saltBin = random_bytes(32); - - // h1 = SHA1(U:P) - $h1 = sha1($U . ':' . $P, true); - - // h2 = SHA1(salt || h1) - $h2 = sha1($saltBin . $h1, true); - - // x = int( h2 ) (interprété comme un entier non signé big-endian) - // -> on passe par l'hex pour éviter les soucis d'endianness - $x = gmp_init(bin2hex($h2), 16); - - $N = gmp_init(self::N_HEX, 16); - $g = gmp_init(self::G_HEX, 16); - - // v = g^x mod N - $v = gmp_powm($g, $x, $N); - - // Longueur hex attendue = longueur de N en hex (ici 64 chars) - $nLen = strlen(self::N_HEX); - - // Hex MAJUSCULE + padding - $vHex = strtoupper(str_pad(gmp_strval($v, 16), $nLen, '0', STR_PAD_LEFT)); - $sHex = strtoupper(str_pad(bin2hex($saltBin), 64, '0', STR_PAD_LEFT)); // 32 bytes => 64 hex - - return ['v' => $vHex, 's' => $sHex]; - } -} diff --git a/soap.php b/soap.php deleted file mode 100644 index 4c9ac4d..0000000 --- a/soap.php +++ /dev/null @@ -1,59 +0,0 @@ - "http://$host:$soapport/", - "uri" => "urn:MaNGOS", - "style" => SOAP_RPC, - 'login' => $username, - 'password' => $password -)); - -try { - $result = $client->executeCommand(new SoapParam($command, "command")); - - echo "Command succeeded! Output:
\n"; - echo $result; -} -catch (Exception $e) -{ - echo "Command failed! Reason:
\n"; - echo $e->getMessage(); -} \ No newline at end of file