Skip to content

added benchmarking.nodejs.org setup to www #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion setup/www/resources/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.crt
*.key
*.pem
*.pem
secrets/*
52 changes: 52 additions & 0 deletions setup/www/resources/config/benchmarking.nodejs.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
server {
listen *:80;
server_name benchmarking.nodejs.org;

return 301 https://benchmarking.nodejs.org$request_uri;
}

server {
listen [::]:443 ssl spdy;
listen *:443 ssl spdy;
server_name benchmarking.nodejs.org;

ssl_certificate ssl/nodejs_chained.crt;
ssl_certificate_key ssl/nodejs.key;
ssl_trusted_certificate ssl/nodejs_chained.crt;
ssl_dhparam ssl/dhparam.pem;

ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

ssl_session_cache shared:benchmarking:100m;
ssl_session_timeout 24h;

ssl_stapling on;
ssl_stapling_verify on;

spdy_keepalive_timeout 300;
spdy_headers_comp 9;

keepalive_timeout 60;
server_tokens off;

resolver 8.8.4.4 8.8.8.8 valid=300s;
resolver_timeout 10s;

add_header Strict-Transport-Security max-age=63072000;
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;

access_log /var/log/nginx/benchmarking.nodejs.org-access.log nodejs;
error_log /var/log/nginx/benchmarking.nodejs.org-error.log;

gzip on;
gzip_static on;
gzip_disable "MSIE [1-6]\.";
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

root /home/www/benchmarking;
default_type text/plain;
index index.html;
}
7 changes: 6 additions & 1 deletion setup/www/resources/config/github-webhook.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
"rules": [
{
"event": "push",
"match": "ref == \"refs/heads/master\" && repository.full_name == \"nodejs/new.nodejs.org\"",
"match": "ref == \"refs/heads/master\" && repository.full_name == \"nodejs/nodejs.org\"",
"exec": "/home/nodejs/build-site.sh nodejs"
},
{
"event": "push",
"match": "ref == \"refs/heads/master\" && repository.full_name == \"nodejs/iojs.org\"",
"exec": "/home/nodejs/build-site.sh iojs"
},
{
"event": "push",
"match": "ref == \"refs/heads/master\" && repository.full_name == \"nodejs/benchmarking\"",
"exec": "/home/nodejs/build-benchmarking-site.sh"
}
]
}
4 changes: 4 additions & 0 deletions setup/www/resources/config/nodejs_ssh_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Host benchmark
HostName 50.97.245.4
User benchmark
IdentityFile ~/.ssh/benchmark_id_rsa
19 changes: 19 additions & 0 deletions setup/www/resources/scripts/build-benchmarking-site.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

site=benchmarking
rsync_from=www/
clonedir=/home/www/github/${site}

if [ ! -d "${clonedir}" ]; then
repo="${site}"
git clone https://github.com/nodejs/${site}.git $clonedir
fi

cd $clonedir
git reset --hard
git clean -fdx
git fetch origin
git checkout origin/master

rsync -avz --delete --exclude charts/ ${clonedir}/${rsync_from} /home/www/${site}/
rsync -avz --delete benchmark:charts/ /home/www/${site}/charts/
4 changes: 0 additions & 4 deletions setup/www/resources/scripts/build-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ clonedir=/home/www/github/${site}

if [ ! -d "${clonedir}" ]; then
repo="${site}.org"
#TODO: remove this when repo is renamed
if [ "$site" == "nodejs" ]; then
repo="new.${site}.org"
fi
git clone https://github.com/nodejs/${repo}.git $clonedir
fi

Expand Down
2 changes: 2 additions & 0 deletions setup/www/tasks/nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- nodejs.org
- iojs.org
- libuv.org
- benchmarking.nodejs.org
tags: nginx

- name: nginx | Create nginx config symlinks
Expand All @@ -18,6 +19,7 @@
- { src: nodejs.org, dest: 00-nodejs.org }
- { src: iojs.org, dest: 01-iojs.org }
- { src: libuv.org, dest: 02-libuv.org }
- { src: benchmarking.nodejs.org, dest: 03-benchmarking.nodejs.org }
tags: nginx

- name: nginx | Make /etc/nginx/ssl/
Expand Down
6 changes: 5 additions & 1 deletion setup/www/tasks/site-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
group: nodejs
with_items:
- build-site.sh
- build-benchmarking-site.sh
- check-build-site.sh
tags: setup

Expand Down Expand Up @@ -41,6 +42,7 @@
- '* * * * * nodejs /home/nodejs/check-build-site.sh nodejs'
- '* * * * * nodejs /home/nodejs/check-build-site.sh iojs'
- '* * * * * root /home/nodejs/cdn-purge.sh'
- '* */4 * * * nodejs rsync -avz --delete benchmark:charts/ /home/www/benchmarking/charts/'

This comment was marked as off-topic.

tags: setup

- name: Site Setup | Copy queue-cdn-purge.sh script
Expand All @@ -63,6 +65,7 @@
- /home/www/iojs
- /home/www/nodejs
- /home/www/github
- /home/www/benchmarking
tags: setup

- name: Site Setup | Make /home/nodejs/.npm
Expand All @@ -73,10 +76,11 @@
owner: nodejs
tags: setup

- name: Site Setup | Initial nodejs and iojs clone and update
- name: Site Setup | Initial nodejs, iojs and benchmarking clone and update
remote_user: "nodejs"
command: "{{ item }}"
with_items:
- "/home/nodejs/build-site.sh nodejs"
- "/home/nodejs/build-site.sh iojs"
- "/home/nodejs/build-benchmarking-site.sh"
tags: setup
10 changes: 10 additions & 0 deletions setup/www/tasks/user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@
- iojs/docs
tags: user

- name: User | Insert benchmarking SSH config and key to nodejs
copy:
src: ./{{ item.src }}
dest: /home/nodejs/.ssh/{{ item.dest }}
mode: 0600

This comment was marked as off-topic.

with_file:
- { src: resources/secrets/benchmark_id_rsa, dest: benchmark_id_rsa }
- { src: resources/config/nodejs_ssh_config, dest: config }
tags: user

- name: User | Insert SSH public key to staging
authorized_key:
user: "staging"
Expand Down