Skip to content
This repository was archived by the owner on Nov 11, 2019. It is now read-only.

Commit f54a343

Browse files
authored
Merge pull request #1 from OpenConext/feature/env-setup
Feature/env setup
2 parents 5c5e89e + c91521a commit f54a343

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+8846
-21
lines changed

.docheader

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Copyright 2017 SURFnet B.V.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# IDE files #
2+
#############
3+
.idea
4+
5+
# Web application ignores #
6+
###########################
7+
8+
/.web-server-pid
9+
/app/config/parameters.yml
10+
/build/
11+
/var/*
12+
!/var/cache
13+
/var/cache/*
14+
!var/cache/.gitkeep
15+
!/var/logs
16+
/var/logs/*
17+
!var/logs/.gitkeep
18+
!/var/sessions
19+
/var/sessions/*
20+
!var/sessions/.gitkeep
21+
!var/SymfonyRequirements.php
22+
/vendor/
23+
/web/bundles/
24+
25+
# Vagrant files #
26+
#################
27+
vagrant.retry
28+
.vagrant
29+
30+
# Code coverage reports #
31+
#################
32+
/coverage/*
33+
34+
# OS generated files #
35+
######################
36+
.DS_Store
37+
.DS_Store?

.travis.php.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
date.timezone = "Europe/Amsterdam"

.travis.yml

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,17 @@
1-
#
2-
# This file has been generated by the Ibuildings QA-Tools
3-
#
4-
# Any custom Travis-ci configuration be added here
5-
# This file should be added to your project repository
6-
#
7-
81
language: php
92

103
php:
114
- 5.6
125
- 7.0
13-
14-
env:
15-
global:
16-
- SYMFONY_ENV=test
6+
- 7.1
177

188
cache:
199
directories:
20-
- ~/.composer
10+
- ~/.composer/cache/files
2111

2212
before_script:
2313
- phpenv config-add .travis.php.ini
24-
- composer self-update
25-
- composer install --prefer-dist
14+
- composer install --no-interaction
2615

2716
script:
28-
- ant
29-
30-
31-
branches:
32-
only:
33-
- master
34-
- develop
17+
- composer test

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Stepup-gssp-example
2+
===================
3+
4+
<a href="#">
5+
<img src="https://travis-ci.org/OpenConext/Stepup-gssp-bundle.svg?branch=master" alt="build:">
6+
</a></br>
7+
8+
Example Generic SAML Stepup Provider.
9+
10+
Development environment
11+
======================
12+
13+
To get started, first setup the development environment. The dev. env. is a virtual machine. Every task described is run
14+
from that machine.
15+
16+
Requirements
17+
-------------------
18+
- ansible 2.x
19+
- vagrant 1.9.x
20+
- vagrant-hostsupdater
21+
- Virtualbox
22+
23+
Install
24+
-------------------
25+
26+
``` vagrant up ```
27+
28+
Go to the directory inside the VM:
29+
30+
``` vagrant ssh ```
31+
32+
``` cd /vagrant ```
33+
34+
Install composer dependencies:
35+
36+
``` composer install ```
37+
38+
If everything goes as planned you can directly go to:
39+
40+
http://gssp.stepup.example.com
41+
42+
Debugging
43+
-------------------
44+
Xdebug is configured when provisioning your development Vagrant box.
45+
It's configured with auto connect IDE_KEY=phpstorm.
46+
47+
Tests and metrics
48+
======================
49+
50+
To run all required test you can run the following command from the dev env:
51+
52+
```composer test```
53+
54+
Every part can be run separately. Check "scripts" section of the composer.json file for the different options.
55+
56+
Other resources
57+
======================
58+
59+
- [Developer documentation](docs/index.md)
60+
- [Issue tracker](https://www.pivotaltracker.com/n/projects/1163646)
61+
- [License](LICENSE)

Vagrantfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Vagrant.configure(2) do |config|
2+
config.vm.box = "CentOS-7.0"
3+
config.vm.box_url = "https://build.openconext.org/vagrant_boxes/virtualbox-centos7.box"
4+
5+
config.vm.network "private_network", ip: "192.168.77.42"
6+
config.vm.hostname = "gssp.stepup.example.com"
7+
config.vm.synced_folder ".", "/vagrant", :nfs => true, type: "nfs"
8+
config.vm.synced_folder ".", "/var/www/gssp.stepup.example.com", type: "nfs"
9+
10+
config.vm.provider "virtualbox" do |v|
11+
v.customize ["modifyvm", :id, "--memory", "1024"]
12+
end
13+
14+
config.vm.provision "ansible" do |ansible|
15+
ansible.playbook = "ansible/vagrant.yml"
16+
ansible.groups = {"dev" => "default"}
17+
ansible.extra_vars = {
18+
develop_spd: true
19+
}
20+
end
21+
end

ansible/files/php-fpm.conf

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
;;;;;;;;;;;;;;;;;;;;;
2+
; FPM Configuration ;
3+
;;;;;;;;;;;;;;;;;;;;;
4+
5+
; All relative paths in this configuration file are relative to PHP's install
6+
; prefix.
7+
8+
; Include one or more files. If glob(3) exists, it is used to include a bunch of
9+
; files from a glob(3) pattern. This directive can be used everywhere in the
10+
; file.
11+
include=/etc/php-fpm.d/*.conf
12+
13+
;;;;;;;;;;;;;;;;;;
14+
; Global Options ;
15+
;;;;;;;;;;;;;;;;;;
16+
17+
[global]
18+
; Pid file
19+
; Default Value: none
20+
pid = /run/php-fpm/php-fpm.pid
21+
22+
; Error log file
23+
; If it's set to "syslog", log is sent to syslogd instead of being written
24+
; in a local file.
25+
; Default Value: /var/log/php-fpm.log
26+
;error_log = /var/log/php-fpm/error.log
27+
error_log = syslog
28+
29+
; syslog_facility is used to specify what type of program is logging the
30+
; message. This lets syslogd specify that messages from different facilities
31+
; will be handled differently.
32+
; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
33+
; Default Value: daemon
34+
;syslog.facility = daemon
35+
36+
; syslog_ident is prepended to every message. If you have multiple FPM
37+
; instances running on the same server, you can change the default value
38+
; which must suit common needs.
39+
; Default Value: php-fpm
40+
;syslog.ident = php-fpm
41+
42+
; Log level
43+
; Possible Values: alert, error, warning, notice, debug
44+
; Default Value: notice
45+
;log_level = notice
46+
47+
; If this number of child processes exit with SIGSEGV or SIGBUS within the time
48+
; interval set by emergency_restart_interval then FPM will restart. A value
49+
; of '0' means 'Off'.
50+
; Default Value: 0
51+
;emergency_restart_threshold = 0
52+
53+
; Interval of time used by emergency_restart_interval to determine when
54+
; a graceful restart will be initiated. This can be useful to work around
55+
; accidental corruptions in an accelerator's shared memory.
56+
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
57+
; Default Unit: seconds
58+
; Default Value: 0
59+
;emergency_restart_interval = 0
60+
61+
; Time limit for child processes to wait for a reaction on signals from master.
62+
; Available units: s(econds), m(inutes), h(ours), or d(ays)
63+
; Default Unit: seconds
64+
; Default Value: 0
65+
;process_control_timeout = 0
66+
67+
; The maximum number of processes FPM will fork. This has been design to control
68+
; the global number of processes when using dynamic PM within a lot of pools.
69+
; Use it with caution.
70+
; Note: A value of 0 indicates no limit
71+
72+
; Default Value: 0
73+
;process.max = 128
74+
75+
; Specify the nice(2) priority to apply to the master process (only if set)
76+
; The value can vary from -19 (highest priority) to 20 (lower priority)
77+
; Note: - It will only work if the FPM master process is launched as root
78+
; - The pool process will inherit the master process priority
79+
; unless it specified otherwise
80+
; Default Value: no set
81+
;process.priority = -19
82+
83+
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
84+
; Default Value: yes
85+
daemonize = yes
86+
87+
; Set open file descriptor rlimit for the master process.
88+
; Default Value: system defined value
89+
;rlimit_files = 1024
90+
91+
; Set max core size rlimit for the master process.
92+
; Possible Values: 'unlimited' or an integer greater or equal to 0
93+
; Default Value: system defined value
94+
;rlimit_core = 0
95+
96+
; Specify the event mechanism FPM will use. The following is available:
97+
; - select (any POSIX os)
98+
; - poll (any POSIX os)
99+
; - epoll (linux >= 2.5.44)
100+
; Default Value: not set (auto detection)
101+
;events.mechanism = epoll
102+
103+
; When FPM is build with systemd integration, specify the interval,
104+
; in second, between health report notification to systemd.
105+
; Set to 0 to disable.
106+
; Available Units: s(econds), m(inutes), h(ours)
107+
; Default Unit: seconds
108+
; Default value: 10
109+
;systemd_interval = 10
110+
111+
;;;;;;;;;;;;;;;;;;;;
112+
; Pool Definitions ;
113+
;;;;;;;;;;;;;;;;;;;;
114+
115+
; Multiple pools of child processes may be started with different listening
116+
; ports and different management options. The name of the pool will be
117+
; used in logs and stats. There is no limitation on the number of pools which
118+
; FPM can handle. Your system will tell you anyway :)
119+
120+
; See /etc/php-fpm.d/*.conf

ansible/files/remi.repo

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[remi]
2+
name=Les RPM de remi pour Enterprise Linux 7 - $basearch
3+
#baseurl=http://rpms.famillecollet.com/enterprise/7/remi/$basearch/
4+
mirrorlist=http://rpms.famillecollet.com/enterprise/7/remi/mirror
5+
enabled=0
6+
gpgcheck=1
7+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
8+
9+
[remi-php55]
10+
name=Les RPM de remi de PHP 5.5 pour Enterprise Linux 7 - $basearch
11+
#baseurl=http://rpms.famillecollet.com/enterprise/7/php55/$basearch/
12+
mirrorlist=http://rpms.famillecollet.com/enterprise/7/php55/mirror
13+
# WARNING: If you enable this repository, you must also enable "remi"
14+
enabled=0
15+
gpgcheck=1
16+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
17+
18+
[remi-php56]
19+
name=Les RPM de remi de PHP 5.6 pour Enterprise Linux 7 - $basearch
20+
#baseurl=http://rpms.famillecollet.com/enterprise/7/php56/$basearch/
21+
mirrorlist=http://rpms.famillecollet.com/enterprise/7/php56/mirror
22+
# WARNING: If you enable this repository, you must also enable "remi"
23+
enabled=1
24+
gpgcheck=1
25+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
26+
27+
[remi-test]
28+
name=Les RPM de remi en test pour Enterprise Linux 7 - $basearch
29+
#baseurl=http://rpms.famillecollet.com/enterprise/7/test/$basearch/
30+
mirrorlist=http://rpms.famillecollet.com/enterprise/7/test/mirror
31+
# WARNING: If you enable this repository, you must also enable "remi"
32+
enabled=0
33+
gpgcheck=1
34+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
35+
36+
[remi-debuginfo]
37+
name=Les RPM de remi pour Enterprise Linux 7 - $basearch - debuginfo
38+
baseurl=http://rpms.famillecollet.com/enterprise/7/debug-remi/$basearch/
39+
enabled=0
40+
gpgcheck=1
41+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
42+
43+
[remi-php55-debuginfo]
44+
name=Les RPM de remi de PHP 5.5 pour Enterprise Linux 7 - $basearch - debuginfo
45+
baseurl=http://rpms.famillecollet.com/enterprise/7/debug-php55/$basearch/
46+
enabled=0
47+
gpgcheck=1
48+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
49+
50+
[remi-php56-debuginfo]
51+
name=Les RPM de remi de PHP 5.6 pour Enterprise Linux 7 - $basearch - debuginfo
52+
baseurl=http://rpms.famillecollet.com/enterprise/7/debug-php56/$basearch/
53+
enabled=0
54+
gpgcheck=1
55+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
56+
57+
[remi-test-debuginfo]
58+
name=Les RPM de remi en test pour Enterprise Linux 7 - $basearch - debuginfo
59+
baseurl=http://rpms.famillecollet.com/enterprise/7/debug-test/$basearch/
60+
enabled=0
61+
gpgcheck=1
62+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

ansible/files/rsyslog_nginx.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Nginx main error log
2+
$InputFileName /var/log/nginx/error.log
3+
$InputFileTag nginx-error:
4+
$InputFileStateFile stat-nginx-error
5+
6+
$InputFileSeverity error
7+
$InputFileFacility local0
8+
$InputRunFileMonitor
9+
10+
# Nginx main access log
11+
$InputFileName /var/log/nginx/access.log
12+
$InputFileTag nginx-access:
13+
$InputFileStateFile stat-nginx-access
14+
15+
$InputFileSeverity notice
16+
$InputFileFacility local0
17+
$InputRunFileMonitor

ansible/files/xdebug.ini

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[XDebug]
2+
3+
xdebug.coverage_enable=1
4+
xdebug.default_enable=1
5+
xdebug.remote_enable=1
6+
xdebug.remote_connect_back=0
7+
xdebug.remote_host=192.168.77.1
8+
xdebug.remote_port=9000
9+
xdebug.remote_handler=dbgp
10+
xdebug.remote_log=/tmp/xdebug.log
11+
xdebug.remote_autostart=1
12+
xdebug.idekey="PHPSTORM"
13+
xdebug.max_nesting_level=256

0 commit comments

Comments
 (0)