Skip to content

Commit

Permalink
explain files
Browse files Browse the repository at this point in the history
  • Loading branch information
gobengo committed Feb 22, 2018
1 parent 2b2e5d3 commit 356ac59
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 2 deletions.
8 changes: 8 additions & 0 deletions build/bin/install-dependencies
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env bash

usage () {
cat <<HELP_USAGE
$0
Install dependency packages required to run an exitnode.
HELP_USAGE
}

set -e

release_info="$(cat /etc/*-release)"
Expand Down
10 changes: 10 additions & 0 deletions build/bin/lint
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
# set -x
set -e

usage () {
cat <<HELP_USAGE
$0 [file]
check bash scripts here for common mistakes
[file] - file to lint for common bash mistakes. If omitted, all files will be checked
HELP_USAGE
}

file="$1"

if [ -z "$file" ]; then
Expand Down
1 change: 0 additions & 1 deletion build/bin/run

This file was deleted.

11 changes: 11 additions & 0 deletions build/bin/set-public-ip
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/usr/bin/env bash

usage () {
cat <<HELP_USAGE
$0 [public_ip]
set the public ip address of this exitnode.
Configures babeld, tunneldigger, etc and restarts them.
[public_ip] - public_ip to lint for common bash mistakes. If omitted, all files will be checked
HELP_USAGE
}

cd "$(dirname "$0")" || return

. ../variables
Expand Down
8 changes: 8 additions & 0 deletions build/bin/tunneldigger
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/usr/bin/env bash

usage () {
cat <<HELP_USAGE
$0
Run tunneldigger in the foreground (alternative to /etc/init.d/tunneldigger)
HELP_USAGE
}

cd /opt/tunneldigger || return
exec /opt/tunneldigger/broker/env_tunneldigger/bin/python -m broker.main /opt/tunneldigger/broker/l2tp_broker.cfg
10 changes: 9 additions & 1 deletion build/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
#!/bin/bash

usage () {
cat <<HELP_USAGE
$0
Docker entrypoint. Configures services for PUBLIC_IP env var, starts services.
HELP_USAGE
}

# print each line
# set -x

# exit on error
set -e

./build/bin/set-public-ip "$EXITNODE_PUBLIC_IP"
./build/bin/set-public-ip "$PUBLIC_IP"

service sudomesh-gateway start
service tunneldigger start
Expand Down
10 changes: 10 additions & 0 deletions build/docker/build
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/usr/bin/env bash

usage () {
cat <<HELP_USAGE
$0 [-t tag]
build a docker image for exitnode
[-t] tag the docker image
HELP_USAGE
}

cd "$(dirname "$0")"
EXITNODE_DIR=../../

Expand Down
8 changes: 8 additions & 0 deletions build/docker/docker-build
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ cd "$(dirname "$0")"
# set -x
set -e

usage () {
cat <<HELP_USAGE
$0
Meant to be run by the Dockerfile upon \`docker build\`
HELP_USAGE
}

echo "docker-build PUBLIC_IP=$PUBLIC_IP"

../../create_exitnode.sh "$PUBLIC_IP"
Expand Down
8 changes: 8 additions & 0 deletions build/docker/docker-cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/usr/bin/env bash

usage () {
cat <<HELP_USAGE
$0
Meant to be the default cmd run by the Dockerfile upon \`docker run\`
HELP_USAGE
}

cd "$(dirname "$0")" || return

exec ../bin/tunneldigger
Expand Down
12 changes: 12 additions & 0 deletions build/remote
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
# This script should provision a remote linux server as an exit node
# usage: PUBLIC_IP=165.227.241.194 ./build/remote [email protected]

usage () {
cat <<HELP_USAGE
$0 [ssh_host]@[ssh_host]
Provision an exitnode by SSHing into a remote server.
[ssh_user] - usually 'root'
[ssh_host] - Public IP address that your exitnode will be available at
HELP_USAGE
}

# set -x
# set -e

Expand Down

0 comments on commit 356ac59

Please sign in to comment.