Merge pull request #21 from kevgliss/buildfixes

Build Fixes
This commit is contained in:
kevgliss 2015-07-19 19:07:08 -07:00
parent 92a3c1a5a0
commit f78e9d47d1
7 changed files with 42 additions and 6 deletions

View File

@ -4,9 +4,14 @@ Frequently Asked Questions
Common Problems Common Problems
--------------- ---------------
In my startup logs I see *'Aborting... Lemur cannot locate db encryption key, is ENCRYPTION_KEY set?'* In my startup logs I see *'Aborting... Lemur cannot locate db encryption key, is LEMUR_ENCRYPTION_KEY set?'*
You likely have not correctly configured **ENCRYPTION_KEY**. See You likely have not correctly configured **LEMUR_ENCRYPTION_KEY**. See
:doc:`administration/configuration` for more information. :doc:`administration/index` for more information.
I am seeing Lemur's javascript load in my browser but not the CSS.
Ensure that you are placing *include mime.types;* to your Nginx static file location. See
:doc:`production/index` for example configurations.
How do I How do I

View File

@ -106,7 +106,12 @@ You can make some adjustments to get a better user experience::
} }
location / { location / {
<<<<<<< HEAD
root /apps/lemur/lemur/static/dist; root /apps/lemur/lemur/static/dist;
=======
root /www/lemur/lemur/static/dist;
include mime.types;
>>>>>>> b978435... Merge pull request #21 from kevgliss/buildfixes
index index.html; index index.html;
} }
@ -171,7 +176,12 @@ sensitive nature of Lemur and what it controls makes this essential. This is a s
} }
location / { location / {
<<<<<<< HEAD
root /apps/lemur/lemur/static/dist; root /apps/lemur/lemur/static/dist;
=======
root /www/lemur/lemur/static/dist;
include mime.types;
>>>>>>> b978435... Merge pull request #21 from kevgliss/buildfixes
index index.html; index index.html;
} }
@ -204,6 +214,9 @@ An example apache config::
Also included in the configurations above are several best practices when it comes to deploying SSL. Things like enabling Also included in the configurations above are several best practices when it comes to deploying SSL. Things like enabling
HSTS, disabling vulnerable ciphers are all good ideas when it comes to deploying Lemur into a production environment. HSTS, disabling vulnerable ciphers are all good ideas when it comes to deploying Lemur into a production environment.
.. note::
This is a rather incomplete apache config for running Lemur (needs mod_wsgi etc.,), if you have a working apache config please let us know!
.. seealso:: .. seealso::
`Mozilla SSL Configuration Generator <https://mozilla.github.io/server-side-tls/ssl-config-generator/>`_ `Mozilla SSL Configuration Generator <https://mozilla.github.io/server-side-tls/ssl-config-generator/>`_

View File

@ -148,6 +148,7 @@ Proxying with Nginx
You'll use the builtin HttpProxyModule within Nginx to handle proxying:: You'll use the builtin HttpProxyModule within Nginx to handle proxying::
location / { location / {
<<<<<<< HEAD
proxy_pass http://localhost:5000; proxy_pass http://localhost:5000;
proxy_redirect off; proxy_redirect off;
@ -155,6 +156,11 @@ You'll use the builtin HttpProxyModule within Nginx to handle proxying::
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
=======
root /www/lemur/lemur/static/dist;
include mime.types;
index index.html;
>>>>>>> b978435... Merge pull request #21 from kevgliss/buildfixes
} }
See :doc:`../production/index` for more details on using Nginx. See :doc:`../production/index` for more details on using Nginx.

View File

@ -26,7 +26,7 @@ var gulp = require('gulp'),
imagemin = require('gulp-imagemin'), imagemin = require('gulp-imagemin'),
minifyHtml = require('gulp-minify-html'), minifyHtml = require('gulp-minify-html'),
bowerFiles = require('main-bower-files'), bowerFiles = require('main-bower-files'),
replace = require('gulp-replace-task'); replace = require('gulp-replace');
gulp.task('default', ['clean'], function () { gulp.task('default', ['clean'], function () {
@ -227,5 +227,15 @@ gulp.task('build:images', function () {
.pipe(size()); .pipe(size());
}); });
gulp.task('package:strip', function () {
return gulp.src(['lemur/static/dist/scripts/main*'])
.pipe(replace('http:\/\/localhost:5000', ''))
.pipe(replace('http:\/\/localhost:3000', ''))
.pipe(useref())
.pipe(revReplace())
.pipe(gulp.dest('lemur/static/dist/scripts'))
.pipe(size());
});
gulp.task('build', ['build:ngviews', 'build:inject', 'build:images', 'build:fonts', 'build:html', 'build:extras']); gulp.task('build', ['build:ngviews', 'build:inject', 'build:images', 'build:fonts', 'build:html', 'build:extras']);
gulp.task('package', ['package:strip']);

View File

@ -62,7 +62,7 @@ lemur.controller('datePickerController', function ($scope, $timeout){
lemur.factory('LemurRestangular', function (Restangular, $location, $auth) { lemur.factory('LemurRestangular', function (Restangular, $location, $auth) {
return Restangular.withConfig(function (RestangularConfigurer) { return Restangular.withConfig(function (RestangularConfigurer) {
RestangularConfigurer.setBaseUrl('http://127.0.0.1:5000/api/1'); RestangularConfigurer.setBaseUrl('http://localhost:5000/api/1');
RestangularConfigurer.setDefaultHttpFields({withCredentials: true}); RestangularConfigurer.setDefaultHttpFields({withCredentials: true});
RestangularConfigurer.addResponseInterceptor(function (data, operation, what, url, response, deferred) { RestangularConfigurer.addResponseInterceptor(function (data, operation, what, url, response, deferred) {

View File

@ -37,7 +37,7 @@
"gulp-plumber": "^0.6.4", "gulp-plumber": "^0.6.4",
"gulp-print": "^1.1.0", "gulp-print": "^1.1.0",
"gulp-protractor": "0.0.11", "gulp-protractor": "0.0.11",
"gulp-replace": "~0.4.0", "gulp-replace": "~0.5.3",
"gulp-replace-task": "~0.1.0", "gulp-replace-task": "~0.1.0",
"gulp-rev": "^1.0.0", "gulp-rev": "^1.0.0",
"gulp-rev-replace": "^0.3.0", "gulp-rev-replace": "^0.3.0",

View File

@ -80,6 +80,8 @@ class BuildStatic(Command):
log.info("running [gulp buld]") log.info("running [gulp buld]")
check_output([os.path.join(ROOT, 'node_modules', '.bin', 'gulp'), 'build'], cwd=ROOT) check_output([os.path.join(ROOT, 'node_modules', '.bin', 'gulp'), 'build'], cwd=ROOT)
log.info("running [gulp package]")
check_output([os.path.join(ROOT, 'node_modules', '.bin', 'gulp'), 'package'], cwd=ROOT)
setup( setup(
name='lemur', name='lemur',