Skip to content

Commit c3634d9

Browse files
committed
Update config for OpenCFP
1 parent f2cdce1 commit c3634d9

File tree

8 files changed

+151
-5
lines changed

8 files changed

+151
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.env
22
.vagrant
3+
env.yml

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
# PHPConf.Asia Server Setup Scripts
22

3+
## Additional Steps
4+
5+
1. Run `mysql_secure_installation`
6+
7+
2. Create `opencfp` database
8+
9+
3. Prepare Letsencrypt (https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04):
10+
11+
```
12+
sudo certbot --nginx -d cfp.phpconf.asia
13+
```

ansible/composer.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
- name: download composer
3+
get_url:
4+
url: https://getcomposer.org/installer
5+
dest: /tmp/installer
6+
tags: composer
7+
8+
- name: install composer
9+
shell: cat /tmp/installer | php -- --install-dir=/usr/local/bin
10+
args:
11+
creates: /usr/local/bin/composer
12+
tags: composer
13+
14+
- name: rename composer.phar to composer
15+
shell: mv /usr/local/bin/composer.phar /usr/local/bin/composer
16+
args:
17+
creates: /usr/local/bin/composer
18+
tags: composer
19+
20+
- name: make composer executable
21+
file:
22+
path: /usr/local/bin/composer
23+
mode: a+x
24+
state: file
25+
tags: composer

ansible/config/cfp.phpconf.asia.j2

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
server {
2-
root /var/www/cfp.phpconf.asia;
2+
root /var/www/opencfp/web;
33
index index.php index.html index.htm;
44
server_name cfp.phpconf.asia www.cfp.phpconf.asia;
55

66
client_max_body_size 100M;
77

8+
access_log /var/log/nginx/access.cfp.phpconf.asia.log;
9+
error_log /var/log/nginx/error.cfp.phpconf.asia.log;
10+
811
location / {
9-
try_files $uri $uri/ =404;
10-
}
12+
try_files $uri $uri/ /index.php?$query_string;
13+
}
1114

1215
location ~ \.php$ {
13-
include snippets/fastcgi-php.conf;
16+
try_files $uri =404;
17+
18+
fastcgi_param CFP_ENV production;
19+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
1420
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
21+
fastcgi_read_timeout 150;
22+
fastcgi_index index.php;
1523
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
24+
include fastcgi_params;
1625
}
1726

1827
location ~ /\.ht {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
application:
2+
title: PHPConf.Asia 2018
3+
url: https://cfp.phpconf.asia
4+
5+
eventurl: https://2018.phpconf.asia
6+
event_location: Singapore
7+
enddate: 1st June 2018
8+
show_submission_count: true
9+
airport: SIN
10+
arrival: 2018-09-25
11+
departure: 2018-09-30
12+
secure_ssl: true
13+
online_conference: false
14+
date_format: d M Y
15+
date_timezone: "Asia/Singapore"
16+
coc_link: https://2018.phpconf.asia/code-of-conduct.html
17+
show_contrib_banner: false
18+
venue_image_path: /assets/img/kent_ridge_banner.jpg
19+
20+
database:
21+
host: {{ db_host }}
22+
database: {{ db_name }}
23+
dsn: mysql:dbname={{ db_name }};host={{ db_host }}
24+
user: {{ db_username }}
25+
password: {{ db_password }}
26+
27+
log:
28+
level: debug
29+
30+
cache:
31+
enabled: false
32+
33+
mail:
34+
host: {{ smtp_host }}
35+
port: {{ smtp_port }}
36+
username: {{ smtp_username }}
37+
password: "{{ smtp_password }}"
38+
encryption: tls
39+
auth_mode: ~
40+
41+
talk:
42+
categories:
43+
api: APIs (REST, SOAP, etc.)
44+
continuousdelivery: Continuous Delivery
45+
casestudy: Case Study
46+
database: Database
47+
development: Development
48+
devops: Devops
49+
framework: Framework
50+
javascript: JavaScript
51+
personal: Personal Skills
52+
security: Security
53+
testing: Testing
54+
uiux: UI/UX
55+
other: Other
56+
bigdata: Big Data
57+
machinelearning: Machine Learning
58+
ai: Artificial Intellegence
59+
iot: Internet of Things
60+
levels:
61+
entry: Entry level
62+
mid: Mid-level
63+
advanced: Advanced
64+
types:
65+
regular: Regular (40 mins)
66+
tutorial: Tutorial (3 hrs)
67+
lightning: Lightning Talk (10 mins)
68+
69+
security:
70+
firewalls:
71+
secured_area:
72+
form_forgot:
73+
csrf_parameter: _csrf_security_token
74+
csrf_token_id: forgot_password
75+
76+
reviewer:
77+
users:
78+
-
Loading

ansible/env.yml.sample

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
db_host:
3+
db_name:
4+
db_username:
5+
db_password:
6+
smtp_host:
7+
smtp_port:
8+
smtp_username:
9+
smtp_password:

ansible/main.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
- hosts: all
33
tasks:
4+
- name: Load env.yml
5+
include_vars: file=env.yml
46
- block:
57
- name: Install 7.1 dependencies
68
apt: name=software-properties-common state=present
@@ -31,6 +33,8 @@
3133
- php7.1-tidy
3234
- php7.1-recode
3335
- php7.1-curl
36+
- php7.1-dom
37+
- php7.1-xml
3438
- python-certbot-nginx
3539
- name: Patch PHP.ini (fix_pathinfo)
3640
lineinfile: dest=/etc/php/7.1/fpm/php.ini regexp='^cgi\.fix_pathinfo=0' line='cgi.fix_pathinfo=0'
@@ -41,14 +45,23 @@
4145
- name: Patch PHP.ini (upload_max_filesize)
4246
lineinfile: dest=/etc/php/7.1/fpm/php.ini regexp='^upload_max_filesize =' line='upload_max_filesize = 4G'
4347
notify: [restart_nginx, restart_php_fpm]
48+
- name: Install Composer
49+
include: composer.yml
4450
- name: Replaces Nginx conf file
4551
template: src=config/default.j2 dest=/etc/nginx/sites-available/default
4652
notify: restart_nginx
53+
- name: Copy OpenCFP files
54+
copy: src=../opencfp dest=/var/www/
55+
notify: [restart_nginx, restart_php_fpm]
56+
- name: OpenCFP Production Config
57+
template: src=config/opencfp/config/production.yml.j2 dest=/var/www/opencfp/config/production.yml
58+
notify: [restart_nginx, restart_php_fpm]
59+
- name: Copy venue image
60+
copy: src=config/opencfp/web/assets/img/kent_ridge_banner.jpg dest=/var/www/opencfp/web/assets/img/kent_ridge_banner.jpg mode=0644
4761
- name: Prepares vhost folders
4862
file: dest=/var/www/{{ item }} state=directory mode=0755
4963
with_items:
5064
- phpconf.asia
51-
- cfp.phpconf.asia
5265
notify: restart_nginx
5366
- name: Nginx vhost conf files
5467
template: src=config/{{ item }}.j2 dest=/etc/nginx/sites-available/{{ item }}

0 commit comments

Comments
 (0)