Docker compose #1

Merged
Nigel merged 2 commits from nigel_quick_fix into master 2020-11-21 14:06:41 +00:00
6 changed files with 27 additions and 6 deletions
Showing only changes of commit 6ff22f0279 - Show all commits

View File

@ -1,5 +1,10 @@
.drone.yml
.drone-manifest.yml
.data
.gitignore
Dockerfile
docker-compose.yml
nginx.conf
onyx2/cache/*.cache.php
onyx2/cache/signatures/*.sign
onyx2/log/*.log

View File

@ -1,7 +1,8 @@
#!/bin/sh
[ -n "$MYSQL_DATABASE" ] && sed -i -r "/db/s/=\s*'([^']*)'/= '${MYSQL_DATABASE}'/" onyx2/db/default.profile.php
[ -n "$MYSQL_HOST" ] && sed -i -r "/host/s/=\s*'([^']*)'/= '${MYSQL_HOST}'/" onyx2/db/default.profile.php
# superseed in onyx2/db/default.profile.php
#[ -n "$MYSQL_HOST" ] && sed -i -r "/host/s/=\s*'([^']*)'/= '${MYSQL_HOST}'/" onyx2/db/default.profile.php
[ -n "$MYSQL_USER" ] && sed -i -r "/user/s/=\s*'([^']*)'/= '${MYSQL_USER}'/" onyx2/db/default.profile.php
[ -n "$MYSQL_PASSWORD" ] && sed -i -r "/pass/s/=\s*'([^']*)'/= '${MYSQL_PASSWORD}'/" onyx2/db/default.profile.php

View File

@ -3,7 +3,11 @@
if(!defined('ONYX')) exit;
$___profile['db'] = 'hb_game';
$___profile['host'] = 'localhost';
if (getenv("MYSQL_HOST") === False) {
$___profile['host'] = 'localhost';
} else {
$___profile['host'] = getenv("MYSQL_HOST");
}
$___profile['user'] = 'hb';
$___profile['pass'] = 'hb';

View File

@ -4,6 +4,9 @@ if(!defined('ONYX')) exit;
if (empty($sess->values["connected"]) && !defined("xCSRF"))
define("xCSRF", true);
//A passer a True pour dev tranquillou (pas d'envois de mail, pas de https,...)
define("DEV", getenv("DEV"));
require_once("function.php"); //Inclusion des fonctions principales
require_once("tables.php"); //Inclusion des noms des tables de base de données correspondant à l'architecture du serveur
@ -50,10 +53,11 @@ if (!empty($sess->values["connected"]))
unset($header);
//Evite les attaques CSRF
if (!empty($_SERVER["HTTP_REFERER"]) && !(preg_match('#^https://'.$_SERVER['HTTP_HOST'].'#', $_SERVER["HTTP_REFERER"]) && defined("xCSRF")))
if (DEV) { $protocole = "http"; } else { $protocole = "https"; }
if (!empty($_SERVER["HTTP_REFERER"]) && !(preg_match('#^'.$protocole.'://'.$_SERVER['HTTP_HOST'].'#', $_SERVER["HTTP_REFERER"]) && defined("xCSRF")))
{
elog("Possibilité d'attaque CSRF\n".var_export($_REQUEST, TRUE), 2);
unset($_POST, $_GET);
$_GET = $_POST = array();
}
?>
?>

View File

@ -147,7 +147,13 @@ if (isset($_POST['HB_pseudo']) && isset($_POST['HB_mdp']) && isset($_POST['HB_co
//$mail->Subject='Halo-Battle :: Pre-Inscription';
//$mail->Body='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Halo-Battle :: Pr&eacute;-Inscription</title></head><body><p>F&eacute;licitations '.$pseudo.' !<br />Votre compte vient d&#39;&ecirc;tre enregistr&eacute; sur notre serveur. Un mail de confirmation vous sera envoy&eacute; lors de la sortie du jeu en ligne Halo-Battle. Si vous ne recevez pas l\'email de confirmation, <a href="mailto:technique@halo-battle.s-fr.com">contactez un administrateur</a>.<br /><br />A tr&egrave;s bient&ocirc;t pour la sortie d&#39;Halo-Battle !</p></body></html>';
if(!$mail->Send()){
if (DEV) {
$ret = true;
} else {
$ret = $mail->Send();
}
if(!$ret){
$template->assign('message','Erreur lors de l\'envoie du courriel de confirmation !<br /><br /><small><i>'.$mail->ErrorInfo.'</i></small><br /><br />Si le problème perciste, <a href="mailto:technique@halo-battle.fr">contactez un administrateur</a>.');
$template->assign('couleur','red');
$template->display('cms/erreur.tpl');

View File

@ -16,7 +16,8 @@ if (!empty($_GET['i'])) {
case 1:
//$url = "http://battle.halo.fr/";
//$url = "http://hb.s-fr.com/beta.php";
$url = "https://beta.halo-battle.fr/";
//$url = "https://beta.halo-battle.fr/";
$url = 'http://'.$_SERVER['HTTP_HOST'].'/';
break;
default:
$url = "http://battle.halo.fr/";