diff --git a/.gitignore b/.gitignore index c8b722b..1b4021e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,11 @@ -logs/ -inc/config.override.php +# General ###################################################################### +.vagrant *~ + +## Language and Framework Specific ############################################# + +# Tattle +inc/config.override.php + +# PHP +vendor/ diff --git a/Homestead.yaml b/Homestead.yaml new file mode 100644 index 0000000..e4933bc --- /dev/null +++ b/Homestead.yaml @@ -0,0 +1,37 @@ +--- +box: laravel/homestead-7 +ip: "192.168.10.20" +memory: 2048 +cpus: 1 +hostname: tattle +name: tattle +provider: virtualbox + +authorize: ~/.ssh/id_rsa.pub + +keys: + - ~/.ssh/id_rsa + +folders: + - map: "." + to: "/home/vagrant/tattle" + +sites: + - map: tattle.local + to: "/home/vagrant/tattle" + +databases: + - tattle + +# blackfire: +# - id: foo +# token: bar +# client-id: foo +# client-token: bar + +# ports: +# - send: 50000 +# to: 5000 +# - send: 7777 +# to: 777 +# protocol: udp diff --git a/README.md b/README.md index eb77207..6d4664b 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,24 @@ Installation and Configuration If you are on EL6 or a recent Fedora , make sure your php.ini has short_open_tag = off commented or you will get bogus output. +Vagrant / Quickstart +------------------- +* One easy way to play around with Tattle is to use our new vagrant box based on [homestead](https://laravel.com/docs/5.2/homestead) + +* You need to have [php](http://php.net/downloads.php) and [composer](https://getcomposer.org/doc/00-intro.md) installed and working + +* Run composer in the root of the project to install the dependencies into the vendor directory + +* Install Vagrant and VirtualBox 5.x as [detailed in homestead first steps](https://laravel.com/docs/5.2/homestead#first-steps) + +* Run `vagrant up` + +* Add **192.168.10.20 tattle.local** to your /etc/hosts file + +* Then you can visit your local version at [http://tattle.local](http://tattle.local). It [looks like this](/screenshots/tattle-vagrant.png) + +* This is very new and running php 7 so please report any issues + Dashboard Cleanurls ----------- If you have apache, with mod_rewrite enabled and allow .htaccess files you can try the new Clean Dashboard urls. diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..5c81259 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,28 @@ +require 'json' +require 'yaml' + +VAGRANTFILE_API_VERSION ||= "2" +confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__)) + +homesteadYamlPath = "Homestead.yaml" +homesteadJsonPath = "Homestead.json" +afterScriptPath = "after.sh" +aliasesPath = "aliases" + +require File.expand_path(confDir + '/scripts/homestead.rb') + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + if File.exists? aliasesPath then + config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases" + end + + if File.exists? homesteadYamlPath then + Homestead.configure(config, YAML::load(File.read(homesteadYamlPath))) + elsif File.exists? homesteadJsonPath then + Homestead.configure(config, JSON.parse(File.read(homesteadJsonPath))) + end + + if File.exists? afterScriptPath then + config.vm.provision "shell", path: afterScriptPath + end +end diff --git a/after.sh b/after.sh new file mode 100644 index 0000000..9e46a66 --- /dev/null +++ b/after.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +# This file runs after the vagrant machine is provisioned via `vagrant up` +echo +echo "Executing homestead extra provisioning ##################################" + +echo +echo "Installing ubuntu extras ################################################" +sudo apt-get install -y ack-grep; + +echo +echo "Run composer install and do database prep ###############################" +cd tattle +composer install + +# TODO: Instead, have a file config.vagrant.php users can edit and copy it +echo "" > /home/vagrant/tattle/inc/config.override.php + +# leading space prevents this from landing in bash history + mysql -hlocalhost -uhomestead -psecret tattle < graphite_tattle_schema_alpha.sql --verbose + +echo +echo "Setup crontab and other root actions ####################################" +sudo su; +echo "* * * * * curl 127.0.0.1/processor.php" > /etc/cron.d/tattle + +# super hacky but necessary because tattle sometimes uses short php tags +echo " +short_open_tag = On" >> /etc/php/7.0/fpm/php.ini + +service php7.0-fpm reload; + +echo +echo "Final reminders #########################################################" +echo "Add this line to your /etc/hosts file to access the vagrant tattle website from localhost:" +echo "192.168.10.20 tattle.local" +echo "" +echo "Then you can just visit http://tattle.local in your browser" +echo "Note: You must not have another web server running on port 80 which would need to be stopped first" +exit; # exit sudo diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..38f8a06 --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ + "require-dev": { + "laravel/homestead": "~3.0" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..bebd698 --- /dev/null +++ b/composer.lock @@ -0,0 +1,232 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "c7f15b2e80d028179811e3eb0983fa8d", + "packages": [], + "packages-dev": [ + { + "name": "laravel/homestead", + "version": "v3.0.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/homestead.git", + "reference": "e3b4a1903a2de46e085217a20e61465d18da7b63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/homestead/zipball/e3b4a1903a2de46e085217a20e61465d18da7b63", + "reference": "e3b4a1903a2de46e085217a20e61465d18da7b63", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/console": "~2.3|~3.0", + "symfony/process": "~2.3|~3.0" + }, + "bin": [ + "homestead" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-php-7": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\Homestead\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "description": "A virtual machine for web artisans.", + "time": "2015-12-21 22:36:28" + }, + { + "name": "symfony/console", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "5a02eaadaa285e2bb727eb6bbdfb8201fcd971b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/5a02eaadaa285e2bb727eb6bbdfb8201fcd971b0", + "reference": "5a02eaadaa285e2bb727eb6bbdfb8201fcd971b0", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2016-02-02 13:44:19" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "1289d16209491b584839022f29257ad859b8532d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d", + "reference": "1289d16209491b584839022f29257ad859b8532d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2016-01-20 09:13:37" + }, + { + "name": "symfony/process", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "dfecef47506179db2501430e732adbf3793099c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/dfecef47506179db2501430e732adbf3793099c8", + "reference": "dfecef47506179db2501430e732adbf3793099c8", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2016-02-02 13:44:19" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/logs/.gitignore b/logs/.gitignore new file mode 100644 index 0000000..888cace --- /dev/null +++ b/logs/.gitignore @@ -0,0 +1,3 @@ +# ignore everything except .gitignore +* +!.gitignore diff --git a/screenshots/tattle-vagrant.png b/screenshots/tattle-vagrant.png new file mode 100644 index 0000000..18d4613 Binary files /dev/null and b/screenshots/tattle-vagrant.png differ