fix: add config.php as ignored

This commit is contained in:
Matthieu Bessat 2021-08-08 19:32:01 +02:00
parent b65642cd0a
commit 14165f6e04
4 changed files with 12 additions and 29 deletions

2
.gitignore vendored
View file

@ -1,2 +1,2 @@
tmp
config.php

View file

@ -17,7 +17,9 @@ return [
'quickupload' => [
'auth' => true
],
'logator' => []
'logator' => [
'alias' => ['logme']
]
],
'auth' => [
'root' => 'password'

View file

@ -1,27 +0,0 @@
<?php
return [
'domain' => 'lefuturiste.fr',
'modules' => [
'random' => [],
'date' => [
'alias' => ['printdate']
],
'httpbin' => [],
'printip' => [
'alias' => ['ip', 'getip']
],
'quicknote' => [
'auth' => true
],
'quickupload' => [
'auth' => true
],
'logator' => [
'alias' => ['logme']
]
],
'auth' => [
'root' => 'password'
]
];

View file

@ -1,7 +1,15 @@
<?php
if (!file_exists('./config.php')) {
die('Config file not present');
}
$config = require('./config.php');
if (!is_array($config)) {
die('Config must be an array');
}
// a basic validation of config keys
if (!(isset($config['domain']) && strlen($config['domain']) > 0)) {
die('Domain key not present in config');