I'm working on proper communication to provide internal access for Bitbucket pipeline runners by running Tailscale to access the private networks in my private server domain, but neither of the two approaches, which are demonstrated below, worked to accomplish the internal communication.
For the following approaches, let's say `100.XXX.XXX.129` is the Tailscale IP of my dedicated server.
- pipe: atlassian/ssh-run:0.7.1
variables:
SSH_USER: ${TAILSCALE_SSH_USER}
SERVER: 100.XXX.XXX.129
PORT: ${TAILSCALE_SSH_PORT}
MODE: 'command'
COMMAND: "echo communication received"
Issues:
- step:
name: Upgrading stuff
# runs-on: # Disable this if self-hosted is not available
# - 'self.hosted'
image: atlassian/default-image:4
script:
- apt-get update -y
- apt-get install -y apt-transport-https ca-certificates
- apt- get install -y netcat
- echo "Configure SSH client"
# - echo "Host *" >> ~/.ssh/config
- echo "StrictHostKeyChecking no" >> ~/.ssh/config
- echo "ProxyCommand nc -X 5 -x 127.0.0.1:1080 %h %p" >> ~/.ssh/config
- cat ~/.ssh/config
- chmod 600 ~/.ssh/config
- curl -fsSL https://tailscale.com/install.sh | sh
- apt-get update -y
- tailscaled --tun=userspace-networking --state=tailscaled.state --socks5-server=127.0.0.1:1080 &
- tailscale up --hostname=bbp-$BITBUCKET_WORKSPACE-haproxy --authkey=$TAILSCALE_AUTH_KEY
- echo "Set up HTTP proxy for all outgoing HTTP requests"
- echo "Connecting to remote server"
- pipe: atlassian/ssh-run:0.7.1
variables:
SSH_USER: ${TAILSCALE_SSH_USER}
SERVER: 100.XXX.XXX.129
PORT: ${TAILSCALE_SSH_PORT}
MODE: 'command'
COMMAND: "echo communication received"
(credits to Brewww article for allowing deployments with bitbucket pipelines and tailscale)
Issues (after Tailscale was installed and up):
2023/12/06 00:35:34 magicsock: 1 active derp conns: derp-10=cr3s,wr3s
2023/12/06 00:35:34 post-rebind ping of DERP region 10 okay
2023/12/06 00:35:51 network-lock unavailable; no state directory