Skip to content
Open
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
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
logs/
inc/config.override.php
# General ######################################################################
.vagrant
*~

## Language and Framework Specific #############################################

# Tattle
inc/config.override.php

# PHP
vendor/
37 changes: 37 additions & 0 deletions Homestead.yaml
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
28 changes: 28 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -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
48 changes: 48 additions & 0 deletions after.sh
Original file line number Diff line number Diff line change
@@ -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 "<?
// DATABASE SETTINGS
\$GLOBALS['DATABASE_HOST'] = '127.0.0.1';
\$GLOBALS['DATABASE_PORT'] = '3306';
\$GLOBALS['DATABASE_NAME'] = 'tattle';
\$GLOBALS['DATABASE_USER'] = 'homestead';
\$GLOBALS['DATABASE_PASS'] = 'secret';
\$GLOBALS['TATTLE_DOMAIN'] = 'http://tattle.local';
?>" > /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
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require-dev": {
"laravel/homestead": "~3.0"
}
}
232 changes: 232 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions logs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ignore everything except .gitignore
*
!.gitignore
Binary file added screenshots/tattle-vagrant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.