From d93639d4807ceced87ec28d5de7e4aae4e15aa1e Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 5 May 2014 21:38:18 -0400 Subject: [PATCH 1/3] Updated README for 4.1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44dd84c19b..3efb5587e9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is a FOSS project for asset management in IT Operations. Knowing who has which laptop, when it was purchased in order to depreciate it correctly, handling software licenses, etc. -It is built on [Laravel 4](http://laravel.com) and uses the [Sentry 2](https://github.com/cartalyst/sentry) package. +It is built on [Laravel 4.1](http://laravel.com) and uses the [Sentry 2](https://github.com/cartalyst/sentry) package. Many thanks to the [Laravel 4 starter site](https://github.com/brunogaspar/laravel4-starter-kit) for a quick start. From 78f4615d016a4fea73e237f59662a07042ff3a7d Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 5 May 2014 21:59:23 -0400 Subject: [PATCH 2/3] Travis CI --- .travis.yml | 32 ++++++++++++++++++++++++++++++++ travis.yml | 12 ------------ 2 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 .travis.yml delete mode 100644 travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..8fb2eb589b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,32 @@ +# see http://about.travis-ci.org/docs/user/languages/php/ for more hints +language: php + +# list any PHP version you want to test against +php: + - 5.4 + - 5.5 + - 5.6 + +# optionally specify a list of environments, for example to test different RDBMS +env: + - DB=mysql + +# execute any number of scripts before the test run, custom env's are available as variables +before_script: + - if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS snipeit_laravel;" -utravis; fi + - curl -s http://getcomposer.org/installer | php + - php composer.phar self-update + - php composer.phar install --prefer-source --no-interaction --dev + - php artisan key:generate + - php artisan migrate:install + - php artisan migrate --package cartalyst/sentry + - php artisan migrate + - php artisan db:seed + +# omitting "script:" will default to phpunit +# use the $DB env variable to determine the phpunit.xml to use +script: phpunit + +# configure notifications (email, IRC, campfire etc) +notifications: + slack: snipe:F6LWbfP6vhr3aRBoeARFG6Ti \ No newline at end of file diff --git a/travis.yml b/travis.yml deleted file mode 100644 index 352638a3e2..0000000000 --- a/travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - - 5.5 - -before_script: - - curl -s http://getcomposer.org/installer | php - - php composer.phar install --prefer-source --no-interaction --dev - -script: phpunit \ No newline at end of file From 71c0c0143042200b219ee4389151b8ab76f0c9bf Mon Sep 17 00:00:00 2001 From: snipe Date: Mon, 5 May 2014 22:02:32 -0400 Subject: [PATCH 3/3] Updated environmental config for hostname-only --- README.md | 22 ++++++++++------------ bootstrap/start.php | 6 +++--- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 3efb5587e9..ee0a694adc 100644 --- a/README.md +++ b/README.md @@ -57,24 +57,22 @@ Update the file `boostrap/start.php` under the section `Detect The Application E ----- -*IMPORTANT*: Since the initial install is done via command line (which cannot grok your apache hostname), it's important -to include your machine name in the environmental array, or to pass the environmental override as a command line argument (using ` --env=local`). -Otherwise, your configs will default to production (as Laravel does). +__AS OF LARAVEL 4.1__ +Per the [Laravel 4.1 upgrade docs](http://laravel.com/docs/upgrade): -To find out your local machine's hostname, type `hostname` from a terminal prompt on the machine you're installing it on. If you -encounter an error on your install, saying that the `driver` variable isn't defined, something got botched in your -environmental settings and it's defaulting to production. +__*"For security reasons, URL domains may no longer be used to detect your application environment. These values are easily spoofable and allow attackers to modify the environment for a request. You should convert your environment detection to use machine host names (hostname command on Mac & Ubuntu)."*__ -So for example, if you're installing this locally on your Mac named SnipeMBP and with a local Apache hostname of http://snipe-it.local:8888, -your environmental variable section of `bootstrap/start.php` might look like this: +To find out your local machine's hostname, type `hostname` from a terminal prompt on the machine you're installing it on. The command-line response is that machine's hostname. Please note that the hostname is NOT always the same as the domain name. + +So for example, if you're installing this locally on your Mac named SnipeMBP, the environmental variable section of `bootstrap/start.php` might look like this: $env = $app->detectEnvironment(array( - - 'local' => array('SnipeMBP','http://*.local', '*.local*', '127.0.0.1', 'localhost*'), - 'staging' => array('http://staging.yourserver.com'), - 'production' => array('http://www.yourserver.com') + 'local' => array('SnipeMBP'), + 'staging' => array('staging.mysite.com'), + 'production' => array('www.mysite.com') )); +If your development, staging and production sites all run on the same server (which is generally a terrible idea), [see this example](http://words.weareloring.com/development/setting-up-multiple-environments-in-laravel-4-1/) of how to configure the app using environmental variables. ----- diff --git a/bootstrap/start.php b/bootstrap/start.php index aa3945824c..52f397b5d8 100755 --- a/bootstrap/start.php +++ b/bootstrap/start.php @@ -26,9 +26,9 @@ $app = new Illuminate\Foundation\Application; $env = $app->detectEnvironment(array( - 'local' => array('http://*.dev', 'http://*.local', '*.local*', '127.0.0.1', 'localhost*','AlisonMBP'), - 'staging' => array('http://staging.yourserver.com'), - 'production' => array('http://www.yourserver.com') + 'local' => array('YourLocalDevHostname','AlisonMBP'), + 'staging' => array('staging.yourserver.com'), + 'production' => array('www.yourserver.com') )); /*