Giter VIP home page Giter VIP logo

envy's Introduction

envy

Development environment manager. Work in progress, but join the process!

Running Envy

$ docker run -d --name envy \
    -v /mnt/envy:/envy \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -p 80:80 \
    -p 22:22 \
    -e HOST_ROOT=/mnt/envy \
    progrium/envy

Using Envy

You connect to Envy via SSH or HTTP. See this screencast for a demo.

Users are authenticated against GitHub using HTTP auth (user,pass or user,token) or SSH keys.

Concepts

  • environment This refers to a Docker image defining an environment
    • An environment is a Docker image
    • It can also refer to the directory used to build the Docker image
    • Each environment comes with a Docker-in-Docker instance
  • session This is an active shell in a Docker container instance for an environment

Envy Commands

All sessions have access to the envy binary and can run management commands. Some of the commands are only available to users with admin privileges. Here are current commands:

Usage: envy <command> [options] [arguments]

Commands:

    admin ls         list admin users
    admin rm         remove admin user
    admin add        add admin user
    environ rebuild  rebuild environment image
    session reload   reload session from environment image
    session commit   commit session changes to environment image
    session switch   switch session to different environment

Run 'envy help [command]' for details.

Aliased Commands

As long as you keep the default envyrc in your environment, you'll have these aliases set up:

alias commit='exec envy session commit'
alias reload='exec envy session reload'
alias switch='exec envy session switch'
alias rebuild='exec envy environ rebuild'

Exec is necessary to exit to the session manager with status 128, which gets Envy to create a new container from the environment image. This happens quickly behind the scenes, so a session feels like a continuous experience even if happening across multiple containers.

Envy Root

When Envy is run it expects a host bind mount at /envy so it can initialize and persist its file tree. This is where most of the state in Envy is kept. Most configuration is kept here in plain files. Here is an explanation of the tree:

/envy
  /users
    /<user>
      /environs       # directory of environs for this user
      /sessions       # directory of sessions for this user
      /home           # home directory mounted into all sessions
      /root           # root home mounted in all sessions (see #3)
  /config
    users             # file of users allowed to login. defaults to * (any)
    admins            # file of admin users. defaults to first logged in user
  /bin
    envy              # staging of the envy binary to put into sessions

Startup Scripts

Both Bash and POSIX shells are set up to source /root/environ/envyrc when started interactively. For Bash, this is done with a default .bashrc, and for POSIX by setting ENV.

Although you can edit your /root/environ/envyrc, by default it will source a few other RC files. First, ~/.envyrc if it exists, and then /home/<envy-user>/.envyrc_<container-user> if it exists. The latter allows you to specify an RC for the root user of all environments. One use case for this is to symlink /root/.ssh to your envy user's .ssh directory so ssh will have access to your identity keys in all environments.

Moving Host SSH

Envy is best experienced running on port 22 on a host. If you want to move your current OpenSSH to port 2222, here is a one-liner that is likely to work:

$ sed -i -e 's/Port 22/Port 2222/' /etc/ssh/sshd_config

Then restart SSH.

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.