浏览代码

Minor fixes to Kris's adjustments with local setup (alternative to docker)

theflametrooper 8 年之前
父节点
当前提交
34d4343c7d

+ 27 - 22
README.md

@@ -84,39 +84,44 @@ of the following commands to give Docker Toolbox access to those files.
    `docker-machine start default && docker-machine ssh default`
    
 3. Tell boot2docker to mount our volume at startup, by appending to its startup script
+	```bash
+	sudo tee -a /mnt/sda1/var/lib/boot2docker/profile >/dev/null <<EOF
 
-   ```bash
-   sudo tee -a /mnt/sda1/var/lib/boot2docker/profile >/dev/null <<EOF
-   
-   mkdir -p /d/Projects/MusareNode
-   mount -t vboxsf -o uid=1000,gid=50 d/Projects/MusareNode /d/Projects/MusareNode
-   EOF
-   ```
+	mkdir -p /d/Projects/MusareNode
+	mount -t vboxsf -o uid=1000,gid=50 d/Projects/MusareNode /d/Projects/MusareNode
+	EOF
+	```
 
 4. Restart the docker machine so that it uses the new shared folder
 
    `docker-machine restart default`
    
-5. You should now be good to go!
+5. You now should be good to go!
 
 ### Fixing the "couldn't connect to docker daemon" error
 
-Some people have had issues while trying to execute the `docker-compose` command. To fix this, you will have to run `docker-machine env default`. This command will print various variables. At the bottom, it will say something similar to `@FOR /f "tokens=*" %i IN ('docker-machine env default') DO @%i`. Run this command in your shell. You will have to do this command for every shell you want to run `docker-compose` in, every session.
+Some people have had issues while trying to execute the `docker-compose` command.
+To fix this, you will have to run `docker-machine env default`.
+This command will print various variables.
+At the bottom, it will say something similar to `@FOR /f "tokens=*" %i IN ('docker-machine env default') DO @%i`.
+Run this command in your shell. You will have to do this command for every shell you want to run `docker-compose` in (every session).
+
+### Running Musare locally without using Docker
+
+1. Install [Redis](http://redis.io/download) and [MongoDB](https://www.mongodb.com/download-center#community)
+
+2. Install nodemon globally
+
+   `npm install nodemon -g`
+
+3. Install webpack globally
 
-### Running Musare locally
+   `npm install webpack -g`
 
-For Windows, install Redis https://cloud.github.com/downloads/dmajkic/redis/redis-2.4.5-win32-win64.zip
-Extract it somewhere on your pc.
-In the Musare project directory, make a batch file called startRedis.cmd. In the batch file, write (in quotation marks "") the full path to the redis-server.exe
+4. Install node-gyp globally (first check out https://github.com/nodejs/node-gyp#installation)
 
-For MongoDB, install MongoDB from https://www.mongodb.com/download-center#community
-Make a new batch file called startMongo with this time the full path to the mongod.exe file. For version 3.2, this is `"C:\Program Files\MongoDB\Server\3.2\bin\mongod.exe"`
-After that, on the same line, add `--dbpath "C:\Path\To\Project\.database"` which leads to your project and then a .database folder in your project. Make sure to make the .database folder in your project before running mongo.
+   `npm install node-gyp -g`.
 
-Install nodemon globally by doing `npm install nodemon -g`.
-Install webpack globally by doing `npm install webpack -g`.
-Install node-gyp globally (first check out https://github.com/nodejs/node-gyp#installation) by doing `npm install node-gyp -g`.
-In frontend and in backend, do `npm install`.
+5. In both `frontend` and `backend` folders, do `npm install`.
 
-To start it, start Mongo and Redis by starting the two start scripts.
-After they have started, in the frontend folder do `npm run development-watch` and in the backend folder run `npm run development-w`
+6. `nodemon backend/index.js`

+ 1 - 1
backend/config/template.json

@@ -1,7 +1,7 @@
 {
 	"secret": "",
 	"domain": "",
-  	"localSetup": false,
+  	"isDocker": true,
 	"apis": {
 		"youtube": {
 			"key": ""

+ 1 - 2
backend/index.js

@@ -16,7 +16,6 @@ async.waterfall([
 	(next) => {
 		cache.init(config.get('redis').url, () => {
 			// load some test stations into the cache
-			console.log(next);
 			async.waterfall([
 				(next) => cache.hset('stations', '7dbf25fd-b10d-6863-2f48-637f6014b162', cache.schemas.station({
 					name: 'edm',
@@ -51,7 +50,7 @@ async.waterfall([
 
 	// setup the frontend for local setups
 	(next) => {
-		if (config.get("localSetup")) {
+		if (!config.get("isDocker")) {
 			const express = require('express');
 			const app = express();
 			const server = app.listen(8080);

+ 1 - 1
backend/logic/io.js

@@ -15,7 +15,7 @@ module.exports = {
 
 		this.io = require('socket.io')(app.server);
 
-		this.io.use(function(socket, next){
+		this.io.use((socket, next) => {
 			let cookies = socket.request.headers.cookie;
 			// set the sessionId for the socket (this will have to be checked every request, this allows us to have a logout all devices option)
 			socket.sessionId = utils.cookies.parseCookies(cookies).SID;

+ 0 - 1
backend/package.json

@@ -7,7 +7,6 @@
   "repository": "https://github.com/Musare/MusareNode",
   "scripts": {
     "development": "nodemon --inspect --debug -L /opt/app",
-    "development-w": "nodemon",
     "production": "node /opt/app"
   },
   "dependencies": {

+ 0 - 1
frontend/App.vue

@@ -32,7 +32,6 @@
 			}
 		},
 		ready: function () {
-			lofig.folder = 'config/default.json';
 			lofig.get('socket.url', res => {
 				let socket = this.socket = io(window.location.protocol + '//' + res);
 				socket.on("ready", status => this.loggedIn = status);

+ 3 - 3
frontend/build/config/default.json

@@ -1,5 +1,5 @@
 {
-  "socket": {
-	"url": "localhost"
-  }
+	"socket": {
+		"url": "192.168.99.100:8081"
+	}
 }

+ 5 - 0
frontend/build/config/template.json

@@ -0,0 +1,5 @@
+{
+	"socket": {
+		"url": ""
+	}
+}