From 719eb6583a8f81472080c454c75146c486fe7cd9 Mon Sep 17 00:00:00 2001 From: nivl4 Date: Sat, 24 Oct 2015 09:51:54 +0800 Subject: [PATCH 01/10] Remove vagrant customization that enables symlinks in /vagrant shared folder, at that is the default behavior of vagrant since 1.1. (https://github.com/mitchellh/vagrant/issues/713#issuecomment-13201507) --- Vagrantfile.example | 1 - 1 file changed, 1 deletion(-) diff --git a/Vagrantfile.example b/Vagrantfile.example index 52ffdf1096..7f89bb417e 100644 --- a/Vagrantfile.example +++ b/Vagrantfile.example @@ -8,7 +8,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provider "virtualbox" do |v| v.memory = 768 v.cpus = 1 - v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"] end config.vm.box = "thepeopleseason/habitrpg" config.ssh.forward_agent = true From 495e103be5ffe2b391871bbcfc3aef31d2d0c248 Mon Sep 17 00:00:00 2001 From: nivl4 Date: Sat, 24 Oct 2015 09:53:01 +0800 Subject: [PATCH 02/10] Update vagrant provisioning script to create symlinks for any binaries the package might contain (default npm install behavior), as without those symlinks "npm test" gives the following error: vagrant@habitrpg:/vagrant$ npm test > habitrpg@0.0.0-152 test /vagrant > gulp test [Error: /vagrant/node_modules/bson/build/Release/bson.node: invalid ELF header] js-bson: Failed to load c++ bson extension, using pure JS version [07:07:48] Using gulpfile /vagrant/gulpfile.js [07:07:48] Starting 'test:prepare:build'... [07:07:48] Starting 'test:prepare:mongo'... [07:07:48] Starting 'test:prepare:webdriver'... [07:07:48] 'test:prepare:build' errored after 33 ms [07:07:48] Error: Command failed: /bin/sh: 1: ./node_modules/.bin/grunt: not found at ChildProcess.exithandler (child_process.js:658:15) at ChildProcess.emit (events.js:98:17) at maybeClose (child_process.js:766:16) at Socket. (child_process.js:979:11) at Socket.emit (events.js:95:17) at Pipe.close (net.js:466:12) [07:07:48] Finished 'test:prepare:mongo' after 78 ms [07:08:50] Finished 'test:prepare:webdriver' after 1.02 min npm ERR! Test failed. See above for more details. - "npm install" was giving the following error in earlier version of VirtualBox when creating symlinks with relative "../" path in shared folders. "--no-bin-links" was a workaround, but it's been fixed in the latest VirtualBox 5.0.8 (https://www.virtualbox.org/ticket/14563) vagrant@habitrpg:/vagrant$ npm install npm WARN install Couldn't install optional dependency: Unsupported npm WARN install Couldn't install optional dependency: Unsupported npm WARN install Couldn't install optional dependency: Unsupported npm WARN EPEERINVALID chai-as-promised@3.3.1 requires a peer of chai@>= 1.0.2 < 2 but none was installed. npm WARN EPEERINVALID karma-requirejs@0.2.2 requires a peer of requirejs@~2.1 but none was installed. npm ERR! Linux 3.2.0-23-generic npm ERR! argv "node" "/usr/bin/npm" "install" npm ERR! node v0.10.37 npm ERR! npm v3.3.6 npm ERR! path ../acorn/bin/acorn npm ERR! code UNKNOWN npm ERR! errno -1 npm ERR! UNKNOWN, symlink '../acorn/bin/acorn' npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! npm ERR! Please include the following file with any support request: npm ERR! /vagrant/npm-debug.log --- vagrant.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vagrant.sh b/vagrant.sh index 38246143e8..e876d94f26 100644 --- a/vagrant.sh +++ b/vagrant.sh @@ -77,7 +77,7 @@ echo Installing gulp/bower... npm install -g gulp grunt-cli bower echo Installing Habitica -npm install --no-bin-links +npm install echo Installing Bower packages sudo -H -u vagrant bower --config.interactive=false install -f From 37cabedecb5f459a6c05c50fd495d85bf6fa1d4b Mon Sep 17 00:00:00 2001 From: Kristian Tashkov Date: Sun, 10 Jan 2016 12:50:52 +0200 Subject: [PATCH 03/10] Use nvm to install node 4 to vagrant env --- .npmignore | 0 Vagrantfile.example | 2 +- vagrant_scripts/install.sh | 19 +++++++++++ vagrant.sh => vagrant_scripts/vagrant.sh | 41 +++++++++++++----------- 4 files changed, 42 insertions(+), 20 deletions(-) create mode 100644 .npmignore create mode 100755 vagrant_scripts/install.sh rename vagrant.sh => vagrant_scripts/vagrant.sh (82%) diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Vagrantfile.example b/Vagrantfile.example index 52ffdf1096..73fcbf38c4 100644 --- a/Vagrantfile.example +++ b/Vagrantfile.example @@ -16,5 +16,5 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.hostname = "habitrpg" config.vm.network "forwarded_port", guest: 3000, host: 3000, auto_correct: true config.vm.usable_port_range = (3000..3050) - config.vm.provision :shell, :path => "vagrant.sh" + config.vm.provision :shell, :path => "vagrant_scripts/vagrant.sh" end diff --git a/vagrant_scripts/install.sh b/vagrant_scripts/install.sh new file mode 100755 index 0000000000..6bb6e8142e --- /dev/null +++ b/vagrant_scripts/install.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +echo Installing nvm... +curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | bash +source ~/.profile + +echo Setting up node... +nvm install +nvm use +nvm alias default current + +echo Update npm... +npm install -g npm + +echo Installing global modules... +npm install -g gulp bower grunt-cli + +echo Installing Habitica... +npm install --no-bin-links diff --git a/vagrant.sh b/vagrant_scripts/vagrant.sh similarity index 82% rename from vagrant.sh rename to vagrant_scripts/vagrant.sh index ceb1e9ab38..48d92a70a3 100644 --- a/vagrant.sh +++ b/vagrant_scripts/vagrant.sh @@ -38,6 +38,9 @@ apt-get update -qq echo Installing Unix build tools - needed for node-gyp to use make... apt-get install -qq build-essential +echo Installing python sofrware properties... +apt-get install -qq python-software-properties + echo Installing GraphicsMagick - provides gm and convert... apt-get install -qq graphicsmagick @@ -59,19 +62,26 @@ apt-get update apt-get install mongodb-10gen apt-get install -y mongodb-org=2.6.4 mongodb-org-server=2.6.4 mongodb-org-shell=2.6.4 mongodb-org-mongos=2.6.4 mongodb-org-tools=2.6.4 +echo Adding PPA repository for gcc... +add-apt-repository ppa:ubuntu-toolchain-r/test +apt-get update -qq + +echo Installing gcc 4.8... +apt-get install -qq gcc-4.8 g++-4.8 + +update-alternatives --remove-all gcc +update-alternatives --remove-all g++ +update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20 +update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20 +update-alternatives --config gcc +update-alternatives --config g++ + echo Installing Git... apt-get install -qq git -echo Installing npm... -apt-get install -qq python-software-properties -echo Adding repository node.js... -apt-add-repository -y ppa:chris-lea/node.js -echo Updating repositories... -apt-get update -qq -echo Installing node.js -apt-get install -qq nodejs -echo Updating npm... -npm install -g npm +echo Installing curl... +apt-get install -qq curl + echo Installing Xvfb... apt-get install -qq xvfb echo Installing Java7... @@ -82,16 +92,9 @@ echo Installing Firefox... dpkg -i firefox.deb rm firefox.deb -cd /vagrant +echo Installing ntp... +apt-get install -qq ntp -echo Installing gulp/bower... -npm install -g gulp grunt-cli bower - -echo Installing Habitica -npm install --no-bin-links - -echo Installing Bower packages -sudo -H -u vagrant bower --config.interactive=false install -f ## # echo Seeding Mongodb... ## node ./src/seed.js From c85f994f4cbd311686313f3d95dfc466ce58255c Mon Sep 17 00:00:00 2001 From: Joshua Holland Date: Sat, 16 Jan 2016 22:39:40 +0000 Subject: [PATCH 04/10] Make .img-rendering-auto apply to descendants --- website/public/css/index.styl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/website/public/css/index.styl b/website/public/css/index.styl index 382d4838b7..4936ea8264 100644 --- a/website/public/css/index.styl +++ b/website/public/css/index.styl @@ -198,10 +198,9 @@ a.label .markdown-preview markdown code white-space inherit -// By default everything should render as pixelart, except images from img tags (which tend to be things like gravatars, -// screenshots and so on) +// By default everything should render as pixelart * image-rendering: pixelated -.img-rendering-auto, .emoji +.img-rendering-auto, .img-rendering-auto *, .emoji image-rendering: auto From e98dc1405b1640ccb5c777c72d2bd77726059c5f Mon Sep 17 00:00:00 2001 From: Joshua Holland Date: Sat, 16 Jan 2016 22:43:29 +0000 Subject: [PATCH 05/10] Fix rendering of front page news icons Rendering was 'pixelated', is now 'auto'. --- website/views/static/front.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/views/static/front.jade b/website/views/static/front.jade index 926f0d6172..d5405d260c 100644 --- a/website/views/static/front.jade +++ b/website/views/static/front.jade @@ -84,7 +84,7 @@ html(ng-app='habitrpg', ng-controller='RootCtrl') h4= env.t('joinOthers', {userCount:'900,000'}) small button#play-btn.btn.btn-primary.btn-lg.gamifybutton(ng-click='playButtonClick()')= env.t('free') - .presslogos.text-center + .presslogos.text-center.img-rendering-auto = env.t('featuredIn') br img(src='https://d2afqr2xdmyzvu.cloudfront.net/front/images/presslogos/lifehacker.png') From 1d7c30a06da7b4a122bae339f1abbb22b308186d Mon Sep 17 00:00:00 2001 From: Tyler Smith Date: Sat, 16 Jan 2016 16:14:20 -0800 Subject: [PATCH 06/10] Fixes for the profile modal This commit fixes the following: 1. Unintented scrollbar was being created on the .modal container element 2. 15px gap between the footer and scrollable content, creating an odd visual lapse 3. Modal was too wide between 768px and 900px, bleeding off the page. --- website/public/css/avatar.styl | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/website/public/css/avatar.styl b/website/public/css/avatar.styl index 13bd58246d..4f74c086b4 100644 --- a/website/public/css/avatar.styl +++ b/website/public/css/avatar.styl @@ -11,11 +11,22 @@ future re: pets and whatnot, this is just temporary. // see http://stackoverflow.com/questions/24166568/set-bootstrap-modal-body-height-by-percentage .profile-modal - .modal-dialog,.modal-content - height: 96% + .modal-dialog + height: 100% + width: auto + max-width: 920px + margin: 0 auto + padding: 10px + @media screen and (min-width:768px) + padding: 30px 10px + .modal-content + height: 100% .modal-body - max-height: calc(100% - 150px) //100% = dialog height, 150px = header + footer + max-height: calc(100% - 137px) // 100% = dialog height, 150px = header (70px) + footer (67px) overflow-y: scroll + .modal-footer + margin: 0 + padding: 16px 20px .herobox // Base styles From af19d0d77b233a2d27f10bb3e79f4f010ed6fc8e Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Sun, 17 Jan 2016 16:11:42 -0600 Subject: [PATCH 07/10] fix: Correct stylus comment about modal height --- website/public/css/avatar.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/public/css/avatar.styl b/website/public/css/avatar.styl index 4f74c086b4..690dc1bb79 100644 --- a/website/public/css/avatar.styl +++ b/website/public/css/avatar.styl @@ -22,7 +22,7 @@ future re: pets and whatnot, this is just temporary. .modal-content height: 100% .modal-body - max-height: calc(100% - 137px) // 100% = dialog height, 150px = header (70px) + footer (67px) + max-height: calc(100% - 137px) // 100% = dialog height, 137px = header (70px) + footer (67px) overflow-y: scroll .modal-footer margin: 0 From 0ee7970276502ba37a127d1ce485b85f862d49e6 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Mon, 18 Jan 2016 08:47:57 -0600 Subject: [PATCH 08/10] fix: vagrant provisioning installs node automatically --- vagrant_scripts/install.sh | 17 +++++++++++------ vagrant_scripts/vagrant.sh | 2 ++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/vagrant_scripts/install.sh b/vagrant_scripts/install.sh index 6bb6e8142e..50c8a75903 100755 --- a/vagrant_scripts/install.sh +++ b/vagrant_scripts/install.sh @@ -1,19 +1,24 @@ #!/bin/bash echo Installing nvm... -curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | bash -source ~/.profile +curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | NVM_DIR="/home/vagrant/.nvm" PROFILE="/home/vagrant/.profile" bash +echo "source /home/vagrant/.nvm/nvm.sh" >> /home/vagrant/.profile +echo "nvm install" >> /home/vagrant/.profile + +chown -R vagrant:vagrant /home/vagrant/.nvm + +source /home/vagrant/.profile echo Setting up node... +cd /vagrant nvm install nvm use nvm alias default current echo Update npm... -npm install -g npm +npm install -g npm@2 echo Installing global modules... -npm install -g gulp bower grunt-cli +npm install -g gulp bower grunt-cli mocha -echo Installing Habitica... -npm install --no-bin-links +npm i diff --git a/vagrant_scripts/vagrant.sh b/vagrant_scripts/vagrant.sh index 5711b796f0..d732cf8689 100644 --- a/vagrant_scripts/vagrant.sh +++ b/vagrant_scripts/vagrant.sh @@ -95,6 +95,8 @@ rm firefox.deb echo Installing ntp... apt-get install -qq ntp +/vagrant/vagrant_scripts/install.sh + ## # echo Seeding Mongodb... ## node ./src/seed.js ## no longer required - see comments in src/seed.js From 89ef7c24c402366c55067c1cf4110179f94a2b14 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Mon, 18 Jan 2016 10:08:49 -0600 Subject: [PATCH 09/10] refactor: Modularize vagrant scripts --- vagrant_scripts/install_gcc.sh | 13 +++++ vagrant_scripts/install_mongo.sh | 11 ++++ .../{install.sh => install_node.sh} | 2 - .../install_sprite_dependencies.sh | 8 +++ vagrant_scripts/install_test_dependencies.sh | 9 ++++ vagrant_scripts/vagrant.sh | 54 ++++--------------- 6 files changed, 51 insertions(+), 46 deletions(-) create mode 100755 vagrant_scripts/install_gcc.sh create mode 100755 vagrant_scripts/install_mongo.sh rename vagrant_scripts/{install.sh => install_node.sh} (98%) create mode 100755 vagrant_scripts/install_sprite_dependencies.sh create mode 100755 vagrant_scripts/install_test_dependencies.sh diff --git a/vagrant_scripts/install_gcc.sh b/vagrant_scripts/install_gcc.sh new file mode 100755 index 0000000000..1eba4372c7 --- /dev/null +++ b/vagrant_scripts/install_gcc.sh @@ -0,0 +1,13 @@ +echo Adding PPA repository for gcc... +add-apt-repository ppa:ubuntu-toolchain-r/test +apt-get update -qq + +echo Installing gcc 4.8... +apt-get install -qq gcc-4.8 g++-4.8 + +update-alternatives --remove-all gcc +update-alternatives --remove-all g++ +update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20 +update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20 +update-alternatives --config gcc +update-alternatives --config g++ diff --git a/vagrant_scripts/install_mongo.sh b/vagrant_scripts/install_mongo.sh new file mode 100755 index 0000000000..4b0e244c32 --- /dev/null +++ b/vagrant_scripts/install_mongo.sh @@ -0,0 +1,11 @@ +# Import MongoDB public GPG key +# http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 + +# Create a list file for MongoDB +echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list + +apt-get update +apt-get install mongodb-10gen +apt-get install -y mongodb-org=2.6.4 mongodb-org-server=2.6.4 mongodb-org-shell=2.6.4 mongodb-org-mongos=2.6.4 mongodb-org-tools=2.6.4 + diff --git a/vagrant_scripts/install.sh b/vagrant_scripts/install_node.sh similarity index 98% rename from vagrant_scripts/install.sh rename to vagrant_scripts/install_node.sh index 50c8a75903..8de976aa62 100755 --- a/vagrant_scripts/install.sh +++ b/vagrant_scripts/install_node.sh @@ -20,5 +20,3 @@ npm install -g npm@2 echo Installing global modules... npm install -g gulp bower grunt-cli mocha - -npm i diff --git a/vagrant_scripts/install_sprite_dependencies.sh b/vagrant_scripts/install_sprite_dependencies.sh new file mode 100755 index 0000000000..631a813c96 --- /dev/null +++ b/vagrant_scripts/install_sprite_dependencies.sh @@ -0,0 +1,8 @@ +echo Installing GraphicsMagick - provides gm and convert... +apt-get install -qq graphicsmagick + +echo Installing phantomjs and dependency... +apt-get install -qq libicu48 + +echo Installing requirements for grunt-spritesmith... +apt-get install -qq pkg-config libcairo2-dev libjpeg-dev diff --git a/vagrant_scripts/install_test_dependencies.sh b/vagrant_scripts/install_test_dependencies.sh new file mode 100755 index 0000000000..f722397d64 --- /dev/null +++ b/vagrant_scripts/install_test_dependencies.sh @@ -0,0 +1,9 @@ +echo Installing Xvfb... +apt-get install -qq xvfb +echo Installing Java7... +apt-get install -qq openjdk-7-jre +echo Downloading Firefox... +wget http://sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/firefox-mozilla-build_40.0.3-0ubuntu1_amd64.deb/download -O firefox.deb >/dev/null 2>&1 +echo Installing Firefox... +dpkg -i firefox.deb +rm firefox.deb diff --git a/vagrant_scripts/vagrant.sh b/vagrant_scripts/vagrant.sh index d732cf8689..a53b97bad4 100644 --- a/vagrant_scripts/vagrant.sh +++ b/vagrant_scripts/vagrant.sh @@ -41,40 +41,14 @@ apt-get install -qq build-essential echo Installing python sofrware properties... apt-get install -qq python-software-properties -echo Installing GraphicsMagick - provides gm and convert... -apt-get install -qq graphicsmagick - -echo Installing phantomjs and dependency... -apt-get install -qq libicu48 - -echo Installing requirements for grunt-spritesmith... -apt-get install -qq pkg-config libcairo2-dev libjpeg-dev - -# Import MongoDB public GPG key -# http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 - -# Create a list file for MongoDB -echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list +echo Installing sprite dependencies... +/vagrant/vagrant_scripts/install_sprite_dependencies.sh echo Installing Mongodb... -apt-get update -apt-get install mongodb-10gen -apt-get install -y mongodb-org=2.6.4 mongodb-org-server=2.6.4 mongodb-org-shell=2.6.4 mongodb-org-mongos=2.6.4 mongodb-org-tools=2.6.4 +/vagrant/vagrant_scripts/install_mongo.sh -echo Adding PPA repository for gcc... -add-apt-repository ppa:ubuntu-toolchain-r/test -apt-get update -qq - -echo Installing gcc 4.8... -apt-get install -qq gcc-4.8 g++-4.8 - -update-alternatives --remove-all gcc -update-alternatives --remove-all g++ -update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20 -update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20 -update-alternatives --config gcc -update-alternatives --config g++ +echo Installing gcc... +/vagrant/vagrant_scripts/install_gcc.sh echo Installing Git... apt-get install -qq git @@ -82,24 +56,16 @@ apt-get install -qq git echo Installing curl... apt-get install -qq curl -echo Installing Xvfb... -apt-get install -qq xvfb -echo Installing Java7... -apt-get install -qq openjdk-7-jre -echo Downloading Firefox... -wget http://sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/firefox-mozilla-build_40.0.3-0ubuntu1_amd64.deb/download -O firefox.deb >/dev/null 2>&1 -echo Installing Firefox... -dpkg -i firefox.deb -rm firefox.deb +echo Installing test dependencies... +/vagrant/vagrant_scripts/install_gcc.sh echo Installing ntp... apt-get install -qq ntp -/vagrant/vagrant_scripts/install.sh +echo Installing nvm, node and global node modules... +/vagrant/vagrant_scripts/install_node.sh -## # echo Seeding Mongodb... -## node ./src/seed.js -## no longer required - see comments in src/seed.js +echo All done! run npm install to install the required node modules and then npm start to start the server # Uncomment both lines to autostart the habitica server when provisioning # echo Starting Habitica server... From aa68a5ed38ca040f4307d83739202dcfc03ea865 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Mon, 18 Jan 2016 10:13:09 -0600 Subject: [PATCH 10/10] fix: Update vagrant to use npm 3 --- vagrant_scripts/install_node.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vagrant_scripts/install_node.sh b/vagrant_scripts/install_node.sh index 8de976aa62..a420e7bdf1 100755 --- a/vagrant_scripts/install_node.sh +++ b/vagrant_scripts/install_node.sh @@ -16,7 +16,7 @@ nvm use nvm alias default current echo Update npm... -npm install -g npm@2 +npm install -g npm@3 echo Installing global modules... npm install -g gulp bower grunt-cli mocha