Merge branch 'master' into SOA

ldap
Cédric Bonhomme 2018-11-21 08:28:36 +01:00
commit cb3af7e538
27 changed files with 626 additions and 278 deletions

2
.gitignore vendored
View File

@ -20,9 +20,11 @@ public/img/
public/flags/
public/views/
module/
npm-debug.log
node_modules/
bin/
data/DoctrineORMModule/
data/monarc/
data/json/
go-pear.phar
scripts/public/

View File

@ -13,7 +13,9 @@ Cyril Rouyer
Guillaume Lesniak
Jérôme De Almeida
Jérôme Lombardi
Jihane Guelzim - https://github.com/jiihaanee
Juan Rocha
Rémi Jambou - https://github.com/rjambou
Thomas Metois

View File

@ -1,6 +1,197 @@
MONARC Changelog
================
## 2.7.3 (2018-10-25)
### Enhancement
- added backend capability for the bulk creation of objects;
- various improvements and harmonization of the backend code;
### Fix
- Sort order for operational risks in final deliverable annex D (#111);
- Upload of template deliverable fails in Dutch (#141);
- SOA is now included in snapshots.
## 2.7.2 (2018-10-08)
### Fix
- MONARC is now compatible with PHP 7.2 (#89). Future MONARC virtual machines
will be based on Ubuntu Bionic LTS;
- Reports not generated in user's language or selected templates (#129);
- All your rights have been revoked. Please contact the manager for your organization (#110);
- various improvements and minor fixes in the back end.
## 2.7.1 (2018-09-07)
### Enhancement
- inform user which rights he has on each risk analysis (#131);
- display read/write access of the currently connected user on the home page (list of analysis) (#130);
- improvements to the statement of applicability (SOA) module (speed improvements);
- minor improvements to the home page.
### Fix
- impossible to download a report when user has no wright access (#133);
- name of columns of the evaluation scales are not displayed when a user has not write access (#132).
## 2.7.0 (2018-08-22)
### New
- this release introduces the statement of applicability (SOA) module for your
risk analysis. This is a first step towards the awaited [Statement of Applicability
& Gap Analysis module](https://github.com/monarc-project/MonarcAppFO/wiki/feature-SOA&GAP)
### Fix
- Error in translation in sector 3 of Final report (#124);
- The management of the position in the library is not working (#123);
- Empty categories in the library (#122);
- Impossible to order the questions in the back oficce (#121);
- Hidden impacts function doesn't works (#119);
- Search and sort filter for import (#38).
## 2.6.0 (2018-07-20)
### New
- MONARC users who open the home page in the web interface will see an image
in the bottom left corner with the text "up-to-date" in green, "update
available" in orange or "security update available" in red.
This will make outdated version more visible for users of MONARC. This
version checking is performed thanks to a
[dedicated service](https://version.monarc.lu/version/MONARC).
### Enhancement
- the import and export functions have been improved;
- creation of recommendation and missing field (#115);
- make an easy link to implement the recommendation directly from the risk view
(#112).
### Fix
- fixed a bug in the table Risk treatment plan management.
- problem on date parsing with the date-picker with non-US browsers (when using
date.toLocaleString) (#117)
- it is not possible to reset the ``duedate`` attribute of a recommendation
since the introduction of the date-picker (#116)
- review and correct the functionality of import by fusion or merge (#62)
- minor translations fixes.
## 2.5.0 (2018-07-04)
### New
- all dashboard data can now be exported to a CSV file with tabs;
- fine grained export of risk analysis (choice between method steps,
interviews, existing controls and recommendations);
- it is now possible to create a new recommendation from an existing one;
- account deletion / right to erasure (#109).
### Enhancement
- how to erase the evaluation of all threats of a risk analysis (#97);
- the risk treatment view has been improved (#96);
- MONARC and the back office are now using AngularJS 1.7.0.
### Fix
- impossible to edit some fields in BO. Only is possible in the default
language of instance (#108);
- md-datepicker sends the day before the one that was selected (#105);
- the filter by tag is not working on Knowledge base > Operational Risk (#103);
- the generation of deliverables has been improved (bullet point lists) (#101);
- various minor improvements and fixes in the back office of MONARC.
## 2.4.2 (2018-06-08)
### Enhancement
- improvements for the breadcrumb used in the graphs of the dashboard. Moreover
it is now possible to click in the items of the breadcrumb in order to
navigate between the different graph's levels;
- the deadlines of recommendations are now set with a date picker in the fourth
step (#98);
- Removed the filter on the checkbox of the step 3 to display the dashboard of
residual risk (#99);
- the column 'phone' has been removed from the 'users' table and in the models.
The application must store the minimum amount of information required on
users;
- Validate recommendations for operational risks (#102);
- the translations have been improved.
### Fix
- Operational risks are not updated (#93);
- In the 4th deliverable, an inherited risk is displayed at -1 and in red
color (#100);
- Fixed a problem with some translations in the legends of the report's graphs;
- Removal of a recommendation on same risk of different assets of the same type
(#92).
## 2.4.1 (2018-05-30)
### Enhancement
- the dashboard has been improved with more interactive graphs;
- the dashboard view is now part of the analysis. The home page of MONARC
simply lists the projects.
### Fix
- Removal of a recommendation on same risk of different asset of the same type
(#92);
- Order of operational risks (#88).
## 2.4.0 (2018-05-14)
### New
- the dashboard of MONARC has been entirely revamped and is now using D3.js;
- the version of MONARC is specified in all exported objects.
### Fix
- restart from an existing analysis (#87);
- order of operational risks (#88).
## 2.3.0 (2018-04-27)
### New
- an administrator of a MONARC front office instance is now able to set custom
templates for deliveries per step.
### Enhancement
- default deliveries templates were improved;
- the section dedicated to the management of the organization has been moved in
a dedicated view;
- improved the switching between the different available languages;
- improved the generation of the deliveries.
### Fix
- fixed a bug in the generation of the deliveries (#84);
- Inconsistency of Threat and Vulnerability Tables (#82);
- various minor fixes.
## 2.2.1 (2018-02-14)
### Enhancement

View File

@ -0,0 +1,187 @@
Installation on Ubuntu 16.04
============================
# 1. Install LAMP & dependencies
## Install the dependencies
$ sudo apt-get install vim zip unzip git gettext curl net-tools gsfonts curl
Some might already be installed.
## Install MariaDB
$ sudo apt-get install mariadb-client mariadb-server
# Secure the MariaDB installation
$ sudo mysql_secure_installation
Especially by setting a strong root password.
## Install Apache2
$ sudo apt-get install apache2 apache2-doc apache2-utils
## Enable modules, settings, and default of SSL in Apache
$ sudo a2dismod status
$ sudo a2enmod ssl
$ sudo a2enmod rewrite
$ sudo a2enmod headers
## Apache Virtual Host
<VirtualHost *:80>
ServerName monarc.localhost
DocumentRoot /var/lib/monarc/fo/public
<Directory /var/lib/monarc/fo/public>
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
SetEnv APPLICATION_ENV "development"
</VirtualHost>
## Install PHP and dependencies
$ sudo apt-get install php apache2 libapache2-mod-php php-curl php-gd php-mcrypt php-mysql php-pear php-apcu php-xml php-mbstring php-intl php-imagick php-zip
## Apply all changes
$ sudo systemctl restart apache2.service
# 2. Installation of MONARC
## MONARC code
Clone the repository and invoke `composer` using the shipped `composer.phar`:
$ cd /var/lib/monarc/
$ git clone https://github.com/monarc-project/MonarcAppFO.git fo
$ cd fo/
$ chown -R www-data data
$ chmod -R g+w data
$ php composer.phar self-update
$ php composer.phar install -o
The `self-update` directive is to ensure you have an up-to-date `composer.phar`
available.
### Backend
The backend is not directly modules of the project but libraries.
You must create modules with symbolic links to libraries.
Create two symbolic links:
$ mkdir module
$ cd module/
$ ln -s ./../vendor/monarc/core MonarcCore
$ ln -s ./../vendor/monarc/frontoffice MonarcFO
There are 2 parts:
* MonarcFO is only for front office;
* MonarcCore is common to the front office and to the back office.
### Frontend
The frontend is an AngularJS application.
$ mkdir node_modules
$ cd node_modules
$ git clone https://github.com/monarc-project/ng-client.git ng_client
$ git clone https://github.com/monarc-project/ng-anr.git ng_anr
There are 2 parts:
* one only for front office: ng_client;
* one common for front office and back office: ng_anr.
## Databases
### Change SQL Mode in my.cnf
[mysqld]
sql-mode = MYSQL40
### Create 2 databases
CREATE DATABASE monarc_cli DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE monarc_common DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
* monarc_common contains models and data created by CASES;
* monarc_cli contains all client risk analyses. Each analysis is based on CASES
model of monarc_common.
### Initializes the database
$ mysql -u user monarc_common < db-bootstrap/monarc_structure.sql
$ mysql -u user monarc_common < db-bootstrap/monarc_data.sql
### Database connection
Create the configuration file:
$ sudo cp ./config/autoload/local.php.dist ./config/autoload/local.php
And configure the database connection:
return array(
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'params' => array(
'host' => 'host',
'user' => 'user',
'password' => 'password',
'dbname' => 'monarc_common',
),
),
'orm_cli' => array(
'params' => array(
'host' => 'host',
'user' => 'user',
'password' => 'password',
'dbname' => 'monarc_cli',
),
),
),
),
);
# Update MONARC
## Install Grunt
$ sudo apt-get install nodejs
$ sudo apt-get install npm
$ sudo npm install -g grunt-cli
$ sudo ln -s /usr/bin/nodejs /usr/bin/node
Update MONARC:
$ ./scripts/update-all.sh
This script will retrieve the updates from the last stable release of MONARC,
execute the database migration scripts and compile the translations.
# Create initial user
$ php ./vendor/robmorgan/phinx/bin/phinx seed:run -c ./module/MonarcFO/migrations/phinx.php
The username is *admin@admin.test* and the password is *admin*.

View File

@ -1,243 +0,0 @@
Installation on Ubuntu 17.04
============================
The master branch should always be working and it is recommended to install the
project using this one.
If you have already installed MONARC and want to upgrade to a later version, you
can use the provided script:
$ ./scripts/update-all.sh
$ sudo systemctl restart apache2
PHP & MySQL
-----------
Install PHP (version 7.0 recommended) with extensions : *xml*, *mbstring*,
*mysql*, *zip*, *unzip*, *mcrypt*, *intl*, *gettext* and *imagick*.
In __php.ini__, set:
* *upload_max_filesize* to 200M;
* *post_max_size* to 50M;
* *memory_limit* to 512M (snapshots of important risk analysis requires more
memory).
Install Apache and enable mods: *rewrite*, *ssl* (with a2enmod)
Install MariaDB.
Installation of MONARC
----------------------
Clone the repository and invoke `composer` using the shipped `composer.phar`:
git clone https://github.com/monarc-project/MonarcAppFO.git ./monarc
cd monarc/
chown -R www-data data
chmod -R g+w data
php composer.phar self-update
php composer.phar install -o
(The `self-update` directive is to ensure you have an up-to-date `composer.phar`
available.)
![Arbo](pictures/arbo1.png "Arbo")
Databases
---------
Create 2 databases:
CREATE DATABASE monarc_cli DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE monarc_common DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
Change SQL Mode in my.cnf:
[mysqld]
sql-mode = MYSQL40
There are 2 databases:
* monarc_common contains models and data created by CASES;
* monarc_cli contains all client risk analyses. Each analysis is based on CASES
model of monarc_common.
Populate the monarc_common database:
mysql -u user monarc_common < db-bootstrap/monarc_structure.sql
mysql -u user monarc_common < db-bootstrap/monarc_data.sql
API
---
The project is composed of 2 parts:
* an API in charge of retrieving data;
* an interface which displays data.
The API is not directly modules of the project but libraries.
You must create modules with symbolic links to libraries.
Create 2 symbolic links in the root of project directory:
mkdir module
cd module/
ln -s ./../vendor/monarc/core MonarcCore
ln -s ./../vendor/monarc/frontoffice MonarcFO
There are 2 parts:
* one only for front office;
* one common for front office and back office (private project).
It is developed with Zend framework 2.
![Arbo](pictures/arbo2.png "Arbo")
Interfaces
----------
Repository for Angular at the root of the project:
mkdir node_modules
cd node_modules
git clone https://github.com/monarc-project/ng-client.git ng_client
git clone https://github.com/monarc-project/ng-anr.git ng_anr
There are 2 parts:
* one only for front office: ng_client;
* one common for front office and back office: ng_anr.
It is developed with Angular framework version 1.
![Arbo](pictures/arbo3.png "Arbo")
Web Server Setup
----------------
### PHP CLI Server
The simplest way to get started if you are using PHP 5.4 or above is to start
the internal PHP cli-server in the root directory:
php -S 0.0.0.0:8080 -t public/ public/index.php
This will start the cli-server on port 8080, and bind it to all network
interfaces.
Note: The built-in CLI server is **for development only**.
### Apache Setup
To setup Apache, setup a virtual host to point to the public/ directory of the
project and you should be ready to go! It should look something like below:
<VirtualHost 127.0.0.1:80>
ServerName monarc.localhost
DocumentRoot /path/to/monarc/public
SetEnv APPLICATION_ENV "development"
<Directory /path/to/monarc/public>
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Database connection
-------------------
Create file `config/autoload/local.php`:
return array(
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'params' => array(
'host' => 'host',
'user' => 'user',
'password' => 'password',
'dbname' => 'monarc_common',
),
),
'orm_cli' => array(
'params' => array(
'host' => 'host',
'user' => 'user',
'password' => 'password',
'dbname' => 'monarc_cli',
),
),
),
),
);
Configuration
-------------
Create configuration file
sudo cp ./config/autoload/local.php.dist ./config/autoload/local.php
Update connection information to *local.php* and *global.php*.
Configuration files are stored in cache.
If your changes have not been considered, empty cache by deleting file in
/data/cache
Install Grunt
-------------
sudo apt-get install nodejs
sudo apt-get install npm
sudo npm install -g grunt-cli
sudo ln -s /usr/bin/nodejs /usr/bin/node
Update MONARC
-------------
Play script (mandatory from the root of the project):
/bin/bash ./scripts/update-all.sh
This script will retrieve the updates from the last stable release of MONARC.
It uses others shell scripts. You may need to change the access rights of those
scripts.
Before updating MONARC it is advised to configure database backup. For that you
just need to create a file _data/backup/credentialsmysql.cnf_:
[client]
host = localhost
user = sql-monarc-user
password = your-password
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = sql-monarc-user
password = your-password
socket = /var/run/mysqld/mysqld.sock
basedir = /usr
If this file is not present, a warning message will be displayed during the
upgrade.
Create Initial User and Client
------------------------------
Create first user:
php ./vendor/robmorgan/phinx/bin/phinx seed:run -c ./module/MonarcFO/migrations/phinx.php
The username is *admin@admin.test* and the password is *admin*.

View File

@ -0,0 +1,179 @@
Installation on Ubuntu 18.04
============================
# 1. Install LAMP & dependencies
## Install the dependencies
$ sudo apt-get install vim zip unzip git gettext curl
Some might already be installed.
## Install MariaDB
$ sudo apt-get install mariadb-client mariadb-server
# Secure the MariaDB installation
$ sudo mysql_secure_installation
Especially by setting a strong root password.
## Install Apache2
$ sudo apt-get install apache2
## Enable modules, settings, and default of SSL in Apache
$ sudo a2dismod status
$ sudo a2enmod ssl
$ sudo a2enmod rewrite
$ sudo a2enmod headers
## Apache Virtual Host
<VirtualHost *:80>
ServerName monarc.localhost
DocumentRoot /var/lib/monarc/fo/public
<Directory /var/lib/monarc/fo/public>
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
SetEnv APPLICATION_ENV "development"
</VirtualHost>
## Install PHP and dependencies
$ sudo apt-get 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
## Apply all changes
$ sudo systemctl restart apache2.service
# 2. Installation of MONARC
## MONARC code
Clone the repository and invoke `composer` using the shipped `composer.phar`:
$ cd /var/lib/monarc/
$ git clone https://github.com/monarc-project/MonarcAppFO.git fo
$ cd fo/
$ chown -R www-data data
$ chmod -R g+w data
$ sudo composer self-update
$ composer install -o
The `self-update` directive is to ensure you have an up-to-date `composer.phar`
available.
### Backend
The backend is not directly modules of the project but libraries.
You must create modules with symbolic links to libraries.
Create two symbolic links:
$ mkdir module
$ cd module/
$ ln -s ./../vendor/monarc/core MonarcCore
$ ln -s ./../vendor/monarc/frontoffice MonarcFO
There are 2 parts:
* MonarcFO is only for front office;
* MonarcCore is common to the front office and to the back office.
### Frontend
The frontend is an AngularJS application.
$ mkdir node_modules
$ cd node_modules
$ git clone https://github.com/monarc-project/ng-client.git ng_client
$ git clone https://github.com/monarc-project/ng-anr.git ng_anr
There are 2 parts:
* one only for front office: ng_client;
* one common for front office and back office: ng_anr.
## Databases
### Create 2 databases
In your MariaDB interpreter:
CREATE DATABASE monarc_cli DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE monarc_common DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
* monarc_common contains models and data created by CASES;
* monarc_cli contains all client risk analyses. Each analysis is based on CASES
model of monarc_common.
### Initializes the database
$ mysql -u user monarc_common < db-bootstrap/monarc_structure.sql
$ mysql -u user monarc_common < db-bootstrap/monarc_data.sql
### Database connection
Create the configuration file:
$ sudo cp ./config/autoload/local.php.dist ./config/autoload/local.php
And configure the database connection:
return array(
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'params' => array(
'host' => 'host',
'user' => 'user',
'password' => 'password',
'dbname' => 'monarc_common',
),
),
'orm_cli' => array(
'params' => array(
'host' => 'host',
'user' => 'user',
'password' => 'password',
'dbname' => 'monarc_cli',
),
),
),
),
);
# Update MONARC
## Install Grunt
$ sudo apt-get -y install npm
$ npm install -g grunt-cli
Update MONARC:
$ ./scripts/update-all.sh
# Create initial user
$ php ./vendor/robmorgan/phinx/bin/phinx seed:run -c ./module/MonarcFO/migrations/phinx.php
The username is *admin@admin.test* and the password is *admin*.

View File

@ -21,7 +21,7 @@ expertise is a barrier for many companies, especially SMEs.
To remedy this situation and allow all organisations, both large and small, to
benefit from the advantages that a risk analysis offers, CASES has developed an
optimised risk analysis method: [MONARC](http://www.monarc.lu)
optimised risk analysis method: [MONARC](https://www.monarc.lu)
(**Optimised Risk Analysis Method**), allowing precise and repeatable risk
management.
@ -37,25 +37,24 @@ Documentation
-------------
You will find a user guide and a technical guide on the
[MONARC website](http://monarc.lu/).
[MONARC website](https://www.monarc.lu/documentation).
For installation instructions see
[INSTALL](https://github.com/monarc-project/MonarcAppFO/tree/master/INSTALL).
If you want to test MONARC you can use the
[latest release](https://github.com/monarc-project/MonarcAppFO/releases/latest)
available as a VirtualBox machine.
You can also use the provided Virtual Machine
[Virtual Machine](https://github.com/monarc-project/MonarcAppFO/releases/latest).
Contributing
------------
If you are interested to contribute to the MONARC project, review our
[community page](http://monarc.lu/community).
[community page](https://www.monarc.lu/community).
There are many ways to contribute and participate to the project.
Feel free to fork the code, play with it, make some patches and send us the pull
requests via the [issues](https://github.com/monarc-project/MonarcAppFO/issues).
requests.
There is one main branch: what we consider as stable with frequent updates as
hot-fixes.
@ -65,7 +64,7 @@ master stable branch.
Please, do not open directly a GitHub issue if you think you have found a
security vulnerability. See our
[vulnerability disclosure](http://monarc.lu/vulnerability-disclosure)
[vulnerability disclosure](https://www.monarc.lu/community/vulnerability-disclosure/)
page.
@ -85,7 +84,8 @@ This software is licensed under
For more information, [the list of authors and contributors](AUTHORS) is available.
Disclaimer: This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
Data provided with MONARC (threats, assets, vulnerabilities) are licensed under
[CC0 1.0 Universal (CC0 1.0)](https://creativecommons.org/publicdomain/zero/1.0/) - Public Domain Dedication.
If a specific author wants to license an object under a different license,
a pull request can be requested.

View File

@ -1 +1 @@
{"major":2, "minor":2, "hotfix":1}
{"major":2, "minor":7, "hotfix":3}

View File

@ -83,6 +83,11 @@ return array(
*/
'activeLanguages' => array('fr','en','de','ne',),
'appVersion' => $package_json['version'],
'checkVersion' => true,
'appCheckingURL' => 'https://version.monarc.lu/check/MONARC',
'email' => [
'name' => 'MONARC',
'from' => 'info@monarc.lu',

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.

View File

@ -1,6 +1,6 @@
{
"name": "MONARC",
"version": "2.2.1",
"version": "2.7.3",
"description": "MONARC Frontoffice App",
"private": true,
"repository": {

View File

@ -12,6 +12,13 @@ if [ ! -d public/css ]; then
else
find -L public/css -type l -exec rm {} \;
fi
if [ ! -d public/flags ]; then
mkdir public/flags
else
find -L public/flags -type l -exec rm {} \;
fi
if [ ! -d public/views/dialogs ]; then
mkdir -p public/views/dialogs
else
@ -38,6 +45,7 @@ if [ -d node_modules/ng_backoffice ]; then
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
if [ -d ../../node_modules/ng_anr ]; then
cd ../js/
@ -69,6 +77,7 @@ if [ -d node_modules/ng_client ]; then
cd ../../js/ && find ../../node_modules/ng_client/src -name "*" -exec ln -s {} \; 2>/dev/null
cd ../css/ && find ../../node_modules/ng_client/css -name "*" -exec ln -s {} \; 2>/dev/null
cd ../img/ && find ../../node_modules/ng_client/img -name "*" -exec ln -s {} \; 2>/dev/null
cd ../flags/ && find ../../node_modules/ng_client/node_modules/ng-country-flags/dist/flags -mindepth 1 -type d -exec ln -s {} \; 2>/dev/null
if [ -d ../../node_modules/ng_anr ]; then
cd ../js/
@ -93,4 +102,3 @@ if [ -d node_modules/ng_client ]; then
grunt concat
popd
fi

View File

@ -20,7 +20,7 @@ Installation of VirtualBox and Vagrant
Deployment of the front office
------------------------------
MONARC will be automatically deployed in an Ubuntu Artful Server.
MONARC will be automatically deployed in an Ubuntu Bionic Server.
.. code-block:: bash

5
vagrant/Vagrantfile vendored
View File

@ -10,8 +10,7 @@ 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-16.04"
config.vm.box = "fso/artful64"
config.vm.box = "ubuntu/bionic64"
config.vm.provision :shell, path: "bootstrap.sh", args: "#{ENV['GITHUB_AUTH_TOKEN']}"
# Disable automatic box update checking. If you disable this, then
@ -54,7 +53,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#
# # Use VBoxManage to customize the VM. For example to change memory:
vb.customize ["modifyvm", :id, "--memory", "1024"]
vb.customize ["modifyvm", :id, "--name", "MONARC FO - Ubuntu 17.10 - DEV"]
vb.customize ["modifyvm", :id, "--name", "MONARC FO - Ubuntu 18.04 - DEV"]
end
#
# View the documentation for the provider you're using for more

View File

@ -3,14 +3,9 @@
# Variables
GITHUB_AUTH_TOKEN=$1
BRANCH='master'
#BRANCH='v0.1'
#TAG='v0.1'
TAG=''
PATH_TO_MONARC='/home/ubuntu/monarc'
APPENV='local'
ENVIRONMENT='PRODUCTION'
DBHOST='localhost'
@ -26,7 +21,7 @@ post_max_size=50M
max_execution_time=100
max_input_time=223
memory_limit=512M
PHP_INI=/etc/php/7.1/apache2/php.ini
PHP_INI=/etc/php/7.2/apache2/php.ini
export DEBIAN_FRONTEND=noninteractive
export LANGUAGE=en_US.UTF-8
@ -41,17 +36,42 @@ echo -e "\n--- Updating packages list… ---\n"
apt-get update
echo -e "\n--- Install base packages… ---\n"
apt-get -y install vim zip unzip git gettext > /dev/null
apt-get -y install vim zip unzip git gettext curl > /dev/null
echo -e "\n--- Install MariaDB specific packages and settings… ---\n"
echo "mysql-server mysql-server/root_password password $DBPASSWORD_ADMIN" | debconf-set-selections
echo "mysql-server mysql-server/root_password_again password $DBPASSWORD_ADMIN" | debconf-set-selections
# echo "mysql-server mysql-server/root_password password $DBPASSWORD_ADMIN" | debconf-set-selections
# echo "mysql-server mysql-server/root_password_again password $DBPASSWORD_ADMIN" | debconf-set-selections
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
sleep 5
apt-get -y install expect > /dev/null
## do we need to spawn mysql_secure_install with sudo in future?
expect -f - <<-EOF
set timeout 10
spawn mysql_secure_installation
expect "Enter current password for root (enter for none):"
send -- "\r"
expect "Set root password?"
send -- "y\r"
expect "New password:"
send -- "${DBPASSWORD_ADMIN}\r"
expect "Re-enter new password:"
send -- "${DBPASSWORD_ADMIN}\r"
expect "Remove anonymous users?"
send -- "y\r"
expect "Disallow root login remotely?"
send -- "y\r"
expect "Remove test database and access to it?"
send -- "y\r"
expect "Reload privilege tables now?"
send -- "y\r"
expect eof
EOF
sudo apt-get purge -y expect > /dev/null 2>&1
echo -e "\n--- Installing PHP-specific packages… ---\n"
apt-get -y install php apache2 libapache2-mod-php php-curl php-gd php-mcrypt php-mysql php-pear php-apcu php-xml php-mbstring php-intl php-imagick php-zip > /dev/null
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 > /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
@ -143,11 +163,7 @@ cat > /etc/apache2/sites-enabled/000-default.conf <<EOF
</Directory>
SetEnv APPLICATION_ENV $ENVIRONMENT
SetEnv APP_ENV $APPENV
SetEnv APP_DIR $PATH_TO_MONARC
SetEnv DB_HOST $DBHOST
SetEnv DB_USER $DBUSER_MONARC
SetEnv DB_PASS $DBPASSWORD_MONARC
</VirtualHost>
EOF
echo -e "\n--- Restarting Apache… ---\n"
@ -206,6 +222,9 @@ return array(
'appVersion' => \$package_json['version'],
'checkVersion' => false,
'appCheckingURL' => 'https://version.monarc.lu/check/MONARC',
'email' => [
'name' => 'MONARC',
'from' => 'info@monarc.lu',
@ -228,8 +247,7 @@ mysql -u $DBUSER_MONARC -p$DBPASSWORD_MONARC monarc_common < db-bootstrap/monarc
echo -e "\n--- Installation of Grunt… ---\n"
apt-get -y install nodejs > /dev/null
apt-get -y install npm > /dev/null
sudo apt-get -y install npm > /dev/null
npm install -g grunt-cli > /dev/null