Skip to content

Commit

Permalink
Merge branch 'master' into doppins/boto3-equals-1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgliss committed Dec 13, 2016
2 parents cf1f375 + 565c9ae commit a76306b
Show file tree
Hide file tree
Showing 64 changed files with 1,295 additions and 860 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sudo: required
dist: trusty

node_js:
- "4.2"
- "6.2.0"

addons:
postgresql: "9.4"
Expand Down
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ endif
node_modules/.bin/gulp package
@echo ""

release:
@echo "--> Installing dependencies"
ifeq ($(USER), root)
@echo "WARNING: It looks like you are installing Lemur as root. This is not generally advised."
npm install --unsafe-perm
else
npm install
endif
pip install "setuptools>=0.9.8"
# order matters here, base package must install first
pip install -e .
node_modules/.bin/gulp build
node_modules/.bin/gulp package
@echo ""

dev-docs:
pip install -r docs/requirements.txt

Expand Down Expand Up @@ -89,4 +104,4 @@ coverage: develop
publish:
python setup.py sdist bdist_wheel upload

.PHONY: develop dev-postgres dev-docs setup-git build clean update-submodules test testloop test-cli test-js test-python lint lint-python lint-js coverage publish
.PHONY: develop dev-postgres dev-docs setup-git build clean update-submodules test testloop test-cli test-js test-python lint lint-python lint-js coverage publish release
8 changes: 8 additions & 0 deletions docs/administration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,14 @@ and are used when Lemur creates the CSR for your certificates.
LEMUR_DEFAULT_ISSUER_PLUGIN = "verisign-issuer"


.. data:: LEMUR_DEFAULT_AUTHORITY
:noindex:

::

LEMUR_DEFAULT_AUTHORITY = "verisign"


Notification Options
--------------------

Expand Down
36 changes: 10 additions & 26 deletions gulp/build.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
'use strict';

var gulp = require('gulp'),
minifycss = require('gulp-minify-css'),
concat = require('gulp-concat'),
less = require('gulp-less'),
gulpif = require('gulp-if'),
order = require('gulp-order'),
gutil = require('gulp-util'),
rename = require('gulp-rename'),
foreach = require('gulp-foreach'),
debug = require('gulp-debug'),
path =require('path'),
merge = require('merge-stream'),
del = require('del'),
Expand Down Expand Up @@ -89,9 +88,9 @@ gulp.task('dev:styles', function () {
.pipe(gulpif(isBootswatchFile, foreach(function (stream, file) {
var themeName = path.basename(path.dirname(file.path)),
content = replaceAll(baseContent, '$theme$', themeName),
file = string_src('bootstrap-' + themeName + '.less', content);
file2 = string_src('bootstrap-' + themeName + '.less', content);

return file;
return file2;
})))
.pipe(less())
.pipe(gulpif(isBootstrapFile, foreach(function (stream, file) {
Expand All @@ -101,7 +100,7 @@ gulp.task('dev:styles', function () {
// http://stackoverflow.com/questions/21719833/gulp-how-to-add-src-files-in-the-middle-of-a-pipe
// https://github.com/gulpjs/gulp/blob/master/docs/recipes/using-multiple-sources-in-one-task.md
return merge(stream, gulp.src(['.tmp/styles/font-awesome.css', '.tmp/styles/lemur.css']))
.pipe(concat('style-' + themeName + ".css"));
.pipe(concat('style-' + themeName + '.css'));
})))
.pipe(plumber())
.pipe(concat('styles.css'))
Expand All @@ -113,7 +112,7 @@ gulp.task('dev:styles', function () {

// http://stackoverflow.com/questions/1144783/replacing-all-occurrences-of-a-string-in-javascript
function escapeRegExp(string) {
return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1');
}

function replaceAll(string, find, replace) {
Expand All @@ -123,7 +122,7 @@ function replaceAll(string, find, replace) {
function string_src(filename, string) {
var src = require('stream').Readable({ objectMode: true });
src._read = function () {
this.push(new gutil.File({ cwd: "", base: "", path: filename, contents: new Buffer(string) }));
this.push(new gutil.File({ cwd: '', base: '', path: filename, contents: new Buffer(string) }));
this.push(null);
};
return src;
Expand All @@ -144,34 +143,25 @@ gulp.task('build:extras', function () {
function injectHtml(isDev) {
return gulp.src('lemur/static/app/index.html')
.pipe(
inject(gulp.src(bowerFiles({ base: 'app' }), {
read: false
}), {
inject(gulp.src(bowerFiles({ base: 'app' })), {
starttag: '<!-- inject:bower:{{ext}} -->',
addRootSlash: false,
ignorePath: isDev ? ['lemur/static/app/', '.tmp/'] : null
})
)
.pipe(inject(gulp.src(['lemur/static/app/angular/**/*.js'], {
read: false
}), {
read: false,
.pipe(inject(gulp.src(['lemur/static/app/angular/**/*.js']), {
starttag: '<!-- inject:{{ext}} -->',
addRootSlash: false,
ignorePath: isDev ? ['lemur/static/app/', '.tmp/'] : null
}))
.pipe(inject(gulp.src(['.tmp/styles/**/*.css'], {
read: false
}), {
read: false,
.pipe(inject(gulp.src(['.tmp/styles/**/*.css']), {
starttag: '<!-- inject:{{ext}} -->',
addRootSlash: false,
ignorePath: isDev ? ['lemur/static/app/', '.tmp/'] : null
}))
.pipe(
gulpif(!isDev,
inject(gulp.src('lemur/static/dist/ngviews/ngviews.min.js'), {
read: false,
starttag: '<!-- inject:ngviews -->',
addRootSlash: false
})
Expand Down Expand Up @@ -203,18 +193,12 @@ gulp.task('build:html', ['dev:styles', 'dev:scripts', 'build:ngviews', 'build:in
var jsFilter = filter('**/*.js');
var cssFilter = filter('**/*.css');

var assets = useref.assets();

return gulp.src('.tmp/index.html')
.pipe(assets)
.pipe(rev())
.pipe(jsFilter)
.pipe(ngAnnotate())
.pipe(jsFilter.restore())
.pipe(cssFilter)
.pipe(csso())
.pipe(cssFilter.restore())
.pipe(assets.restore())
.pipe(useref())
.pipe(revReplace())
.pipe(gulp.dest('lemur/static/dist'))
Expand Down
7 changes: 5 additions & 2 deletions lemur/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,16 @@ def configure_hook(app):
def after(response):
return response

@app.after_request
def log_status(response):
metrics.send('status_code_{}'.format(response.status_code), 'counter', 1)
return response

@app.errorhandler(Exception)
def handle_error(e):
code = 500
if isinstance(e, HTTPException):
code = e.code

metrics.send('{}_status_code'.format(code), 'counter', 1)

app.logger.exception(e)
return jsonify(error=str(e)), code
64 changes: 0 additions & 64 deletions lemur/analyze/service.py

This file was deleted.

2 changes: 1 addition & 1 deletion lemur/authorities/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def mint(**kwargs):
elif len(values) == 4:
body, private_key, chain, roles = values

roles = create_authority_roles(roles, kwargs['owner'], kwargs['plugin']['plugin_object'].title, None)
roles = create_authority_roles(roles, kwargs['owner'], kwargs['plugin']['plugin_object'].title, kwargs['creator'])
return body, private_key, chain, roles


Expand Down

0 comments on commit a76306b

Please sign in to comment.