diff --git a/README.md b/README.md index 8a337da..af02d8e 100755 --- a/README.md +++ b/README.md @@ -1,54 +1,150 @@ -# OS2Forms Drupal 8 project [![Build Status](https://travis-ci.org/OS2Forms/os2forms8.svg?branch=master)](https://travis-ci.org/OS2Forms/os2forms8) +# OS2Forms Drupal 8 project -## Usage +[![Build Status](https://travis-ci.org/OS2Forms/os2forms8.svg?branch=master)](https://travis-ci.org/OS2Forms/os2forms8) -* Clone the repository +## Getting Started - ``` - git clone git@github.com:OS2Forms/os2forms8.git - ``` -* Rename your installation if needed +These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system. -* Go to the installation and start composer - ``` - composer install - ``` -* Follow the regular install process, select ```OS2Forms8``` as install profile. -* After installation is done, enable OS2Forms by: - ``` - drush en os2forms, os2forms_nemid, os2forms_dawa, os2forms_sbsys - ``` -* Enable `Custom theme` for project. This is a recommended theme that has minimum settings, - so you will need to add all required blocks into proper regions afterwards. +### Traditional -### Drupal settings +#### Installing -Main Drupal setting file `web/sites/default/settings.php` has been added to git index. -By this way all os2forms projects are getting default settings, like temporary -directory, private directory, sync directory. +1. Clone the git repository + ```sh + git clone git@github.com:OS2Forms/os2forms8.git + ``` -All project's sensitive configuration should be stored in `settings.local.php` -file. This file will be included from main `settings.php` settings. +2. Enter the newly created project directory + ```sh + cd os2forms8 + ``` -#### Multisite/Subsite configuration. +3. Install dependencies + ```sh + composer install + ``` -On multisite solution main Drupal setting file`web/sites/default/settings.php` -should be included into subsite's `settings.php` file. The easiest way to get -the new configuration on a subsite is to copy prepared template -`web/sites/subsite.settings.php` and add DB configuration, salt. +4. Install drupal based on OS2Forms profile. Make sure you substitute the following variables: + * db_pass + * db_user + * db_host + * db_name + * account_password + * site_name + ```sh + drush si os2forms8 --db-url=mysql://db_pass:db_user@db_host/db_name --account-pass=account_password --site-name="site_name" + ``` -Hint to generate salt string: +### With Docksal + +#### Prerequisites + +* [Docksal](https://docksal.io/) + +#### Installing + +1. Clone the git repository + ```sh + git clone git@github.com:OS2Forms/os2forms8.git + ``` + +2. Enter the newly created project directory + ```sh + cd os2forms8 + ``` + +3. Start docksal environment + ```sh + fin start + ``` + +4. Install dependencies and enable modules + ```sh + fin rebuild-test + ``` + +5. Create local settings + ```sh + cp web/sites/example.settings.local.php web/sites/default/settings.local.php + ``` + +6. Configure trusted hosts in settings.local.php (add the following if not present) + ```php + // web/sites/default/settings.local.php + + $settings['trusted_host_patterns'] = ['^os2forms8.docksal$', '^localhost$']; + ``` + +You should now be able to browse to the application at `http://os2forms8.docksal` + +## Deployment + +These instructions will get you a copy of the project up and running on a live system. +For a more detailed description, you could look at the `web/core/INSTALL.txt` [here](./web/core/INSTALL.txt). + +### Prerequisites + +* A HTTP server such as [Apache](https://httpd.apache.org/) that supports PHP +* A database service such as [MySQL](https://www.mysql.com/) +* PHP 7 with the following extensions enabled: + * gd + * curl + * simplexml + * xml + * dom + * soap + * mbstring + * database specific extension such as the mysql extension +* [Composer](https://getcomposer.org/) + +### Installing + +1. Clone the git repository +```sh +git clone git@github.com:OS2Forms/os2forms8.git +``` + +2. Enter the newly created project directory +```sh +cd os2forms8 ``` -drush php-eval 'echo \Drupal\Component\Utility\Crypt::randomBytesBase64(55) . "\n";' + +3. Install dependencies without development dependencies +```sh +composer install --no-dev ``` -## Contribution +4. Generate a salt string and insert it in web/sites/default/settings.php + ```sh + # Generate salt string - this will output a new salt string + ./vendor/bin/drush php-eval 'echo \Drupal\Component\Utility\Crypt::randomBytesBase64(55) . "\n";' + ``` + + ```php + // web/sites/default/settings.php + $settings['hash_salt'] = ''; // Insert the generated salt string here + ``` + +5. Configure trusted hosts in web/sites/default/settings.php. + For more information on how to write this, see the section for [Trusted Host settings](https://www.drupal.org/docs/installing-drupal/trusted-host-settings) + in the official Drupal installation guide. + ```php + // web/sites/default/settings.php + + $settings['trusted_host_patterns'] = ['']; + ``` +6. Visit the url for the os2forms application and follow the instructions + * Select the os2forms install profile for a default os2forms installation + +7. Enable OS2Forms modules + ```sh + ./vendor/bin/drush en os2forms, os2forms_nemid, os2forms_dawa, os2forms_sbsys + ``` + +## Contributing -OS2Forms projects is an opened for new features and os course bugfixes. -If you have any suggestion, or you found a bug in project, you are very welcome -to create an issue in github repository issue tracker. -For issue description there is expected that you will provide clear and -sufficient information about your feature request or bug report. +OS2Forms projects is open for new features and os course bugfixes. If you have any suggestion, or you found a bug in project, you are very welcome to create an issue in github repository issue tracker. For issue description there is expected that you will provide clear and sufficient information about your feature request or bug report. ### Code review policy See [OS2Forms code review policy](https://github.com/OS2Forms/docs#code-review) diff --git a/composer.json b/composer.json index 991ca21..3d1fdb9 100644 --- a/composer.json +++ b/composer.json @@ -95,6 +95,9 @@ "initial": { ".editorconfig": "../.editorconfig", ".gitattributes": "../.gitattributes" + }, + "locations": { + "web-root": "web/" } }, "enable-patching": true, diff --git a/composer.lock b/composer.lock index 57904d9..9a68462 100644 --- a/composer.lock +++ b/composer.lock @@ -782,6 +782,20 @@ "validation", "versioning" ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], "time": "2020-12-03T15:47:16+00:00" }, { @@ -1904,16 +1918,16 @@ }, { "name": "doctrine/annotations", - "version": "1.11.1", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad" + "reference": "b17c5014ef81d212ac539f07a1001832df1b6d3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/ce77a7ba1770462cd705a91a151b6c3746f9c6ad", - "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/b17c5014ef81d212ac539f07a1001832df1b6d3b", + "reference": "b17c5014ef81d212ac539f07a1001832df1b6d3b", "shasum": "" }, "require": { @@ -1928,11 +1942,6 @@ "phpunit/phpunit": "^7.5 || ^9.1.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.11.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" @@ -1971,7 +1980,7 @@ "docblock", "parser" ], - "time": "2020-10-26T10:28:16+00:00" + "time": "2021-02-21T21:00:45+00:00" }, { "name": "doctrine/cache", @@ -3949,16 +3958,16 @@ }, { "name": "drupal/core", - "version": "8.9.10", + "version": "8.9.13", "source": { "type": "git", "url": "https://github.com/drupal/core.git", - "reference": "e725c01cdf6fb6d8b330a27fa75caab91034805a" + "reference": "a53db77b55a035453d7229e0c3069f8591cb4cb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/drupal/core/zipball/e725c01cdf6fb6d8b330a27fa75caab91034805a", - "reference": "e725c01cdf6fb6d8b330a27fa75caab91034805a", + "url": "https://api.github.com/repos/drupal/core/zipball/a53db77b55a035453d7229e0c3069f8591cb4cb6", + "reference": "a53db77b55a035453d7229e0c3069f8591cb4cb6", "shasum": "" }, "require": { @@ -3985,8 +3994,8 @@ "laminas/laminas-diactoros": "^1.8", "laminas/laminas-feed": "^2.12", "masterminds/html5": "^2.1", - "pear/archive_tar": "^1.4.11", - "php": ">=7.0.8", + "pear/archive_tar": "^1.4.12", + "php": "^7.0.8", "psr/log": "^1.0", "stack/builder": "^1.0", "symfony-cmf/routing": "^1.4", @@ -4176,7 +4185,7 @@ "GPL-2.0-or-later" ], "description": "Drupal is an open source content management platform powering millions of websites and applications.", - "time": "2020-11-26T01:49:15+00:00" + "time": "2021-01-19T23:11:00+00:00" }, { "name": "drupal/core-composer-scaffold", @@ -7317,6 +7326,9 @@ }, "type": "drupal-module", "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + }, "drupal": { "version": "8.x-2.2", "datestamp": "1549289280", @@ -8280,16 +8292,16 @@ }, { "name": "egulias/email-validator", - "version": "2.1.24", + "version": "2.1.25", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "ca90a3291eee1538cd48ff25163240695bd95448" + "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ca90a3291eee1538cd48ff25163240695bd95448", - "reference": "ca90a3291eee1538cd48ff25163240695bd95448", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/0dbf5d78455d4d6a41d186da50adc1122ec066f4", + "reference": "0dbf5d78455d4d6a41d186da50adc1122ec066f4", "shasum": "" }, "require": { @@ -8334,7 +8346,13 @@ "validation", "validator" ], - "time": "2020-11-14T15:56:27+00:00" + "funding": [ + { + "url": "https://github.com/egulias", + "type": "github" + } + ], + "time": "2020-12-29T14:50:06+00:00" }, { "name": "fabpot/goutte", @@ -10157,16 +10175,16 @@ }, { "name": "pear/archive_tar", - "version": "1.4.11", + "version": "1.4.13", "source": { "type": "git", "url": "https://github.com/pear/Archive_Tar.git", - "reference": "17d355cb7d3c4ff08e5729f29cd7660145208d9d" + "reference": "2b87b41178cc6d4ad3cba678a46a1cae49786011" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/Archive_Tar/zipball/17d355cb7d3c4ff08e5729f29cd7660145208d9d", - "reference": "17d355cb7d3c4ff08e5729f29cd7660145208d9d", + "url": "https://api.github.com/repos/pear/Archive_Tar/zipball/2b87b41178cc6d4ad3cba678a46a1cae49786011", + "reference": "2b87b41178cc6d4ad3cba678a46a1cae49786011", "shasum": "" }, "require": { @@ -10219,7 +10237,17 @@ "archive", "tar" ], - "time": "2020-11-19T22:10:24+00:00" + "funding": [ + { + "url": "https://github.com/mrook", + "type": "github" + }, + { + "url": "https://www.patreon.com/michielrook", + "type": "patreon" + } + ], + "time": "2021-02-16T10:50:50+00:00" }, { "name": "pear/console_getopt", @@ -15076,16 +15104,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.20.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" + "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", + "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", "shasum": "" }, "require": { @@ -15097,7 +15125,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -15134,20 +15162,34 @@ "polyfill", "portable" ], - "time": "2020-10-23T14:02:19+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-07T16:49:33+00:00" }, { "name": "symfony/polyfill-iconv", - "version": "v1.20.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "c536646fdb4f29104dd26effc2fdcb9a5b085024" + "reference": "06fb361659649bcfd6a208a0f1fcaf4e827ad342" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/c536646fdb4f29104dd26effc2fdcb9a5b085024", - "reference": "c536646fdb4f29104dd26effc2fdcb9a5b085024", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/06fb361659649bcfd6a208a0f1fcaf4e827ad342", + "reference": "06fb361659649bcfd6a208a0f1fcaf4e827ad342", "shasum": "" }, "require": { @@ -15159,7 +15201,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -15197,20 +15239,34 @@ "portable", "shim" ], - "time": "2020-10-23T14:02:19+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-22T09:19:47+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.20.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "3b75acd829741c768bc8b1f84eb33265e7cc5117" + "reference": "2d63434d922daf7da8dd863e7907e67ee3031483" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/3b75acd829741c768bc8b1f84eb33265e7cc5117", - "reference": "3b75acd829741c768bc8b1f84eb33265e7cc5117", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/2d63434d922daf7da8dd863e7907e67ee3031483", + "reference": "2d63434d922daf7da8dd863e7907e67ee3031483", "shasum": "" }, "require": { @@ -15224,7 +15280,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -15267,20 +15323,34 @@ "portable", "shim" ], - "time": "2020-10-23T14:02:19+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-22T09:19:47+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.20.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "727d1096295d807c309fb01a851577302394c897" + "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/727d1096295d807c309fb01a851577302394c897", - "reference": "727d1096295d807c309fb01a851577302394c897", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/43a0283138253ed1d48d352ab6d0bdb3f809f248", + "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248", "shasum": "" }, "require": { @@ -15292,7 +15362,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -15334,20 +15404,34 @@ "portable", "shim" ], - "time": "2020-10-23T14:02:19+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-22T09:19:47+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.20.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" + "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", + "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", "shasum": "" }, "require": { @@ -15359,7 +15443,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -15397,7 +15481,21 @@ "portable", "shim" ], - "time": "2020-10-23T14:02:19+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-22T09:19:47+00:00" }, { "name": "symfony/polyfill-php56", @@ -15503,16 +15601,16 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.20.0", + "version": "v1.22.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "cede45fcdfabdd6043b3592e83678e42ec69e930" + "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cede45fcdfabdd6043b3592e83678e42ec69e930", - "reference": "cede45fcdfabdd6043b3592e83678e42ec69e930", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", + "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", "shasum": "" }, "require": { @@ -15521,7 +15619,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", @@ -15558,7 +15656,21 @@ "portable", "shim" ], - "time": "2020-10-23T14:02:19+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-07T16:49:33+00:00" }, { "name": "symfony/polyfill-php80", @@ -16312,16 +16424,16 @@ }, { "name": "twig/twig", - "version": "v1.44.1", + "version": "v1.44.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "04b15d4c0bb18ddbf82626320ac07f6a73f199c9" + "reference": "138c493c5b8ee7cff3821f80b8896d371366b5fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/04b15d4c0bb18ddbf82626320ac07f6a73f199c9", - "reference": "04b15d4c0bb18ddbf82626320ac07f6a73f199c9", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/138c493c5b8ee7cff3821f80b8896d371366b5fe", + "reference": "138c493c5b8ee7cff3821f80b8896d371366b5fe", "shasum": "" }, "require": { @@ -16372,7 +16484,17 @@ "keywords": [ "templating" ], - "time": "2020-10-27T19:22:48+00:00" + "funding": [ + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "time": "2021-01-05T10:10:05+00:00" }, { "name": "typo3/phar-stream-wrapper", diff --git a/web/modules/.gitignore b/web/modules/.gitignore new file mode 100644 index 0000000..739a339 --- /dev/null +++ b/web/modules/.gitignore @@ -0,0 +1 @@ +/README.txt \ No newline at end of file diff --git a/web/profiles/.gitignore b/web/profiles/.gitignore new file mode 100644 index 0000000..739a339 --- /dev/null +++ b/web/profiles/.gitignore @@ -0,0 +1 @@ +/README.txt \ No newline at end of file diff --git a/web/sites/.gitignore b/web/sites/.gitignore new file mode 100644 index 0000000..739a339 --- /dev/null +++ b/web/sites/.gitignore @@ -0,0 +1 @@ +/README.txt \ No newline at end of file diff --git a/web/themes/.gitignore b/web/themes/.gitignore new file mode 100644 index 0000000..739a339 --- /dev/null +++ b/web/themes/.gitignore @@ -0,0 +1 @@ +/README.txt \ No newline at end of file