RController

... control everything from anywhere
RController will allow you to control your servers and personal computers from anywhere. Each target machine will use a server that will listen for connections. All the data on the server is managed using a Control Panel Interface. You will be able to add, remove, update commands. There are no limitations upon commands that can be executed: scripts, command lines commands, python methods, etc. You will be able to add/edit/remove users.
Using the mobile application you can easily connect and execute any predefined commands. There are multiple types of commands, with or without return status.
    Here are shome of the key features:
  • Fully transparent for user to add remote commands
  • Full opensource server (written in Python)
  • Add and manage as many servers as you want
  • Supports on/off command type and commands with/without status
Requirements:
Client application is compatible with iPhone,iPod devices. Requires iPhone OS 7.0 or later. WiFi, Edge, or 3G network connection is required.
Requirements:
Soon RController client will be available for Android devices.

Server application

  • Server application is compatible with Linux, OSX and Windows. It will require Python 2.x and Flask.
  • Full opensource
  • Each target machine will be managed using a control panel web interface. You can add/remove users update/add/delete commands.
  • You can download server package from http://rcontroller.duculete.com/server/rcontroller.zip
  • Bellow you can find installation instructions for different OS.

Screenshots

CentOS server - installation

  • Enable epel on CentOS 6:
  • 
    $ cd /tmp
    $ wget http://mirror-fpt-telecom.fpt.net/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
    # rpm -ivh epel-release-6-8.noarch.rpm
    				
  • Install python tool for installing and managing Python packages (pip):
  • 
    [root@centos tmp]# yum -y install python-pip
    .........
    				
  • Check that you have python version 2.x installed:
  • 
    [root@centos tmp]# python -V
    Python 2.6.6
    				
  • Install Flask and SqlAchemy (python modules):
  • 
    [root@centos tmp]# pip install Flask SqlAlchemy
    .........
    				
  • Check Flask flask module installation:
  • 
    [root@centos tmp]# python
    Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36) 
    [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import flask
    >>> flask.__version__
    '0.10.1'
    >>> exit() 
    				
  • Now that everything is installed, download server app:
  • 
    [root@centos tmp]# mkdir /opt/rcontroller
    [root@centos tmp]# cd /opt/rcontroller/
    [root@centos rcontroller]# wget http://rcontroller.duculete.com/server/rcontroller.tgz
    ....
    100%[===========================================================================>] 3,363,134   6.18M/s   in 0.5s    
    
    2014-09-16 11:39:40 (6.18 MB/s) - “rcontroller.tgz” saved [3363134/3363134]
    
    [root@centos rcontroller]# tar -xzvf rcontroller.tgz
    ....
    [root@centos rcontroller]# rm -f rcontroller.tgz
    
    [root@centos tmp]# ls
    commands.db  init.d  pid  rcontroller.cfg  rcontroller.py  schema.sql  start.sh  static  templates
    				
  • Next edit file named rcontroller.cfg and change SECRET_KEY:
  • 
    SECRET_KEY = '23b#$@w0^k2@#$%sjU7@#$nRYH*&qQrCFw'
    				

    How to generate good secret keys?
    The problem with random is that it’s hard to judge what is truly random. And a secret key should be as random as possible. Your operating system has ways to generate pretty random stuff based on a cryptographic random generator which can be used to get such a key. Here is an example how to generate an random key using python:

    
    [root@centos rcontroller]# python
    Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 
    >>> import os
    >>> os.urandom(24).encode('hex')
    'b85911bdfa3a6606768f30582ef4166f357efc861a823ab1'
    

    Now just replace the old (default value) with new value generated.

    If you want to use init.d to start the server at boot, there is an init script that needs to be updated. This file is located to init.d/rcontroller folder provided with server application. You need to change the following parameters:

    
    PYTHON_EXEC="/usr/bin/python" <<< the path of the python executable
    APP_FOLDER="/rcontroller" <<< the root folder of the application (in this case /opt/rcontroller)
    

    Copy the init script to /etc/init.d folder and activate start at boot:

    
    [root@centos rcontroller]# cp init.d/rcontroller /etc/init.d/
    [root@centos rcontroller]# chkconfig --level 345 rcontroller on
    
  • You can now start the server:
  • 
    [root@centos rcontroller]# /etc/init.d/rcontroller start
    Starting server ...
     ... DONE [2423]
    

    If you have firewall enabled make sure you add rules for the server app.

    Open web browser and connect to administration interface of the server(for login use admin/admin): http://server_ip:5001

Ubuntu server - installation

  • Install python tool for installing and managing Python packages (pip):
  • 
    alex@ubuntu:~$ sudo su
    [sudo] password for alex: 
    root@ubuntu:/home/alex# apt-get install python-pip
    .........
    				
  • Check that you have python version 2.x installed:
  • 
    root@ubuntu:/home/alex# python -V
    Python 2.7.6
    				
  • Install Flask and SqlAchemy (python modules):
  • 
    root@ubuntu:/home/alex# pip install Flask SqlAlchemy
    .........
    				
  • Check Flask flask module installation:
  • 
    root@ubuntu:/home/alex# python
    Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import flask
    >>> flask.__version__
    '0.10.1'
    >>> exit() 
    				
  • Now that everything is installed, download server app:
  • 
    root@ubuntu:/home/alex# mkdir /opt/rcontroller
    root@ubuntu:/home/alex# cd /opt/rcontroller/
    
    root@ubuntu:/opt/rcontroller# wget http://rcontroller.duculete.com/server/rcontroller.tgz
    ....
    100%[============================================================================>] 3,367,139   3.00MB/s   in 1.1s   
    
    2014-09-15 16:28:30 (3.00 MB/s) - ‘rcontroller.tgz’ saved [3367139/3367139]
    
    root@ubuntu:/opt/rcontroller# tar -xzvf rcontroller.tgz
    ....
    root@ubuntu:/opt/rcontroller# rm -f rcontroller.tgz 
    
    root@ubuntu:/opt/rcontroller# ls
    commands.db  init.d  pid  rcontroller.cfg  rcontroller.py  schema.sql  start.sh  static  templates
    				
  • Next edit file named rcontroller.cfg and change SECRET_KEY:
  • 
    SECRET_KEY = '23b#$@w0^k2@#$%sjU7@#$nRYH*&qQrCFw'
    				

    How to generate good secret keys?
    The problem with random is that it’s hard to judge what is truly random. And a secret key should be as random as possible. Your operating system has ways to generate pretty random stuff based on a cryptographic random generator which can be used to get such a key. Here is an example how to generate an random key using python:

    
    root@ubuntu:/opt/rcontroller# python
    Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 
    >>> import os
    >>> os.urandom(24).encode('hex')
    'b6d4e53b4bf21e8a9e8802e6b8b3351eb1e7603cc7ae7243'
    

    Now just replace the old (default value) with new value generated.

    If you want to use init.d to start the server at boot, there is an init script that needs to be updated. This file is located to init.d/rcontroller folder provided with server application. You need to change the following parameters:

    
    PYTHON_EXEC="/usr/bin/python" <<< the path of the python executable
    APP_FOLDER="/rcontroller" <<< the root folder of the application (in this case /opt/rcontroller)
    

    Copy the init script to /etc/init.d folder and activate start at boot:

    
    root@ubuntu:/opt/rcontroller# cp init.d/rcontroller /etc/init.d/
    root@ubuntu:/opt/rcontroller# update-rc.d rcontroller defaults
    update-rc.d: warning: /etc/init.d/rcontroller missing LSB information
    update-rc.d: see 
     Adding system startup for /etc/init.d/rcontroller ...
       /etc/rc0.d/K20rcontroller -> ../init.d/rcontroller
       /etc/rc1.d/K20rcontroller -> ../init.d/rcontroller
       /etc/rc6.d/K20rcontroller -> ../init.d/rcontroller
       /etc/rc2.d/S20rcontroller -> ../init.d/rcontroller
       /etc/rc3.d/S20rcontroller -> ../init.d/rcontroller
       /etc/rc4.d/S20rcontroller -> ../init.d/rcontroller
       /etc/rc5.d/S20rcontroller -> ../init.d/rcontroller
    
  • You can now start the server:
  • 
    root@ubuntu:/opt/rcontroller# /etc/init.d/rcontroller start
    Starting server ...
     ... DONE [6822]
    

    If you have firewall enabled make sure you add rules for the server app.

    Open web browser and connect to administration interface of the server(for login use admin/admin): http://server_ip:5001

For more details you can contact me at dragoescu.alexandru@gmail.com