Merge branch 'master' into ci

* master:
  Fixed issue where hardcoded localhost:port combination existed in Javascript, added another step to setup.py 'package' that removes such instances and creates a more agnostic javascript blob.
  Fixing issue where nginx was not sending the right mimetype for CSS files.

Conflicts:
	gulp/build.js
This commit is contained in:
kevgliss 2015-07-20 16:53:58 -07:00
commit 9c0f2917ad
9 changed files with 90 additions and 7 deletions

View File

@ -4,9 +4,14 @@ Frequently Asked Questions
Common Problems
---------------
In my startup logs I see *'Aborting... Lemur cannot locate db encryption key, is ENCRYPTION_KEY set?'*
You likely have not correctly configured **ENCRYPTION_KEY**. See
:doc:`administration/configuration` for more information.
In my startup logs I see *'Aborting... Lemur cannot locate db encryption key, is LEMUR_ENCRYPTION_KEY set?'*
You likely have not correctly configured **LEMUR_ENCRYPTION_KEY**. See
: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

View File

@ -107,6 +107,7 @@ You can make some adjustments to get a better user experience::
location / {
root /www/lemur/lemur/static/dist;
include mime.types;
index index.html;
}
@ -172,6 +173,7 @@ sensitive nature of Lemur and what it controls makes this essential. This is a s
location / {
root /www/lemur/lemur/static/dist;
include mime.types;
index index.html;
}
@ -204,6 +206,9 @@ An example apache config::
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.
.. 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::
`Mozilla SSL Configuration Generator <https://mozilla.github.io/server-side-tls/ssl-config-generator/>`_

View File

@ -147,6 +147,7 @@ You'll use the builtin HttpProxyModule within Nginx to handle proxying
location / {
root /www/lemur/lemur/static/dist;
include mime.types;
index index.html;
}

View File

@ -27,8 +27,7 @@ var gulp = require('gulp'),
minifyHtml = require('gulp-minify-html'),
bowerFiles = require('main-bower-files'),
karma = require('karma'),
replace = require('gulp-replace-task');
replace = require('gulp-replace');
gulp.task('default', ['clean'], function () {
gulp.start('fonts', 'styles');
@ -237,5 +236,15 @@ gulp.task('build:images', function () {
.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('package', ['package:strip']);

View File

@ -0,0 +1,49 @@
"""Refactors Accounts to Destinations
Revision ID: 3b718f59b8ce
Revises: None
Create Date: 2015-07-09 17:44:55.626221
"""
# revision identifiers, used by Alembic.
revision = '3b718f59b8ce'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_table('certificate_account_associations')
op.drop_table('accounts')
op.add_column('destinations', sa.Column('plugin_name', sa.String(length=32), nullable=True))
op.drop_index('ix_elbs_account_id', table_name='elbs')
op.drop_constraint(u'elbs_account_id_fkey', 'elbs', type_='foreignkey')
op.drop_column('elbs', 'account_id')
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column('elbs', sa.Column('account_id', sa.BIGINT(), autoincrement=False, nullable=True))
op.create_foreign_key(u'elbs_account_id_fkey', 'elbs', 'accounts', ['account_id'], ['id'])
op.create_index('ix_elbs_account_id', 'elbs', ['account_id'], unique=False)
op.drop_column('destinations', 'plugin_name')
op.create_table('accounts',
sa.Column('id', sa.INTEGER(), server_default=sa.text(u"nextval('accounts_id_seq'::regclass)"), nullable=False),
sa.Column('account_number', sa.VARCHAR(length=32), autoincrement=False, nullable=True),
sa.Column('label', sa.VARCHAR(length=32), autoincrement=False, nullable=True),
sa.Column('notes', sa.TEXT(), autoincrement=False, nullable=True),
sa.PrimaryKeyConstraint('id', name=u'accounts_pkey'),
sa.UniqueConstraint('account_number', name=u'accounts_account_number_key'),
postgresql_ignore_search_path=False
)
op.create_table('certificate_account_associations',
sa.Column('account_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('certificate_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['account_id'], [u'accounts.id'], name=u'certificate_account_associations_account_id_fkey', ondelete=u'CASCADE'),
sa.ForeignKeyConstraint(['certificate_id'], [u'certificates.id'], name=u'certificate_account_associations_certificate_id_fkey', ondelete=u'CASCADE')
)
### end Alembic commands ###

View File

@ -62,7 +62,7 @@ lemur.controller('datePickerController', function ($scope, $timeout){
lemur.factory('LemurRestangular', function (Restangular, $location, $auth) {
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.addResponseInterceptor(function (data, operation, what, url, response, deferred) {

View File

@ -0,0 +1,12 @@
angular.module('lemur')
.service('PluginApi', function (LemurRestangular) {
return LemurRestangular.all('plugins');
})
.service('PluginService', function (PluginApi) {
var PluginService = this;
PluginService.get = function (type) {
return PluginApi.customGETLIST(type).then(function (plugins) {
return plugins;
});
};
});

View File

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

View File

@ -100,6 +100,8 @@ class BuildStatic(Command):
log.info("running [gulp build]")
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(
name='lemur',