Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
7577ac9
HT-135: Update Drush to 10.3.5 & add local Drush alias.
tormi Oct 13, 2020
81c3994
HT-135: Add lando update tool.
tormi Oct 13, 2020
5931145
HT-135: Add lando npm tool.
tormi Oct 13, 2020
042aee7
HT-135: npm audit fix, fixed 52 of 53 vulnerabilities.
tormi Oct 13, 2020
b97adf7
HT-135: .lando.yml changes.
tormi Oct 13, 2020
13a0ee7
HT-135: Remove drupal/console.
tormi Oct 13, 2020
7c71cbc
HT-135: Use sort-packages in Composer.
tormi Oct 13, 2020
431183e
HT-135: Remove legacy $settings['install_profile'].
tormi Oct 13, 2020
06e3e6b
HT-135: Remove scaffolding files.
tormi Oct 13, 2020
bebf94d
HT-135: Remove hardcoded softlink to files folder.
tormi Oct 13, 2020
d19eb2e
HT-135: Add scaffolding files to gitignore.
tormi Oct 13, 2020
7f9f50f
HT-135: Remove outdated dumpfiles.
tormi Oct 13, 2020
4d57c29
HT-135: Minor changes in settings.php.
tormi Oct 13, 2020
ca89c25
HT-135: Add skip_permissions_hardening setting to local setup.
tormi Oct 13, 2020
f231bd9
HT-135: Upgrade Drupal core* packages to 8.9.7.
tormi Oct 13, 2020
8f109ab
HT-135: drush cex changes for search_api from production.
tormi Oct 13, 2020
452e234
HT-135: Update easy_breadcrumb to 1.13, SA-CONTRIB-2020-027.
tormi Oct 13, 2020
9c8f353
HT-135: Remove legacy config_installer module.
tormi Oct 13, 2020
139f516
HT-135: Convert remote site aliases to Drush 10, remove outdated docs.
tormi Oct 13, 2020
ca8b0d6
HT-135: Add stage_file_proxy settings, update module.
tormi Oct 13, 2020
73a3b0b
HT-135: Update leaflet to 2.1.2.
tormi Oct 13, 2020
97025ac
HT-135: Update geofield* modules.
tormi Oct 13, 2020
1ea3ffe
HT-135: Update de to 3.9.0.
tormi Oct 13, 2020
e6dce96
HT-135: Update field_group* modules.
tormi Oct 13, 2020
15ae6a1
HT-135: Remove root files directory.
tormi Oct 13, 2020
2fdd6f8
HT-135: Update simple_sitemap to.3.7.
tormi Oct 14, 2020
795a9e1
HT-135: Update search_api to 1.17.
tormi Oct 14, 2020
3231d76
HT-135: Update search_api_autocomplete to 1.4.
tormi Oct 14, 2020
d5b60fc
HT-135: Update menu_multilingual to 1.0.0-alpha2.
tormi Oct 14, 2020
0adc60e
HT-135: Update cookieconsent to 1.6.0.
tormi Oct 14, 2020
4c52ab0
HT-135: Update admin_toolbar to 2.4.
tormi Oct 14, 2020
2f311af
HT-135: Update config_readonly to 1.0.0-beta4.
tormi Oct 14, 2020
db26b0f
HT-135: Rewrite the readme.
tormi Oct 14, 2020
2670bdc
HT-135: Add Warden 2.0 setup.
tormi Oct 14, 2020
547b098
HT-135: Remove unrelated content from the readme.
tormi Oct 14, 2020
2ce7837
Merge branch 'master' of github.com:UniversityofHelsinki/Opetustila-e…
tormi Dec 21, 2020
fce0fa5
HT-135: Disable admin_toolbar_search module.
tormi Dec 21, 2020
758214a
HT-135: Increase COMPOSER_PROCESS_TIMEOUT to 600.
tormi Dec 21, 2020
5f30bdb
HT-135: Update Composer & Lando versions.
tormi Dec 21, 2020
397eaaf
HT-135: Upgrade Drupal core & several packages.
tormi Dec 21, 2020
53cb8d7
HT-135: Update npm package ini.
tormi Dec 21, 2020
3dc11cb
HT-135: Update npm packages.
tormi Dec 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 18 additions & 110 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,120 +1,28 @@
# Wundertools
# Opetustilat

Reference setup with Ansible & Vagrant for Drupal 8 projects. For Drupal 7 support, see the [Drupal 7 branch](https://github.com/wunderio/WunderTools/tree/drupal7).
[Opetustilat](https://tilavaraus.helsinki.fi) is a service offered by the University of Helsinki about its teaching facilities. The site offers information on the equipment available in the facilities, a link to a real-time booking calendar as well as contact information and instructions.

[![Build Status](https://travis-ci.org/wunderio/WunderMachina.svg)](https://travis-ci.org/wunderio/WunderMachina)
[![Build Status](https://travis-ci.org/wunderio/WunderTools.svg)](https://travis-ci.org/wunderio/WunderTools)
## Local development

### Setup

## Requirements
- Install [Vagrant](https://www.vagrantup.com/downloads.html) 1.9.2 or greater
- Install [vagrant-cachier](https://github.com/fgrehm/vagrant-cachier)
`vagrant plugin install vagrant-cachier`
- Install Ansible in your host machine. For OS X:
`brew install ansible`
- Install [Virtualbox](https://www.virtualbox.org/wiki/Downloads) 5.1 or greater. Note version 5.1.24 has a known issue that breaks nfs, do not use it, version 5.1.22 s known to work.
## Creating a new project
1. Read the [Lando docs](https://docs.lando.dev/) and install the **latest** [Lando](https://github.com/lando/lando/releases).
2. Check out the repo: `[email protected]:UniversityofHelsinki/Opetustila-esittely.git opetustilat && cd opetustilat/drupal`.
3. Start the site by running `lando start`.
4. Import data: `lando db-import <dumpfile>`.
5. Update database & enable develpoment components: `lando update`.
6. Import config if needed: `lando drush cim -y`.

If you are starting a new project, see: [Setup.md](docs/Setup.md)
### Sites

- <https://tilat.lndo.site/>

## Setting up an existing project locally
### Services

Find the IP-address and hostname that this local environment is configured to use from `conf/vagrant_local.yml` and add
it to your own `/etc/hosts` file:
- <http://mail-tilat.lndo.site> - Mailhog for mail management.

`10.0.13.37 local.wundertools.com`
### Tools

Let Vagrant create your new machine:

`vagrant up`

This will create a new Virtual machine on your computer, configure it with all the nice bells & whistles that you can
think of (like MariaDB, nginx, Varnish, memcached and whatnot) and start it up for you. This will also install vagrant plugin depedencies, if you encounter issues while installing the plugins then you could use: `vagrant --skip-dependency-manager up`

SSH into your box and build and install Drupal:

```
vagrant ssh
cd /vagrant/drupal
./build.sh new
```

If this is a project with an existing production/staging server, you should probably sync the production database now,
from your local machine:

`sync.sh`

Drush is usable without ssh access with the drush.sh script e.g:

```bash
$ ./drush.sh cr
```

To open up ssh access to the virtual machine:

```bash
$ vagrant ssh
```


## Optional additions

### WunderSecrets

You can setup additional git repository for shared secrets. You need to set that in `conf/project.yml` -> `wundersecrets: remote: [email protected]:username/repo`.

Only the file `ansible.yml` is loaded from that repository.

## Useful things

At the moment IP is configured in
Vagrantfile
variable INSTANCE_IP

Varnish responds to
http://x.x.x.x/

Nginx responds to
http://x.x.x.x:8080/

Solr responds to
http://x.x.x.x:8983/solr

MailHOG responds to
http://x.x.x.x:8025
or
https://local.project.tld/mailhog/

Docs are in
http://x.x.x.x:8080/index.html
You can setup the dir where the docs are taken from and their URL from the
variables.yml file.

#Docs
docs:
hostname : 'docs.local.wundertools.com'
dir : '/vagrant/docs'


## Vagrant + Ansible configuration

Vagrant is using Ansible provision stored under the ansible subdirectory.
The inventory file (which stores the hosts and their IP's) is located under
ansible/inventory. Host specific configurations for Vagrant are stored in
ansible/vagrant.yml and the playbooks are under ansible/playbook directory.
Variable overrides are defined in ansible/variables.yml.

You should only bother with the following:

- Vagrant box setup `conf/vagrant.yml`
- What components do you want to install? `conf/vagrant.yml`
- And how are those set up? `conf/variables.yml`
- You can also fix your vagrant/ansible base setup to certain branch/revision `conf/project.yml`
There you can also do the same for build.sh


## Debugging tools

XDebug tools are installed via the devtools role. Everything should work out
of the box for PHPStorm. PHP script e.g. drush debugging should also work.
- `lando` - tools overview.
- `lando npm <commands>` - run [npm](https://www.npmjs.com/) commands.
- `lando update` - update local database.
30 changes: 17 additions & 13 deletions conf/prod-vars.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
$ANSIBLE_VAULT;1.1;AES256
34643633373135373936656562313264353636336435616435313536646338633530363865623862
6336626262616661353631303337613033376161613466330a663337643165323563316666303237
30363735643338646635313235613932356535626533356436326634363531366434363434323033
3034336535623665320a313335303462613633636137363831626632653761333761383435633937
37656535306636613864366539323131366436316163663565353637356332663066393738346531
34323130386532326637616334326361666461303663373437326565636533663238613836343639
63383566373930646361616162313034373230343235373165613436613464396464346161653539
36643062346463353538616465616363326436656432633334326336316661656230356333363737
38346338356335656137393463393037353264656362323835633863653565306139666535336637
33663363396235313166646230633533313137376666326633346130366363353234353032303766
39366131623630626538336132613565353039316533633335383565343931633964623130373138
32356430363131613530333636633739353031393638343637613761366539626336353734393037
37636336343233383838396139663232333461613535633364313161633365333738
61653566383963383434353739313030313333666563313861643162323063356635616264326666
3036656465613237343438613536373365306432366337320a323134376562376437356661366331
32396433633361373266613934653964646138653935663930666139616166646638633165333666
3838326237383365340a306639653934366139306238373833336665326232333835323137303530
35616435653061623361313263326564653131393834663865623164626639363731303365613039
33356635363865653231376233613535393538313537396131386362633130336364656636303766
39306263343837376262393962373638396462326334303930326631666135343961306135623733
37633135373166366238656462353830333636333338396138373439633137656564323862313863
39373630336234386665353561316135663562323239656662616563343262633865353136343364
35386232393865346333383332373630643535376663643235386431313063306337663133623561
61383162376631653264653639653366636262396236306330363561386463393739303932363834
66336635643131616461653437393363386331306530656635303635646434643361623730653435
61356230333033633130323133373936383166663161316466303734663164323130656639366665
33313966623165386332366261366261303362643365393837386465376364613033633931643837
39643439663332393738663238323030343765666635623966353936303964323131336264346636
63316131613935616362393861366335303538393433333031363131336365646463656263313764
38303334613436363238373264363833323638376130323839353439356334323136
4 changes: 4 additions & 0 deletions conf/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@
drupal_web_root: "/var/www/{{ domain_name }}/current/web"
project_name: opetustilat

php_extra_env_vars:
- key: "WARDEN_TOKEN"
value: "{{ WARDEN_TOKEN }}"

memory_db: 1024 # In MB
memory_app: 2048 # In MB should be atleast 4x php_memory_limit

Expand Down
19 changes: 11 additions & 8 deletions drupal/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,20 @@
# Ignore wunderio/drupal-ping healthcheck module
web/_ping.php

# Ignore test logs
# Ignore test folders.
/tests/_log
/web/sites/simpletest

# Ignore sensitive information
/web/sites/*/settings.local.php

# Ignore Drupal's file directory
/web/sites/*/files/

# Ignore SimpleTest multi-site environment.
/web/sites/simpletest

# Ignore files generated by PhpStorm
/.idea/

# Ingore files generated by scaffold which are not needed
# Ingore scaffolding files.
web/.csslintrc
web/.editorconfig
web/.eslintignore
Expand All @@ -37,7 +35,12 @@ web/sites/example.settings.local.php
web/sites/example.sites.php
web/update.php
web/web.config

web/_ping.php
web/autoload.php
web/index.php
web/.ht.router.php
web/robots.txt
/.editorconfig
/.gitattributes
/.gitattributes

# Ignore database dumps.
*.sql
52 changes: 21 additions & 31 deletions drupal/.lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ config:
php: 7.2
database: mariadb:10.1
xdebug: false
composer_version: 1.10.17
composer_version: 1.10.19

tooling:
build.sh:
Expand All @@ -20,6 +20,8 @@ tooling:
cmd: drush --root=/app/web
node:
service: node
npm:
service: node
npm-install:
service: node
description: Execute `npm install`
Expand All @@ -36,57 +38,45 @@ tooling:
service: node
description: Execute `npm rebuild node-sass`
cmd: "cd /app/web/themes/custom/uh_space && npm rebuild node-sass"
update:
description: Update local database.
cmd:
- appserver: /app/conf/lando/update.sh

services:
mailhog:
type: mailhog
hogfrom:
- appserver

# Making SequelPro access easier with static port: https://docs.devwithlando.io/tutorials/external-access.html
# Edit, not strictly necessary.
database:
portforward: 33306
scanner: false

appserver:
build:
- composer install
build_as_root:
- "apt-get update -y"
- "apt-get install python-yaml -y"
- "apt-get install sudo nano vim mlocate -y"
# Make sure our custom drush.yml is active either by copying or symlinking.
# - "/bin/cp /app/web/sites/default/drush.yml /var/www/.drush/drush.yml"
#- "ln -sf /app/web/sites/default/drush.yml ~/.drush/drush.yml"
#- "ln -sf /app/drush/drushrc.php /var/www/.drush/drushrc.php"
- "ln -sf /app/drush/drush.yml /var/www/.drush/drush.yml"
overrides:
environment:
WKV_SITE_ENV: lando
DB_PASS_DRUPAL: drupal8
DB_USER_DRUPAL: drupal8
DB_HOST_DRUPAL: database
DB_NAME_DRUPAL: drupal8
COMPOSER_PROCESS_TIMEOUT: 600
database:
portforward: true
mailhog:
type: mailhog
hogfrom:
- appserver
node:
type: node
build:
- "cd /app/web/themes/custom/uh_space && npm install"
build_as_root:
- "apt-get update -y"
- "apt-get install curl php-cli php-mbstring git unzip -y"
- "curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer"
# run:
# - "cd /app/web/themes/custom/uh_space && npm install"
# - "cd /app/web/themes/custom/uh_space && npm rebuild node-sass"
# - "cd /app/web/themes/custom/uh_space && npm run build"

proxy:
mailhog:
- mail.lndo.site

events:
# Clear caches after a database import
post-db-import:
- appserver: cd /app/web && drush cr -y
# Update modules after lando start.
post-start:
- appserver: cd /app && composer install
- mail-tilat.lndo.site

# Tested with Lando version
version: v3.0.19
version: v3.0.23
Loading