Skip to content

Commit

Permalink
Fixes #103, #102 & #51
Browse files Browse the repository at this point in the history
  • Loading branch information
explodingcamera committed Jul 11, 2016
1 parent b7de1a7 commit 51c8e69
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 532 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ The base for creating a self-hosted pad.
2. Download the [latest stable version](https://github.com/musiqpad/mqp-server/releases/latest)
3. Unzip it in the location you want to install
4. Open a terminal and `npm install --production` it
5. Copy the `serverconfig.example.js` to create the file `serverconfig.js`
6. Start the server by running `npm start`
7. If everything went well, there should be no error messages.
5. Start the server by running `npm start`
6. If everything went well, there should be no error messages!

To change the settings, edit the config.hjson file!

If you want to start musiqpad using an application manager like forever, start the app.js file. To see server logs, run `npm run log` You can also download the latest pre-release [here](https://github.com/musiqpad/mqp-server/releases) (rc = release candidate, exp = experimental)

Expand Down Expand Up @@ -57,7 +58,8 @@ Params:
debug: false,
stream: false
}
}
},
config: fs.readFileSync('config.hjson'), // example config: config.example.hjson
}
```

Expand Down
160 changes: 86 additions & 74 deletions config.example.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@
<h1>Pad Description</h1>
Here you can put anything you want in HTML!
'''
tags: { // Tags for Google & co
keywords: "musiqpad"
description: ""
image: "https://cdn.musiqpad.com/img/icon-256.png" // Image on twitter/facebook/slack/...
twitter: "@musiqpad"
description: // A one to two sentence description for search engines & co
'''

'''
themeColor: "" // a hex color for the theme on chrome for android
favicon: "/pads/lib/img/icon.png"
}
}
apis: {
YT: {
Expand Down Expand Up @@ -154,7 +166,6 @@
"bot"
]



/*

Expand All @@ -175,14 +186,14 @@
*/

// Defines roles and permissions

owner: { // REQUIRED ROLE
title: "Owner"
showtitle: true
style: {
color: "#F46B40"
}
permissions: [
roles: {
owner: { // REQUIRED ROLE
title: "Owner"
showtitle: true
style: {
color: "#F46B40"
}
permissions: [
"djqueue.join"
"djqueue.joinlocked"
"djqueue.leave"
Expand Down Expand Up @@ -214,23 +225,23 @@
"room.whois"
"room.whois.iphistory"
"server.checkForUpdates"
]
canGrantRoles: [
]
canGrantRoles: [
"dev"
"coowner"
"supervisor"
"bot"
"regular"
"default"
]
}
dev: { // OPTIONAL ROLE FOR MUSIQPAD DEVS
title: "Dev"
showtitle: true
style: {
color: "#A77DC2"
]
}
permissions: [
dev: { // OPTIONAL ROLE FOR MUSIQPAD DEVS
title: "Dev"
showtitle: true
style: {
color: "#A77DC2"
}
permissions: [
"djqueue.join"
"djqueue.joinlocked"
"djqueue.leave"
Expand Down Expand Up @@ -260,24 +271,24 @@
"room.restrict.mute_silent"
"room.ratelimit.bypass"
"room.whois"
]
canGrantRoles: [
]
canGrantRoles: [
"dev"
"coowner"
"supervisor"
"bot"
"regular"
"default"
]
mention: "devs"
}
coowner: {
title: "Co-owner"
showtitle: true
style: {
color: "#89BE6C"
]
mention: "devs"
}
permissions: [
coowner: {
title: "Co-owner"
showtitle: true
style: {
color: "#89BE6C"
}
permissions: [
"djqueue.join"
"djqueue.joinlocked"
"djqueue.leave"
Expand Down Expand Up @@ -308,21 +319,21 @@
"room.ratelimit.bypass"
"room.whois"
"room.whois.iphistory"
]
canGrantRoles: [
]
canGrantRoles: [
"supervisor"
"bot"
"regular"
"default"
]
}
supervisor: {
title: "Supervisor"
showtitle: true
style: {
color: "#009CDD"
]
}
permissions: [
supervisor: {
title: "Supervisor"
showtitle: true
style: {
color: "#009CDD"
}
permissions: [
"djqueue.join"
"djqueue.joinlocked"
"djqueue.leave"
Expand Down Expand Up @@ -350,20 +361,20 @@
"room.restrict.mute_silent"
"room.ratelimit.bypass"
"room.whois"
]
canGrantRoles: [
]
canGrantRoles: [
"regular"
"default"
]
}
bot: {
title: "Bot"
showtitle: true
badge: "android"
style: {
color: "#964B74"
]
}
permissions: [
bot: {
title: "Bot"
showtitle: true
badge: "android"
style: {
color: "#964B74"
}
permissions: [
"djqueue.skip.other"
"djqueue.lock"
"djqueue.cycle"
Expand All @@ -375,17 +386,17 @@
"room.restrict.mute"
"room.restrict.mute_silent"
"room.ratelimit.bypass"
]
canGrantRoles: [
]
}
regular: {
title: "Regular"
showtitle: false
style: {
color: "#925AFF"
]
canGrantRoles: [
]
}
permissions: [
regular: {
title: "Regular"
showtitle: false
style: {
color: "#925AFF"
}
permissions: [
"djqueue.join"
"djqueue.joinlocked"
"djqueue.leave"
Expand All @@ -396,17 +407,17 @@
"playlist.delete"
"playlist.rename"
"playlist.import"
]
canGrantRoles: [
]
}
default: { // REQUIRED ROLE
title: "Default"
showtitle: false
style: {
color: "#ffffff"
]
canGrantRoles: [
]
}
permissions: [
default: { // REQUIRED ROLE
title: "Default"
showtitle: false
style: {
color: "#ffffff"
}
permissions: [
"djqueue.join"
"djqueue.leave"
"chat.send"
Expand All @@ -416,8 +427,9 @@
"playlist.delete"
"playlist.rename"
"playlist.import"
]
canGrantRoles: [
]
]
canGrantRoles: [
]
}
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"deasync": "^0.1.4",
"download-git-repo": "^0.1.2",
"durationjs": "^1.1.1",
"ejs": "^2.4.2",
"express": "^4.13.3",
"extend": "^3.0.0",
"file-tail": "^0.3.0",
Expand Down
10 changes: 7 additions & 3 deletions server-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var log = new(require('basic-logger'))({
showTimestamp: true,
prefix: "ServerContainer"
});
var fs = require('fs');

var extend = require('extend');

Expand All @@ -23,8 +24,11 @@ var server = function (params) {
}
}
extend(true, this.settings, params);

this.start = function() {
if(this.settings.config) {
fs.writeFileSync('./config.hjson', this.settings.config, 'utf8');
}
if (this.settings.forever.enabled) {
forever.load(this.settings.forever.options);
that.pid = forever.start('./start.js');
Expand All @@ -35,11 +39,11 @@ var server = function (params) {
});
}
};

this.stop = function() {
stopServer();
};

function stopServer() {
if (that.settings.forever.enabled) {
forever.stop();
Expand Down
Loading

0 comments on commit 51c8e69

Please sign in to comment.