Code Monkey home page Code Monkey logo

co-console's Introduction

Co-Console

GitHub license

What is Co-Console ?

Co-Console is a Web-based Console which provide a console environment can be shared with others, powered by django and django-console.

Setup

Co-Console is a django project, please install Django and required modules before you run the server.

pip install Django

# or install from requirements.txt

pip install -r requirements.txt

# python path/to/manage.py runserver 0.0.0.0:{your_port}

python manage.py runserver 0.0.0.0:1234

Settings and Customize

There are some settings in settings.py may need to be set if you want to have better experience as expected.

# IP whitelist for what ip can use this console
CONSOLE_WHITELIST = [
    '127.0.0.1'
]

# change the default current working directory
CONSOLE_CWD = None

# command whitelist for what commands user can use, you need to prepare your environment and add commands into whitelist.
COMMAND_WHITELIST = [
    'dir',
    'ls',
    'python',
    'help',
    'ip',
    'cd'
]

# redirect command if need
COMMAND_MAPPING = {
    'ls' : 'dir'
}

# command which arguments required
ARGS_REQUIRED = [
    'python'
]

# add other path into sys.path
APPEND_PATH = []

Not only use existing commands in your environment, you also can define some custom commands in commands.py, for example:

from django.conf import settings

def cd(request):
    command = request.POST.get('command')
    args = command.split(' ')[1]
    settings.CONSOLE_CWD = args
    return settings.CONSOLE_CWD

CUSTOM_COMMAND = {
    'cd': cd
}

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.