Fixes directory structure

main
Yasen Pramatarov 2024-08-13 17:53:52 +03:00
parent 2cdfbe6e86
commit 8eed6afd46
18 changed files with 19 additions and 17 deletions

View File

@ -49,7 +49,7 @@ You can install it in the following ways:
- download the latest release from the **"Releases"** section here
```bash
tar -xzf jilo-web_*.tgz
cd jilo-web
cd jilo-web/doc/
./install.sh
```
- clone the **git repo**:
@ -66,7 +66,7 @@ cd jilo-web
- "sqlite_file" is the sqlite db file for jilo-web itself, it goes to `app/jilo-web.db`, create it with
```bash
cd app
cat doc/jilo-web.schema | sqlite3 jilo-web.db
cat ../doc/jilo-web.schema | sqlite3 jilo-web.db
```
- "jilo_database" is the sqlite db file for jilo, with data from the Jitsi logs

View File

@ -1,6 +1,6 @@
<?php
$config = [
return [
// edit to customize
'domain' => 'localhost', // domain for the web app
'folder' => '/jilo-web/', // subfolder for the web app, if any
@ -10,8 +10,10 @@ $config = [
'login_message' => '', // will be displayed on login screen
// edit only if needed for tests or debugging
'db_type' => 'sqlite', // DB type for the web app, currently only "sqlite" is used
'sqlite_file' => '../app/jilo-web.db', // default is ../app/jilo-web.db
'db' => [
'db_type' => 'sqlite', // DB type for the web app, currently only "sqlite" is used
'sqlite_file' => '../app/jilo-web.db', // default is ../app/jilo-web.db
],
'version' => '0.1.1', // system info
];

View File

@ -18,11 +18,11 @@ function connectDB($config, $database = '') {
} else {
// sqlite database file
if ($config['db_type'] === 'sqlite') {
if ($config['db']['db_type'] === 'sqlite') {
try {
$db = new Database([
'type' => $config['db_type'],
'dbFile' => $config['sqlite_file'],
'type' => $config['db']['db_type'],
'dbFile' => $config['db']['sqlite_file'],
]);
$pdo = $db->getConnection();
} catch (Exception $e) {
@ -31,15 +31,15 @@ function connectDB($config, $database = '') {
exit();
}
// mysql/mariadb database
} elseif ($config['db_type'] === 'mysql' || $config['db_type'] === 'mariadb') {
} elseif ($config['db']['db_type'] === 'mysql' || $config['db']['db_type'] === 'mariadb') {
try {
$db = new Database([
'type' => $config['db_type'],
'host' => $config['sql_host'] ?? 'localhost',
'port' => $config['sql_port'] ?? '3306',
'dbname' => $config['sql_database'],
'user' => $config['sql_username'],
'password' => $config['sql_password'],
'type' => $config['db']['db_type'],
'host' => $config['db']['sql_host'] ?? 'localhost',
'port' => $config['db']['sql_port'] ?? '3306',
'dbname' => $config['db']['sql_database'],
'user' => $config['db']['sql_username'],
'password' => $config['db']['sql_password'],
]);
$pdo = $db->getConnection();
} catch (Exception $e) {
@ -49,7 +49,7 @@ function connectDB($config, $database = '') {
}
// unknown database
} else {
$error = "Error: unknow database type \"{$config['db_type']}\"";
$error = "Error: unknow database type \"{$config['db']['db_type']}\"";
include '../app/templates/block-message.php';
exit();
}

View File

@ -48,7 +48,7 @@ foreach ($config_file_locations as $location) {
}
// if found, use it
if ($config_file) {
require_once $config_file;
$config = require $config_file;
} else {
die('Config file not found');
}