Skip to content

Commit

Permalink
fix: remove support for SQLite Bacula catalog
Browse files Browse the repository at this point in the history
Update documentation

Update config example

chore: fix comment in Database::__construct()

Resolve: #31
  • Loading branch information
dfranco committed Jan 7, 2024
1 parent 3eafb6b commit 17ca036
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 47 deletions.
7 changes: 0 additions & 7 deletions application/config/config.php.sample
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@ $config['rows_per_page'] = 25;
// $config[0]['db_type'] = 'pgsql';
// $config[0]['db_port'] = '5432';

// SQLite bacula catalog
// $config[0]['label'] = 'Dev backup server';
// $config[0]['db_type'] = 'sqlite';
// $config[0]['db_name'] = '/path/to/database/db.sdb';
// Copy the section below only if you have at least two Bacula catalog
// Don't forget to modify options such as label, host, login, password, etc.

// 2nd bacula catalog (MySQL)
// $config[1]['label'] = 'Dev backup server';
// $config[1]['host'] = 'mysql-server.domain.net';
Expand Down
2 changes: 1 addition & 1 deletion core/App/UserAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function check()
*/
public function checkSchema(): void
{
// Check if sqlite db file is writable
// Check if SQLite db file is writable
if (!is_writable($this->appDbBackend)) {
throw new DatabaseException('Application backend database file is not writable, please fix it');
}
Expand Down
4 changes: 2 additions & 2 deletions core/Db/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct(int $catalogId = null)
$this->driver = FileConfig::get_Value('db_type', $catalogId);
$dsn = FileConfig::get_DataSourceName($catalogId);

// Bacula catalog is using sqlite
// Bacula catalog is not using SQLite
if ($this->driver != 'sqlite') {
$username = FileConfig::get_Value('login', $catalogId);
$password = FileConfig::get_Value('password', $catalogId);
Expand Down Expand Up @@ -113,7 +113,7 @@ public function getServerVersion()
*/
public function getServerTimestamp(): int
{
// Different query for SQlite
// TODO: remove support for SQLite
if ($this->getDriverName() == 'sqlite') {
$statment = "SELECT datetime('now') as currentdatetime";
} else {
Expand Down
2 changes: 1 addition & 1 deletion docs/source/01_about/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ The test page do the following check for you
* PHP - session support (used in the Core php code)
* PHP - MySQL support
* PHP - PostgreSQL support
* PHP - sqlite support
* PHP - SQLite support
* PHP - PDO support
* PHP timezone setting
* Bacula catalog database connection (must be improved)
Expand Down
23 changes: 0 additions & 23 deletions docs/source/02_install/apache-installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ postgreSQL Bacula catalog

$ sudo yum install php php-gettext php-pgsql php-pdo

SQLite database support

::

$ sudo yum install php php-gettext php-pdo

Change SQLite database file permissions

Assuming that the bacula database file is located under /var/spool/bacula

::

# chmod -v 755 /var/spool/bacula
# chmod -v 704 /var/spool/bacula/bacula.db

.. note:: RedHat / Centos 6 users might need to install php-posix or php-process packages

Install requirements on Gentoo
Expand All @@ -67,9 +52,6 @@ Modify portage configuration
# postgreSQL
dev-lang/php postgres apache2 truetype cli pcre xml zlib
# SQLite
dev-lang/php sqlite apache2 truetype cli pcre xml zlib

Install Apache and PHP

Expand Down Expand Up @@ -146,11 +128,6 @@ With MySQL bacula catalog
* databases/php5-mysql
* databases/php5-pdo_mysql

With SQLite bacula catalog
* databases/php5-sqlite
* databases/php5-pdo_sqlite


.. note:: A big thanks to Dean E. Weimer who provided me Bacula-Web installation instructions for \*BSD setup

Apache web server configuration
Expand Down
11 changes: 2 additions & 9 deletions docs/source/02_install/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,9 @@ host hostname of the db server hosting Bacula catalog localhost
db_name name of the catalog database name usually bacula, unless you changed it
login database user bacula, admin, etc.
password database password mK3DQLolUV
db_type database type mysql, pgsql or sqlite
db_type database type mysql, pgsql
db_port database port number - mysql, use 3306
- pgsql, use 5432
- sqlite, leave blank
================= ==================================================== ====================================

**Examples**
Expand All @@ -279,7 +278,7 @@ db_port database port number - mysql,
// Database user's password
$config[0]['password'] = 'verystrongpassword';
// Database type (mysql | pgsql | sqlite)
// Database type (mysql | pgsql)
$config[0]['db_type'] = 'mysql';
// Database port
Expand Down Expand Up @@ -343,12 +342,6 @@ db_port database port number - mysql,
$config[1]['db_type'] = 'pgsql';
$config[1]['db_port'] = '5432';

// SQLite bacula catalog
$config[2]['db_type'] = 'sqlite';
$config[2]['label'] = 'bacula';
$config[2]['db_name'] = '/path/to/database';
?>

.. warning:: If you define several Bacula catalog, make sure each catalog connection settings have a different id
example: $config[0], $config[1], etc.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/02_install/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ General requirements
| | - Session |
| | - PDO |
| | - MySQL, postgreSQL |
| | - SQlite (required for user authentication)|
| | - SQLite (required for user authentication)|
| | - CLI |
| | - JSON |
| | - Posix |
Expand Down
6 changes: 5 additions & 1 deletion docs/source/03_get-help/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ But, if you encounter any problems with a specific version of Bacula, then feel
Which Bacula catalog database engine are supported by Bacula-Web ?
------------------------------------------------------------------

As of current version of Bacula-Web (version 8.7.0), Bacula catalog running with MySQL, MariaDB, postgreSQL and SQLite databases are supported.
As of current version of Bacula-Web (version 9.4.0), Bacula catalog running with MySQL, MariaDB and postgreSQL are supported.

.. important::

Support of Bacula catalog using SQLite are not supported as of v9.4.0

.. _current-status:

Expand Down
3 changes: 1 addition & 2 deletions docs/source/03_get-help/support.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ Before submitting a bug report, please make sure that ...

* $ mysql for MySQL
* $ psql for postgreSQL
* $ sqlite3 for SQLite

Then make sure you include those details in the bug report

* PHP version
* Which database you're using (SQLite, MySQL or postgreSQL)
* Which database you're using (MySQL, MariaDB or postgreSQL)
* Apache (or any web server) logs
* Screenshot(s) are useful too sometime

Expand Down

0 comments on commit 17ca036

Please sign in to comment.