Skip to content

Commit 514ede3

Browse files
author
David Coutadeur
committed
debian cleanup (#205)
1 parent 54938ec commit 514ede3

File tree

10 files changed

+163
-43
lines changed

10 files changed

+163
-43
lines changed

conf/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!.gitignore
3+
!config.inc.php

docs/configuration-apache.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
1+
.. _apache_configuration:
2+
13
Apache configuration
24
====================
35

6+
7+
Apache or Nginx is not installed by default. You must choose one.
8+
9+
Current section explains how to install and configure Apache.
10+
11+
Install and configure Apache
12+
----------------------------
13+
14+
On Debian:
15+
16+
.. code-block:: shell
17+
18+
apt install apache2
19+
20+
# configure php-fpm for apache2
21+
a2enmod proxy_fcgi setenvif
22+
a2enconf php*-fpm.conf
23+
24+
# enable the default website
25+
a2ensite service-desk
26+
27+
Then you can configure your virtual host. A default one is provided in ``/etc/apache2/sites-available``
28+
29+
On RHEL systems:
30+
31+
.. code-block:: shell
32+
33+
dnf install httpd
34+
35+
Then you can configure your virtual host. A default one is provided in ``/etc/httpd/conf.d/``
36+
437
Virtual host
538
------------
639

docs/general-parameters.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ General parameters
44
Configuration files
55
-------------------
66

7-
To configure White Pages, you need to create a local configuration file named ``config.inc.local.php`` in ``white-pages/conf``. For example :
7+
To configure White Pages, you need to create a local configuration file named ``config.inc.local.php`` in ``/etc/white-pages/``. For example :
88

99
.. code-block:: php
1010
@@ -13,7 +13,7 @@ To configure White Pages, you need to create a local configuration file named ``
1313
1414
?>
1515
16-
White Pages default configuration file is ``white-pages/conf/config.inc.php``. It includes ``config.inc.local.php``. Consequently, you can override all parameters in ``config.inc.local.php``. This prevents you to be disturbed by an upgrade.
16+
White Pages default configuration file is ``/etc/white-pages/config.inc.php``. It includes ``config.inc.local.php``. Consequently, you can override all parameters in ``config.inc.local.php``. This prevents you to be disturbed by an upgrade.
1717

1818
.. warning::
1919
Do not copy ``config.inc.php`` into ``config.inc.local.php``, as the first one includes the second.
@@ -30,7 +30,7 @@ This feature is disabled by default. To enable it:
3030
$header_name_extra_config = "WP-Extra-Config";
3131
3232
Then if you send the header ``WP-Extra-Config: domain1``, the file
33-
``conf/config.inc.domain1.php`` will be loaded.
33+
``/etc/white-pages/config.inc.domain1.php`` will be loaded.
3434

3535
Using Apache, we may set such header using the following:
3636

@@ -39,19 +39,20 @@ Using Apache, we may set such header using the following:
3939
<VirtualHost *:80>
4040
ServerName wp.domain1.com
4141
RequestHeader setIfEmpty WP-Extra-Config domain1
42-
[...]
42+
# ...
4343
</VirtualHost>
4444
4545
Using Nginx, we could use instead:
4646

4747
.. code-block:: nginx
4848
4949
server {
50-
[...]
50+
# ...
5151
location ~ \.php {
5252
fastcgi_param WP-Extra-Config domain1;
53-
[...]
53+
# ...
5454
}
55+
}
5556
5657
Language
5758
--------
@@ -70,7 +71,12 @@ Available languages are:
7071
* French (fr)
7172
* Italian (it)
7273

73-
.. tip:: You can override messages by creating lang files in ``conf/``, for example ``conf/en.inc.php``.
74+
.. tip:: You can override messages by creating lang files in configuration directory:
75+
76+
* ``conf/`` directory for white-pages archive
77+
* ``/etc/white-pages`` directory for rpm/deb packages
78+
79+
For example, you can create a customized file: ``/etc/white-pages/en.inc.php``.
7480

7581
In order to restrict languages to a specific set add ``$allowed_lang`` array as follows:
7682

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ LDAP Tool Box White Pages documentation
99

1010
presentation.rst
1111
installation.rst
12+
upgrade.rst
1213
authentication.rst
1314
configuration-apache.rst
1415
general-parameters.rst

docs/installation.rst

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ From tarball
66

77
Prerequisites:
88

9-
* php (version 7.4 or higher)
109
* php-ldap
1110
* php-gd
12-
* Smarty (version 3 or higher)
1311
* composer
12+
* php-fpm
13+
* smarty (version 3 or 4)
1414

1515
Tarball can be downloaded from `LTB project website <https://ltb-project.org/download.html>`_.
1616

@@ -94,10 +94,12 @@ You are now ready to install:
9494

9595
apt install white-pages
9696

97+
You should now proceed to :ref:`webserver installation and configuration <apache_configuration>`
98+
9799
CentOS / RedHat
98100
---------------
99101

100-
.. warning:: You need to install first the package `php-Smarty`_ which is not in official repositories.
102+
.. warning:: You must install the package `php-Smarty`_. You can get it from EPEL repositories.
101103

102104
.. _php-Smarty: https://pkgs.org/download/php-Smarty
103105

@@ -120,7 +122,7 @@ Then update:
120122

121123
.. prompt:: bash #
122124

123-
yum update
125+
dnf update
124126

125127
Import repository key:
126128

@@ -132,7 +134,9 @@ You are now ready to install:
132134

133135
.. prompt:: bash #
134136

135-
yum install white-pages
137+
dnf install white-pages
138+
139+
You should now proceed to :ref:`webserver installation and configuration <apache_configuration>`
136140

137141
Docker
138142
------
@@ -147,25 +151,3 @@ Start container, mounting that configuration file:
147151
-v /home/test/whitepages.conf.php:/var/www/conf/config.inc.local.php \
148152
-it docker.io/ltbproject/white-pages:latest
149153

150-
Upgrade Notes
151-
-------------
152-
153-
If you upgrade from an older version, read the following instructions:
154-
155-
Version 0.4
156-
~~~~~~~~~~~
157-
158-
* Parameter `$ldap_user_regex` is now disbaled by default, means that the object type detection is done with configured LDAP filters.
159-
160-
* The new map feature is disabled by default, as it requires to request OpenStreetMap API. Check the documentation before enabling it.
161-
162-
Version 0.3
163-
~~~~~~~~~~~
164-
165-
There is a new parameter: `$ldap_user_regex`.
166-
167-
If the default value does not fit your LDAP directory configuration, you must unset the default value, or adapt it. To unset it, put in your config.inc.local.php:
168-
169-
```unset($ldap_user_regex);```
170-
171-
See also the ldap parameters page.

docs/upgrade.rst

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
Upgrade
2+
=======
3+
4+
If you upgrade from an older version, read the following instructions:
5+
6+
From 0.4 to 0.5
7+
---------------
8+
9+
bundled dependencies
10+
~~~~~~~~~~~~~~~~~~~~
11+
12+
The dependencies are now explicitly listed in the white-pages package, including the bundled ones.
13+
14+
You can find bundled dependencies list:
15+
16+
* in package description in debian package
17+
* in Provides field in rpm package
18+
19+
20+
configuration
21+
~~~~~~~~~~~~~
22+
23+
The configuration files are now in ``/etc/white-pages`` directory.
24+
25+
During the upgrade process towards 0.5, the previous configuration files present in ``/usr/share/white-pages/conf`` (all .php files) are migrated to ``/etc/white-pages/``:
26+
27+
* ``config.inc.php`` is migrated as a ``config.inc.php.bak`` file,
28+
* all other php file names are preserved. (including local conf, domain conf, and customized lang files)
29+
30+
Please take in consideration that ``config.inc.php`` is now replaced systematically by the version in the RPM package. A .rpmsave backup will be done with the current version. The deb package will continue asking which file to use, it is advised to replace the current one with the version in the package.
31+
32+
Avoid as much as possible editing the ``/etc/white-pages/config.inc.php`` file. Prefer modifying the ``/etc/white-pages/config.inc.local.php``.
33+
34+
cache cleaning
35+
~~~~~~~~~~~~~~
36+
37+
Now the cache is being cleaned-up during white-pages upgrade / install.
38+
39+
This is intended to avoid smarty problems due to white-pages templates upgrade, and possibly smarty upgrade itself.
40+
41+
42+
dependencies update
43+
~~~~~~~~~~~~~~~~~~~
44+
45+
Removed packaged dependencies:
46+
47+
* old php module for apache2/httpd is no more required. The migration is done towards php-fpm.
48+
* apache2/httpd is not required any more. You can installed nginx or httpd by hand.
49+
50+
Packaged dependencies:
51+
52+
* smarty is now a required package. white-pages will work with either version 3 or 4. On debian, ``config.inc.php`` will be configured to use smarty4 if available
53+
* php-fpm >= 7.3 is now a required dependency, replacing old php module for apache/httpd. On debian, if apache2 is already installed, php-fpm configuration for apache2 will be done automatically
54+
* php-ldap has been kept as dependency
55+
56+
Bundled dependencies:
57+
58+
* js-bootstrap has been updated from version 3.2.0 to version v5.3.6
59+
* js-jquery has been updated from version v1.10.2 to version v3.7.1
60+
* js-datatables.net-datatables.net has been updated from version 1.10.16 to version 2.1.2
61+
* js-datatables.net-datatables.net-bs5 has been updated from version 1.10.16 to version 2.0.8
62+
* js-datatables.net-datatables.net-buttons has been updated from version 1.5.1 to version 3.1.0
63+
* js-datatables.net-datatables.net-buttons-bs5 has been updated from version 1.5.1 to version 3.0.2
64+
* fontawesome-fonts has been updated from version 4.7.0 to version 6.5.2
65+
* php-ltb-project-ltb-common has been updated from version 0.1 to version 0.5.0
66+
* php-phpmailer has been updated from version 6.8.0 to version v6.9.1
67+
68+
Note that hidden files (.gitignore,...) from bundled dependencies are now removed from packages.
69+
70+
71+
From 0.3 to 0.4
72+
---------------
73+
74+
* Parameter `$ldap_user_regex` is now disbaled by default, means that the object type detection is done with configured LDAP filters.
75+
76+
* The new map feature is disabled by default, as it requires to request OpenStreetMap API. Check the documentation before enabling it.
77+
78+
From 0.2 to 0.3
79+
---------------
80+
81+
There is a new parameter: `$ldap_user_regex`.
82+
83+
If the default value does not fit your LDAP directory configuration, you must unset the default value, or adapt it. To unset it, put in your config.inc.local.php:
84+
85+
```unset($ldap_user_regex);```
86+
87+
See also the ldap parameters page.

packaging/debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
ltb-project-white-pages (0.5-1) unstable; urgency=low
2+
3+
* gh#205: debian cleanup
4+
5+
-- Clement Oudot <clem@ltb-project.org> Fri, 23 Jan 2026 12:00:00 +0200
6+
17
ltb-project-white-pages (0.4-2) unstable; urgency=low
28

39
* gh#126: Missing bin/ directory in packages

packaging/debian/conffiles

Lines changed: 0 additions & 2 deletions
This file was deleted.

packaging/debian/copyright

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,25 @@ Maintainer: Clement Oudot <clem@ltb-project.org>
44
Source: http://ltb-project.org/wiki/documentation/white-pages
55

66
Files: htdocs/vendor/bootstrap
7-
Copyright: 2011-2014 Twitter, Inc.
7+
Copyright: Copyright (c) 2011-2024 The Bootstrap Authors
88

99
Files: htdocs/vendor/bootstrap-datepicker
1010
Copyright: 2012 Stefan Petre
1111

1212
Files: htdocs/vendor/font-awesome
13-
Copyright: @davegandy - http://fontawesome.io - @fontawesome
13+
Copyright: Font Awesome by Dave Gandy - http://fontawesome.io
1414

1515
Files: htdocs/vendor/hover
1616
Copyright: 2014 Ian Lunn
1717

1818
Files: htdocs/vendor/jquery
19-
Copyright: 2005, 2013 jQuery Foundation, Inc.
19+
Copyright: Copyright OpenJS Foundation and other contributors, https://openjsf.org/
20+
21+
Files: htdocs/vendor/datatables
22+
Copyright: Copyright (C) 2008-2024, SpryMedia Ltd.
2023

2124
Files: *
22-
Copyright: 2009-2025 LTB-Project, Worteks, Clement Oudot, David Coutadeur
25+
Copyright: 2009-2026 LTB-Project, Worteks, Clement Oudot, David Coutadeur
2326

2427
License: GPL
2528
This program is free software; you can redistribute it and/or modify

tests/LangTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public function testTranslations()
1010

1111
# Available languages
1212
$languages = array();
13-
if ($handle = opendir('lang')) {
13+
if ($handle = opendir(__DIR__ . '/../lang')) {
1414
while (false !== ($entry = readdir($handle))) {
1515
if ($entry != "." && $entry != "..") {
1616
array_push($languages, str_replace(".inc.php", "", $entry));
@@ -19,13 +19,14 @@ public function testTranslations()
1919
closedir($handle);
2020
}
2121

22-
require("lang/en.inc.php");
22+
require(__DIR__ . "/../conf/config.inc.php");
23+
require(__DIR__ . "/../lang/en.inc.php");
2324
$reference = $messages;
2425
$error = '';
2526

2627
foreach ($languages as $lang) {
2728
$messages = array();
28-
require("lang/$lang.inc.php");
29+
require(__DIR__ . "/../lang/$lang.inc.php");
2930

3031
$missing = array_diff(array_keys($reference), array_keys($messages));
3132
if (!empty($missing)) {

0 commit comments

Comments
 (0)