GithubHelp home page GithubHelp logo

rngadam / lmc Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 808 KB

LOPHILO lmc

License: GNU Affero General Public License v3.0

JavaScript 99.51% CoffeeScript 0.12% Processing 0.20% Shell 0.18%

lmc's Introduction

The Lophilo Main Controller (mc)

Lophilo main web console from which users can:

  • login (using third party authentication systems with OAuth)
  • manage various aspects of the systems
  • monitor Lophilo remotely
  • checkout repositories
  • launch the Cloud9 IDE

Technology

Based on the Socketstream framework.

SocketStream offers:

  • a pre-defined directory hierarchy to organize code
  • automatic pre-processing of files based on "formatters"
  • packaging of all assets and dependencies for faster downloads (production mode)
  • built-in RPC call system

Running

installation

Should be installed as /home/lophilo/lophilo/lmc

We want to run as a non-root user for additional safety. Many server-side services also expect running as a user, not root.

Note: for developers, we recommend exporting your $HOME/lophilo to NFS and mounting the NFS drive on lophilo.

startup

Adapt the script start_lophilo.sh to your needs.

open lophilo.local in your browser

Dependencies

Kernel

To forward from port 80 to 8080, you need the following Netfilter option enabled:

CONFIG_IP_NF_TARGET_REDIRECT=m

Debian packages

depends on the following:

apt-get install libpam0g-dev
apt-get install redis-server

Node.JS

Node.JS version 0.8.11

npm global packages dependencies:

npm install -g nodemon

Binary npm

Some npm with compiled modules from just being a copy from the host system:

  • mmap
  • socket.io

running as a non-root user

non-root user can't bind ports below 1024 (including HTTP port 80). Use iptables to redirect:

sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
sudo iptables -t nat -A OUTPUT --src 0/0 --dst 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 8080

Development

adding an app

lmc is based on the SocketStream framework. This means you can create additional apps as part of the lmc directory structure:

  • create directory and file ./client/code//.js
  • create file ./client/code//entry.js (copy from other existing)
  • make sure the require in entry.js points to
  • create file ./client/views/
  • modify ./app.js to ss.client.define your app dependencies and ss.http.route to route a URL to your app.
  • test (node-mon and socketstream should automatically reload on app change)

reload on client changes

use nodemon (or supervisor):

nodemon app.js

Note: this only reloads on changes with client/; for server-side see the bug:

socketstream/socketstream#310

Troubleshooting

can't connect to host

if console shows:

warn - error raised: Error: getaddrinfo ENOENT

check that your config.json host entry matches your hostname.

Otherwise, make sure that the IP the server is listening to matches what your client is trying to connect to. Use 0.0.0.0 to bind to any IP.

Copyright and license notice

This software has been developed by:

Shyu Lee [email protected] (Lophilo hardware engineering) Ricky Ng-Adam [email protected] (Lophilo software engineering)

Copyright (C) 2012 Lophilo

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

lmc's People

Contributors

rngadam avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.