-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from martindale/release
Initial Release
- Loading branch information
Showing
13 changed files
with
171 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
service_name: travis-ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
language: node_js | ||
node_js: | ||
- '0.12' | ||
services: | ||
- mongodb | ||
after_script: istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
# blog.soundtrack.io | ||
Simple blog for the soundtrack.io website. | ||
melody | ||
====== | ||
[![Build Status](https://img.shields.io/travis/martindale/melody.svg?branch=master&style=flat-square)](https://travis-ci.org/martindale/melody) | ||
[![Coverage Status](https://img.shields.io/coveralls/martindale/melody.svg?style=flat-square)](https://coveralls.io/r/martindale/melody) | ||
[![Community](https://chat.maki.io/badge.svg)](https://chat.maki.io/) | ||
|
||
simple, self-hosted publishing platform. | ||
|
||
## Quick Start | ||
After running `npm install`, simply type `npm start`. If it's your first time, | ||
melody will automatically create an admin user and generate a random password. | ||
|
||
Extra config values, such as character limit and allowing public registrations, | ||
are available in `config/index.js` for your convenience. | ||
|
||
## Hosting | ||
We strongly recommend using `pm2` to manage melody in production. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,25 @@ | ||
module.exports = { | ||
service: { | ||
name: 'melody', | ||
icon: 'music' | ||
name: 'Your Stream Name', // change this! | ||
synopsis: 'Thoughts and musings from me.', // and this... | ||
mission: 'Self-hosted writing and content sharing, powered by Maki', // also | ||
icon: 'write' // pick from: http://semantic-ui.com/elements/icon.html | ||
}, | ||
config: { | ||
allowPublicRegistration: false, // let other people register | ||
characterLimit: false // set to a number, such as 140. | ||
}, | ||
users: { // users will be created on startup, password logged to console | ||
'admin': { // admin username will be 'admin', change if you'd like | ||
roles: ['admin'] // what roles this user will have | ||
} | ||
}, | ||
database: { | ||
name: 'melody' // only change if you know what you're doing | ||
}, | ||
services: { | ||
http: { | ||
port: 13005 // you might want this to be 80, or 3000 | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var config = require('./config'); | ||
var crypto = require('crypto'); | ||
var melody = require('./lib/melody'); | ||
|
||
melody.start(function(err) { | ||
var Person = melody.resources.Person; | ||
var usernames = Object.keys(config.users); | ||
|
||
usernames.forEach(function(username) { | ||
Person.get({ | ||
username: username | ||
}, function(err, person) { | ||
if (err || person) return; | ||
var user = config.users[username]; | ||
var password = crypto.randomBytes(12).toString('base64'); | ||
|
||
user.username = username; | ||
user.password = password; | ||
|
||
Person.create(user, function(err, person) { | ||
if (err) return console.error(err); | ||
console.log('Created user "'+person.username+'", password:', password); | ||
}); | ||
|
||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
describe('Melody', function() { | ||
this.timeout(5000); | ||
describe('web server', function() { | ||
it('should run', function(done) { | ||
var melody = require('../lib/melody'); | ||
melody.start(done); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
a.ui.card(href="/people/#{person.slug}") | ||
.content | ||
.header #{person.username} | ||
.meta joined #{moment(person.created).fromNow()} | ||
.meta joined | ||
abbr.tooltipped(title="#{person.created}") #{moment(person.created).fromNow()} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
.ui.card.fluid | ||
.content | ||
a.right.floated(href="/people/#{post._author.slug}") #{post._author.username} | ||
h3.header #{post.title} | ||
.right.floated | ||
.ui.buttons | ||
if (user && user.capabilities && ~user.capabilities.indexOf('write')) | ||
a.ui.mini.button(href="#", data-intent="edit", data-target="post-description", data-id="#{post.slug}") | ||
i.icon.edit | ||
| edit | ||
a.ui.mini.button(href="/people/#{post._author.slug}") #{post._author.username} | ||
h3.header | ||
a(href="/posts/#{post.slug}") #{post.title} | ||
.meta | ||
a(href="/posts/#{post.slug}") #{moment(post.created).fromNow()} | ||
.description !{markdown(post.content)} | ||
.description(data-bind="post-description", data-id="#{post.slug}") !{markdown(post.content)} |