Wire up the SSH passthrough

This commit is contained in:
Luke Murphy 2020-03-23 18:07:49 +01:00
parent 291175340e
commit 0cc68fea6d
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 13 additions and 1 deletions

View File

@ -41,7 +41,19 @@
- "https:443:3000"
state: present
- name: Ensure jq package is installed
apt:
name: jq
state: present
- name: Retrieve application container IP address
shell: "dokku ps:inspect gitea | jq .[0].NetworkSettings.IPAddress"
register: dokku_container_ip
- name: Symlink the authorized keys configuration
vars:
ssh_listen_port: "{{ ssh_listen_port }}"
dokku_container_ip: "{{ dokku_container_ip }}"
file:
src: /var/lib/gitea/git/.ssh/authorized_keys
dest: /home/git/.ssh/authorized_keys

View File

@ -1,2 +1,2 @@
#!/bin/sh
ssh -p $GIT_SSH_PORT -o StrictHostKeyChecking=no git@127.0.0.1 "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $0 $@"
ssh -p {{ ssh_listen_port }} -o StrictHostKeyChecking=no git@{{ dokku_container_ip }} "SSH_ORIGINAL_COMMAND=\"$SSH_ORIGINAL_COMMAND\" $0 $@"