diff --git a/setup/www/resources/.gitignore b/setup/www/resources/.gitignore index 99faad5d7..059c69adf 100644 --- a/setup/www/resources/.gitignore +++ b/setup/www/resources/.gitignore @@ -1,3 +1,4 @@ *.crt *.key -*.pem \ No newline at end of file +*.pem +secrets/* diff --git a/setup/www/resources/config/benchmarking.nodejs.org b/setup/www/resources/config/benchmarking.nodejs.org new file mode 100644 index 000000000..2f99cb9d5 --- /dev/null +++ b/setup/www/resources/config/benchmarking.nodejs.org @@ -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; +} diff --git a/setup/www/resources/config/github-webhook.json b/setup/www/resources/config/github-webhook.json index 9b0325705..dec65cf8d 100644 --- a/setup/www/resources/config/github-webhook.json +++ b/setup/www/resources/config/github-webhook.json @@ -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" } ] } diff --git a/setup/www/resources/config/nodejs_ssh_config b/setup/www/resources/config/nodejs_ssh_config new file mode 100644 index 000000000..1f77ae86f --- /dev/null +++ b/setup/www/resources/config/nodejs_ssh_config @@ -0,0 +1,4 @@ +Host benchmark + HostName 50.97.245.4 + User benchmark + IdentityFile ~/.ssh/benchmark_id_rsa diff --git a/setup/www/resources/scripts/build-benchmarking-site.sh b/setup/www/resources/scripts/build-benchmarking-site.sh new file mode 100755 index 000000000..b58430ee9 --- /dev/null +++ b/setup/www/resources/scripts/build-benchmarking-site.sh @@ -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/ diff --git a/setup/www/resources/scripts/build-site.sh b/setup/www/resources/scripts/build-site.sh index fe9136fb3..2ca508af1 100755 --- a/setup/www/resources/scripts/build-site.sh +++ b/setup/www/resources/scripts/build-site.sh @@ -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 diff --git a/setup/www/tasks/nginx.yaml b/setup/www/tasks/nginx.yaml index 39f64497b..b165af5c1 100644 --- a/setup/www/tasks/nginx.yaml +++ b/setup/www/tasks/nginx.yaml @@ -7,6 +7,7 @@ - nodejs.org - iojs.org - libuv.org + - benchmarking.nodejs.org tags: nginx - name: nginx | Create nginx config symlinks @@ -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/ diff --git a/setup/www/tasks/site-setup.yaml b/setup/www/tasks/site-setup.yaml index ac20c57d0..3a971dac1 100644 --- a/setup/www/tasks/site-setup.yaml +++ b/setup/www/tasks/site-setup.yaml @@ -7,6 +7,7 @@ group: nodejs with_items: - build-site.sh + - build-benchmarking-site.sh - check-build-site.sh tags: setup @@ -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/' tags: setup - name: Site Setup | Copy queue-cdn-purge.sh script @@ -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 @@ -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 diff --git a/setup/www/tasks/user.yaml b/setup/www/tasks/user.yaml index effca6202..98f3e5770 100644 --- a/setup/www/tasks/user.yaml +++ b/setup/www/tasks/user.yaml @@ -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 + 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"