-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added option to use docker container over ssh tunnel
- Loading branch information
1 parent
c29f093
commit 83bb2a4
Showing
9 changed files
with
341 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
|
||
*.log | ||
/node.tpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
#! /bin/bash | ||
source $SCRIPT_DIR/utils.sh | ||
|
||
# Check if the vantage6-node user already exists | ||
print_step "Checking if the vantage6-node user already exists" | ||
NEW_USER="vantage6-node" | ||
if id -u "vantage6-node" >/dev/null 2>&1; then | ||
print_warning "The vantage6-node user already exists" | ||
else | ||
print_step "Creating new user: $NEW_USER" | ||
sudo useradd $NEW_USER | ||
|
||
# Set password for the new user | ||
PASSWORD=$(openssl rand -base64 16) | ||
echo "$NEW_USER:$PASSWORD" | sudo chpasswd | ||
fi | ||
|
||
|
||
print_step "Executing some steps as sudo user" | ||
source $SCRIPT_DIR/create-ssh-keys.sh | ||
|
||
# Tunnel settings | ||
print_step "Setting tunnel settings" | ||
export TUNNEL_HOSTNAME=$OMOP_HOST | ||
export SSH_HOST=$(ip addr show eth0 | grep 'inet ' | awk '{print $2}' | cut -d/ -f1) | ||
export SSH_PORT=22 | ||
print_step "SSH_HOST: $SSH_HOST, SSH_PORT: $SSH_PORT" | ||
|
||
|
||
if [ -f "/etc/ssh/ssh_host_rsa_key.pub" ]; then | ||
export SSH_HOST_FINGERPRINT=$(cat /etc/ssh/ssh_host_rsa_key.pub) | ||
else | ||
print_error "File /etc/ssh/ssh_host_rsa_key.pub does not exist." | ||
print_error "Is openssh-server installed and running?" | ||
fi | ||
|
||
export SSH_USERNAME=$NEW_USER | ||
export SSH_KEY=$PRIVATE_KEY_FILE | ||
print_step "SSH_KEY: $SSH_KEY" | ||
|
||
export TUNNEL_BIND_IP="0.0.0.0" | ||
export TUNNEL_BIND_PORT=$OMOP_PORT | ||
|
||
export TUNNEL_REMOTE_IP="127.0.0.1" | ||
export TUNNEL_REMOTE_PORT=5432 | ||
print_step "TUNNEL_REMOTE_PORT: $TUNNEL_REMOTE_PORT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
docker_services: | ||
container_label: ${DOCKER_SERVICE_CONTAINER_LABEL} |
Oops, something went wrong.