Permalink
Browse files

Tweaks

Various tweaks cherry picked from local dev.

* Switch from marked to markdown-it (security update)
* Fix the matching md5 warning
* Add link to Assembly for contributors
  • Loading branch information...
davidkaneda committed May 3, 2015
1 parent 45dfd65 commit b99bf91e4229d4bbfb0cd814e6ca6bf77fa8c232
Showing with 17 additions and 11 deletions.
  1. +1 −1 config/test.json
  2. +1 −1 docs/frontend.md
  3. +4 −1 package.json
  4. +2 −2 server/models/build.coffee
  5. +7 −2 server/routes/admin.coffee
  6. +1 −1 server/views/admin.hbs
  7. +1 −3 test/server/models/entry.coffee
View
@@ -2,5 +2,5 @@
// Buckets’ local testing environment
"db": "mongodb://localhost/buckets_test",
"buildsPath": "./test/builds/",
- "logLevel": "none"
+ "logLevel": "info"
}
View
@@ -9,7 +9,7 @@ Once you’ve installed the project dependencies, use Grunt.js to build, serve,
* `grunt` (default) — Builds a development version of Buckets (unminified, with source maps).
* `grunt prepublish` (default) — Builds a production version of Buckets (minified).
* `grunt start`**This’ll be your main jam.** Creates a local server (localhost:3000) and runs “watch” for all files. Any changes to server CoffeeScript will restart the Node server and then reload the browser. Any changes to client-side CoffeeScript, Stylus, or Handlebars will re-compile, then reload the browser.
-* `grunt dev` — Shortcut for `grunt && grunt start`
+* `grunt dev` — Shortcut for `grunt && grunt start`, with Node Debugger (for node-inspector) added.
There are also specific [Grunt tasks for testing](./tests.md).
View
@@ -21,6 +21,9 @@
}
},
"author": "David Kaneda <dk@morfunk.com> (http://www.davidkaneda.com)",
+ "contributors": [
+ "Assembly Community (https://assembly.com/buckets/people)"
+ ],
"license": "AGPL-3.0",
"bugs": {
"url": "https://assembly.com/buckets/bounties"
@@ -82,7 +85,7 @@
"hbs": "^2.7.0",
"inflection": "^1.3.6",
"inquirer": "^0.8.0",
- "marked": "^0.3.2",
+ "markdown-it": "^3.0.6",
"moment": "^2.7.0",
"mongoose": "legacy",
"mongoose-regexp": "0.0.1",
@@ -70,10 +70,10 @@ buildSchema.pre 'validate', (next) ->
BuildFile.count build_env: @env, (e, count) =>
if count is 0
Build.count {env: @env, md5: tar.md5}, (err, count) =>
- logger.warn 'Found a matching md5, invalidating build.'
if count is 0
@set tar
else
+ logger.info 'Found a matching md5, invalidating build.'
@invalidate 'source', 'A build with that md5 already exists.'
next()
else
@@ -277,7 +277,7 @@ buildSchema.statics.generateTar = (dirpath, callback) ->
logger.error 'Error writing .tar.gz'
return
- output.on 'close', =>
+ output.on 'close', ->
size = archive.pointer()
logger.verbose 'Wrote', filename, filesize size
@@ -7,7 +7,11 @@ glob = require 'glob'
fs = require 'fs'
favicon = require 'serve-favicon'
_ = require 'underscore'
-marked = require 'marked'
+md = require('markdown-it')(
+ typographer: yes
+ linkify: yes
+ breaks: yes
+)
config = require '../lib/config'
plugins = require '../lib/plugins'
@@ -56,8 +60,9 @@ app.get '/logout', (req, res) ->
app.get "/help-html/*", (req, res, next) ->
glob "../../docs/user-docs/#{req.params[0]}", cwd: __dirname, (e, files) ->
return res.status(404).end() unless files.length
+
fs.readFile "#{__dirname}/#{files[0]}", encoding: 'utf-8', (e, content) ->
- return res.status(400).end() unless content and html = marked(content)
+ return res.status(400).end() unless content and html = md.render(content)
res.status(200).send html
app.get '/:admin*?', (req, res) ->
View
@@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Buckets</title>
<meta name="description" content="">
- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui">
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="theme-color" content="#edb91d">
<link rel="shortcut icon" href="{{assetPath}}/favicon.ico?v1">
<link rel="apple-touch-icon-precomposed" href="/{{adminSegment}}/apple-touch-icon-precomposed.png">
@@ -1,5 +1,4 @@
db = require '../../../server/lib/database'
-mongoose = require 'mongoose'
Entry = require '../../../server/models/entry'
Bucket = require '../../../server/models/bucket'
@@ -110,8 +109,7 @@ describe 'Entry', ->
bucket: photoBucket._id
author: user._id
status: 'live'
- ], ->
- done()
+ ], done
it 'filters by bucket slug (empty)', (done) ->
Entry.findByParams bucket: '', (e, entries) ->

0 comments on commit b99bf91

Please sign in to comment.