Allow sharing access to your container ports to enable live collaboration (IDE, VNC, web preview...)
- [x] To enable Cloud9 collaboration, add
--collabto https://github.com/JanitorTechnology/dockerfiles/blob/d25a150613cb02c32a1d6ef97ba1a4beaeb3494c/ubuntu-dev/supervisord.conf#L10 - [ ] To expose it, find out how to give other Janitor users access to the collaborative IDE URL (currently, Janitor users can only access containers that they actually own)
- [ ] In the sharing UI, we should be very clear that sharing container access may allow others to view sensitive credentials like OAuth tokens and API keys (see also https://github.com/github/hub/issues/1668#issuecomment-363175351)
The --collab argument was added in https://github.com/JanitorTechnology/dockerfiles/commit/acc5035ba7579d144c81115f9cb0a928c9b130b2.
Now we can try to use the IDE in collaborative mode / figure out how to make the feature easy to use.
It could be done by allowing other users to access your container ports, and then giving them the same URL you're using, e.g. https://pianosa.janitor.technology/abcd1234/8089/
In the above example, if you don't own the container abcd1234, the Docker host's API call to https://janitor.technology/api/hosts/pianosa.janitor.technology/containers/abcd1234/3000 will result in a 404 error.
We could tweak this API handler to check an access list (which could be edited by container owners using a new API handler for sharing containers) instead of just verifying container ownership.
A quick little mockup of how this feature can look like:

Thanks a lot for this mockup! It's perfect 😄 I want this feature so bad...
Random thought: If we have a URL that can point to a specific container and a specific tab, we could potentially redirect Cloud9 IDE's "Share" button to this panel in Janitor.
Edit: Maybe something like https://jntr.io/containers/#abcdef0123456-share? Would probably require some JS though, unfortunately.
@bnjbvr would also like a feature to "share publicly" 😄 (I'm thinking maybe port-specific, e.g. just share a web preview but not Cloud9 IDE, and with a secret URL).