From 8ed558456518045d9fd3b5d7c8eb19a93e694df5 Mon Sep 17 00:00:00 2001 From: Gil Rutkowski Date: Fri, 29 Nov 2013 12:42:14 -0600 Subject: [PATCH 1/5] =?UTF-8?q?Removed=20post-install=20artisan=20optimize?= =?UTF-8?q?=20from=20composer.json=20=E2=80=94=20this=20breaks=20first=20t?= =?UTF-8?q?ime=20install=20as=20a=20mail=20config=20doesn=E2=80=99t=20exis?= =?UTF-8?q?t=20yet.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/composer.json b/composer.json index 80681e901f..0150f72ce7 100755 --- a/composer.json +++ b/composer.json @@ -20,9 +20,6 @@ ] }, "scripts": { - "post-install-cmd": [ - "php artisan optimize" - ], "pre-update-cmd": [ "php artisan clear-compiled" ], From f9d8cb1b93d70a40f73d59516e1ee6cb3252f7f3 Mon Sep 17 00:00:00 2001 From: Gil Rutkowski Date: Fri, 29 Nov 2013 23:22:48 -0600 Subject: [PATCH 2/5] Made things a bit more environmentally sensitive. --- app/config/app.php | 49 +------ app/config/local/app.php | 45 +++++++ .../database.php} | 0 .../{mail.example.php => local/mail.php} | 0 app/config/production/app.php | 45 +++++++ app/config/production/database.php | 124 ++++++++++++++++++ app/config/production/mail.php | 124 ++++++++++++++++++ app/config/staging/app.php | 44 +++++++ app/config/staging/database.php | 124 ++++++++++++++++++ app/config/staging/mail.php | 124 ++++++++++++++++++ bootstrap/start.php | 5 +- 11 files changed, 638 insertions(+), 46 deletions(-) create mode 100644 app/config/local/app.php rename app/config/{database.example.php => local/database.php} (100%) rename app/config/{mail.example.php => local/mail.php} (100%) create mode 100644 app/config/production/app.php create mode 100755 app/config/production/database.php create mode 100755 app/config/production/mail.php create mode 100644 app/config/staging/app.php create mode 100755 app/config/staging/database.php create mode 100755 app/config/staging/mail.php diff --git a/app/config/app.php b/app/config/app.php index 17c04bec5c..1f8c5a5091 100755 --- a/app/config/app.php +++ b/app/config/app.php @@ -2,32 +2,6 @@ return array( - /* - |-------------------------------------------------------------------------- - | Application Debug Mode - |-------------------------------------------------------------------------- - | - | When your application is in debug mode, detailed error messages with - | stack traces will be shown on every error that occurs within your - | application. If disabled, a simple generic error page is shown. - | - */ - - 'debug' => true, - - /* - |-------------------------------------------------------------------------- - | Application URL - |-------------------------------------------------------------------------- - | - | This URL is used by the console to properly generate URLs when using - | the Artisan command line tool. You should set this to the root of - | your application so that it is used when running Artisan tasks. - | - */ - - 'url' => 'http://localhost', - /* |-------------------------------------------------------------------------- | Application Timezone @@ -43,29 +17,16 @@ return array( /* |-------------------------------------------------------------------------- - | Application Locale Configuration + | Application Debug Mode |-------------------------------------------------------------------------- | - | The application locale determines the default locale that will be used - | by the translation service provider. You are free to set this value - | to any of the locales which will be supported by the application. + | When your application is in debug mode, detailed error messages with + | stack traces will be shown on every error that occurs within your + | application. If disabled, a simple generic error page is shown. | */ - 'locale' => 'en', - - /* - |-------------------------------------------------------------------------- - | Encryption Key - |-------------------------------------------------------------------------- - | - | This key is used by the Illuminate encrypter service and should be set - | to a random, 32 character string, otherwise these encrypted strings - | will not be safe. Please do this before deploying an application! - | - */ - - 'key' => 'YourSecretKey!!!', + 'debug' => false, /* |-------------------------------------------------------------------------- diff --git a/app/config/local/app.php b/app/config/local/app.php new file mode 100644 index 0000000000..e9b06cdd0f --- /dev/null +++ b/app/config/local/app.php @@ -0,0 +1,45 @@ + true, + + /* + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | your application so that it is used when running Artisan tasks. + | + */ + + 'url' => 'http://snipeit.dev', + + /* + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is used by the Illuminate encrypter service and should be set + | to a random, 32 character string, otherwise these encrypted strings + | will not be safe. Please do this before deploying an application! + | + | Run a php artisand key:generate --env=staging to create a random one + */ + + 'key' => 'Change_this_key_or_snipe_will_get_ya', + +); diff --git a/app/config/database.example.php b/app/config/local/database.php similarity index 100% rename from app/config/database.example.php rename to app/config/local/database.php diff --git a/app/config/mail.example.php b/app/config/local/mail.php similarity index 100% rename from app/config/mail.example.php rename to app/config/local/mail.php diff --git a/app/config/production/app.php b/app/config/production/app.php new file mode 100644 index 0000000000..229d012077 --- /dev/null +++ b/app/config/production/app.php @@ -0,0 +1,45 @@ + true, + + /* + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | your application so that it is used when running Artisan tasks. + | + */ + + 'url' => 'http://www.yourserver.com', + + /* + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is used by the Illuminate encrypter service and should be set + | to a random, 32 character string, otherwise these encrypted strings + | will not be safe. Please do this before deploying an application! + | + | Run a php artisand key:generate --env=production to create a random one + */ + + 'key' => 'Change_this_key_or_snipe_will_get_ya', + +); diff --git a/app/config/production/database.php b/app/config/production/database.php new file mode 100755 index 0000000000..31db93b9de --- /dev/null +++ b/app/config/production/database.php @@ -0,0 +1,124 @@ + PDO::FETCH_CLASS, + + /* + |-------------------------------------------------------------------------- + | Default Database Connection Name + |-------------------------------------------------------------------------- + | + | Here you may specify which of the database connections below you wish + | to use as your default connection for all database work. Of course + | you may use many connections at once using the Database library. + | + */ + + 'default' => 'mysql', + + /* + |-------------------------------------------------------------------------- + | Database Connections + |-------------------------------------------------------------------------- + | + | Here are each of the database connections setup for your application. + | Of course, examples of configuring each database platform that is + | supported by Laravel is shown below to make development simple. + | + | + | All database work in Laravel is done through the PHP PDO facilities + | so make sure you have the driver for your particular database of + | choice installed on your machine before you begin development. + | + */ + + 'connections' => array( + + 'sqlite' => array( + 'driver' => 'sqlite', + 'database' => __DIR__.'/../database/production.sqlite', + 'prefix' => '', + ), + + 'mysql' => array( + 'driver' => 'mysql', + 'host' => 'localhost', + 'database' => 'snipeit_laravel', + 'username' => 'snipeit_laravel', + 'password' => '', + 'charset' => 'utf8', + 'collation' => 'utf8_unicode_ci', + 'prefix' => '', + ), + + 'pgsql' => array( + 'driver' => 'pgsql', + 'host' => 'localhost', + 'database' => 'database', + 'username' => 'root', + 'password' => '', + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', + ), + + 'sqlsrv' => array( + 'driver' => 'sqlsrv', + 'host' => 'localhost', + 'database' => 'database', + 'username' => 'root', + 'password' => '', + 'prefix' => '', + ), + + ), + + /* + |-------------------------------------------------------------------------- + | Migration Repository Table + |-------------------------------------------------------------------------- + | + | This table keeps track of all the migrations that have already run for + | your application. Using this information, we can determine which of + | the migrations on disk have not actually be run in the databases. + | + */ + + 'migrations' => 'migrations', + + /* + |-------------------------------------------------------------------------- + | Redis Databases + |-------------------------------------------------------------------------- + | + | Redis is an open source, fast, and advanced key-value store that also + | provides a richer set of commands than a typical key-value systems + | such as APC or Memcached. Laravel makes it easy to dig right in. + | + */ + + 'redis' => array( + + 'cluster' => true, + + 'default' => array( + 'host' => '127.0.0.1', + 'port' => 6379, + 'database' => 0, + ), + + ), + +); diff --git a/app/config/production/mail.php b/app/config/production/mail.php new file mode 100755 index 0000000000..a7151a0674 --- /dev/null +++ b/app/config/production/mail.php @@ -0,0 +1,124 @@ + 'smtp', + + /* + |-------------------------------------------------------------------------- + | SMTP Host Address + |-------------------------------------------------------------------------- + | + | Here you may provide the host address of the SMTP server used by your + | applications. A default option is provided that is compatible with + | the Postmark mail service, which will provide reliable delivery. + | + */ + + 'host' => 'smtp.mailgun.org', + + /* + |-------------------------------------------------------------------------- + | SMTP Host Port + |-------------------------------------------------------------------------- + | + | This is the SMTP port used by your application to delivery e-mails to + | users of your application. Like the host we have set this value to + | stay compatible with the Postmark e-mail application by default. + | + */ + + 'port' => 587, + + /* + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all e-mails sent by your application to be sent from + | the same address. Here, you may specify a name and address that is + | used globally for all e-mails that are sent by your application. + | + */ + + 'from' => array('address' => null, 'name' => null), + + /* + |-------------------------------------------------------------------------- + | E-Mail Encryption Protocol + |-------------------------------------------------------------------------- + | + | Here you may specify the encryption protocol that should be used when + | the application send e-mail messages. A sensible default using the + | transport layer security protocol should provide great security. + | + */ + + 'encryption' => 'tls', + + /* + |-------------------------------------------------------------------------- + | SMTP Server Username + |-------------------------------------------------------------------------- + | + | If your SMTP server requires a username for authentication, you should + | set it here. This will get used to authenticate with your server on + | connection. You may also set the "password" value below this one. + | + */ + + 'username' => null, + + /* + |-------------------------------------------------------------------------- + | SMTP Server Password + |-------------------------------------------------------------------------- + | + | Here you may set the password required by your SMTP server to send out + | messages from your application. This will be given to the server on + | connection so that the application will be able to send messages. + | + */ + + 'password' => null, + + /* + |-------------------------------------------------------------------------- + | Sendmail System Path + |-------------------------------------------------------------------------- + | + | When using the "sendmail" driver to send e-mails, we will need to know + | the path to where Sendmail lives on this server. A default path has + | been provided here, which will work well on most of your systems. + | + */ + + 'sendmail' => '/usr/sbin/sendmail -bs', + + /* + |-------------------------------------------------------------------------- + | Mail "Pretend" + |-------------------------------------------------------------------------- + | + | When this option is enabled, e-mail will not actually be sent over the + | web and will instead be written to your application's logs files so + | you may inspect the message. This is great for local development. + | + */ + + 'pretend' => false, + +); \ No newline at end of file diff --git a/app/config/staging/app.php b/app/config/staging/app.php new file mode 100644 index 0000000000..57722e1789 --- /dev/null +++ b/app/config/staging/app.php @@ -0,0 +1,44 @@ + true, + + /* + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | your application so that it is used when running Artisan tasks. + | + */ + + 'url' => 'http://localhost', + + /* + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is used by the Illuminate encrypter service and should be set + | to a random, 32 character string, otherwise these encrypted strings + | will not be safe. Please do this before deploying an application! + | + */ + + 'key' => 'Change_this_key_or_snipe_will_get_ya', + +); diff --git a/app/config/staging/database.php b/app/config/staging/database.php new file mode 100755 index 0000000000..31db93b9de --- /dev/null +++ b/app/config/staging/database.php @@ -0,0 +1,124 @@ + PDO::FETCH_CLASS, + + /* + |-------------------------------------------------------------------------- + | Default Database Connection Name + |-------------------------------------------------------------------------- + | + | Here you may specify which of the database connections below you wish + | to use as your default connection for all database work. Of course + | you may use many connections at once using the Database library. + | + */ + + 'default' => 'mysql', + + /* + |-------------------------------------------------------------------------- + | Database Connections + |-------------------------------------------------------------------------- + | + | Here are each of the database connections setup for your application. + | Of course, examples of configuring each database platform that is + | supported by Laravel is shown below to make development simple. + | + | + | All database work in Laravel is done through the PHP PDO facilities + | so make sure you have the driver for your particular database of + | choice installed on your machine before you begin development. + | + */ + + 'connections' => array( + + 'sqlite' => array( + 'driver' => 'sqlite', + 'database' => __DIR__.'/../database/production.sqlite', + 'prefix' => '', + ), + + 'mysql' => array( + 'driver' => 'mysql', + 'host' => 'localhost', + 'database' => 'snipeit_laravel', + 'username' => 'snipeit_laravel', + 'password' => '', + 'charset' => 'utf8', + 'collation' => 'utf8_unicode_ci', + 'prefix' => '', + ), + + 'pgsql' => array( + 'driver' => 'pgsql', + 'host' => 'localhost', + 'database' => 'database', + 'username' => 'root', + 'password' => '', + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', + ), + + 'sqlsrv' => array( + 'driver' => 'sqlsrv', + 'host' => 'localhost', + 'database' => 'database', + 'username' => 'root', + 'password' => '', + 'prefix' => '', + ), + + ), + + /* + |-------------------------------------------------------------------------- + | Migration Repository Table + |-------------------------------------------------------------------------- + | + | This table keeps track of all the migrations that have already run for + | your application. Using this information, we can determine which of + | the migrations on disk have not actually be run in the databases. + | + */ + + 'migrations' => 'migrations', + + /* + |-------------------------------------------------------------------------- + | Redis Databases + |-------------------------------------------------------------------------- + | + | Redis is an open source, fast, and advanced key-value store that also + | provides a richer set of commands than a typical key-value systems + | such as APC or Memcached. Laravel makes it easy to dig right in. + | + */ + + 'redis' => array( + + 'cluster' => true, + + 'default' => array( + 'host' => '127.0.0.1', + 'port' => 6379, + 'database' => 0, + ), + + ), + +); diff --git a/app/config/staging/mail.php b/app/config/staging/mail.php new file mode 100755 index 0000000000..a7151a0674 --- /dev/null +++ b/app/config/staging/mail.php @@ -0,0 +1,124 @@ + 'smtp', + + /* + |-------------------------------------------------------------------------- + | SMTP Host Address + |-------------------------------------------------------------------------- + | + | Here you may provide the host address of the SMTP server used by your + | applications. A default option is provided that is compatible with + | the Postmark mail service, which will provide reliable delivery. + | + */ + + 'host' => 'smtp.mailgun.org', + + /* + |-------------------------------------------------------------------------- + | SMTP Host Port + |-------------------------------------------------------------------------- + | + | This is the SMTP port used by your application to delivery e-mails to + | users of your application. Like the host we have set this value to + | stay compatible with the Postmark e-mail application by default. + | + */ + + 'port' => 587, + + /* + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all e-mails sent by your application to be sent from + | the same address. Here, you may specify a name and address that is + | used globally for all e-mails that are sent by your application. + | + */ + + 'from' => array('address' => null, 'name' => null), + + /* + |-------------------------------------------------------------------------- + | E-Mail Encryption Protocol + |-------------------------------------------------------------------------- + | + | Here you may specify the encryption protocol that should be used when + | the application send e-mail messages. A sensible default using the + | transport layer security protocol should provide great security. + | + */ + + 'encryption' => 'tls', + + /* + |-------------------------------------------------------------------------- + | SMTP Server Username + |-------------------------------------------------------------------------- + | + | If your SMTP server requires a username for authentication, you should + | set it here. This will get used to authenticate with your server on + | connection. You may also set the "password" value below this one. + | + */ + + 'username' => null, + + /* + |-------------------------------------------------------------------------- + | SMTP Server Password + |-------------------------------------------------------------------------- + | + | Here you may set the password required by your SMTP server to send out + | messages from your application. This will be given to the server on + | connection so that the application will be able to send messages. + | + */ + + 'password' => null, + + /* + |-------------------------------------------------------------------------- + | Sendmail System Path + |-------------------------------------------------------------------------- + | + | When using the "sendmail" driver to send e-mails, we will need to know + | the path to where Sendmail lives on this server. A default path has + | been provided here, which will work well on most of your systems. + | + */ + + 'sendmail' => '/usr/sbin/sendmail -bs', + + /* + |-------------------------------------------------------------------------- + | Mail "Pretend" + |-------------------------------------------------------------------------- + | + | When this option is enabled, e-mail will not actually be sent over the + | web and will instead be written to your application's logs files so + | you may inspect the message. This is great for local development. + | + */ + + 'pretend' => false, + +); \ No newline at end of file diff --git a/bootstrap/start.php b/bootstrap/start.php index 9848f9bc9e..d8b2b120c6 100755 --- a/bootstrap/start.php +++ b/bootstrap/start.php @@ -28,8 +28,9 @@ $app->redirectIfTrailingSlash(); $env = $app->detectEnvironment(array( - 'local' => array('your-machine-name'), - + 'local' => array('http://*.dev', 'http://*.local', '*.local*', '127.0.0.1', 'localhost*'), + 'staging' => array('http://staging.yourserver.com'), + 'production' => array('http://www.yourserver.com') )); /* From 71eaeb2783ff8de8fa6f238a6b37de35f6e679be Mon Sep 17 00:00:00 2001 From: Gil Rutkowski Date: Fri, 29 Nov 2013 23:56:48 -0600 Subject: [PATCH 3/5] Updated README for Environments and revised the order of things. --- README.md | 79 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 6978f675c9..25fc6a07a7 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This isn't actually ready for anyone to use yet, as I'm still working out some o ## Requirements -- PHP 5.3.7 or later +- PHP 5.4 or later - MCrypt PHP Extension ----- @@ -43,41 +43,55 @@ Forgetting to do this can mean your DB might end up out of sync with the new fil ----- -### 2) Install the Dependencies via Composer -##### 2.1) If you don't have composer installed globally +### 2) Setup Database and Mail Settings + +#### 2.1) Setup Your Database + +Update the file `app/config/local/database.php` with your database name and credentials. + + vi app/config/local/database.php + +#### 2.2) Setup Mail Settings + +Update the file `app/config/local/mail.php` with your mail settings. + + vi app/config/local/mail.php + +This will be used to send emails to your users, when they register and they request a password reset. + +#### 2.3) Adjust the application settings. + +Update the file `app/config/local/app.php` with your setting URL settings. You should also change your secret key here -- if you prefer to have your key randomly generated, run the artisan key:generate command from the application root. + + php artisan key:generate --env=local + +#### 2.4) Adjust Environments + +Update the file `boostrap/start.php' under the section `Detect The Application Environment`. + + vi bootstrap/start.php + +#### 2.5) Additional Adjustments + +The app is configured to automatically detect if your in a local, staging, or production environment. Before deploying to a staging or production environment, follow sets 2.1, 2.2, and 2.3 above to tweak each environment as nescessary. Configuration files for each environment can be found in app/config/{environment} (local, staging, and production). + +----- + +### 3) Install the Dependencies via Composer +##### 3.1) If you don't have composer installed globally cd your-folder curl -s http://getcomposer.org/installer | php php composer.phar install -##### 2.2) For globally composer installations +##### 3.2) For global composer installations cd your-folder composer install ----- -### 3) Setup Database - -Copy the file `app/config/database.php` to `database.php`, and update `database.php` with your database name and credentials - - cp app/config/database.example.php app/config/database.php - vi app/config/database.example.php - ------ - -### 4) Setup Mail Settings - -Now, copy the file `app/config/mail.php` to `mail.php`, and update `mail.php` with your mail settings - - cp app/config/mail.example.php app/config/mail.php - vi app/config/mail.example.php - -This will be used to send emails to your users, when they register and they request a password reset. - ------ - -### 5) Use custom CLI Installer Command +### 4) Use custom CLI Installer Command Now, you need to create yourself a user and finish the installation. @@ -101,7 +115,7 @@ If you still run into a permissions error, you may need to increase the permissi ### 7) Set the correct document root for your server -The document root for the app should be set to the public directory. In a standard Apache virtualhost setup, that might look something like this: +The document root for the app should be set to the public directory. In a standard Apache virtualhost setup, that might look something like this on a standard linux LAMP stack: DocumentRoot /var/www/html/public @@ -110,6 +124,19 @@ The document root for the app should be set to the public directory. In a standa # Other directives here +An OS X virtualhost setup could look more like: + + Directory "/Users/flashingcursor/Sites/snipe-it/public/"> + Allow From All + AllowOverride All + Options +Indexes + + + ServerName "snipe-it.dev" + DocumentRoot "/Users/flashingcursor/Sites/snipe-it/public" + SetEnv LARAVEL_ENV development + + ----- ### 8) Seed the Database From 3d1a533bf21d8da29ab301422d6412a545bbee24 Mon Sep 17 00:00:00 2001 From: Gil Rutkowski Date: Sat, 30 Nov 2013 11:17:02 -0600 Subject: [PATCH 4/5] Environmental cleanup. --- README.md | 10 +++++++++- app/config/local/.gitignore | 3 +++ app/config/local/{app.php => app.example.php} | 0 .../local/{database.php => database.example.php} | 0 app/config/local/{mail.php => mail.example.php} | 0 app/config/production/.gitignore | 3 +++ app/config/production/{app.php => app.example.php} | 4 ++-- .../production/{database.php => database.example.php} | 0 app/config/production/{mail.php => mail.example.php} | 0 app/config/staging/.gitignore | 3 +++ app/config/staging/{app.php => app.example.php} | 3 ++- .../staging/{database.php => database.example.php} | 0 app/config/staging/{mail.php => mail.example.php} | 0 13 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 app/config/local/.gitignore rename app/config/local/{app.php => app.example.php} (100%) rename app/config/local/{database.php => database.example.php} (100%) rename app/config/local/{mail.php => mail.example.php} (100%) create mode 100644 app/config/production/.gitignore rename app/config/production/{app.php => app.example.php} (93%) rename app/config/production/{database.php => database.example.php} (100%) rename app/config/production/{mail.php => mail.example.php} (100%) create mode 100644 app/config/staging/.gitignore rename app/config/staging/{app.php => app.example.php} (91%) rename app/config/staging/{database.php => database.example.php} (100%) rename app/config/staging/{mail.php => mail.example.php} (100%) diff --git a/README.md b/README.md index 25fc6a07a7..68de0242be 100644 --- a/README.md +++ b/README.md @@ -47,12 +47,14 @@ Forgetting to do this can mean your DB might end up out of sync with the new fil #### 2.1) Setup Your Database +Copy the example database config `app/config/local/database.example.php` to `database.php`. Update the file `app/config/local/database.php` with your database name and credentials. vi app/config/local/database.php #### 2.2) Setup Mail Settings +Copy the example mail config `app/config/local/database.example.php` to `database.php`. Update the file `app/config/local/mail.php` with your mail settings. vi app/config/local/mail.php @@ -61,7 +63,13 @@ This will be used to send emails to your users, when they register and they requ #### 2.3) Adjust the application settings. -Update the file `app/config/local/app.php` with your setting URL settings. You should also change your secret key here -- if you prefer to have your key randomly generated, run the artisan key:generate command from the application root. +Copy the example app config `app/config/local/app.example.php` to `app.php`. + +Update the file `app/config/local/app.php` with your setting URL settings. + + vi app/config/local/app.php + +You should also change your secret key here -- if you prefer to have your key randomly generated, run the artisan key:generate command from the application root. php artisan key:generate --env=local diff --git a/app/config/local/.gitignore b/app/config/local/.gitignore new file mode 100644 index 0000000000..3fbd46353d --- /dev/null +++ b/app/config/local/.gitignore @@ -0,0 +1,3 @@ +app.php +mail.php +database.php diff --git a/app/config/local/app.php b/app/config/local/app.example.php similarity index 100% rename from app/config/local/app.php rename to app/config/local/app.example.php diff --git a/app/config/local/database.php b/app/config/local/database.example.php similarity index 100% rename from app/config/local/database.php rename to app/config/local/database.example.php diff --git a/app/config/local/mail.php b/app/config/local/mail.example.php similarity index 100% rename from app/config/local/mail.php rename to app/config/local/mail.example.php diff --git a/app/config/production/.gitignore b/app/config/production/.gitignore new file mode 100644 index 0000000000..3fbd46353d --- /dev/null +++ b/app/config/production/.gitignore @@ -0,0 +1,3 @@ +app.php +mail.php +database.php diff --git a/app/config/production/app.php b/app/config/production/app.example.php similarity index 93% rename from app/config/production/app.php rename to app/config/production/app.example.php index 229d012077..598b272ed3 100644 --- a/app/config/production/app.php +++ b/app/config/production/app.example.php @@ -13,7 +13,7 @@ return array( | */ - 'debug' => true, + 'debug' => false, /* |-------------------------------------------------------------------------- @@ -37,7 +37,7 @@ return array( | to a random, 32 character string, otherwise these encrypted strings | will not be safe. Please do this before deploying an application! | - | Run a php artisand key:generate --env=production to create a random one + | Run a php artisand key:generate --env=staging to create a random one */ 'key' => 'Change_this_key_or_snipe_will_get_ya', diff --git a/app/config/production/database.php b/app/config/production/database.example.php similarity index 100% rename from app/config/production/database.php rename to app/config/production/database.example.php diff --git a/app/config/production/mail.php b/app/config/production/mail.example.php similarity index 100% rename from app/config/production/mail.php rename to app/config/production/mail.example.php diff --git a/app/config/staging/.gitignore b/app/config/staging/.gitignore new file mode 100644 index 0000000000..3fbd46353d --- /dev/null +++ b/app/config/staging/.gitignore @@ -0,0 +1,3 @@ +app.php +mail.php +database.php diff --git a/app/config/staging/app.php b/app/config/staging/app.example.php similarity index 91% rename from app/config/staging/app.php rename to app/config/staging/app.example.php index 57722e1789..44544721d0 100644 --- a/app/config/staging/app.php +++ b/app/config/staging/app.example.php @@ -26,7 +26,7 @@ return array( | */ - 'url' => 'http://localhost', + 'url' => 'http://staging.yourserver.com', /* |-------------------------------------------------------------------------- @@ -37,6 +37,7 @@ return array( | to a random, 32 character string, otherwise these encrypted strings | will not be safe. Please do this before deploying an application! | + | Run a php artisand key:generate --env=staging to create a random one */ 'key' => 'Change_this_key_or_snipe_will_get_ya', diff --git a/app/config/staging/database.php b/app/config/staging/database.example.php similarity index 100% rename from app/config/staging/database.php rename to app/config/staging/database.example.php diff --git a/app/config/staging/mail.php b/app/config/staging/mail.example.php similarity index 100% rename from app/config/staging/mail.php rename to app/config/staging/mail.example.php From ca39b34b8c09192089772e48f8d4bd23ea0a756a Mon Sep 17 00:00:00 2001 From: Gil Rutkowski Date: Sat, 30 Nov 2013 11:36:05 -0600 Subject: [PATCH 5/5] Automatically run Sentry Migrations and DB migrations after composer install. --- composer.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/composer.json b/composer.json index 0150f72ce7..3147feef1d 100755 --- a/composer.json +++ b/composer.json @@ -20,6 +20,10 @@ ] }, "scripts": { + "post-install-cmd": [ + "php artisan migrate --package=cartalyst/sentry" + "php artisan migrate" + ] "pre-update-cmd": [ "php artisan clear-compiled" ],