Skip to content

Commit 1deba68

Browse files
authored
Merge pull request #8 from OS2Forms/#41790_documentation_additions
#41790 documentation additions
2 parents cc36205 + 4703127 commit 1deba68

File tree

1 file changed

+133
-37
lines changed

1 file changed

+133
-37
lines changed

README.md

Lines changed: 133 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,150 @@
1-
# OS2Forms Drupal 8 project [![Build Status](https://travis-ci.org/OS2Forms/os2forms8.svg?branch=master)](https://travis-ci.org/OS2Forms/os2forms8)
1+
# OS2Forms Drupal 8 project
22

3-
## Usage
3+
[![Build Status](https://travis-ci.org/OS2Forms/os2forms8.svg?branch=master)](https://travis-ci.org/OS2Forms/os2forms8)
44

5-
* Clone the repository
5+
## Getting Started
66

7-
```
8-
git clone [email protected]:OS2Forms/os2forms8.git
9-
```
10-
* Rename your installation if needed
7+
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.
118

12-
* Go to the installation and start composer
13-
```
14-
composer install
15-
```
16-
* Follow the regular install process, select ```OS2Forms8``` as install profile.
17-
* After installation is done, enable OS2Forms by:
18-
```
19-
drush en os2forms, os2forms_nemid, os2forms_dawa, os2forms_sbsys
20-
```
21-
* Enable `Custom theme` for project. This is a recommended theme that has minimum settings,
22-
so you will need to add all required blocks into proper regions afterwards.
9+
### Traditional
2310

24-
### Drupal settings
11+
#### Installing
2512

26-
Main Drupal setting file `web/sites/default/settings.php` has been added to git index.
27-
By this way all os2forms projects are getting default settings, like temporary
28-
directory, private directory, sync directory.
13+
1. Clone the git repository
14+
```sh
15+
git clone [email protected]:OS2Forms/os2forms8.git
16+
```
2917

30-
All project's sensitive configuration should be stored in `settings.local.php`
31-
file. This file will be included from main `settings.php` settings.
18+
2. Enter the newly created project directory
19+
```sh
20+
cd os2forms8
21+
```
3222

33-
#### Multisite/Subsite configuration.
23+
3. Install dependencies
24+
```sh
25+
composer install
26+
```
3427

35-
On multisite solution main Drupal setting file`web/sites/default/settings.php`
36-
should be included into subsite's `settings.php` file. The easiest way to get
37-
the new configuration on a subsite is to copy prepared template
38-
`web/sites/subsite.settings.php` and add DB configuration, salt.
28+
4. Install drupal based on OS2Forms profile. Make sure you substitute the following variables:
29+
* db_pass
30+
* db_user
31+
* db_host
32+
* db_name
33+
* account_password
34+
* site_name
35+
```sh
36+
drush si os2forms8 --db-url=mysql://db_pass:db_user@db_host/db_name --account-pass=account_password --site-name="site_name"
37+
```
3938

40-
Hint to generate salt string:
39+
### With Docksal
40+
41+
#### Prerequisites
42+
43+
* [Docksal](https://docksal.io/)
44+
45+
#### Installing
46+
47+
1. Clone the git repository
48+
```sh
49+
git clone [email protected]:OS2Forms/os2forms8.git
50+
```
51+
52+
2. Enter the newly created project directory
53+
```sh
54+
cd os2forms8
55+
```
56+
57+
3. Start docksal environment
58+
```sh
59+
fin start
60+
```
61+
62+
4. Install dependencies and enable modules
63+
```sh
64+
fin rebuild-test
65+
```
66+
67+
5. Create local settings
68+
```sh
69+
cp web/sites/example.settings.local.php web/sites/default/settings.local.php
70+
```
71+
72+
6. Configure trusted hosts in settings.local.php (add the following if not present)
73+
```php
74+
// web/sites/default/settings.local.php
75+
76+
$settings['trusted_host_patterns'] = ['^os2forms8.docksal$', '^localhost$'];
77+
```
78+
79+
You should now be able to browse to the application at `http://os2forms8.docksal`
80+
81+
## Deployment
82+
83+
These instructions will get you a copy of the project up and running on a live system.
84+
For a more detailed description, you could look at the `web/core/INSTALL.txt` [here](./web/core/INSTALL.txt).
85+
86+
### Prerequisites
87+
88+
* A HTTP server such as [Apache](https://httpd.apache.org/) that supports PHP
89+
* A database service such as [MySQL](https://www.mysql.com/)
90+
* PHP 7 with the following extensions enabled:
91+
* gd
92+
* curl
93+
* simplexml
94+
* xml
95+
* dom
96+
* soap
97+
* mbstring
98+
* database specific extension such as the mysql extension
99+
* [Composer](https://getcomposer.org/)
100+
101+
### Installing
102+
103+
1. Clone the git repository
104+
```sh
105+
git clone [email protected]:OS2Forms/os2forms8.git
106+
```
107+
108+
2. Enter the newly created project directory
109+
```sh
110+
cd os2forms8
41111
```
42-
drush php-eval 'echo \Drupal\Component\Utility\Crypt::randomBytesBase64(55) . "\n";'
112+
113+
3. Install dependencies without development dependencies
114+
```sh
115+
composer install --no-dev
43116
```
44117

45-
## Contribution
118+
4. Generate a salt string and insert it in web/sites/default/settings.php
119+
```sh
120+
# Generate salt string - this will output a new salt string
121+
./vendor/bin/drush php-eval 'echo \Drupal\Component\Utility\Crypt::randomBytesBase64(55) . "\n";'
122+
```
123+
124+
```php
125+
// web/sites/default/settings.php
126+
$settings['hash_salt'] = ''; // Insert the generated salt string here
127+
```
128+
129+
5. Configure trusted hosts in web/sites/default/settings.php.
130+
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)
131+
in the official Drupal installation guide.
132+
```php
133+
// web/sites/default/settings.php
134+
135+
$settings['trusted_host_patterns'] = [''];
136+
```
137+
6. Visit the url for the os2forms application and follow the instructions
138+
* Select the os2forms install profile for a default os2forms installation
139+
140+
7. Enable OS2Forms modules
141+
```sh
142+
./vendor/bin/drush en os2forms, os2forms_nemid, os2forms_dawa, os2forms_sbsys
143+
```
144+
145+
## Contributing
46146

47-
OS2Forms projects is an opened for new features and os course bugfixes.
48-
If you have any suggestion, or you found a bug in project, you are very welcome
49-
to create an issue in github repository issue tracker.
50-
For issue description there is expected that you will provide clear and
51-
sufficient information about your feature request or bug report.
147+
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.
52148

53149
### Development environment
54150

0 commit comments

Comments
 (0)