GithubHelp home page GithubHelp logo

gobox's Introduction

GoBox v0.3.1

GoBox is supposed to be something like BusyBox. I.e. a single, preferably small executable which bundles all important shell tools. A swiss army knife for the command line, if you will. It is being developed with a focus on Amazon EC2 or as a small footprint basis for an OpenVZ template.

In order to keep the source code and executable small, I have cut a lot of options you might be used to from GNU Coreutils or similar. I might even have less options than BusyBox itself. I certainly have fewer applets right now, and probably ever will. But I consider that a good thing.

Pitfalls

  • The shell is not a bash, sh or zsh. It is something original, written by me and is fairly limited. It does the job of acting as a shell, it‘s hardly adequate for scripting, though.
  • Telnetd has no authentication mechanism right now. It’s noting more than a network-capable pipe.

Installation

GoBox is now go get-able.

Developing applets

  • Copy applets/template and name the copy like your applet
  • Rename template.go and edit its contents to fit your applet
  • Add your applet to cmd/gobox/applets.go

The template provides the basic framework you should stick to.

Why is there not real shell?

I got this question a lot and I have 2 main reasons:

  • I seriously did not want to implement the broken and god-awful syntax of bash or any other currently used shell!
  • You have Go. Do you need anything more lightweight? The philosohpy behind this project is that it is cheap to (re)build and deploy. You don’t really use scripting anymore. If you need to automate some process, write an applet in Go and integrate it with GoBox and push it.

Bugs

Probably

Contact

If you have ideas for missing applets, found a bug or have a suggestion, use this project’s issues. If you want to participate, just fork and code away. For questions contact me: [email protected]

Thanks

Credits

(c) 2011-2014 Alexander "Surma" Surma [email protected]

gobox's People

Contributors

aerth avatar akrennmair avatar surma avatar vbatts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gobox's Issues

Not able to chroot into gobox

The default list of applets don't output a static binary, and are not able to be chrooted into using only /bin/gobox and symlinks created with -install

And the gobox -install . command installs correctly if not using a chroot, but it is not a relative path (such as the example file tree below) and therefore links to the pre-chroot path of gobox.

Is there a way to output a static binary with networking features? 😄

A quick ldd returns the following dependencies:

bash-4.3$ ldd /git/gopath/bin/gobox 
        linux-vdso.so.1 (0x00007ffe14764000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa94151a000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fa941151000)
        /lib64/ld-linux-x86-64.so.2 (0x000055e35e78f000)

I am using go version go1.6.2 linux/amd64

Here is the filesystem that is able to be chrooted into, after removing the network related applets (telnetd,httpd,wget) and manually creating the correct symbolic links:

.
└── bin
    ├── bash -> sh
    ├── cat -> gobox
    ├── echo -> gobox
    ├── gobox
    ├── grep -> gobox
    ├── gunzip -> gobox
    ├── gzip -> gobox
    ├── head -> gobox
    ├── kill -> gobox
    ├── ls -> gobox
    ├── mkdir -> gobox
    ├── mknod -> gobox
    ├── mount -> gobox
    ├── ps -> gobox
    ├── rm -> gobox
    ├── sh -> gobox
    ├── shell -> gobox
    ├── umount -> gobox
    └── zcat -> gobox

Here is the size difference in case you were curious:

-rwxr-xr-x 1 aerth root  3966408 May 24 00:39 gobox-nonet
-rwxr-xr-x 1 aerth root  8966744 May 24 00:48 gobox-net
# and human form
-rwxr-xr-x 1 aerth root  3.8M May 24 00:39 gobox-nonet
-rwxr-xr-x 1 aerth root  8.6M May 24 00:48 gobox-net

and ldd difference:

bash-4.3$ ldd gobox-net
        linux-vdso.so.1 (0x00007ffe1abef000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f33b17aa000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f33b13e1000)
        /lib64/ld-linux-x86-64.so.2 (0x0000556a98aba000)
bash-4.3$ ldd gobox-nonet
        not a dynamic executable

a similar project

Hi Surma,

I have made a similar project recently called 'someutils' - https://github.com/laher/someutils - having initially seen your project, amongst others.

So, thanks for the inspiration I took from your code - I've linked you on my README because I got good ideas from you.

So, this isn't really an issue but just a heads-up & thanks.

Also, your project came up in the someutils discussion on golang-nuts aswell:
https://groups.google.com/forum/#!topic/golang-nuts/hr6Nnv20_L8

Cheers

go gettable?

would you like to consider making gobox go gettable?

not works on go1

Hello. I'm interesting on this project, but it not works in go1 release.
Can You upgrade code to ability to go get cmd/gobox ?

After that i can add dpkg reader/installer and ar reader

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.