Compare commits
87 Commits
Author | SHA1 | Date |
---|---|---|
Ruslan Baidan | 8f005da738 | |
Ruslan Baidan | 497ab325f3 | |
Ruslan Baidan | 3d99019bfc | |
Ruslan Baidan | 5d92aa8aa5 | |
Ruslan Baidan | 2aa121d41b | |
Ruslan Baidan | 561e6793e1 | |
Ruslan Baidan | 4aacfe4ccf | |
Ruslan Baidan | 93b847191e | |
Ruslan Baidan | 862879066b | |
Ruslan Baidan | 29a78ddfd0 | |
Ruslan Baidan | 368c9b7c60 | |
Ruslan Baidan | 11364f3b3f | |
Ruslan Baidan | 2fcd92e05d | |
Ruslan Baidan | 03e6d47f78 | |
Ruslan Baidan | 1e307691bb | |
Ruslan Baidan | b7eb17f06b | |
Ruslan Baidan | 4118d48c4a | |
Ruslan Baidan | 4e82cc864a | |
Ruslan Baidan | 650831e071 | |
jfrocha | 0bfd7dd322 | |
Ruslan Baidan | acff5b43ac | |
Ruslan Baidan | 03465c2f44 | |
Ruslan Baidan | 855100136c | |
Ruslan Baidan | f892fc7cd1 | |
Ruslan Baidan | 2648319da1 | |
Ruslan Baidan | 4ddb6c42d8 | |
Ruslan Baidan | ead469f096 | |
Ruslan Baidan | 01600858d5 | |
Ruslan Baidan | c2dfb60dca | |
Ruslan Baidan | 7cbd53eef4 | |
Cédric Bonhomme | 77b0a68e27 | |
Cédric Bonhomme | ab95ee6c6e | |
Cédric Bonhomme | b91e2bfaf3 | |
Ruslan Baidan | df8d8ac90d | |
Cédric Bonhomme | 74a13d269e | |
Cedric | 78f274075a | |
Rémi Laurent | 24b1bfcf5e | |
Rémi Laurent | 97b75586e9 | |
Rémi Laurent | f208ed4f5a | |
Rémi Laurent | 3daefd99ed | |
Rémi Laurent | 62681f0275 | |
Cédric Bonhomme | 25fb2513a0 | |
Cédric Bonhomme | 239166a930 | |
Cédric Bonhomme | 39c490abc6 | |
Cédric Bonhomme | b5ded532fa | |
Cédric Bonhomme | 0c543d6847 | |
Cédric Bonhomme | 35458470e0 | |
Cédric Bonhomme | 6995ec1218 | |
Ruslan Baidan | 23dacbffa4 | |
dependabot[bot] | 8de0a994dc | |
Ruslan Baidan | 2095d4751f | |
dependabot[bot] | 4a9e1188c3 | |
Ruslan Baidan | 5012fb9d4b | |
Ruslan Baidan | 105399730f | |
Ruslan Baidan | f3105a6761 | |
Ruslan Baidan | fc31de9b80 | |
jfrocha | 11c9a58d73 | |
Cédric Bonhomme | c6173bfea7 | |
Cédric Bonhomme | f4c179493a | |
Cédric Bonhomme | cede994b83 | |
Ruslan Baidan | d62d9d5d7f | |
Ruslan Baidan | 8ba95c8bf0 | |
Cédric Bonhomme | aac3aaaa1c | |
Ruslan Baidan | 6cd81e4baa | |
Ruslan Baidan | 481d1b60d7 | |
Ruslan Baidan | beeb9d6207 | |
Ruslan Baidan | 789b63c771 | |
Ruslan Baidan | 9ad7b375da | |
Cédric Bonhomme | 71d4a109c1 | |
Ruslan Baidan | f22b0d27d6 | |
Cédric Bonhomme | dc88640d91 | |
Ruslan Baidan | 885a80a552 | |
Ruslan Baidan | 48a6b299e2 | |
Ruslan Baidan | cbbee4a643 | |
Ruslan Baidan | 2d854e56fa | |
Ruslan Baidan | 480916c33f | |
Cédric Bonhomme | 7c843fef61 | |
Cédric Bonhomme | 304555d580 | |
Ruslan Baidan | 699f983105 | |
Ruslan Baidan | 05e0ad3d8b | |
Ruslan Baidan | 3e0d611c48 | |
ruslanbaidan | b169fffd3a | |
Ruslan Baidan | dc96289c36 | |
Cédric Bonhomme | a7d811749f | |
Cédric Bonhomme | 905a638318 | |
Ruslan Baidan | 8bebf629c2 | |
Ruslan Baidan | 6b78d0d470 |
|
@ -0,0 +1,107 @@
|
|||
name: MonarcAppBO releases
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ 'master' ]
|
||||
tags: [ 'v*.*', 'v*.*.*', 'v*.*.*-*' ]
|
||||
pull_request:
|
||||
branches: [ 'master' ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [ "16.x" ]
|
||||
php-version: [ "8.1" ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: install deps
|
||||
run: sudo apt-get update && sudo apt install -y gettext
|
||||
|
||||
# PHP
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
tools: composer:v2.3
|
||||
extensions: bcmath
|
||||
|
||||
- name: Validate composer.json and composer.lock
|
||||
run: composer validate
|
||||
|
||||
- name: Install PHP dependencies
|
||||
run: composer ins --prefer-dist --no-progress --no-suggest --no-dev --ignore-platform-req=php
|
||||
|
||||
- name: Symlink Monarc modules
|
||||
run: |
|
||||
mkdir -p module/Monarc
|
||||
ln -s ../../vendor/monarc/core module/Monarc/Core
|
||||
ln -s ../../vendor/monarc/backoffice module/Monarc/BackOffice
|
||||
|
||||
# javascript
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- uses: oprypin/find-latest-tag@v1
|
||||
with:
|
||||
repository: monarc-project/ng-anr
|
||||
releases-only: true
|
||||
id: ng_anr_lasttag
|
||||
|
||||
- run: echo "ng-anr is at version ${{ steps.ng_anr_lasttag.outputs.tag }}"
|
||||
|
||||
- name: Install ng-anr
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: monarc-project/ng-anr
|
||||
ref: ${{ steps.ng_anr_lasttag.outputs.tag }}
|
||||
path: './node_modules/ng_anr'
|
||||
|
||||
- uses: oprypin/find-latest-tag@v1
|
||||
with:
|
||||
repository: monarc-project/ng-backoffice
|
||||
releases-only: true
|
||||
id: ng_backoffice_lasttag
|
||||
|
||||
- run: echo "ng-backoffice is at version ${{ steps.ng_backoffice_lasttag.outputs.tag }}"
|
||||
|
||||
- name: Install ng-backoffice
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: monarc-project/ng-backoffice
|
||||
ref: ${{ steps.ng_backoffice_lasttag.outputs.tag }}
|
||||
path: './node_modules/ng_backoffice'
|
||||
|
||||
- name: Install ng-backoffice dependencies
|
||||
run: |
|
||||
cd node_modules/ng_backoffice
|
||||
npm ci
|
||||
|
||||
# final "cleanup"
|
||||
- name: post job
|
||||
run: |
|
||||
bash -ex ./scripts/link_modules_resources.sh
|
||||
bash -ex ./scripts/compile_translations.sh
|
||||
|
||||
# prepare release
|
||||
- name: Get repository name
|
||||
id: repository
|
||||
run: echo "::set-output name=pathref::$(echo '${{ github.repository }}' | cut -d'/' -f2)-$(echo '${{ github.ref_name }}' | sed 's/[^[:alnum:]\.-]/_/g')"
|
||||
|
||||
- name: create artifact archive
|
||||
run: |
|
||||
tar --exclude .git --exclude .github -zcf '../${{ steps.repository.outputs.pathref }}.tar.gz' .
|
||||
|
||||
- name: release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
../${{ steps.repository.outputs.pathref }}.tar.gz
|
||||
fail_on_unmatched_files: true
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
12
AUTHORS
12
AUTHORS
|
@ -1,8 +1,9 @@
|
|||
# Developers
|
||||
|
||||
Cédric Bonhomme
|
||||
Cédric Bonhomme - https://www.cedricbonhomme.org
|
||||
Jérôme Lombardi
|
||||
Juan Rocha
|
||||
Ruslan Baidan
|
||||
|
||||
|
||||
# Contributors
|
||||
|
@ -19,10 +20,11 @@ Thomas Metois
|
|||
|
||||
# Copyright holders
|
||||
|
||||
- Copyright (C) 2016-2019 Jérôme Lombardi - https://github.com/jerolomb
|
||||
- Copyright (C) 2016-2019 Juan Rocha - https://github.com/jfrocha
|
||||
- Copyright (C) 2016-2019 SMILE gie securitymadein.lu
|
||||
- Copyright (C) 2017-2019 Cédric Bonhomme - https://github.com/cedricbonhomme
|
||||
- Copyright (C) 2016-2021 Jérôme Lombardi - https://github.com/jerolomb
|
||||
- Copyright (C) 2016-2021 Juan Rocha - https://github.com/jfrocha
|
||||
- Copyright (C) 2016-2021 SMILE gie securitymadein.lu
|
||||
- Copyright (C) 2017-2021 Cédric Bonhomme - https://github.com/cedricbonhomme
|
||||
- Copyright (C) 2016-2017 Guillaume Lesniak
|
||||
- Copyright (C) 2016-2017 Thomas Metois
|
||||
- Copyright (C) 2016-2017 Jérôme De Almeida
|
||||
- Copyright (C) 2019-2021 Ruslan Baidan - https://github.com/ruslanbaydan
|
||||
|
|
|
@ -83,7 +83,7 @@ Create two symbolic links:
|
|||
|
||||
$ cd module/Monarc
|
||||
$ ln -s ./../../vendor/monarc/core Core
|
||||
$ ln -s ./../../vendor/monarc/frontoffice FrontOffice
|
||||
$ ln -s ./../../vendor/monarc/backoffice BackOffice
|
||||
$ cd ../..
|
||||
|
||||
There are 2 parts:
|
||||
|
|
11
README.md
11
README.md
|
@ -24,17 +24,18 @@ License
|
|||
This software is licensed under
|
||||
[GNU Affero General Public License version 3](http://www.gnu.org/licenses/agpl-3.0.html)
|
||||
|
||||
- Copyright (C) 2016-2019 Jérôme Lombardi - https://github.com/jerolomb
|
||||
- Copyright (C) 2016-2019 Juan Rocha - https://github.com/jfrocha
|
||||
- Copyright (C) 2016-2019 SMILE gie securitymadein.lu
|
||||
- Copyright (C) 2017-2019 Cédric Bonhomme - https://github.com/cedricbonhomme
|
||||
- Copyright (C) 2016-2022 SECURITYMADEIN.LU
|
||||
- Copyright (C) 2016-2022 Jérôme Lombardi - https://github.com/jerolomb
|
||||
- Copyright (C) 2016-2022 Juan Rocha - https://github.com/jfrocha
|
||||
- Copyright (C) 2017-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
|
||||
- Copyright (C) 2016-2017 Guillaume Lesniak
|
||||
- Copyright (C) 2016-2017 Thomas Metois
|
||||
- Copyright (C) 2016-2017 Jérôme De Almeida
|
||||
- Copyright (C) 2019-2022 Ruslan Baidan - https://github.com/ruslanbaydan
|
||||
|
||||
For more information, [the list of authors and contributors](AUTHORS) is available.
|
||||
|
||||
Data provided with MONARC (threats, assets, vulnerabilities, referentials,
|
||||
Data provided with MONARC (threats, assets, vulnerabilities, standards,
|
||||
etc.) are licensed under
|
||||
[CC0 1.0 Universal (CC0 1.0)](https://creativecommons.org/publicdomain/zero/1.0/) -
|
||||
Public Domain Dedication.
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"major":2, "minor":9, "hotfix":4}
|
||||
{"major":2, "minor":12, "hotfix":6}
|
||||
|
|
|
@ -2,35 +2,65 @@
|
|||
"name": "monarc/monarc-backoffice",
|
||||
"description": "Monarc back office application",
|
||||
"authors": [
|
||||
{"name": "Cyril Rouyer", "email": "cyril@netlor.fr"},
|
||||
{"name": "Guillaume Lesniak", "email": "guillaume@netlor.fr"},
|
||||
{"name": "Jerôme De Almeida", "email": "jerome.dealmeida@vesperiagroup.com"},
|
||||
{"name": "Benjamin Ganivet", "email": "benjamin@netlor.fr"},
|
||||
{"name": "Thomas Metois", "email": "thomas@netlor.fr"},
|
||||
{"name": "Jérôme Lombardi", "email": "jerome.lombardi@cases.lu"},
|
||||
{"name": "Juan Rocha", "email": "juan.rocha@cases.lu"},
|
||||
{"name": "Cédric Bonhomme", "email": "cedric.bonhomme@cases.lu"},
|
||||
{"name": "Ruslan Baidan", "email": "ruslan.baidan@cases.lu"}
|
||||
{
|
||||
"name": "Cyril Rouyer",
|
||||
"email": "cyril@netlor.fr"
|
||||
},
|
||||
{
|
||||
"name": "Guillaume Lesniak",
|
||||
"email": "guillaume@netlor.fr"
|
||||
},
|
||||
{
|
||||
"name": "Jérôme De Almeida",
|
||||
"email": "jerome.dealmeida@vesperiagroup.com"
|
||||
},
|
||||
{
|
||||
"name": "Benjamin Ganivet",
|
||||
"email": "benjamin@netlor.fr"
|
||||
},
|
||||
{
|
||||
"name": "Thomas Metois",
|
||||
"email": "thomas@netlor.fr"
|
||||
},
|
||||
{
|
||||
"name": "Jérôme Lombardi",
|
||||
"email": "jerome.lombardi@cases.lu"
|
||||
},
|
||||
{
|
||||
"name": "Juan Rocha",
|
||||
"email": "juan.rocha@cases.lu"
|
||||
},
|
||||
{
|
||||
"name": "Cédric Bonhomme",
|
||||
"email": "cedric.bonhomme@cases.lu"
|
||||
},
|
||||
{
|
||||
"name": "Ruslan Baidan",
|
||||
"email": "ruslan.baidan@cases.lu"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.1",
|
||||
"php": "^7.4 || ^8.0",
|
||||
"ext-json": "*",
|
||||
"ext-pdo": "*",
|
||||
"monarc/backoffice": "^2.9",
|
||||
"monarc/core": "^2.9",
|
||||
"zendframework/zend-mvc": "^3.1",
|
||||
"zendframework/zend-di": "^3.1",
|
||||
"zendframework/zend-permissions-rbac": "^3.0",
|
||||
"zendframework/zend-log": "^2.11",
|
||||
"zendframework/zend-i18n": "^2.9"
|
||||
}
|
||||
,
|
||||
"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",
|
||||
"laminas/laminas-log": "^2.11",
|
||||
"laminas/laminas-i18n": "^2.9",
|
||||
"laminas/laminas-dependency-plugin": "^2.0",
|
||||
"endroid/qr-code": "^4.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"roave/security-advisories": "dev-master",
|
||||
"zendframework/zend-component-installer": "^2.1"
|
||||
"roave/security-advisories": "dev-latest"
|
||||
},
|
||||
"config": {
|
||||
"bin-dir": "bin/"
|
||||
"bin-dir": "bin/",
|
||||
"allow-plugins": {
|
||||
"laminas/laminas-dependency-plugin": true
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6,34 +6,41 @@
|
|||
* @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(
|
||||
'Zend\Di',
|
||||
'Zend\Cache',
|
||||
'Zend\Form',
|
||||
'Zend\InputFilter',
|
||||
'Zend\Filter',
|
||||
'Zend\Paginator',
|
||||
'Zend\Hydrator',
|
||||
'Zend\Router',
|
||||
'Zend\Log',
|
||||
'Zend\Mail',
|
||||
'Zend\Validator',
|
||||
'Zend\I18n',
|
||||
'Laminas\Di',
|
||||
'Laminas\Cache',
|
||||
'Laminas\Form',
|
||||
'Laminas\InputFilter',
|
||||
'Laminas\Filter',
|
||||
'Laminas\Paginator',
|
||||
'Laminas\Hydrator',
|
||||
'Laminas\Router',
|
||||
'Laminas\Log',
|
||||
'Laminas\Mail',
|
||||
'Laminas\Validator',
|
||||
'Laminas\I18n',
|
||||
'DoctrineModule',
|
||||
'DoctrineORMModule',
|
||||
'Monarc\Core',
|
||||
|
|
|
@ -11,60 +11,60 @@
|
|||
* file.
|
||||
*/
|
||||
|
||||
use Doctrine\DBAL\Driver\PDOMySql\Driver;
|
||||
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
|
||||
);
|
||||
];
|
||||
|
|
|
@ -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(
|
||||
|
@ -20,7 +28,7 @@ return array(
|
|||
'doctrine' => array(
|
||||
'connection' => array(
|
||||
'orm_default' => array(
|
||||
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
|
||||
'driverClass' => 'Doctrine\DBAL\Driver\PDO\MySQL\Driver',
|
||||
'params' => array(
|
||||
'host' => 'localhost',
|
||||
'port' => 3306,
|
||||
|
@ -34,7 +42,7 @@ return array(
|
|||
),
|
||||
),
|
||||
'orm_cli' => array(
|
||||
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
|
||||
'driverClass' => 'Doctrine\DBAL\Driver\PDO\MySQL\Driver',
|
||||
'params' => array(
|
||||
'host' => 'localhost',
|
||||
'port' => 3306,
|
||||
|
@ -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(),
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
14
package.json
14
package.json
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "MONARC",
|
||||
"version": "2.9.4",
|
||||
"description": "Monarc back office",
|
||||
"name": "MONARC Back Office",
|
||||
"version": "2.12.6",
|
||||
"description": "MONARC Back Office",
|
||||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -10,11 +10,11 @@
|
|||
"author": "CASES",
|
||||
"license": "GNU Affero General Public License version 3",
|
||||
"dependencies": {
|
||||
"ng_anr": "git+https://github.com/monarc-project/ng-anr.git#master",
|
||||
"ng_backoffice": "git+https://github.com/monarc-project/ng-backoffice.git#master"
|
||||
"ng_anr": "git+https://github.com/monarc-project/ng-anr.git",
|
||||
"ng_backoffice": "git+https://github.com/monarc-project/ng-backoffice.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt": "~1.0.3",
|
||||
"grunt-cli": "~1.3.2"
|
||||
"grunt": "~1.5.3",
|
||||
"grunt-cli": "~1.4.3"
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 78 KiB |
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
use Zend\Mvc\Application;
|
||||
use Laminas\Mvc\Application;
|
||||
|
||||
chdir(dirname(__DIR__));
|
||||
|
||||
|
@ -28,7 +28,7 @@ if (! class_exists(Application::class)) {
|
|||
|
||||
$appConfig = require 'config/application.config.php';
|
||||
if (file_exists('config/development.config.php')) {
|
||||
$appConfig = Zend\Stdlib\ArrayUtils::merge($appConfig, include 'config/development.config.php');
|
||||
$appConfig = Laminas\Stdlib\ArrayUtils::merge($appConfig, include 'config/development.config.php');
|
||||
}
|
||||
|
||||
Application::init($appConfig)->run();
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
vercomp () {
|
||||
if [[ $1 == $2 ]]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
local IFS=.
|
||||
local i ver1=($1) ver2=($2)
|
||||
# fill empty fields in ver1 with zeros
|
||||
for ((i=${#ver1[@]}; i<${#ver2[@]}; i++))
|
||||
do
|
||||
ver1[i]=0
|
||||
done
|
||||
for ((i=0; i<${#ver1[@]}; i++))
|
||||
do
|
||||
if [[ -z ${ver2[i]} ]]
|
||||
then
|
||||
# fill empty fields in ver2 with zeros
|
||||
ver2[i]=0
|
||||
fi
|
||||
if ((10#${ver1[i]} > 10#${ver2[i]}))
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
composer_version_string=`composer --version`
|
||||
composer_version=`echo $composer_version_string | awk 'BEGIN { FS="[ ]" } ; { print $3 }'`
|
||||
|
||||
if [[ $(vercomp $composer_version 1.9.0 ; echo $?) -eq 0 ]]; then
|
||||
echo -e "${RED}Please update your version of composer.${NC} The minimum requirements is 1.9.0."
|
||||
echo -e "The minimum requirement is 1.9.0. You can use the following to update your composer installation:"
|
||||
|
||||
cat << EOF
|
||||
|
||||
$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||
$ php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
|
||||
$ php composer-setup.php --install-dir=/tmp --filename=composer
|
||||
$ mv /tmp/composer /usr/local/bin/composer
|
||||
EOF
|
||||
|
||||
exit 1
|
||||
|
||||
fi
|
|
@ -40,11 +40,11 @@ fi
|
|||
# Link modules resources. TODO: Replace with Grunt tasks to minify the JS and CSS.
|
||||
cd public/views/ && find ../../node_modules/ng_backoffice/views -maxdepth 1 -name "*.html" -exec ln -s {} \; 2>/dev/null
|
||||
cd dialogs/ && find ../../../node_modules/ng_backoffice/views/dialogs -maxdepth 1 -name "*.html" -exec ln -s {} \; 2>/dev/null
|
||||
cd ../partials/ && find ../../../node_modules/ng_backoffice/views/partials -maxdepth 1 -name "*.html" -exec ln -s {} \; 2>/dev/null
|
||||
#cd ../partials/ && find ../../../node_modules/ng_backoffice/views/partials -maxdepth 1 -name "*.html" -exec ln -s {} \; 2>/dev/null
|
||||
cd ../../js/ && find ../../node_modules/ng_backoffice/src -maxdepth 1 -name "*" -exec ln -s {} \; 2>/dev/null
|
||||
cd ../css/ && find ../../node_modules/ng_backoffice/css -name "*" -exec ln -s {} \; 2>/dev/null
|
||||
cd ../img/ && find ../../node_modules/ng_backoffice/img -name "*" -exec ln -s {} \; 2>/dev/null
|
||||
cd ../flags/ && find ../../node_modules/ng_backoffice/node_modules/ng-country-flags/dist/flags -mindepth 1 -type d -exec ln -s {} \; 2>/dev/null
|
||||
cd ../flags/ && find ../../node_modules/ng_backoffice/node_modules/flag-icons/flags -mindepth 1 -type d -exec ln -s {} \; 2>/dev/null
|
||||
|
||||
cd ../js/
|
||||
mkdir -p anr
|
||||
|
|
|
@ -26,6 +26,17 @@ do
|
|||
esac
|
||||
done
|
||||
|
||||
checkout_to_latest_tag() {
|
||||
if [ -d $1 ]; then
|
||||
pushd $1
|
||||
git fetch --tags
|
||||
tag=$(git describe --tags `git rev-list --tags --max-count=1`)
|
||||
git checkout $tag -b $tag
|
||||
git pull origin $tag
|
||||
popd
|
||||
fi
|
||||
}
|
||||
|
||||
pull_if_exists() {
|
||||
if [ -d $1 ]; then
|
||||
pushd $1
|
||||
|
@ -52,29 +63,32 @@ if [ $? != 0 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
composer install -o
|
||||
./scripts/check_composer.sh
|
||||
if [[ $? -eq 1 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
composer install -o --no-dev --ignore-platform-req=php
|
||||
|
||||
pathCore="module/Monarc/Core"
|
||||
pathBO="module/Monarc/BackOffice"
|
||||
|
||||
if [[ -d node_modules && -d node_modules/ng_anr ]]; then
|
||||
if [[ -d node_modules/ng_anr/.git ]]; then
|
||||
pull_if_exists node_modules/ng_backoffice
|
||||
pull_if_exists node_modules/ng_anr
|
||||
else
|
||||
npm update
|
||||
fi
|
||||
else
|
||||
npm install
|
||||
fi
|
||||
|
||||
if [[ $bypass -eq 0 ]]; then
|
||||
migrate_module $pathCore
|
||||
migrate_module $pathBO
|
||||
fi
|
||||
|
||||
if [[ -d node_modules && -d node_modules/ng_anr ]]; then
|
||||
if [[ -d node_modules/ng_anr/.git ]]; then
|
||||
checkout_to_latest_tag node_modules/ng_backoffice
|
||||
checkout_to_latest_tag node_modules/ng_anr
|
||||
else
|
||||
npm update
|
||||
fi
|
||||
fi
|
||||
|
||||
cd node_modules/ng_backoffice
|
||||
npm install
|
||||
npm ci
|
||||
cd ../..
|
||||
|
||||
./scripts/link_modules_resources.sh
|
||||
|
|
|
@ -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
|
|
@ -10,8 +10,9 @@ 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 = "ubuntu/bionic64"
|
||||
config.vm.provision :shell, path: "bootstrap.sh"
|
||||
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
|
||||
# boxes will only be checked for updates when the user runs
|
||||
|
@ -21,7 +22,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
# Create a forwarded port mapping which allows access to a specific port
|
||||
# within the machine from a port on the host machine. In the example below,
|
||||
# accessing "localhost:8080" will access port 80 on the guest machine.
|
||||
config.vm.network "forwarded_port", guest: 80, host: 5000
|
||||
config.vm.network :forwarded_port, guest: 80, host: 5000
|
||||
config.vm.network :forwarded_port, guest: 3306, host: 3309
|
||||
|
||||
# Create a private network, which allows host-only access to the machine
|
||||
|
@ -41,8 +42,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|||
# the path on the host to the actual folder. The second argument is
|
||||
# the path on the guest to mount the folder. And the optional third
|
||||
# argument is a set of non-required options.
|
||||
config.vm.synced_folder "..", "/home/ubuntu/monarc",
|
||||
owner: "www-data", group: "www-data", disabled: false
|
||||
config.vm.synced_folder "..", "/home/vagrant/monarc",
|
||||
owner: "vagrant", group: "vagrant", disabled: false, mount_options: ["dmode=777", "fmode=775"]
|
||||
|
||||
# Provider-specific configuration so you can fine-tune various
|
||||
# backing providers for Vagrant. These expose provider-specific options.
|
||||
|
@ -54,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 18.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
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
PATH_TO_MONARC='/home/ubuntu/monarc'
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
PATH_TO_MONARC='/home/vagrant/monarc'
|
||||
|
||||
APPENV='local'
|
||||
ENVIRONMENT='development'
|
||||
|
@ -18,37 +22,38 @@ post_max_size=50M
|
|||
max_execution_time=100
|
||||
max_input_time=223
|
||||
memory_limit=512M
|
||||
PHP_INI=/etc/php/7.2/apache2/php.ini
|
||||
X_DEBUG_CFG=/etc/php/7.2/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
|
||||
export LANGUAGE=en_US.UTF-8
|
||||
export LANG=en_US.UTF-8
|
||||
export LC_ALL=en_US.UTF-8
|
||||
locale-gen en_US.UTF-8
|
||||
dpkg-reconfigure locales
|
||||
sudo -E locale-gen en_US.UTF-8
|
||||
sudo -E dpkg-reconfigure locales
|
||||
|
||||
|
||||
echo -e "\n--- Installing now… ---\n"
|
||||
|
||||
echo -e "\n--- Updating packages list ---\n"
|
||||
apt-get update && apt-get -y upgrade
|
||||
sudo apt-get update && sudo apt-get upgrade -y
|
||||
|
||||
echo -e "\n--- Install base packages… ---\n"
|
||||
apt-get -y install vim zip unzip git gettext > /dev/null
|
||||
sudo apt-get -y install vim zip unzip git gettext curl gsfonts > /dev/null
|
||||
|
||||
|
||||
echo -e "\n--- Install MariaDB specific packages and settings… ---\n"
|
||||
apt-get -y install mariadb-server mariadb-client > /dev/null
|
||||
sudo apt-get -y install mariadb-server mariadb-client > /dev/null
|
||||
|
||||
# Secure the MariaDB installation (especially by setting a strong root password)
|
||||
systemctl restart mariadb.service > /dev/null
|
||||
sudo systemctl restart mariadb.service > /dev/null
|
||||
sleep 5
|
||||
apt-get -y install expect > /dev/null
|
||||
## do we need to spawn mysql_secure_install with sudo in future?
|
||||
sudo apt-get -y install expect > /dev/null
|
||||
expect -f - <<-EOF
|
||||
set timeout 10
|
||||
spawn mysql_secure_installation
|
||||
spawn sudo mysql_secure_installation
|
||||
expect "Enter current password for root (enter for none):"
|
||||
send -- "\r"
|
||||
expect "Set root password?"
|
||||
|
@ -67,45 +72,51 @@ 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"
|
||||
sed -i "s/skip-external-locking/#skip-external-locking/g" $MARIA_DB_CFG
|
||||
sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" $MARIA_DB_CFG
|
||||
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"
|
||||
mysql -u root -p$DBPASSWORD_ADMIN -e "CREATE USER '$DBUSER_MONARC'@'%' IDENTIFIED BY '$DBPASSWORD_MONARC';"
|
||||
mysql -u root -p$DBPASSWORD_ADMIN -e "GRANT ALL PRIVILEGES ON * . * TO '$DBUSER_MONARC'@'%';"
|
||||
mysql -u root -p$DBPASSWORD_ADMIN -e "FLUSH PRIVILEGES;"
|
||||
systemctl restart mariadb.service > /dev/null
|
||||
sudo mysql -u root -p$DBPASSWORD_ADMIN -e "CREATE USER '$DBUSER_MONARC'@'%' IDENTIFIED BY '$DBPASSWORD_MONARC';"
|
||||
sudo mysql -u root -p$DBPASSWORD_ADMIN -e "GRANT ALL PRIVILEGES ON * . * TO '$DBUSER_MONARC'@'%';"
|
||||
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"
|
||||
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
|
||||
do
|
||||
sed -i "s/^\($key\).*/\1 = $(eval echo \${$key})/" $PHP_INI
|
||||
sudo sed -i "s/^\($key\).*/\1 = $(eval echo \${$key})/" $PHP_INI
|
||||
done
|
||||
|
||||
echo -e "\n--- Configuring Xdebug for development ---\n"
|
||||
cat > $X_DEBUG_CFG <<EOF
|
||||
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
|
||||
EOF"
|
||||
|
||||
echo -e "\n--- Enabling mod-rewrite and ssl… ---\n"
|
||||
a2enmod rewrite > /dev/null
|
||||
a2enmod ssl > /dev/null
|
||||
sudo a2enmod rewrite > /dev/null 2>&1
|
||||
sudo a2enmod ssl > /dev/null 2>&1
|
||||
sudo a2enmod headers > /dev/null 2>&1
|
||||
|
||||
echo -e "\n--- Allowing Apache override to all ---\n"
|
||||
sed -i "s/AllowOverride None/AllowOverride All/g" /etc/apache2/apache2.conf
|
||||
sudo sed -i "s/AllowOverride None/AllowOverride All/g" /etc/apache2/apache2.conf
|
||||
|
||||
|
||||
echo -e "\n--- Installing composer… ---\n"
|
||||
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer > /dev/null
|
||||
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "\nERROR: unable to install composer\n"
|
||||
exit 1;
|
||||
|
@ -117,7 +128,7 @@ cd $PATH_TO_MONARC
|
|||
git config core.fileMode false
|
||||
|
||||
echo -e "\n--- Retrieving MONARC libraries… ---\n"
|
||||
composer install -o
|
||||
composer ins
|
||||
|
||||
|
||||
# Make modules symlinks.
|
||||
|
@ -131,19 +142,25 @@ cd $PATH_TO_MONARC
|
|||
mkdir -p $PATH_TO_MONARC/data/cache
|
||||
mkdir -p $PATH_TO_MONARC/data/LazyServices/Proxy
|
||||
mkdir -p $PATH_TO_MONARC/data/DoctrineORMModule/Proxy
|
||||
chown -R www-data data
|
||||
chmod -R 777 data
|
||||
|
||||
|
||||
# Front-end
|
||||
mkdir node_modules
|
||||
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
|
||||
git clone --config core.filemode=false https://github.com/monarc-project/ng-backoffice.git ng_backoffice > /dev/null
|
||||
if [ ! -d "ng_backoffice" ]; then
|
||||
git clone --config core.filemode=false https://github.com/monarc-project/ng-backoffice.git ng_backoffice > /dev/null
|
||||
fi
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "\nERROR: unable to clone the ng-backoffice repository\n"
|
||||
exit 1;
|
||||
fi
|
||||
git clone --config core.filemode=false https://github.com/monarc-project/ng-anr.git ng_anr > /dev/null
|
||||
if [ ! -d "ng_anr" ]; then
|
||||
git clone --config core.filemode=false https://github.com/monarc-project/ng-anr.git ng_anr > /dev/null
|
||||
fi
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "\nERROR: unable to clone the ng-anr repository\n"
|
||||
exit 1;
|
||||
|
@ -151,13 +168,10 @@ fi
|
|||
cd ..
|
||||
|
||||
|
||||
chown -R www-data $PATH_TO_MONARC
|
||||
chgrp -R www-data $PATH_TO_MONARC
|
||||
chmod -R 700 $PATH_TO_MONARC
|
||||
|
||||
|
||||
echo -e "\n--- Add a VirtualHost for MONARC ---\n"
|
||||
cat > /etc/apache2/sites-enabled/000-default.conf <<EOF
|
||||
sudo bash -c "cat << EOF > /etc/apache2/sites-enabled/000-default.conf
|
||||
<VirtualHost *:80>
|
||||
ServerName localhost
|
||||
DocumentRoot $PATH_TO_MONARC/public
|
||||
|
@ -176,58 +190,42 @@ cat > /etc/apache2/sites-enabled/000-default.conf <<EOF
|
|||
SetEnv DB_USER $DBUSER
|
||||
SetEnv DB_PASS $DBPASSWD
|
||||
</VirtualHost>
|
||||
EOF
|
||||
EOF"
|
||||
echo -e "\n--- Restarting Apache… ---\n"
|
||||
systemctl restart apache2.service > /dev/null
|
||||
sudo systemctl restart apache2.service > /dev/null
|
||||
|
||||
|
||||
echo -e "\n--- Configuration of MONARC database connection ---\n"
|
||||
cat > config/autoload/local.php <<EOF
|
||||
<?php
|
||||
return array(
|
||||
'doctrine' => array(
|
||||
'connection' => array(
|
||||
'orm_default' => array(
|
||||
'params' => array(
|
||||
'doctrine' => [
|
||||
'connection' => [
|
||||
'orm_default' => [
|
||||
'params' => [
|
||||
'host' => '$DBHOST',
|
||||
'user' => '$DBUSER_MONARC',
|
||||
'password' => '$DBPASSWORD_MONARC',
|
||||
'dbname' => '$DBNAME_COMMON',
|
||||
),
|
||||
),
|
||||
'orm_cli' => array(
|
||||
'params' => array(
|
||||
],
|
||||
],
|
||||
'orm_cli' => [
|
||||
'params' => [
|
||||
'host' => '$DBHOST',
|
||||
'user' => '$DBUSER_MONARC',
|
||||
'password' => '$DBPASSWORD_MONARC',
|
||||
'dbname' => '$DBNAME_MASTER',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
/* Link with (ModuleCore)
|
||||
config['languages'] = [
|
||||
'fr' => array(
|
||||
'index' => 1,
|
||||
'label' => 'Français'
|
||||
),
|
||||
'en' => array(
|
||||
'index' => 2,
|
||||
'label' => 'English'
|
||||
),
|
||||
'de' => array(
|
||||
'index' => 3,
|
||||
'label' => 'Deutsch'
|
||||
),
|
||||
]
|
||||
*/
|
||||
'activeLanguages' => array('fr','en','de','nl'),
|
||||
'activeLanguages' => ['fr','en','de','nl'],
|
||||
|
||||
'monarc' => array(
|
||||
'ttl' => 60, // timeout
|
||||
'salt' => '', // salt privé pour chiffrement pwd
|
||||
),
|
||||
'monarc' => [
|
||||
'ttl' => 60,
|
||||
'salt' => '',
|
||||
],
|
||||
);
|
||||
EOF
|
||||
|
||||
|
@ -240,14 +238,15 @@ 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 Grunt… ---\n"
|
||||
curl -sL https://deb.nodesource.com/setup_13.x | sudo bash -
|
||||
sudo apt-get install -y nodejs
|
||||
sudo npm install -g grunt-cli
|
||||
echo -e "\n--- Adjusting user mod… ---\n"
|
||||
sudo usermod -aG www-data vagrant
|
||||
sudo usermod -aG vagrant www-data
|
||||
|
||||
|
||||
echo -e "\n--- Update the project… ---\n"
|
||||
/bin/bash ./scripts/update-all.sh > /dev/null
|
||||
sudo npm install -g grunt-cli
|
||||
sudo npm install -g node-gyp
|
||||
./scripts/update-all.sh -d
|
||||
|
||||
|
||||
echo -e "\n--- Create initial user and client ---\n"
|
||||
|
@ -255,8 +254,7 @@ php ./vendor/robmorgan/phinx/bin/phinx seed:run -c ./module/Monarc/BackOffice/mi
|
|||
|
||||
|
||||
echo -e "\n--- Restarting Apache… ---\n"
|
||||
systemctl restart apache2.service > /dev/null
|
||||
|
||||
sudo systemctl restart apache2.service > /dev/null
|
||||
|
||||
|
||||
echo -e "\n--- MONARC is ready! Point your Web browser to http://127.0.0.1:5000 ---\n"
|
||||
|
|
Loading…
Reference in New Issue