Skip to content

Commit

Permalink
deb cleanup (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Coutadeur committed Aug 1, 2024
1 parent cc3601d commit e5e7073
Show file tree
Hide file tree
Showing 19 changed files with 341 additions and 87 deletions.
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,10 @@
"cp -R vendor/fortawesome/font-awesome/webfonts htdocs/vendor/font-awesome",
"rm -rf vendor/fortawesome/font-awesome"
]
},
"require-dev": {
"phpunit/phpunit": ">=8",
"php-mock/php-mock-phpunit": "*",
"mockery/mockery": ">=1.4"
}
}
33 changes: 33 additions & 0 deletions docs/configuration-apache.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
.. _apache_configuration:

Apache configuration
====================

Apache or Nginx is not installed by default. You must choose one.

Current section explains how to install and configure Apache.

Install and configure Apache
----------------------------

On Debian:

.. code-block:: shell
apt install apache2
# configure php-fpm for apache2
a2enmod proxy_fcgi setenvif
a2enconf php*-fpm.conf
# enable the default website
a2ensite service-desk
Then you can configure your virtual host. A default one is provided in ``/etc/apache2/sites-available``

On RHEL systems:

.. code-block:: shell
dnf install httpd
Then you can configure your virtual host. A default one is provided in ``/etc/httpd/conf.d/``

Virtual host
------------

Expand Down
13 changes: 9 additions & 4 deletions docs/general-parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ General parameters
Configuration files
-------------------

The default configuration file is ``conf/config.inc.php``, it contains all default values.
To edit configuration, you should create ``conf/config.inc.local.php`` and override needed parameters:
The default configuration file is ``/etc/service-desk/config.inc.php``, it contains all default values.
To edit configuration, you should create ``/etc/service-desk/config.inc.local.php`` and override needed parameters:

.. code-block:: php
Expand All @@ -29,7 +29,7 @@ This feature is disable by default. To enable it:
$header_name_extra_config = "SSP-Extra-Config";
Then if you send the header ``SSP-Extra-Config: domain1``, the file
``conf/config.inc.domain1.php`` will be loaded.
``/etc/service-desk/config.inc.domain1.php`` will be loaded.

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

Expand Down Expand Up @@ -64,7 +64,12 @@ Set default language in ``$lang``:
$lang = "en";
.. tip:: You can override messages by creating lang files in ``conf/``, for example ``conf/en.inc.php``.
.. tip:: You can override messages by creating lang files in configuration directory:

* ``conf/`` directory for service-desk archive
* ``/etc/service-desk`` directory for rpm/deb packages

For example, you can create a customized file: ``/etc/service-desk/en.inc.php``.

Language is picked according to browser choice among the available ones. All languages
are allowed by default, to restrict them add ``$allowed_lang`` array:
Expand Down
16 changes: 10 additions & 6 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Install files in ``/usr/share/``:
You need to install these prerequisites:

* Apache or another web server
* php
* php-ldap
* Smarty (version 3)
* php-fpm
* smarty (version 3 or 4)

Debian / Ubuntu
---------------
Expand Down Expand Up @@ -54,12 +54,14 @@ You are now ready to install:

.. prompt:: bash #

apt install service-desk smarty3
apt install service-desk

You should now proceed to :ref:`webserver installation and configuration <apache_configuration>`

CentOS / RedHat
---------------

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

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

Expand All @@ -81,7 +83,7 @@ Then update:

.. prompt:: bash #

yum update
dnf update

Import repository key:

Expand All @@ -93,7 +95,9 @@ You are now ready to install:

.. prompt:: bash #

yum install service-desk
dnf install service-desk

You should now proceed to :ref:`webserver installation and configuration <apache_configuration>`

Docker
------
Expand Down
78 changes: 78 additions & 0 deletions docs/upgrade.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,84 @@ Upgrade
From 0.5 to 0.6
---------------

bundled dependencies
~~~~~~~~~~~~~~~~~~~~

The dependencies are now explicitly listed in the service-desk package, including the bundled ones.

You can find bundled dependencies list:

* in package description in debian package
* in Provides field in rpm package


configuration
~~~~~~~~~~~~~

The configuration files are now in ``/etc/service-desk`` directory.

During the upgrade process towards 0.6, the previous configuration files present in ``/usr/share/service-desk/conf`` (all .php files) are migrated to ``/etc/service-desk/``:

* ``config.inc.php`` is migrated as a ``config.inc.php.bak`` file,
* all other php file names are preserved. (including local conf, domain conf, and customized lang files)

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.

Avoid as much as possible editing the ``/etc/service-desk/config.inc.php`` file. Prefer modifying the ``/etc/service-desk/config.inc.local.php``.

cache cleaning
~~~~~~~~~~~~~~

Now the cache is being cleaned-up during service-desk upgrade / install.

This is intended to avoid smarty problems due to service-desk templates upgrade, and possibly smarty upgrade itself.


dependencies update
~~~~~~~~~~~~~~~~~~~

Removed packaged dependencies:

* old php module for apache2/httpd is no more required. The migration is done towards php-fpm.
* apache2/httpd is not required any more. You can installed nginx or httpd by hand.

Packaged dependencies:

* smarty is now a required package. service-desk will work with either version 3 or 4. On debian, ``config.inc.php`` will be configured to use smarty4 if available
* 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
* php-ldap has been kept as dependency

Bundled dependencies:

* js-bootstrap has been updated from version v3.4.1 to version v5.3.2
* js-jquery has been updated from version v1.10.2 to version v3.7.1
* js-datatables.net-datatables.net has been updated from version 1.10.16 to version 2.1.2
* js-datatables.net-datatables.net-bs5 has been updated from version 1.10.16 to version 2.0.8
* js-datatables.net-datatables.net-buttons has been updated from version 1.5.1 to version 3.1.0
* js-datatables.net-datatables.net-buttons-bs5 has been updated from version 1.5.1 to version 3.0.2
* fontawesome-fonts has been updated from version 4.7.0 to version 6.5.2
* php-ltb-project-ltb-common has been updated from version 0.1 to version 0.3.0
* php-phpmailer has been updated from version 6.8.0 to version v6.9.1

Removed bundled dependencies:

.. code-block::
myclabs/deep-copy, doctrine/instantiator,
nikic/php-parser, phar-io/version, phpunit/php-code-coverage, phpunit/phpunit,
phpunit/php-timer, phpunit/php-invoker, phpunit/php-text-template,
phpunit/php-file-iterator, sebastian/recursion-context,
sebastian/version, sebastian/complexity, sebastian/environment,
sebastian/object-enumerator, sebastian/global-state,
sebastian/resource-operations, sebastian/comparator,
sebastian/exporter, sebastian/type, sebastian/code-unit,
sebastian/lines-of-code, sebastian/diff, sebastian/object-reflector,
sebastian/code-unit-reverse-lookup, sebastian/cli-parser, theseer/tokenizer
Note that hidden files (.gitignore,...) from bundled dependencies are now removed from packages.



Last authentication time and idle accounts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
60 changes: 0 additions & 60 deletions packaging/README

This file was deleted.

110 changes: 110 additions & 0 deletions packaging/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Some notes on packaging Service Desk

## 0 - Version update

Update version in following files:

* htdocs/index.php
* packaging/rpm/SPECS/service-desk.spec
* packaging/debian/changelog

## 1 - Update dependencies and run tests

From the service-desk root directory, run:

```
composer update
```

Run tests:

```
XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --configuration tests/phpunit.xml
```

After the tests, remove the useless dependencies:

```
composer update --no-dev
```

## 2 - Archive tar.gz

From current directory, do:

```
./makedist.sh VERSION
```

with VERSION the current verion of the package

For example:

```
./makedist.sh 0.6
```


## 2 - Debian

Form current directory, do:

```
dpkg-buildpackage -b -kLTB
```

If you do not have LTB GPG secret key, do:

```
dpkg-buildpackage -b -us -uc
```

## 3 - RPM (RHEL, CentOS, Fedora, ...)

Prepare your build environment, for example in /home/clement/build.

You should have a ~/.rpmmacros like this:

```
%_topdir /home/clement/build
%dist .el5
%distribution .el5
%_signature gpg
%_gpg_name 6D45BFC5
%_gpgbin /usr/bin/gpg
%packager Clement OUDOT <[email protected]>
%vendor LTB-project
```

Copy packaging files from current directory to build directory:

```
cp -Ra rpm/* /home/clement/build
```

Copy Self Service Archive to SOURCES/:

```
cp ltb-project-service-desk-VERSION.tar.gz /home/clement/build/SOURCES
```

Go in build directory and build package:

```
cd /home/clement/build
rpmbuild -ba SPECS/service-desk.spec
```

Sign RPM:

```
rpm --addsign RPMS/noarch/service-desk*
```

## 4 - Docker

From current directory, do:

```
docker build -t service-desk -f ./docker/Dockerfile ../
```
Loading

0 comments on commit e5e7073

Please sign in to comment.