Giter Club home page Giter Club logo

pojde's Introduction

pojde

Demo Video

Develop from any device with a browser.

Docker CI Matrix Docker Pulls Chrome Support Firefox Support Safari Support

Overview

pojde is a distributed multi-tenant development environment with web access to all components.

It strives to be ...

  • Open: Free/libre and open source software under the AGPL-3.0 license
  • Versatile: Supports multiple isolated instances on one host (for multi-user and/or multi-usecase support)
  • Fast: Minimal base image with optional modules for languages and tools
  • Portable: Runs on both Intel/AMD and ARM and requires Docker as the only dependency
  • Lean: Built on projects like code-server and JupyterLab

With pojde, you can develop from any device with a browser!

Installation

To install pojdectl, the management tool for pojde, run the following:

$ curl https://raw.githubusercontent.com/pojntfx/pojde/main/bin/pojdectl | bash -s -- upgrade-pojdectl

Works on Linux, macOS and Windows (WSL2). Now, continue to Usage to create your first instance.

Usage

I've created a brief YouTube video which guides you through the process:

Code from Anywhere with pojde YouTube video

If you prefer the instructions in written form, continue reading.

1. Installing Docker or Podman

pojde supports running many isolated instances on a host, where the host can be your local machine, a cloud server or even a Raspberry Pi. Before you continue to the next step, please install either Docker or Podman on the host that you wish to run the instance on. Please note:

  • If you have CGroups V2 enabled on your system (i.e. if you're using Fedora), please check out the Docker, Podman and CGroups V2 FAQ first.
  • Host systems using systemd have the best support, but on systems which don't support it (i.e. Docker on macOS or WSL), pojde falls back to using OpenRC instead.

2. Creating a first Instance

To create your first instance, use pojdectl apply:

$ pojdectl apply my-first-instance 5000 # Append `-n root@your-ip:ssh-port` to create the instance on a remote host instead

Now follow the instructions. pojdectl apply will ask you to download the CA certificate to your system, which you should do when creating the first instance; future instances will share this certificate. You can also get the certificate at any later point using pojdectl get-ca-cert.

3. Trusting the CA Certificate

To trust the CA certificate, follow the videos we've created for you:

Note that you'll have to select the CA certificate you've downloaded in the step before, not download the certificate as described in the videos.

4. Listing the Instances

Once you've done so, confirm that everything went well by listing your instances with pojdectl list:

$ pojdectl list # Append `-n root@your-ip:ssh-port` to list the instances on a remote host instead
NAME                           STATUS     PORTS
my-first-instance              running    5000-5005

As you can see, our first instance (my-first-instance) is running and has exposed ports 5000 through 5005. This port range has been selected when we ran pojdectl apply above.

5. Accessing the Services

You can now access the services you've enabled (replace localhost with your remote host's IP or domain if you deployed to a remote host):

Icon Service Address Description
Cockpit https://localhost:5000/ General management interface
code-server https://localhost:5001/ VSCode in the browser
ttyd https://localhost:5002/ Shell access from the browser
noVNC https://localhost:5003/ Graphical access from the browser
JupyterLab https://localhost:5004/ Interactive development environment

If you can't access the services from outside localhost, make sure to open the ports on your firewall.

Additionally, there is a SSH server running on port 5005 which you can use to forward ports from the instance with pojdectl forward:

$ pojdectl forward local my-first-instance 127.0.0.1:4200:127.0.0.1:1234 127.0.0.1:4201:127.0.0.1:1235 # Append `-n root@your-ip:ssh-port` to also forward from the remote host to the local host

This, for example, forwards remote port 1234 in the instance to local port 4200 and remote port 1235 to local port 4201.

You can also forward ports to the instance:

$ pojdectl forward remote my-first-instance 127.0.0.1:6969:127.0.0.1:6969 # Append `-n root@your-ip:ssh-port` to also forward from the local host to the remote host

๐Ÿš€ That's it! We hope you enjoy using pojde. Please be sure to also check out the Updates and FAQ sections to keep your pojde setup up to date.

Modules

pojde is based on a minimal base image; additional functionality can be added by enabling any of the following modules when running pojdectl apply:

Language Modules

Icon Name Description
C/C++ GCC, GDB, CMake, the C/C++ VSCode extensions and C++ Jupyter kernel
Go Go, TinyGo, the Go/TinyGo VSCode extensions and Go Jupyter kernel
Python Python, pip, the Python VSCode extensions and Python Jupyter kernel
Rust Rust, Cargo, the Rust VSCode extensions and Rust Jupyter kernel
JavaScript Node, the JavaScript/TypeScript VSCode extensions and JavaScript Jupyter kernel
Ruby Ruby, the Ruby VSCode extensions and Ruby Jupyter kernel
C# Mono, .NET, PowerShell, the C# VSCode extensions and C#/F#/PowerShell Jupyter kernels
Java Java, Maven, Gradle, the Java VSCode extensions and Java Jupyter kernel
Julia Julia, the Julia VSCode extensions and Julia Jupyter kernel
Octave Octave, the Octave VSCode extensions and Octave Jupyter kernel
R R, the R VSCode extensions and R Jupyter kernel
SQL SQLite, MariaDB, PostgreSQL, the SQL VSCode extensions and SQL Jupyter kernel
Bash Bash, the Bash VSCode extensions and Bash Jupyter kernel

Tool Modules

  • Vim: Vim and the VSCodeVim extension
  • QEMU, Docker and Kubernetes: kubectl, helm, k9s, skaffold, k3d and more DevOps tools
  • Technical Documentation: pandoc, plantuml, gnuplot, media, Office, PDF and Markdown/LaTeX support for VSCode
  • Full LaTeX Support: Full TeX Live installation
  • Web Development: Protobuf, GraphQL, OpenAPI, browser debugging and more VSCode extensions
  • Common VSCode Extensions: Prettier, GitLens, Git Graph and test explorer VSCode extensions
  • Common CLIs: tmux, jq, htop etc.
  • Networking: Wireshark, nmap, iperf3 etc.
  • Browsers and Mail (TUI): lynx, links, aerc etc.
  • Browsers and Mail (GUI): Chromium, Firefox, GNOME Web and Thunderbird
  • Multimedia: ffmpeg, Handbrake, youtube-dl etc.

Reference

$ pojdectl --help
pojdectl is the management tool for pojde.
Global Flags:
[-n]ode <user@host:port>            Remote host to execute on.
                                    If not specified, execute locally.

Modification Commands:
apply <name> <startPort>            Create or upgrade an instance.
    [-f]orce                            Skip confirmation prompts.
    [-u]pgrade                          Pull latest image.
    [-r]ecreate                         Re-create the container.
    [-i]solate                          Block Docker daemon access.
    [-p]rivileged                       Run in privileged mode.
remove [name...]                    Remove instances(s).
    [-f]orce                            Skip confirmation prompts.
    [-c]ustomization                    Remove customizations.
    [-p]references                      Remove preferences.
    [-s]ecurity                         Remove CA.
    [-u]ser data                        Remove user data.
    [-t]ransfer                         Remove transfer data.
    [-d]eb cache                        Remove .deb cache.
    [-a]ll                              Remove everything.
list                                List all instances.

Lifecycle Commands:
start [name...]                     Start instance(s).
stop [name...]                      Stop instance(s).
restart [name...]                   Restart instance(s).

Utility Commands:
logs <name>                                                 Get the logs of an instance.
enter <name>                                                Get a shell in an instance.
forward <name> <local|remote> [lhost:lport:rhost:rport...]  Forward port(s) to or from an instance.

Miscellaneous Commands:
upgrade-pojdectl                    Upgrade this tool.
get-ca-cert [-p]rint                Get the CA cert.
reset-ca [-f]orce                   Reset the CA.

For more information, please visit https://github.com/pojntfx/pojde#Usage.

Contributing

To contribute, please use the GitHub flow and follow our Code of Conduct.

To build and start a development version of pojde locally, run the following:

$ git clone https://github.com/pojntfx/pojde.git
$ cd pojde
$ make build
$ ./bin/pojdectl apply my-first-instance 5000 -f -r

You should now have the pojde services running on http://localhost:5000/ through http://localhost:5004/ (see Accessing the Services). Whenever you change something in the source code, run make build and ./bin/pojdectl apply my-first-instance 5000 -f -r again, which will recompile and restart the services.

Have any questions or need help? Chat with us on Matrix!

FAQ

Updates

Updating pojdectl

pojdectl includes a self-update tool, which you can invoke by running the following:

$ pojdectl upgrade-pojdectl

Updating (or Reconfiguring) an Instance

Updating an instance (to get the latest pojde version) and changing an instance's configuration are both done using the pojdectl apply command.

To for example update the instance created in Usage or to change it's configuration, installed modules etc., run the following and follow the instructions:

$ pojdectl apply my-first-instance 5000 -f -r -u # Append `-n root@your-ip:ssh-port` to upgrade the instance on a remote host instead

There are multiple update and configuration strategies available; see Reference for more options.

Docker, Podman and CGroups V2

The following combinations are known to work:

  • Podman and CGroups V2
  • Docker and CGroups V1

Using Docker and CGroups V2 together on a systemd-based host does not work, as running systemd inside the container is not yet supported properly using this configuration. If you are using CGroups V2, i.e. if you're on Fedora, please use Podman. Alternatively, you can also switch to CGroups V1 and use Docker:

$ sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"
$ sudo reboot

Mounting Docker Volumes from an Instance

Thanks to the pojde-docker-env script, mounting Docker volumes from within an instance is supported:

pojntfx@5d084b2bf2ca:~$ pojde-docker-env # Run this in the instance, using i.e. `ttyd` or code-server's terminal
pojntfx@5d084b2bf2ca:/var/lib/docker/volumes/pojde-my-first-instance-home-user/_data/pojntfx$ # You can now use i.e. `docker run -v` in this shell!

You can also block Docker daemon access completely by specifiying the -i flag; see Reference for more information.

Transfering Files in and out of an Instance

There are many options available to transfer files; you can for example use scp, another "traditional" option or use one of the following inbuilt ones.

Transfer Folder

A transfer folder is automatically created for even easier exchange of data between the host system and the instance; this folder is mounted into ~/Documents in the instance and available at ~/Documents/pojde/your-instance-name on the host system.

WebWormhole

WebWormhole (available as ww) is pre-installed in every instance; it allows you to exchange files globally by using WebRTC. Find out more over at the WebWormhole GitHub repo.

Further Resources

License

pojde (c) 2021 Felicitas Pojtinger and contributors

SPDX-License-Identifier: AGPL-3.0

pojde's People

Contributors

jakwai01 avatar pojntfx 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

Watchers

 avatar  avatar  avatar  avatar

pojde's Issues

I can open localhost:5000 but none of the others

I have a problem where I can open only https://45.79.101.251:5000/system but when I go to the others it didn't work and I just got an Nginx server error. I think this project is quite incredible and would love to play around with it but can't get it working for some reason. I installed everything like in the README and I'm using a Digital Ocean server with Unbuntu 20.04. Let me know if you need more details.

Ability to select the list of services to install

Personally, I would like not to have any vnc services running.

But, also, as a matter of generalization, I would like to be able to select any of the services that are being installed. In certain cases, only installing code-server, for example.

Can these be configurable?

Cannot access any of the ports listed

Tried to follow your install instructions to the letter.

But after installation I do not seem to be able to use any of the 5000-5005 ports that you mention. The browser seems to load for a while only to get a "Connection has timedout" after a while.

You made no mention of server firewalls, but even when I sudo ufw allow 500x does not seem to fix the problem.

Logs from my running instance lists:

stratos@hypervasis:~$ pojdectl logs inst2
-- Logs begin at Fri 2021-05-28 08:39:29 UTC. --
May 28 08:39:55 e2b88e63ec3b update-motd[392]: /usr/share/cockpit/motd/update-motd: 24: /usr/share/cockpit/motd/update-motd: cannot create /run/cockpit/active.motd: Directory nonexistent
May 28 08:39:55 e2b88e63ec3b systemd[1]: cockpit-motd.service: Succeeded.
May 28 08:39:55 e2b88e63ec3b systemd[1]: Started Cockpit motd updater service.
May 28 08:39:55 e2b88e63ec3b exim4[393]: Starting MTA: exim4.
May 28 08:39:55 e2b88e63ec3b exim4[393]: ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken
May 28 08:39:55 e2b88e63ec3b systemd[1]: Started LSB: exim Mail Transport Agent.
May 28 08:39:55 e2b88e63ec3b systemd[1]: Reached target Multi-User System.
May 28 08:39:55 e2b88e63ec3b systemd[1]: Reached target Graphical Interface.
May 28 08:39:55 e2b88e63ec3b systemd[1]: Startup finished in 5d 10h 45min 6.916s (kernel) + 25.858s (userspace) = 5d 10h 45min 32.775s.
May 28 08:40:05 e2b88e63ec3b systemd[1]: NetworkManager-dispatcher.service: Succeeded.

Is there something else I can check what prevents this from working?

PS: I logged another issue (#3) regarding the CA certificate. So I am trying all the above without having applied any CA to my local browser.

Indication that no update is available

This is not a bug, just a suggestion: pojdectl upgrade-pojdectl shows an empty curl progress indicator if there is no update available. Would be nice to have an output reading no update available (or something like this) instead.

CA credentials do not appear

During the last step of the installation, there is a warning screen suggesting that I press Enter to display the CA certificate and/or QR code, but when I do so, the screen refreshes with a success page but without actually showing any CA info...

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.