Compare commits

...

16 Commits

Author SHA1 Message Date
Ruslan Baidan 8f005da738 Updated the dependency with "Fixed all the clients' models unlink when a single one is removed.". 2023-12-04 15:44:13 +01:00
Ruslan Baidan 497ab325f3 Added definition and usage of the DATA_PATH global const. 2023-10-24 11:40:14 +02:00
Ruslan Baidan 3d99019bfc Added the PROJECT_ROOT definition and usage in the core lib patch. 2023-10-18 16:29:47 +02:00
Ruslan Baidan 5d92aa8aa5 Updated the backoffice dependency with the 2FA fix. 2023-08-08 12:55:27 +02:00
Ruslan Baidan 2aa121d41b Updated the backoffice dependency with added the missing space in the sql. 2023-06-22 14:19:18 +02:00
Ruslan Baidan 561e6793e1 Updated the backoffice dependency with the password reset when clients' 1st user's email is changed. 2023-06-22 14:07:19 +02:00
Ruslan Baidan 4aacfe4ccf Updated the backoffice dependency with the reset 2FA feature. 2023-06-20 17:00:17 +02:00
Ruslan Baidan 93b847191e Updated the Core dependency with the fix of typcasting. 2023-06-14 13:40:15 +02:00
Ruslan Baidan 862879066b Updated the zm-backoffice dependency. 2023-04-11 09:34:42 +02:00
Ruslan Baidan 29a78ddfd0 Updated the BackOffice dependency with the models unlink fix. 2023-03-31 11:25:01 +02:00
Ruslan Baidan 368c9b7c60 Reinstalled all the dependencies. 2023-03-24 09:57:16 +01:00
Ruslan Baidan 11364f3b3f Update the version and the dependencies. 2023-03-23 16:14:04 +01:00
Ruslan Baidan 2fcd92e05d Added the client update folder config option. 2023-03-23 11:41:28 +01:00
Ruslan Baidan 03e6d47f78
Update releases.yml
Fixed the typo.
2023-03-09 15:11:23 +01:00
Ruslan Baidan 1e307691bb Applied all the PHP8 required changes. 2023-03-09 15:05:40 +01:00
Ruslan Baidan b7eb17f06b Updated the core version. 2023-03-06 16:33:57 +01:00
12 changed files with 1330 additions and 1661 deletions

View File

@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
node-version: [ "16.x" ]
php-version: [ "7.4" ]
php-version: [ "8.1" ]
steps:
- uses: actions/checkout@v2
@ -34,10 +34,10 @@ jobs:
run: composer validate
- name: Install PHP dependencies
run: composer install --prefer-dist --no-progress --no-suggest --no-dev
run: composer ins --prefer-dist --no-progress --no-suggest --no-dev --ignore-platform-req=php
- name: Symlink Monarc modules
run: |
run: |
mkdir -p module/Monarc
ln -s ../../vendor/monarc/core module/Monarc/Core
ln -s ../../vendor/monarc/backoffice module/Monarc/BackOffice

View File

@ -1 +1 @@
{"major":2, "minor":12, "hotfix":4}
{"major":2, "minor":12, "hotfix":6}

View File

@ -40,11 +40,11 @@
}
],
"require": {
"php": "^7.4",
"php": "^7.4 || ^8.0",
"ext-json": "*",
"ext-pdo": "*",
"monarc/backoffice": "^2.9.7",
"monarc/core": "^2.9.15",
"monarc/backoffice": "^2.12.6",
"monarc/core": "^v2.12.6",
"laminas/laminas-mvc": "^3.1",
"laminas/laminas-di": "^3.1",
"laminas/laminas-permissions-rbac": "^3.0",
@ -54,7 +54,7 @@
"endroid/qr-code": "^4.4"
},
"require-dev": {
"roave/security-advisories": "dev-master"
"roave/security-advisories": "dev-latest"
},
"config": {
"bin-dir": "bin/",

2751
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -6,19 +6,26 @@
* @see https://github.com/zendframework/ZFTool
*/
$env = getenv('APP_ENV') ?: 'production';
$appConfDir = getenv('APP_CONF_DIR') ?: '';
$appConfDir = getenv('APP_CONF_DIR') ?: null;
$confPaths = ['config/autoload/{,*.}{global,local}.php'];
defined('PROJECT_ROOT') or define('PROJECT_ROOT', __DIR__ . '/../');
if ($env !== 'testing') {
$confPaths = ['config/autoload/{,*.}{global,local}.php'];
}
$dataPath = 'data';
if (!empty($appConfDir)) {
$confPaths[] = $appConfDir . '/local.php';
$dataPath = $appConfDir . '/data';
if (!is_dir($dataPath . '/cache')
&& !mkdir($concurrentDirectory = $dataPath . '/cache') && !is_dir($concurrentDirectory)
) {
throw new RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
if (!is_dir($dataPath . '/cache')) {
if (is_dir(PROJECT_ROOT . 'data/cache')) {
$dataPath = PROJECT_ROOT . 'data';
} elseif (!mkdir($concurrentDirectory = $dataPath . '/cache') && !is_dir($concurrentDirectory)) {
throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
}
}
}
defined('DATA_PATH') or define('DATA_PATH', $dataPath);
return array(
'modules' => array(

View File

@ -15,56 +15,56 @@ use Doctrine\DBAL\Driver\PDO\MySQL\Driver;
use Monarc\Core\Service\DoctrineCacheServiceFactory;
use Monarc\Core\Service\DoctrineLoggerFactory;
$appconfdir = getenv('APP_CONF_DIR') ?: '';
$datapath = "data";
if( ! empty($appconfdir) ){
$datapath = $appconfdir.'/data';
$dataPath = 'data';
if (defined('DATA_PATH')) {
$dataPath = DATA_PATH;
} elseif (!empty(getenv('APP_CONF_DIR'))) {
$dataPath = getenv('APP_CONF_DIR') . '/data';
}
return array(
return [
// DOCTRINE CONF
'service_manager' => array(
'factories' => array(
'service_manager' => [
'factories' => [
'doctrine.cache.mycache' => DoctrineCacheServiceFactory::class,
'doctrine.monarc_logger' => DoctrineLoggerFactory::class,
),
),
'doctrine' => array(
'connection' => array(
'orm_default' => array(
],
],
'doctrine' => [
'connection' => [
'orm_default' => [
'driverClass' => Driver::class,
'params' => array(
'params' => [
'host' => '127.0.0.1',
'port' => 3306,
'user' => 'root',
'password' => '',
'dbname' => 'monarc_common',
'charset' => 'utf8',
'driverOptions' => array(
'driverOptions' => [
PDO::ATTR_STRINGIFY_FETCHES => false,
PDO::ATTR_EMULATE_PREPARES => false,
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
),
),
),
'orm_cli' => array(
],
],
],
'orm_cli' => [
'driverClass' => Driver::class,
'params' => array(
'params' => [
'host' => '127.0.0.1',
'port' => 3306,
'user' => 'root',
'password' => '',
'dbname' => 'monarc_cli',
'charset' => 'utf8',
'driverOptions' => array(
'driverOptions' => [
PDO::ATTR_STRINGIFY_FETCHES => false,
PDO::ATTR_EMULATE_PREPARES => false,
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
),
),
),
),
],
],
],
],
/*'migrations_configuration' => array(
'orm_default' => array(
'name' => 'Monarc Migrations',
@ -81,52 +81,55 @@ return array(
'column' => 'version',
),
),*/
'entitymanager' => array(
'orm_default' => array(
'connection' => 'orm_default',
'configuration' => 'orm_default'
),
'orm_cli' => array(
'connection' => 'orm_cli',
'entitymanager' => [
'orm_default' => [
'connection' => 'orm_default',
'configuration' => 'orm_default',
],
'orm_cli' => [
'connection' => 'orm_cli',
'configuration' => 'orm_cli',
),
),
'configuration' => array(
'orm_default' => array(
'metadata_cache' => 'mycache',
'query_cache' => 'mycache',
'result_cache' => 'mycache',
'driver' => 'orm_default', // This driver will be defined later
'generate_proxies' => true,
'proxy_dir' => $datapath.'/DoctrineORMModule/Proxy',
'proxy_namespace' => 'DoctrineORMModule\Proxy',
'filters' => array(),
'datetime_functions' => array(),
'string_functions' => array(),
'numeric_functions' => array(),
'second_level_cache' => array(),
'sql_logger' => 'doctrine.monarc_logger',
),
'orm_cli' => array(
'metadata_cache' => 'mycache',
'query_cache' => 'mycache',
'result_cache' => 'mycache',
'driver' => 'orm_cli', // This driver will be defined later
'generate_proxies' => true,
'proxy_dir' => $datapath.'/DoctrineORMModule/Proxy',
'proxy_namespace' => 'DoctrineORMModule\Proxy',
'filters' => array(),
'datetime_functions' => array(),
'string_functions' => array(),
'numeric_functions' => array(),
'second_level_cache' => array(),
'sql_logger' => 'doctrine.monarc_logger',
),
),
),
],
],
'configuration' => [
'orm_default' => [
'metadata_cache' => 'mycache',
'query_cache' => 'mycache',
'result_cache' => 'mycache',
'driver' => 'orm_default', // This driver will be defined later
'generate_proxies' => true,
'proxy_dir' => $dataPath . '/DoctrineORMModule/Proxy',
'proxy_namespace' => 'DoctrineORMModule\Proxy',
'filters' => [],
'datetime_functions' => [],
'string_functions' => [],
'numeric_functions' => [],
'second_level_cache' => [],
'sql_logger' => 'doctrine.monarc_logger',
],
'orm_cli' => [
'metadata_cache' => 'mycache',
'query_cache' => 'mycache',
'result_cache' => 'mycache',
'driver' => 'orm_cli', // This driver will be defined later
'generate_proxies' => true,
'proxy_dir' => $dataPath . '/DoctrineORMModule/Proxy',
'proxy_namespace' => 'DoctrineORMModule\Proxy',
'filters' => [],
'datetime_functions' => [],
'string_functions' => [],
'numeric_functions' => [],
'second_level_cache' => [],
'sql_logger' => 'doctrine.monarc_logger',
],
],
],
'spool_path_create' => $datapath.'/json/create/',//default location path where the json file enabling the creation of the environment of the client should be generated
'spool_path_delete' => $datapath.'/json/delete/', //default location path where the json file enabling the deletion of the environment of the client should be generated
'spool_path_create' => $dataPath . '/json/create/',
//default location path where the json file enabling the creation of the environment of the client should be generated
'spool_path_delete' => $dataPath . '/json/delete/',
//default location path where the json file enabling the deletion of the environment of the client should be generated
'spool_path_update' => $dataPath . '/json/update/',
// END DOCTRINE CONF
);
];

View File

@ -10,6 +10,14 @@
* control, so do not include passwords or other sensitive information in this
* file.
*/
$dataPath = 'data';
if (defined('DATA_PATH')) {
$dataPath = DATA_PATH;
} elseif (!empty(getenv('APP_CONF_DIR'))) {
$dataPath = getenv('APP_CONF_DIR') . '/data';
}
return array(
// DOCTRINE CONF
'service_manager' => array(
@ -81,7 +89,7 @@ return array(
'result_cache' => 'mycache',
'driver' => 'orm_default', // This driver will be defined later
'generate_proxies' => true,
'proxy_dir' => 'data/DoctrineORMModule/Proxy',
'proxy_dir' => $dataPath .'data/DoctrineORMModule/Proxy',
'proxy_namespace' => 'DoctrineORMModule\Proxy',
'filters' => array(),
'datetime_functions' => array(),
@ -95,7 +103,7 @@ return array(
'result_cache' => 'mycache',
'driver' => 'orm_cli', // This driver will be defined later
'generate_proxies' => true,
'proxy_dir' => 'data/DoctrineORMModule/Proxy',
'proxy_dir' => $dataPath . 'data/DoctrineORMModule/Proxy',
'proxy_namespace' => 'DoctrineORMModule\Proxy',
'filters' => array(),
'datetime_functions' => array(),

View File

@ -1,6 +1,6 @@
{
"name": "MONARC Back Office",
"version": "2.12.4",
"version": "2.12.6",
"description": "MONARC Back Office",
"private": true,
"repository": {

View File

@ -68,7 +68,7 @@ if [[ $? -eq 1 ]]; then
exit 1
fi
composer install -o --no-dev
composer install -o --no-dev --ignore-platform-req=php
pathCore="module/Monarc/Core"
pathBO="module/Monarc/BackOffice"

View File

@ -0,0 +1,10 @@
#!/bin/bash
pushd node_modules/ng_backoffice
if [[ -d po && -f po/template.pot ]]; then
for f in po/*.po; do
msgmerge --backup=none -U "$f" po/template.pot
msgattrib --no-obsolete --clear-fuzzy --empty -o "$f" "$f"
done;
fi

6
vagrant/Vagrantfile vendored
View File

@ -10,8 +10,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "bento/ubuntu-20.04"
config.disksize.size = "50GB"
config.vm.box = "bento/ubuntu-22.04"
config.disksize.size = "100GB"
config.vm.provision "shell", privileged: false, path: "bootstrap.sh"
# Disable automatic box update checking. If you disable this, then
@ -55,7 +55,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#
# # Use VBoxManage to customize the VM. For example to change memory:
vb.customize ["modifyvm", :id, "--memory", "2048"]
vb.customize ["modifyvm", :id, "--name", "MONARC BO - Ubuntu 20.04 - DEV"]
vb.customize ["modifyvm", :id, "--name", "MONARC BO - Ubuntu 22.04 - DEV"]
end
#
# View the documentation for the provider you're using for more

View File

@ -23,8 +23,8 @@ max_execution_time=100
max_input_time=223
memory_limit=512M
PHP_INI=/etc/php/7.4/apache2/php.ini
XDEBUG_CFG=/etc/php/7.4/apache2/conf.d/20-xdebug.ini
PHP_INI=/etc/php/8.1/apache2/php.ini
XDEBUG_CFG=/etc/php/8.1/apache2/conf.d/20-xdebug.ini
MARIA_DB_CFG=/etc/mysql/mariadb.conf.d/50-server.cnf
export DEBIAN_FRONTEND=noninteractive
@ -46,6 +46,7 @@ sudo apt-get -y install vim zip unzip git gettext curl gsfonts > /dev/null
echo -e "\n--- Install MariaDB specific packages and settings… ---\n"
sudo apt-get -y install mariadb-server mariadb-client > /dev/null
# Secure the MariaDB installation (especially by setting a strong root password)
sudo systemctl restart mariadb.service > /dev/null
sleep 5
@ -71,10 +72,13 @@ expect -f - <<-EOF
send -- "y\r"
expect eof
EOF
sudo apt-get purge -y expect php-xdebug > /dev/null 2>&1
sudo apt-get purge -y expect > /dev/null 2>&1
echo -e "\n--- Configuring… ---\n"
sudo sed -i "s/skip-external-locking/#skip-external-locking/g" $MARIA_DB_CFG
sudo sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" $MARIA_DB_CFG
sudo sed -i "s/.*character-set-server.*/character-set-server = utf8mb4/" $MARIA_DB_CFG
sudo sed -i "s/.*collation-server.*/collation-server = utf8mb4_general_ci/" $MARIA_DB_CFG
echo -e "\n--- Setting up our MariaDB user for MONARC… ---\n"
sudo mysql -u root -p$DBPASSWORD_ADMIN -e "CREATE USER '$DBUSER_MONARC'@'%' IDENTIFIED BY '$DBPASSWORD_MONARC';"
@ -82,8 +86,11 @@ sudo mysql -u root -p$DBPASSWORD_ADMIN -e "GRANT ALL PRIVILEGES ON * . * TO '$DB
sudo mysql -u root -p$DBPASSWORD_ADMIN -e "FLUSH PRIVILEGES;"
sudo systemctl restart mariadb.service > /dev/null
echo -e "\n--- Installing Apache… ---\n"
sudo apt install apache2 -y
echo -e "\n--- Installing PHP-specific packages… ---\n"
sudo apt-get -y install php apache2 libapache2-mod-php php-curl php-gd php-mysql php-pear php-apcu php-xml php-mbstring php-intl php-imagick php-zip php-xdebug > /dev/null
sudo apt-get install -y php8.1 php8.1-cli php8.1-common php8.1-mysql php8.1-zip php8.1-gd php8.1-mbstring php8.1-curl php8.1-xml php8.1-bcmath php8.1-intl php8.1-imagic php8.1-xdebug > /dev/null
echo -e "\n--- Configuring PHP… ---\n"
for key in upload_max_filesize post_max_size max_execution_time max_input_time memory_limit
@ -92,10 +99,10 @@ do
done
echo -e "\n--- Configuring Xdebug for development ---\n"
sudo bash -c cat "<< EOF > $XDEBUG_CFG
sudo bash -c "cat << EOF > $XDEBUG_CFG
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.mode=debug
xdebug.discover_client_host=1
xdebug.idekey=IDEKEY
EOF"
@ -138,6 +145,10 @@ mkdir -p $PATH_TO_MONARC/data/DoctrineORMModule/Proxy
# Front-end
echo -e "\n--- Installation of Node, NPM… ---\n"
curl -sL https://deb.nodesource.com/setup_15.x | sudo bash -
sudo apt-get install -y nodejs npm
mkdir -p node_modules
cd node_modules
if [ ! -d "ng_backoffice" ]; then
@ -227,11 +238,6 @@ mysql -u $DBUSER_MONARC -p$DBPASSWORD_MONARC monarc_common < db-bootstrap/monarc
mysql -u $DBUSER_MONARC -p$DBPASSWORD_MONARC monarc_common < db-bootstrap/monarc_data.sql > /dev/null
echo -e "\n--- Installation of Node, NPM… ---\n"
curl -sL https://deb.nodesource.com/setup_15.x | sudo bash -
sudo apt-get install -y nodejs
echo -e "\n--- Adjusting user mod… ---\n"
sudo usermod -aG www-data vagrant
sudo usermod -aG vagrant www-data