-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for building for DO Debian, DO Ubuntu, Dockerfile debian-slim #8
Conversation
…sion on remote host, plus Dockerfile
Full output of |
Well the good news is that travis-ci actually seems like it's running the tunneldigger broker just fine? https://travis-ci.org/gobengo/exitnode/builds/344651270 . It runs until I cancel it. The bad news is:
Update: This would have happened if the OS doesn't support L2TP. |
``` | ||
|
||
Expected output should be something like: | ||
This should SSH to the exit node, configure it, reboot, and wait for the reboot to complete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest to include expected output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
# run | ||
docker run --privileged -e IP=$exit_node_ip exitnode | ||
# run bash for debugging | ||
docker run --privileged -it -e IP=$exit_node_ip exitnode bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the use case for running an exit node in docker? Does this allow for connecting physical home node to a docker container? If so that would be awesome! Suggest to document how to do this, if you haven't already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the use case for running an exit node in docker?
- I am willing/eager to host an exitnode on my existing cluster, but don't want to pay more $/month for a dedicated VM if I don't have to. My existing cluster dynamically schedules containers across it, as long as I can build the workload into a docker container.
- Even if I didn't have an existing cluster, if I wanted to run other apps on the same server, I'd want to isolate them in separate linux containers so they can use different system deps, and docker/Dockerfiles are one of the easier ways to build/distribute/run lxc containers.
Does this allow for connecting physical home node to a docker container? If so that would be awesome! Suggest to document how to do this, if you haven't already.
- That's the idea. Will document further when I actually get it working. Next steps
- - Determine why
docker run ...
won't work on my mac, but does on Travis-CI - - See if the container works on my k8s cluster, since it works on Travis-CI
- - Determine why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to elaborate! The docker case sounds really cool - and I'd like to suggest to add it as part of a separate pull request after you get it working and with examples of how to use it. Perhaps @bennlich and @paidforby have some ideas about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds useful and practical to me. I was hoping to run nginx and host some webpages on my exit node eventually, but I would want to give access to other contributors. I could create separate UNIX users or run a CMS (like wordpress), still I would worry about potential conflicts or unintended side effects. Wrapping the exitnode up in a docker container would put my mind at ease.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very much agree with @gobengo and @paidforby about the benefits of docker. I was making an argument for making sure it works / examples before introduce it. Won't block it, but am weary of introducing functionality that can't be tested / used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A dockerized exit node sounds super awesome 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bennlich @jhpoelen FWIW I did diagnose and resolve the above issues, and got it running in Docker and in my Kubernetes cluster (container requires --privileged flag, I think because L2TP requires privileged syscalls?, but that's fine). I have not tested the exitnode yet from a home node.
So I have three things to test, and will do so in this order:
- exitnode in digitalocean as created by ./build/remote
- exitnode in docker in digitalocean - just to prove docker does{,n't} create problems
- exitnode in docker in my kubernetes cluster (on AWS FWIW) - I may never test this, or at least if it doesn't work I'm not in a rush to debug this. No one else needs this setup. Though if the mesh need more exitnodes this is the cheapest place for me to run one (.... or a dozen) because it can be packed into my exiting EC2 Instances.
build/bin/install-dependencies
Outdated
echo "release_name=$release_name" | ||
|
||
|
||
# Upgrade kernel on OS that require it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this upgrading the kernel or installing extra modules?
build/bin/install-dependencies
Outdated
echo "release_name=$release_name" | ||
if [ "$release_name" == '"Ubuntu"' ]; then | ||
echo "OS is Ubuntu. Need to upgrade kernel" | ||
# This would NOT work on Debian 8.10, (@TODO test others). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! By "would NOT work" you mean something like would not be executed correct?
build/remote
Outdated
#!/usr/bin/env bash | ||
|
||
# This script should provision a remote linux server as an exit node | ||
# usage: PUBLIC_IP=165.227.241.194 ./build/remote [email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you using PUBLIC_IP if you are not using it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used below on line 27. e.g. you can provide it if the PUBLIC_IP is different from the ip/hostname you are SSHing to.
But it doesn't really need to be in this usage note. That's from before I made it use your SSH host as IP if no env var is provided.
create_exitnode.sh
Outdated
cp /opt/exitnode/l2tp_broker.cfg $TUNNELDIGGER_HOME/broker/l2tp_broker.cfg | ||
echo "EXITNODE_DIR=$EXITNODE_DIR" | ||
if [[ ! $EXITNODE_DIR ]]; then | ||
echo "cloning jhpoelan/exitnode to /opt/exitnode" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jhpoelen/exitnode --> sudomesh/exitnode
create_exitnode.sh
Outdated
@@ -142,4 +118,4 @@ service sudomesh-gateway start | |||
service tunneldigger start | |||
service babeld start | |||
|
|||
reboot now | |||
# reboot now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest to remove commented command
…rward is not already 1 (e.g. if docker or other container runtime sets it up for you)
This PR was superceded by #11 |
You can now provision remote linux hosts over SSH using
./build/bin/remote <user>@<ip>
I tested this on Digital Ocean: Ubuntu 16.04, 17.10
--
There is also now a Dockerfile in here, so the following should start to be useful.
Note: It doesn't work all the way now. Opening this PR to illustrate blockers.
...